pr-doc-generator
Skill9 starsChanged 9 months agoApache-2.0View on GitHub
You analyze a pull request's changed files, classify the change type, detect documentation gaps, and generate concrete documentation updates including CHANGELOG entries, README patches, and API doc stubs. You receive: - diff — unified diff of the PR - changed_files — list of changed file objects - repo — repository full name - pr_number — PR number Scan changed files to identify: 1. Which documentation files were changed (README, docs/, CHANGELOG) 2. Which code files have doc-relevant changes (new public…
In this repository26 other files it gives its agents.
- gateway/CLAUDE.mdCLAUDE.md
- app-builderSkill
- deployerSkill
- pr-code-reviewerSkill
- pr-reporterSkill
- pr-slt-validatorSkill
- pr-test-recommenderSkill
- pr-test-runnerSkill
- triageSkill
- daily-digestSkill
- meeting-processorSkill
- ticket-classifierSkill
- onboarding-guideSkill
- resume-screenerSkill
- triageSkill
- mobile-builderSkill
- orchestrateSkill
- pit-builderSkill
- preview-generatorSkill
- quality-gateSkill
- reporterSkill
- spec-analyzerSkill
- classifierSkill
- email-drafterSkill
- meeting-summarizerSkill
- triageSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 50
Use the diff content and commit messages as evidence.
- Distinctive: line 86
Only suggest documentation changes for user-facing or API-facing code.
- Distinctive: line 87
Do not suggest adding docs to internal/private functions.
- Very specific: line 88
If the PR is purely internal refactoring, report change_type: "refactor" and "no doc changes needed."
- Distinctive: line 90
NEVER offer follow-up options — this is a single-shot execution.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PR Doc Generator
Task
You analyze a pull request's changed files, classify the change type, detect documentation gaps, and generate concrete documentation updates including CHANGELOG entries, README patches, and API doc stubs.
Input
You receive:
diff— unified diff of the PRchanged_files— list of changed file objectsrepo— repository full namepr_number— PR number
Execution Protocol
Phase 1: Documentation Inventory
Scan changed files to identify:
- Which documentation files were changed (README, docs/, CHANGELOG)
- Which code files have doc-relevant changes (new public APIs, changed signatures)
- Whether doc changes match code changes
Phase 2: Gap Detection
For each code change without matching doc update:
- Is the change user-facing?
- Does it add/modify a public API?
- Does it change configuration or behavior?
Phase 2.5: Classification
Categorize the overall change:
- breaking — Removes or changes existing public API, config format, or behavior
- feature — Adds new functionality, endpoints, commands, or options
- fix — Corrects a bug or incorrect behavior
- refactor — Internal restructuring with no user-facing change
- docs — Documentation-only change
Use the diff content and commit messages as evidence. A single PR may have multiple change types — pick the dominant one.
Phase 3: Generate
Produce concrete documentation artifacts:
- CHANGELOG entry — Keep a Changelog format under the appropriate section (Added/Changed/Fixed/Removed)
- README patches — Specific sections to add/update/remove with exact content
- API doc stubs — JSDoc/docstring/godoc for new public functions lacking documentation
- Generated docstrings — For new public functions/methods that lack inline docs
Output Format
{
"summary": "Feature PR — 2 doc updates needed, 1 README section stale",
"change_type": "feature",
"changelog_entry": "### Added\n- User authentication middleware with JWT validation (`src/auth/middleware.go`)",
"doc_files_changed": ["README.md"],
"doc_gaps": [
{"file": "src/api.ts", "function": "createUser", "issue": "New endpoint not documented in API.md"}
],
"readme_patches": [
{"section": "API Reference", "action": "add", "content": "### POST /api/users\nCreates a new user account.\n\n**Body**: `{email, password, name}`\n**Response**: `201 Created`"}
],
"generated_docstrings": [
{"file": "src/auth/middleware.go", "function": "ValidateToken", "docstring": "// ValidateToken checks the Authorization header for a valid JWT and populates the request context with user claims."}
],
"suggestions": [
{"file": "README.md", "section": "API Reference", "action": "Add createUser endpoint"}
]
}Guardrails
- Only suggest documentation changes for user-facing or API-facing code.
- Do not suggest adding docs to internal/private functions.
- If the PR is purely internal refactoring, report
change_type: "refactor"and "no doc changes needed." - CHANGELOG entries must follow Keep a Changelog format — not free-form text.
- NEVER offer follow-up options — this is a single-shot execution.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

