Docs updater

From y-miyazaki/terraform-aws-base · View interactive version

Docs updater is an AI agent skill from the GitHub repository y-miyazaki/terraform-aws-base. Detect documentation drift and patch affected docs (candidate survey, git hook, range cursor, or detect JSON). Use in conversation when the user asks to sync or update docs after code changes. Also the loop entry skill for documentation drift automation. Interactive default is survey only; edit docs

How to use this skill

Skill file

UTILITY SKILL — automated diff-sync and drift repair, not content authoring.

Input

Path allowlist, when present, arrives in ## Constraints.

Output Specification

Report per common-output-format.md. On the automation path, also follow common-output-format-automation.md and category-automation-envelope.md. Stay within category-scope.md.

Execution Scope

Target: candidate documentation per common-impact-map.md Search Scope — typically root *.md, the repository's documentation tree, nested README.md files (excluding generated directories), and site nav config when present.

USE FOR:

DO NOT USE FOR:

Reference Files Guide

Workflow

Resolve agent_edit_allowed before patching (git hook runs follow the Interactive rows):

| Source | agent_edit_allowed |

| --------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |

| Interactive — default: the request asks to look, check, triage, or survey, or only names the skill | false — survey only; do not edit documentation files |

| Interactive — the request asks for changes to be made (for example fix, apply, 修正して, 適用して, update, add) | true |

| Interactive — follow-up after a survey asking to apply | true |

| Automation — ## Constraints | agent_edit_allowed: true or agent_edit_allowed: false from category-automation-envelope.md |

When intent is unclear, survey and offer to apply — edits are harder to undo than a report.

When agent_edit_allowed is true, resolve agent_edit_target: on the interactive path use fix (this skill); on the automation path read agent_edit_target from ## Constraints. Do not branch on other caller metadata outside ## Constraints.

Interactive / hook path

  1. Resolve scope (category-scope.md). Parse detect JSON when present; otherwise resolve the detect universe from the prompt (category-detect-scope.md), run this skill's optional detect script with the resolved --scope (default all for Interactive free-form; staged for git hook; range when the user named a SHA range), then Agent-complement beyond mechanical output; if tools for detect are unavailable, gather changed paths from git and the user request instead of silent no-op. On detect script non-zero exit, read stdout and stop.
  2. IF detect reports skip OR no documentation impact after gathering → emit survey no-op per common-output-format.md (Overview explains no-op); stop.
  3. Triage affected docs per common-impact-map.md; grep before full read.
  4. IF agent_edit_allowed is false OR agent_edit_target is not fix → emit survey shape per common-output-format.md; stop — do not edit documentation files or run git add.
  5. ELSE → apply minimal patches per common-checklist.md; when the repository maintains a generated documentation index and documentation files were created/deleted/renamed, regenerate it per UV-05; stage with git add; emit apply shape per common-output-format.md.

Automation path

When detect JSON and ## Constraints are present: follow category-automation-envelope.md for edit gate, report shape, and synthesis. Triage and patch per common-checklist.md and category-documentation-maintenance.md. Do not manage caller state.

Error Handling

| Condition | Severity | Action |

| ------------------------------------------------------------------- | ----------- | --------------------------------------------------------------------------------------------- |

| Detect script non-zero exit or status: "error" (when invoked) | Fatal | Read stdout; stop — do not treat as success-path detect JSON |

| No git repository | Fatal | Stop |

| Empty diff / no documentation impact | Info | Emit survey no-op (Overview explains no-op); stop |

| Affected doc file missing | Recoverable | Skip file; note in report |

| Exceeds scope (>3 H2, new top-level document, etc.) | Recoverable | Stop for file; note out of scope for new top-level authoring |

| mkdocs.yml missing | Recoverable | Skip nav update |

| Edit requested but ## Constraints set agent_edit_allowed: false | Info | Survey only; note that the caller Constraints disallow edits |

| Automation agent_edit_target mismatch | Recoverable | Survey only per category-automation-envelope.md |

Examples

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.