How it works
End-to-end automated workflow:- Trigger: Code merged to main branch
- Explore: Droid exec explores codebase structure (project type, tech stack)
- Analyze: Identifies changed files and their purpose
- Discover: Searches docs/ directory for relevant documentation
- Update: Updates affected documentation sections
- Commit: Workflow creates commit
- PR: Bot opens pull request for team review
Prerequisites
To get started, you’ll need:- Droid installed
- A Factory API key
- GitHub repository with Actions enabled
FACTORY_API_KEYin repository secrets (Settings → Secrets → Actions)- Existing documentation directory
See the Droid Exec setup here.
Complete GitHub Actions workflow
This workflow will create pull requests automatically. Review the generated PRs carefully before merging to ensure accuracy.
.github/workflows/update-docs.yml:
- Uses
--auto lowfor file modifications only (following cookbook patterns) - Explicit instruction: “DO NOT commit or push” (separation of concerns)
- Workflow handles git operations in separate step
- Droid autonomously explores codebase and discovers relevant docs (no mapping file needed)
Best practices
Trust autonomous discovery
Let droid explore and find relevant docs rather than maintaining manual mappings:
Variations
Weekly comprehensive review
For repositories with frequent changes, batch updates into a weekly review:Multiple documentation directories
If your docs are spread across multiple locations:Language-specific targeting
Focus on specific file types:Troubleshooting
No PR created even though code changed
No PR created even though code changed
Droid may have determined no docs needed updates. Check the workflow logs or add more specific search instructions in the prompt. You can also check if
doc-update-summary.md was created to see what droid analyzed.Wrong sections get updated
Wrong sections get updated
Improve the exploration prompt to be more specific about what to look for. Consider adding explicit instructions about which doc sections should or shouldn’t be modified.
Droid can't find relevant docs
Droid can't find relevant docs
Make the search instructions more explicit by pointing Droid Exec at specific directories, filenames, or keywords. Providing a short list of likely docs can dramatically improve accuracy.
Workflow times out
Workflow times out
For large repositories, consider:
- Increasing the timeout in the workflow
- Processing documentation updates in batches
- Using scheduled updates instead of triggering on every merge
See also
- Droid Exec Overview - Autonomy levels and capabilities
- GitHub Actions Cookbook - More workflow examples
- Documentation Sync Hooks - Preventive approach
