skills/update-docs/SKILL.md
Refresh project documentation after code changes. Use after implementing features, changing behavior, or preparing a milestone commit.
npx skillsauth add a-green-hand-jack/ml-research-skills update-docsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this workflow whenever code has changed and the project documentation needs to be brought up to date. The agent uses git to detect what changed since the last documentation commit, analyses the diff, and updates only the affected docs.
This workflow is project-agnostic: it auto-detects the project root and documentation location.
// turbo Run the following to establish the project root and basic structure:
# Project root and current branch
git rev-parse --show-toplevel && git branch --show-current
# Last 5 commits (so we can pick the baseline)
git log --oneline -5
Then find where the documentation lives:
# Look for common doc directory patterns
find "$(git rev-parse --show-toplevel)" -maxdepth 3 -type d \
\( -name "docs" -o -name "doc" -o -name "wiki" -o -name "pages" \) \
! -path "*/.git/*" ! -path "*/node_modules/*" ! -path "*/.venv/*"
# Also check for top-level markdown files
find "$(git rev-parse --show-toplevel)" -maxdepth 1 -name "*.md" -type f
From the results, identify:
$ROOT: the git root directory$DOCS_DIR: where the documentation files are (e.g. docs/src/, docs/, wiki/)If $DOCS_DIR cannot be determined automatically, ask the user: "Where are your documentation files? (e.g. docs/, docs/src/, or README.md only)"
// turbo Find the most recent commit that touched the documentation directory:
git log --oneline --all -- "$DOCS_DIR" | head -5
Note the first hash — call it <baseline>. This is the last point in time when docs were current.
If no doc commits exist, use the initial commit as baseline:
git log --oneline --all | tail -1
// turbo First, a compact summary of what changed in source code (not docs):
git diff <baseline> HEAD --stat -- . \
':!'"$DOCS_DIR" ':!*.md' ':!*.rst' ':!*.txt' ':!*.json'
If the diff is manageable, get the full diff:
git diff <baseline> HEAD -- . \
':!'"$DOCS_DIR" ':!*.md' ':!*.rst' ':!*.txt' ':!*.json'
Tip: If the diff exceeds ~400 lines, analyse it file by file using:
git diff <baseline> HEAD -- path/to/file.pyFocus on: new/deleted classes or functions, changed method signatures, new modules, changed configuration keys, new data files.
Read the documentation files discovered in Step 1. Understand:
Maintain the same style and language as the existing docs when making edits.
For each changed file or module, determine which documentation file(s) need updating.
General mapping heuristics (adapt to the specific project structure):
| Type of code change | What to update | | ---------------------------------------------- | ------------------------------------------------------------------------------------------- | | New class or module added | Add it to whichever architecture/overview doc covers that layer; update dependency diagrams | | Class or function deleted | Remove or strike from all docs that mention it | | Method signature / parameter changed | Update code examples, parameter tables | | New config key or environment variable | Update configuration docs | | New external dependency added | Update setup/installation docs | | Data schema changed (DB, JSON, Pydantic, etc.) | Update data model docs | | New CLI command or flag | Update CLI reference / usage docs | | Behaviour change (algorithm, business logic) | Update design/architecture docs | | New test coverage (major new tests) | No doc update usually needed unless testing guide exists |
Update only the sections that are out of date. Do not rewrite sections that are still accurate.
Edit rules:
After all edits, display a brief summary:
Then ask the user: "文档已更新。是否要将这些改动提交到 Git?(Y/n)"
If yes, suggest a commit message in the format:
docs: update <DOCS_DIR> to reflect changes since <baseline-short-hash>
Then run (replace <DOCS_DIR> and <message> accordingly):
git add <DOCS_DIR> && git commit -m "<message>"
If no, remind the user that all files are already saved and can be committed later with:
git add <DOCS_DIR> && git commit -m "docs: ..."
testing
Bootstrap project-local ml-research-skills. Use from global installs when creating a new ML research project, enabling this collection in an existing ML research repo, or deciding whether to install the full bundle locally. Route to project-init for new projects; do not handle paper or experiment work directly.
development
Route project operations tasks — git, memory, bootstrap, remote, workspace, code review, timeline, ops — to the correct skill. Use when the task involves commits, pushes, worktrees, project memory, enabling project-local skills, SSH/server coordination, sidecar runners, or audits. Do not solve the ops task directly.
testing
Route ML/AI paper writing tasks to the correct skill — contract planning, prose drafting, section writing, consistency editing, review simulation, rebuttal, submission, or citation work. Use when the task involves writing, revising, reviewing, or submitting a paper instead of guessing between paper-writing-assistant, paper-writing-contract-planner, paper-reviewer-simulator, auto-paper-improvement-loop, or citation skills. Do not draft prose directly.
data-ai
Project-local router for ML research skill selection. Use inside an initialized ML research project, or while maintaining this skill repo, when the user describes an ML research/paper/experiment/discovery/ops/release workflow and may not know the skill; route to a domain router or high-signal leaf. Do not use for generic non-ML projects.