document-update
Document Update: Pre-PR Documentation Sync
Ensure every documentation file is accurate, up to date, and written in a friendly, succinctly, user-forward voice. Runs after a feature is completed, before a PR is opened or merged.
Autonomy Rules
You are mostly automated. The top-level rules below govern ALL steps — they are not repeated per-step.
Auto-update (never ask):
- Factual corrections clearly supported by the diff
- Adding items to tables/lists, updating paths/counts/versions
- Fixing stale cross-references
- CHANGELOG minor voice adjustments
- Marking TODOS complete
- Cross-doc factual inconsistencies (e.g., version mismatch)
Ask user first:
- Narrative, philosophy, or security-related changes
- Large rewrites or removals
- New TODOS items to add
- Cross-doc contradictions that are narrative (not factual)
NEVER do:
- Overwrite, replace, or regenerate CHANGELOG entries — polish wording only, preserve all content
- Use
Writetool on CHANGELOG.md — always useEdit/Replacewith exact matches
Step 1: Pre-flight & Diff Analysis
BASE_BRANCH=$(gh pr view --json baseRefName -q .baseRefName 2>/dev/null || gh repo view --json defaultBranchRef -q .defaultBranchRef.name 2>/dev/null || echo "main")
git diff $BASE_BRANCH...HEAD --stat
git log $BASE_BRANCH..HEAD --oneline
git diff $BASE_BRANCH...HEAD --name-only
find . -maxdepth 2 -name "*.md" -not -path "*/.git/*" -not -path "*/node_modules/*" | sort
Output: "Analyzing N files changed across M commits. Found K documentation files to review."
Step 2: Per-File Audit & Update
Read each doc file. Cross-reference against the diff. Apply auto-updates directly; queue risky changes for user confirmation.
| File | Focus |
|---|---|
| README.md | Features, install/setup instructions, examples, usage descriptions still valid? |
| ARCHITECTURE.md | Component descriptions match code? Be conservative — only update clear contradictions. |
| AGENTS.md | Agent tools, behaviors, capabilities, configurations still accurate? |
| CONTRIBUTING.md | Walk through setup as a new contributor — would each command succeed? |
| Other .md files | Determine purpose/audience, check if diff contradicts anything. |
For each file modified, output a one-line summary (e.g., "README.md: added feature X to capabilities list").
After auto-updates, present any risky/questionable changes to the user with your recommendation. Apply approved changes immediately.
Step 3: CHANGELOG Voice Polish
If CHANGELOG was modified in this branch:
- Read the entire CHANGELOG.md first.
- Review entries for voice:
- Lead with what the user can now do — not implementation details
- "You can now..." not "Refactored the..."
- Rewrite entries that read like commit messages
- Only modify wording. Never delete, reorder, or replace entries.
Step 4: Cross-Doc Consistency & Discoverability
- README feature list matches what other docs describe?
- ARCHITECTURE component list matches CONTRIBUTING project structure?
- Discoverability: Is every doc file reachable from README.md? Every doc should be discoverable from the main entry point.
Step 5: TODOS Cleanup
- Completed: Cross-reference diff against open TODO items. Move clearly completed items to "Completed" section.
- Stale: If a TODO references significantly changed files, ask user whether to update, complete, or leave.
- New: Check diff for
TODO,FIXME,HACKcomments. Ask user whether to capture in TODOS.md.
Step 6: Commit & Output
If no docs were modified (git status clean), output "All documentation is up to date." and exit.
Otherwise:
git add <modified doc files>
git commit -m "docs: sync documentation for recent changes"
git push
PR body update:
gh pr view --json body -q .body > /tmp/pr-body-$$.md
# Append/update a "## Documentation" section with doc diff preview
gh pr edit --body-file /tmp/pr-body-$$.md
Output a structured summary:
Documentation health:
README.md [Updated] (added feature X)
CHANGELOG.md [Voice polished] (adjusted wording)
ARCHITECTURE.md [Current] (no changes needed)
...
More from jihunkim0/jk-skills
pr-merge-cleanup
Execute a PR workflow: commit changes, push to a branch, create a GitHub PR, wait for CI checks to pass (no bypassing), merge the PR, and clean up all git status, branches, and scratch files. Aggressively removes temporary scratch files; every file committed must be explicitly justified. Use when a user asks to commit, PR, and clean up.
10optimize-code
Deep architectural analysis, aggressive cleanup, modularization, and test enforcement — ruminate on the codebase to identify dead code, redundancies, duplicated logic, over-abstractions, test gaps, and files exceeding 300 lines that need splitting. Systematically eliminate waste, enforce modular architecture, and ensure all functionality has corresponding integration tests. Use whenever the user asks to optimize, slim down, clean up, audit, deduplicate, tighten, or modularize a codebase. Also use when asked to find dead code, reduce line count, eliminate redundancies, split large files, enforce architecture, make code leaner, or audit test coverage. Triggers on phrases like 'audit the codebase', 'clean up', 'find dead code', 'deduplicate', 'make it leaner', 'trim the fat', 'optimize code', 'tidy up', 'remove redundancies', 'refactor for maintainability', 'modularize', 'split large files', 'architecture review', 'files are too big', or 'break this up'. Proactively suggest using this skill before creating a PR.
8product-implement
Product Implement phase. Use this skill when a user wants to execute a planned feature by fetching unblocked tickets from Linear/GitHub, dispatching isolated subagents via git worktrees, and executing a strict TDD loop.
8setup-optimize-code-action
Installs a cloud-native Gemini GitHub Action workflow that automatically performs deep architectural analysis, dead code removal, and modularization audits on your Pull Requests.
8product-pipeline
Product Factory — the single entry point for all product development. Detects where you are, shows a dashboard, and routes to the right phase. Handles ideation, discovery, PRD, vision, stress test, plan, deepening, issues, implementation, and feature-complete ceremony. Invoke at any stage — it picks up where you left off.
7product-plan
Product Plan phase. Use this skill to break a PRD into a phased implementation plan using vertical slices (tracer bullets).
4