Post-ship documentation update. Reads all project docs, cross-references the diff, updates README/ARCHITECTURE/CONTRIBUTING/CLAUDE.md to match what shipped, polishes CHANGELOG voice, cleans up TODOS, and optionally bumps VERSION.
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 /ship (code committed, PR
exists or about to exist) but . 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 "./.skill-data/*" -not -path "./.context/*" | 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 skill-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:
/ship from the
actual diff and commit history. It is the source of truth. You are polishing prose, not
rewriting history.old_string matches — never use Write to overwrite CHANGELOG.md.If CHANGELOG was not modified in this branch: 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:
This is a second pass that complements /ship's Step 5.5. Read references/TODOS-format.md (if
available) for the canonical TODO item format.
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.W (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:
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 "$(cat <<'EOF'