Update Docs From Changes
Purpose
Bring repository documentation (docs/*, README.md, AGENTS.md) up to date with a specific set of code changes, following the shared documentation guideline.
Use When
- Code or behaviour changed and the matching documentation must be updated.
- The user wants documentation regenerated from unstaged, uncommitted, last-commit, or branch-diff changes.
- A change is ready for review and its documentation impact must be reflected first.
Do Not Use When
- The repository has no documentation yet and the full required set must be authored from scratch (use
mpt-ext-task-write-documentation).
- The task is to commit, open a pull request, or transition Jira state.
- The task is to verify documentation without editing it.
Inputs
- A target repository that is a Git working tree with history.
- The change source to document:
unstaged: working tree vs index
uncommitted: working tree vs HEAD (staged + unstaged)
last-commit: HEAD~1..HEAD
branch-diff: <base>...HEAD (base defaults to origin/main)
- Optional base ref when the source is
branch-diff.
- Installed shared package root when shared guidance is needed:
${MPT_EXTENSION_SKILLS_HOME:-$HOME/.mpt-extension-skills}/current
Workflow
- Build repository context first.
- Read the target repository
AGENTS.md once per session. If you already loaded it earlier in this session and still have its full contents, reuse them instead of re-reading; if the context was summarized or you are unsure it is complete, read it again. Do not pre-load shared docs in this step; read them lazily only when the repository points to them.
- Read repository-specific docs when they exist, because they may extend or override shared guidance.
- Read shared docs required by this skill (see Shared References) regardless of repository pointers; read additional shared docs only when the repository explicitly points to them.
- Resolve shared docs from
${MPT_EXTENSION_SKILLS_HOME:-$HOME/.mpt-extension-skills}/current when available; otherwise read them from the main branch of the shared GitHub repository.
- Determine the change source.
- Use the source the user requested.
- If the source is ambiguous, ask the user before running. For
branch-diff, confirm the base ref.
- Collect the change set with the bundled script.
python3 "${MPT_EXTENSION_SKILLS_HOME:-$HOME/.mpt-extension-skills}/current/skills/mpt-ext-task-update-docs-from-changes/scripts/collect_changes.py" \
--source branch-diff --base origin/main
- Use
affected_docs to know which documents each changed path most likely affects.
- Use
missing_doc_updates to see which affected docs were not yet touched in this change set.
- Treat
always_review (README.md, AGENTS.md) as documents that need a judgement call, because behaviour and structure changes affecting them are not detectable from paths.
- Treat
unmapped_code as changes with no default mapping; decide their documentation impact manually. Modified (not added or deleted) source files map to docs/architecture.md only through a structural signal, so ordinary edits land here for a manual call rather than flooding missing_doc_updates.
- Treat
stale_doc_references as likely-stale references: each entry is an existing document that still mentions a path removed or renamed in this change set; confirm and fix or remove the reference.
- Update the affected documents.
- For each affected document, read the current document and the actual change content, then edit only what the change affects.
- Follow
standards/documentation.md for structure, topic boundaries, and required-set expectations.
- Do not duplicate shared standards; link to them and document only repository-specific behaviour, exceptions, or context.
- Update
README.md navigation and AGENTS.md reading order only when structure, entry points, or public behaviour actually changed.
- Report the result.
- List the documents updated and the change paths that drove each update.
- List affected documents you intentionally left unchanged, with a short reason.
- Surface anything that needs human judgement (for example a behaviour change whose user-facing impact is unclear).
Guardrails
- Never document behaviour that is not present in the change set; do not invent features or future plans.
- Never duplicate shared engineering rules that already live in
standards/; link to them instead.
- Never edit documentation unrelated to the change set.
- Never reproduce the deterministic change collection in prose; always use the bundled script.
- Never stage, commit, push, open a pull request, or change Jira state in this task; the invoking workflow stages the updated documentation files.
- Keep edits minimal and scoped to the change; do not rewrite untouched sections.
Shared References
standards/documentation.md: required documentation set, structure, and authoring rules.
Bundled Resources
scripts/collect_changes.py
- Inputs:
--source {unstaged,uncommitted,last-commit,branch-diff}, optional --base
- Output: JSON with
source, base, changed_files, code_changes, doc_changes, affected_docs, missing_doc_updates, always_review, and unmapped_code
- Runtime path:
${MPT_EXTENSION_SKILLS_HOME:-$HOME/.mpt-extension-skills}/current/skills/mpt-ext-task-update-docs-from-changes/scripts/collect_changes.py
Expected Outcome
The documentation affected by the given change set is updated in line with standards/documentation.md, README/AGENTS are adjusted only when structure or behaviour changed, and the result clearly states what was updated and what was intentionally left unchanged.
1---2name: mpt-ext-task-update-docs-from-changes3description: Only update repository docs to match a code change set (docs/*, README.md, AGENTS.md) for unstaged, uncommitted, last-commit, or branch-diff changes. A building block: no self-check or staging.4---56# Update Docs From Changes78## Purpose910Bring repository documentation (`docs/*`, `README.md`, `AGENTS.md`) up to date with a specific set of code changes, following the shared documentation guideline.1112## Use When1314- Code or behaviour changed and the matching documentation must be updated.15- The user wants documentation regenerated from unstaged, uncommitted, last-commit, or branch-diff changes.16- A change is ready for review and its documentation impact must be reflected first.1718## Do Not Use When1920- The repository has no documentation yet and the full required set must be authored from scratch (use `mpt-ext-task-write-documentation`).21- The task is to commit, open a pull request, or transition Jira state.22- The task is to verify documentation without editing it.2324## Inputs2526- A target repository that is a Git working tree with history.27- The change source to document:28 - `unstaged`: working tree vs index29 - `uncommitted`: working tree vs `HEAD` (staged + unstaged)30 - `last-commit`: `HEAD~1..HEAD`31 - `branch-diff`: `<base>...HEAD` (base defaults to `origin/main`)32- Optional base ref when the source is `branch-diff`.33- Installed shared package root when shared guidance is needed:3435```text36${MPT_EXTENSION_SKILLS_HOME:-$HOME/.mpt-extension-skills}/current37```3839## Workflow40411. Build repository context first.42- Read the target repository `AGENTS.md` once per session. If you already loaded it earlier in this session and still have its full contents, reuse them instead of re-reading; if the context was summarized or you are unsure it is complete, read it again. Do not pre-load shared docs in this step; read them lazily only when the repository points to them.43- Read repository-specific docs when they exist, because they may extend or override shared guidance.44- Read shared docs required by this skill (see Shared References) regardless of repository pointers; read additional shared docs only when the repository explicitly points to them.45- Resolve shared docs from `${MPT_EXTENSION_SKILLS_HOME:-$HOME/.mpt-extension-skills}/current` when available; otherwise read them from the `main` branch of the shared GitHub repository.46472. Determine the change source.48- Use the source the user requested.49- If the source is ambiguous, ask the user before running. For `branch-diff`, confirm the base ref.50513. Collect the change set with the bundled script.5253```bash54python3 "${MPT_EXTENSION_SKILLS_HOME:-$HOME/.mpt-extension-skills}/current/skills/mpt-ext-task-update-docs-from-changes/scripts/collect_changes.py" \55 --source branch-diff --base origin/main56```5758- Use `affected_docs` to know which documents each changed path most likely affects.59- Use `missing_doc_updates` to see which affected docs were not yet touched in this change set.60- Treat `always_review` (`README.md`, `AGENTS.md`) as documents that need a judgement call, because behaviour and structure changes affecting them are not detectable from paths.61- Treat `unmapped_code` as changes with no default mapping; decide their documentation impact manually. Modified (not added or deleted) source files map to `docs/architecture.md` only through a structural signal, so ordinary edits land here for a manual call rather than flooding `missing_doc_updates`.62- Treat `stale_doc_references` as likely-stale references: each entry is an existing document that still mentions a path removed or renamed in this change set; confirm and fix or remove the reference.63644. Update the affected documents.65- For each affected document, read the current document and the actual change content, then edit only what the change affects.66- Follow `standards/documentation.md` for structure, topic boundaries, and required-set expectations.67- Do not duplicate shared standards; link to them and document only repository-specific behaviour, exceptions, or context.68- Update `README.md` navigation and `AGENTS.md` reading order only when structure, entry points, or public behaviour actually changed.69705. Report the result.71- List the documents updated and the change paths that drove each update.72- List affected documents you intentionally left unchanged, with a short reason.73- Surface anything that needs human judgement (for example a behaviour change whose user-facing impact is unclear).7475## Guardrails7677- Never document behaviour that is not present in the change set; do not invent features or future plans.78- Never duplicate shared engineering rules that already live in `standards/`; link to them instead.79- Never edit documentation unrelated to the change set.80- Never reproduce the deterministic change collection in prose; always use the bundled script.81- Never stage, commit, push, open a pull request, or change Jira state in this task; the invoking workflow stages the updated documentation files.82- Keep edits minimal and scoped to the change; do not rewrite untouched sections.8384## Shared References8586- `standards/documentation.md`: required documentation set, structure, and authoring rules.8788## Bundled Resources8990- `scripts/collect_changes.py`91 - Inputs: `--source {unstaged,uncommitted,last-commit,branch-diff}`, optional `--base`92 - Output: JSON with `source`, `base`, `changed_files`, `code_changes`, `doc_changes`, `affected_docs`, `missing_doc_updates`, `always_review`, and `unmapped_code`93 - Runtime path: `${MPT_EXTENSION_SKILLS_HOME:-$HOME/.mpt-extension-skills}/current/skills/mpt-ext-task-update-docs-from-changes/scripts/collect_changes.py`9495## Expected Outcome9697The documentation affected by the given change set is updated in line with `standards/documentation.md`, README/AGENTS are adjusted only when structure or behaviour changed, and the result clearly states what was updated and what was intentionally left unchanged.