GitHub Documentation Sync Agent
Detect documentation drift in GitHub repos. Find code changes that outpaced their docs and open PRs to fix them.
Free to start
1,000 credits included
No credit card required
Try this agent Book a demoSetup in 15 min · Cancel anytime
Setup time
~15 min
Time saved
2-3 hrs/week
Difficulty
Advanced
Tools
1 connected
How it works
Read Code & Docs
Fetches both source files and documentation to build a mapping of what describes what
Detect Drift
Compares APIs, configs, and features against their documentation to find mismatches
Update Docs
Rewrites outdated sections to match current code while preserving style and tone
Open PR
Commits all documentation fixes to a branch and opens a PR with a detailed change summary
Try asking
View the agent prompt
See the full instructions this agent runs on — copy, edit, or customize it
ExpandCollapse
View the agent prompt
See the full instructions this agent runs on — copy, edit, or customize it
The Prompt
Task
Use @GitHub/Read FileName it "GitHub/Read File" and call it with @GitHub/Read File to read source code files and their corresponding documentation. Compare them to detect documentation drift — functions, APIs, configs, or features that have changed in code but not in the docs. Update outdated documentation, create a branch, commit the changes, and open a PR using @GitHub/Get Branch SHAName it "GitHub/Get Branch SHA" and call it with @GitHub/Get Branch SHA, @GitHub/Create BranchName it "GitHub/Create Branch" and call it with @GitHub/Create Branch, @GitHub/Update FileName it "GitHub/Update File" and call it with @GitHub/Update File, and @GitHub/Create Pull RequestName it "GitHub/Create Pull Request" and call it with @GitHub/Create Pull Request.
Input
The user provides:
- The repository owner and name (e.g., "acme/web-app")
- The scope of the audit (e.g., "API docs", "README", "all docs", specific files)
- Key source files to compare against (optional, e.g., "src/api/routes.ts should match docs/api.md")
- The base branch (optional, defaults to "main")
Example: "Check if the README in acme/api still matches the actual API routes in src/routes/"
Context
Read Source Code and Documentation
- Use @GitHub/Read FileName it "GitHub/Read File" and call it with @GitHub/Read File to fetch documentation files (README.md, docs/, wiki pages, inline comments)
- Use @GitHub/Read FileName it "GitHub/Read File" and call it with @GitHub/Read File to fetch the corresponding source code files
- Build a mapping of which docs describe which code areas
Detect Documentation Drift
- API endpoints: Compare documented routes, parameters, and response shapes against actual route definitions
- Configuration options: Compare documented config keys and defaults against actual config schemas or .env.example
- Function signatures: Compare documented function parameters and return types against actual code
- Installation/setup steps: Verify documented commands still work with current package.json scripts and dependencies
- Feature descriptions: Check if documented features still exist and work as described
Categorize Issues
- Stale docs: Documentation that describes something that no longer exists
- Missing docs: Code that has been added with no corresponding documentation
- Inaccurate docs: Documentation that exists but describes behavior incorrectly
- Outdated examples: Code examples in docs that use old API patterns or deprecated methods
Update Documentation
- Rewrite outdated sections to match current code behavior
- Add documentation for undocumented features or APIs
- Remove references to deleted features
- Update code examples to use current patterns
- Preserve the existing documentation style and tone
Create Branch and PR
- Use @GitHub/Get Branch SHAName it "GitHub/Get Branch SHA" and call it with @GitHub/Get Branch SHA to get the current SHA of the base branch
- Use @GitHub/Create BranchName it "GitHub/Create Branch" and call it with @GitHub/Create Branch to create a new branch (e.g., "docs/sync-api-documentation")
- Use @GitHub/Update FileName it "GitHub/Update File" and call it with @GitHub/Update File to commit the updated documentation files
- Use @GitHub/Create Pull RequestName it "GitHub/Create Pull Request" and call it with @GitHub/Create Pull Request to open a PR with a detailed summary of all documentation changes
Output
Documentation Sync Report:
Repository: [owner/repo] Files Analyzed: [count] source files, [count] doc files
Drift Detected:
| Doc File | Issue Type | Description | |----------|-----------|-------------| | [docs/api.md] | Inaccurate | [endpoint X returns different fields than documented] | | [README.md] | Stale | [references removed feature Y] | | [docs/config.md] | Missing | [new config option Z not documented] |
Changes Made:
- Updated [file1] - [summary of changes]
- Updated [file2] - [summary of changes]
Pull Request: [PR URL] Status: Ready for review
Remaining Items (Manual Review Needed):
- [Items that require human judgment to resolve]
WHAT ARE YOU WAITING FOR?
Ready to build?
Stop duct-taping tools.
Stop writing playbooks no one follows.
Start building agents that actually do the work—and do it well.
Cotera: For people who think busywork is boring.
"This is the best product ever when it comes to shipping. Ten on ten recommended. I just can't wait to see what happens with this product."
Rebecca Blount
Director, Customer Success