agentleFS
srinidhis05srinidhis05/agentura/skills/dev/pr-doc-generator/SKILL.md

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…

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
  1. Distinctive:

    Use the diff content and commit messages as evidence.

    line 50
  2. Distinctive:

    Only suggest documentation changes for user-facing or API-facing code.

    line 86
  3. Distinctive:

    Do not suggest adding docs to internal/private functions.

    line 87
  4. Very specific:

    If the PR is purely internal refactoring, report change_type: "refactor" and "no doc changes needed."

    line 88
  5. Distinctive:

    NEVER offer follow-up options — this is a single-shot execution.

    line 90

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 PR
  • changed_files — list of changed file objects
  • repo — repository full name
  • pr_number — PR number

Execution Protocol

Phase 1: Documentation Inventory

Scan changed files to identify:

  1. Which documentation files were changed (README, docs/, CHANGELOG)
  2. Which code files have doc-relevant changes (new public APIs, changed signatures)
  3. Whether doc changes match code changes

Phase 2: Gap Detection

For each code change without matching doc update:

  1. Is the change user-facing?
  2. Does it add/modify a public API?
  3. 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:

  1. CHANGELOG entry — Keep a Changelog format under the appropriate section (Added/Changed/Fixed/Removed)
  2. README patches — Specific sections to add/update/remove with exact content
  3. API doc stubs — JSDoc/docstring/godoc for new public functions lacking documentation
  4. 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.