From gh
Post-ship documentation update. Use after shipping a feature or at session end to ensure README, ARCHITECTURE, CONTRIBUTING, CLAUDE.md, CHANGELOG, TODOS, and VERSION are accurate and up to date. Trigger phrases: "update the docs to match what shipped", "docs are stale after my changes", "README is outdated", "CHANGELOG needs polish", "review project docs before finishing", "check all docs are consistent".
How this skill is triggered — by the user, by Claude, or both
Slash command
/gh:document-releaseThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Determine which branch this PR targets. Use the result as "the base branch" in all subsequent steps.
Determine which branch this PR targets. Use the result as "the base branch" in all subsequent steps.
Check if a PR already exists for this branch:
gh pr view --json baseRefName -q .baseRefName
If this succeeds, use the printed branch name as the base branch.
If no PR exists (command fails), detect the repo's default branch:
gh repo view --json defaultBranchRef -q .defaultBranchRef.name
If both commands fail, fall back to main.
Print the detected base branch name. In every subsequent git diff, git log,
git fetch, git merge, and gh pr create command, substitute the detected
branch name wherever the instructions say "the base branch."
You are running the document-release workflow. This runs after code is committed but
before the PR merges. Your job: ensure every documentation file in the project is accurate,
up to date, and written in a friendly, user-forward voice.
You are mostly automated. Make obvious factual updates directly. Stop and ask only for risky or subjective decisions.
Only stop for:
Never stop for:
NEVER do:
Write tool on CHANGELOG.md — always use Edit with exact old_string matchesCheck the current branch. If on the base branch, abort: "You're on the base branch. Run from a feature branch."
Gather context about what changed:
git diff <base>...HEAD --stat
git log <base>..HEAD --oneline
git diff <base>...HEAD --name-only
find . -maxdepth 2 -name "*.md" -not -path "./.git/*" -not -path "./node_modules/*" -not -path "./.changes/*" -not -path "./.pixi/*" | sort
Classify the changes into categories relevant to documentation:
Output a brief summary: "Analyzing N files changed across M commits. Found K documentation files to review."
Read each documentation file and cross-reference it against the diff. Use these generic heuristics (adapt to whatever project you're in — these are not project-specific):
README.md:
ARCHITECTURE.md:
CONTRIBUTING.md — New contributor smoke test:
CLAUDE.md / project instructions:
Any other .md files:
For each file, classify needed updates as:
Make all clear, factual updates directly using the Edit tool.
For each file modified, output a one-line summary describing what specifically changed — not just "Updated README.md" but "README.md: added /new-skill to skills table, updated skill count from 9 to 10."
Never auto-update:
For each risky or questionable update identified in Step 2, use AskUserQuestion with:
RECOMMENDATION: Choose [X] because [one-line reason]Apply approved changes immediately after each answer.
CRITICAL — NEVER CLOBBER CHANGELOG ENTRIES.
This step polishes voice. It does NOT rewrite, replace, or regenerate CHANGELOG content.
A real incident occurred where an agent replaced existing CHANGELOG entries when it should have preserved them. This skill must NEVER do that.
Rules:
old_string matches — never use Write to overwrite CHANGELOG.md.Changie projects (.changie.yaml exists):
If the repo uses Changie (.changie.yaml is present), do NOT edit CHANGELOG.md directly.
Instead, polish the body field within existing .changes/unreleased/*.yaml fragment files.
Never create new fragment files — that is the developer's job. Only edit the body text of
existing fragments to improve voice.
If CHANGELOG was not modified in this branch (and no unreleased fragments were modified): skip this step.
If CHANGELOG was modified in this branch, review the entry for voice:
After auditing each file individually, do a cross-doc consistency pass:
If TODOS.md does not exist, skip this step.
Completed items not yet marked: Cross-reference the diff against open TODO items. If a
TODO is clearly completed by the changes in this branch, move it to the Completed section
with **Completed:** vX.Y.Z (YYYY-MM-DD). Be conservative — only mark items with clear
evidence in the diff.
Items needing description updates: If a TODO references files or components that were significantly changed, its description may be stale. Use AskUserQuestion to confirm whether the TODO should be updated, completed, or left as-is.
New deferred work: Check the diff for TODO, FIXME, HACK, and XXX comments. For
each one that represents meaningful deferred work (not a trivial inline note), use
AskUserQuestion to ask whether it should be captured in TODOS.md.
CRITICAL — NEVER BUMP VERSION WITHOUT ASKING.
If VERSION does not exist: Skip silently.
Check if VERSION was already modified on this branch:
git diff <base>...HEAD -- VERSION
If VERSION was NOT bumped: Use AskUserQuestion with:
If VERSION was already bumped: Do NOT skip silently. Instead, check whether the bump still covers the full scope of changes on this branch:
a. Read the CHANGELOG entry for the current VERSION. What features does it describe?
b. Read the full diff (git diff <base>...HEAD --stat and git diff <base>...HEAD --name-only).
Are there significant changes (new features, new skills, new commands, major refactors)
that are NOT mentioned in the CHANGELOG entry for the current version?
c. If the CHANGELOG entry covers everything: Skip — output "VERSION: Already bumped to
vX.Y.Z, covers all changes."
d. If there are significant uncovered changes: Use AskUserQuestion explaining what the
current version covers vs what's new, and ask:
The key insight: a VERSION bump set for "feature A" should not silently absorb "feature B" if feature B is substantial enough to deserve its own version entry.
Empty check first: Run git status (never use -uall). If no documentation files were
modified by any previous step, output "All documentation is up to date." and exit without
committing.
Commit:
git add -A or git add .).git commit -m "docs: update project documentation"
git push
PR body update (idempotent, race-safe):
gh pr view --json body -q .body > /tmp/docrelease-pr-body-$$.md
If the tempfile already contains a ## Documentation section, replace that section with the
updated content. If it does not contain one, append a ## Documentation section at the end.
The Documentation section should include a doc diff preview — for each file modified, describe what specifically changed (e.g., "README.md: added document-release to skills table, updated skill count from 9 to 10").
Write the updated body back:
gh pr edit --body-file /tmp/docrelease-pr-body-$$.md
rm -f /tmp/docrelease-pr-body-$$.md
gh pr view fails (no PR exists): skip with message "No PR found — skipping body update."gh pr edit fails: warn "Could not update PR body — documentation changes are in the
commit." and continue.Structured doc health summary (final output):
Output a scannable summary showing every documentation file's status:
Documentation health:
README.md [status] ([details])
ARCHITECTURE.md [status] ([details])
CONTRIBUTING.md [status] ([details])
CHANGELOG.md [status] ([details])
TODOS.md [status] ([details])
VERSION [status] ([details])
Where status is one of:
Creates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.
npx claudepluginhub nq-rdl/agent-extensions --plugin gh