AutoDoc Demo: Step-by-Step Walkthrough
> **Quick setup?** See the [main README](./README.md) - it takes 2 minutes.
AutoDoc Demo: Step-by-Step Walkthrough
Quick setup? See the main README - it takes 2 minutes.
This demo shows exactly what happens at each step when you set up and use AutoDoc.
π¬ Complete Walkthrough
Step 1: Create Template Repository (30 seconds)
- Visit https://github.com/Harry-kp/autodoc
- Click green "Use this template" button
- Name it anything (e.g.,
my-autodoc) - Click "Create repository"
Result: You now have your own copy of AutoDoc
Step 2: Run Setup Workflow (60 seconds)
- In YOUR new repo β Actions tab
- Click "Setup AutoDoc in Target Repository"
- Click "Run workflow" (right side)
- Enter target repo:
your-username/your-project - Click "Run workflow"
What happens:
- β Downloads AutoDoc files
- β Creates PR in your target repo
- β Shows success message
Step 3: Merge Setup PR (30 seconds)
- Go to your-project repository
- Pull Requests tab
- See: "π€ Set up AutoDoc"
- Click "Merge pull request"
Files added:
.github/agents/docusaurus.md β AI configuration
.github/workflows/auto-docs.yml β Automation
Step 4: Test It! (2 minutes)
Make a code change:
// src/utils/math.ts
export function add(a: number, b: number): number {
return a + b;
}
Create PR and merge:
git checkout -b add-math-utils
git add src/utils/math.ts
git commit -m "feat: add math utilities"
git push origin add-math-utils
# Create PR on GitHub and merge it
Watch the magic:
- GitHub Action runs automatically (Actions tab)
- Issue created: "Update docs for PR #X" (Issues tab)
- Copilot responds with documentation PR
- Review and merge the docs PR
Result: Your docs are updated!
π Example Output
After merging your code PR, Copilot creates:
docs/api/math.md:
---
sidebar_position: 3
---
# Math Utilities
## add
Adds two numbers together.
### Signature
\`\`\`typescript
function add(a: number, b: number): number
\`\`\`
### Parameters
- `a` (number): First number
- `b` (number): Second number
### Returns
- (number): Sum of a and b
### Example
\`\`\`typescript
import { add } from '@/utils/math';
const result = add(5, 3);
console.log(result); // 8
\`\`\`
π₯ Video Demo
Coming soon: Full video walkthrough
π What's Next?
- Customize: Edit
.github/agents/docusaurus.mdto change documentation style - Advanced: See SETUP.md for advanced configuration
- Updates: See README for how to get AutoDoc updates
Questions? Check the main README or open an issue
-
Commit and push
git add src/api/hello.ts git commit -m "feat: Add sayHello function" git push origin test-autodoc -
Create PR
- Go to your repository on GitHub
- Click "Compare & pull request"
- Title: "Test AutoDoc - Add hello function"
- Create pull request
-
Merge the PR
- Click "Merge pull request"
- Confirm merge
Expected Results (within 1-2 minutes)
-
GitHub Action runs
- Actions tab shows: "Auto-Update Documentation" β
-
Issue created
- Issues tab shows: "π Update documentation for PR #X"
- Assigned to: @copilot
- Mentions: @docusaurus-agent
-
Copilot works (may take a few minutes)
- Copilot reads the code changes
- Analyzes what documentation is needed
- Creates documentation PR
-
Documentation PR appears
- Pull Requests tab shows new PR from Copilot
- Title: "docs: Add documentation for sayHello function"
- Files changed:
docs/api/hello.md(new)sidebars.js(updated)
-
Review documentation
--- title: Hello API --- # Hello API ## sayHello Returns a greeting message. ### Signature \`\`\`typescript function sayHello(name: string): string \`\`\` ### Example \`\`\`typescript import { sayHello } from '@/api/hello'; const greeting = sayHello('World'); console.log(greeting); // "Hello, World!" \`\`\` -
Merge documentation PR
- Review the documentation
- Request changes if needed (Copilot will update)
- Merge when satisfied
π― Real-World Usage Examples
Example 1: API Function Documentation
Your code:
// src/api/users.ts
export async function createUser(
email: string,
name: string,
options?: CreateUserOptions
): Promise<User> {
// Implementation
}
AutoDoc creates:
docs/api/users.mdwith full API documentation- Examples showing basic and advanced usage
- Parameter descriptions
- Return value documentation
- Error handling examples
Example 2: Breaking Change Documentation
Your code:
// Changed from:
// login(username, password)
// To:
login({ username, password, mfaCode })
AutoDoc creates:
- Updates
docs/auth/login.md - Creates
docs/migration/v2.mdmigration guide - Shows before/after examples
- Explains why the change was made
Example 3: New Feature Documentation
Your code:
// src/features/export/
export function exportToPDF(data: any[]) { }
export function exportToCSV(data: any[]) { }
AutoDoc creates:
docs/features/export.mdfeature guide- Multiple usage examples
- Common use cases
- Troubleshooting section
π¨ Customization Examples
Customize Documentation Style
Edit .github/agents/docusaurus.md:
## Communication Style
Write in a friendly, approachable tone.
Use emoji in headings for visual interest π―
Include at least 2 code examples per function.
Add "Common Mistakes" section for tricky APIs.
Use "you" instead of "the user".
Only Document Public APIs
## Scope
Focus ONLY on:
- Exported functions from src/api/
- Public classes
- User-facing features
NEVER document:
- Internal helper functions
- Private methods
- Test utilities
Require Examples
## Documentation Quality
Every API function MUST include:
- At least 2 code examples (basic + advanced)
- Error handling example
- Common use cases section
- Links to related documentation
Custom Triggers
Edit .github/workflows/auto-docs.yml:
# Only trigger for TypeScript files in src/api
CODE_CHANGES=$(echo "$FILES" | grep -E '^src/api/.*\.ts$' || echo "")
π Monitoring & Analytics
View Documentation Activity
# List recent documentation issues
gh issue list --label documentation,automated --limit 10
# List documentation PRs
gh pr list --label documentation --state all --limit 10
Check Success Rate
Track in your team's dashboard:
- Documentation PRs created
- Documentation PRs merged
- Average time to merge
- Documentation coverage
GitHub Insights
- Actions tab β "Auto-Update Documentation" workflow
- See success/failure rate
- Check execution times
- View logs for debugging
π Troubleshooting Guide
Issue: Workflow Not Triggering
Symptom: No issue created after merging PR
Solutions:
- Check Actions tab for errors
- Verify workflow file:
.github/workflows/auto-docs.yml - Check PR had source code changes (not just docs)
- Verify PR doesn't have
skip-docslabel - Check Actions permissions: Settings β Actions β General
Issue: Copilot Not Responding
Symptom: Issue created but no documentation PR
Solutions:
- Verify Copilot enabled: Settings β Copilot
- Check agent file exists:
.github/agents/docusaurus.md - Verify you have active Copilot subscription
- Wait a bit longer (can take 5-10 minutes)
- Try manual trigger: Comment "@copilot please update docs"
Issue: Poor Documentation Quality
Symptom: Generated docs are too generic
Solutions:
- Edit
.github/agents/docusaurus.mdwith more specific instructions - Add better context in PR descriptions
- Provide feedback in documentation PRs (Copilot learns!)
- Include examples of good documentation
- Set explicit quality requirements in agent config
Issue: Wrong Files Modified
Symptom: Agent modified source code
Solutions:
- Review agent's "Files You NEVER Modify" section
- Make it more explicit:
β You CANNOT modify ANY files in: - src/ - lib/ - components/ - Report the issue so we can improve the default config
π‘ Tips & Best Practices
1. Write Good PR Descriptions
Better PR descriptions = Better documentation:
**Good PR description:**
"Added createUser() function to the API. It accepts name, email, and
optional role. Returns a User object. Throws EmailExistsError if email
is already registered."
**AutoDoc can extract:**
- Function purpose
- Parameters and types
- Return value
- Error cases
2. Use Conventional Commits
feat: Add user creation API
fix: Correct email validation regex
docs: Update API examples
breaking: Change login signature
Helps AutoDoc categorize changes correctly.
3. Review Documentation PRs
- Treat them like code reviews
- Request changes if needed
- Copilot will update based on feedback
- This improves future documentation
4. Skip When Not Needed
Add skip-docs label to PRs that don't need documentation:
- Dependency updates
- Internal refactoring
- Test changes
- CI/CD updates
5. Provide Feedback
When Copilot creates good docs:
- Approve and merge quickly
- Leave positive comments
When docs need improvement:
- Request specific changes
- Show examples of what you want
- Copilot learns from feedback
π Advanced Usage
Multi-Repository Documentation
Set up AutoDoc in multiple repos:
- Use same template for all repos
- Customize each agent config
- Maintain consistency across projects
Custom Documentation Types
Extend the agent for:
- API reference generation
- Architecture documentation
- Deployment guides
- Troubleshooting docs
Integration with Deployment
Add to your workflow:
- name: Deploy docs after merge
if: github.event.pull_request.merged == true
run: npm run docs:deploy
π Next Steps
Now that AutoDoc is set up:
- Use it regularly - Merge PRs and watch it work
- Customize - Tune the agent for your needs
- Share - Tell your team about it
- Contribute - Improve the template for others
- Star the repo β if it saves you time!
π Additional Resources
π€ Get Help
- Issues: Create an issue in this repository
- Discussions: Ask questions in GitHub Discussions
- Community: Join our Discord (coming soon)
Congratulations! π You now have automated documentation that stays in sync with your code!
Related Documents
Valet V1 β Architecture & Implementation Plan
1. [Vision & Scope](#1-vision--scope)
Writing Effective Skills
What makes a skill actually work vs. being ignored or misapplied. Based on studying production skills across Claude Code (Superpowers, Trail of Bits, Anthropic's official plugins), Codex (babysit-pr, skill-creator, curated catalog), OpenClaw (55 bundled skills, 13,700+ community), and Cursor/Cline rule systems (BMAD-METHOD, RIPER-5, steipete/agent-rules).
Spotipy Types - Implementation Plan
A standalone type stub package for spotipy using Pydantic models generated from the official Spotify Web API OpenAPI schema.