name: doc-maintenance
description: Use for keeping repository documentation accurate and synchronized with code changes, including README requirements, cross-skill document updates, and mandatory creation/maintenance of missing core docs.
Doc Maintenance
Quick Index (Action-Routed)
Read First (All Actions)
MissionScope BoundaryHard PolicyTrigger Examples
Action Modules (Read As Needed)
- Identifying doc impact:
Required Documentation InventoryDocumentation Impact Mapping (Required)
- Core documentation updates:
README Standard (Required)Cross-Skill Documentation SynchronizationUpdate Rules
- Capturing rationale:
Decision Notes and Code Notes Policy
- Validating and closing:
Consistency ChecksDocumentation Quality GatesPriority Order for Doc UpdatesNew Repo Bootstrapping Rule
Output
Deliverable FormatAnti-Patterns
Mission
Ensure all relevant documentation stays current whenever code, configuration, workflows, or operational policies change.
Scope Boundary
This skill governs documentation currency and consistency.
Use File Maintenance for:
- periodic or deep file-level factuality/freshness audits
- duplicate/staleness remediation across documentation surfaces
Use User Instructions Tracker for:
- directive-level status tracking (
pending/in_progress/blocked/done/won_t_do) - instruction evidence lifecycle management
- instruction audit workflows
Hard Policy
- If a repository has no
README (or README.md), create one. - Once present, README must be maintained with every relevant change.
- Any document referenced by skills must be updated when triggering changes occur.
- Documentation updates are part of done criteria, not optional cleanup.
Trigger Examples
Use this skill when requests involve:
- feature additions or removals
- API, schema, config, auth, or deployment changes
- new scripts, commands, workflows, or tools
- changes to skill-defined operational artifacts
- refactors that affect behavior, architecture, or usage
Anti-Overuse Rules
Use when:
- behavior, workflow, policy, setup, validation, or user-facing usage changes
- a referenced documentation artifact must stay synchronized
- documentation is part of the user's requested deliverable
Do not use when:
- the task is answer-only and no repo artifact changes
- a tiny internal code edit has no behavior or workflow impact
- another skill owns the artifact and no documentation drift exists
Stop after:
- canonical affected docs are updated
- related references agree
- validation confirms paths and commands are plausible or explicitly blocked
Required Documentation Inventory
At task start, inventory doc surfaces likely impacted:
README.md / README- architecture and design docs (
docs/architecture.md, etc.) - setup/run/test docs
- API and schema docs
- migration and rollback notes
- operational runbooks
- skill-linked docs (for example
docs/chat-history-index.md from token-reduction practices) - release notes/changelog files if present
docs/project-index.md (new-project intake metadata)user-instructions.md (directive tracking and fulfillment state)docs/skill-index.md (cross-skill trigger routing)
If a repository lacks a docs directory but non-trivial behavior exists, create docs/ and add minimum structure.
Inventory output format:
- doc file/path
- owner or primary audience
- impacted by change? (
yes/no) - update action (
edit/create/none)
Documentation Impact Mapping (Required)
Before editing docs, produce a mini impact map:
- changed code paths/features
- user-facing behavior changes
- operator/dev workflow changes
- affected doc files
- new doc files needed
README Standard (Required)
README must include, at minimum:
- project purpose
- stack summary
- setup prerequisites
- local run instructions
- test/validation commands
- key environment variables and where examples live
- high-level repo structure
- operational caveats (if any)
README update triggers:
- command changes
- dependency/runtime changes
- env var changes
- service endpoint changes
- build/test/deploy flow changes
If no README exists:
- create
README.md - include minimum standard sections
- link to deeper docs in
docs/
Cross-Skill Documentation Synchronization
When other skills define documentation artifacts, keep them synchronized.
Examples:
- token-reduction references
docs/chat-history-index.md:
- create if missing when long-history workflow is used
- update index when major interaction milestones occur
- maintain concise response behavior and no-repetition conventions in related templates/docs
- token-reduction also requires
docs/project-index.md:
- create if missing
- keep project language, <=4-word description, and test/build preference (
yes/no) current - when governance scripts are used, ensure index values match latest governance artifact intake fields
- backup/restore skills imply runbook maintenance:
- ensure restore and backup runbook references stay current
- regression-prevention implies validation evidence format:
- keep checklists/templates consistent with current test workflow
- user-instructions-tracker requires
user-instructions.md:
- create if missing
- append/update rows when directives are added/changed
- keep status, evidence, and
Last Updated UTC synchronized with actual execution state
- cross-skill trigger routing requires
docs/skill-index.md:
- create if missing
- update when trigger relationships or recommended companion skills change
- effective-testing-methods requires accurate test command/documentation surfaces:
- keep unit and Playwright command docs current
- keep coverage mapping artifacts aligned with current flows
Update Rules
- Prefer direct edits to existing canonical docs over creating duplicates.
- Keep docs concise but complete; avoid stale boilerplate.
- Use exact command examples that are currently valid.
- Update links/paths when files move.
- Mark deprecated behavior explicitly with migration guidance.
- Capture decision-driving assumptions/tradeoffs in docs instead of relying on ephemeral chat/internal reasoning.
Decision Notes and Code Notes Policy
When changes include non-obvious logic or risk-based tradeoffs:
- add short code comments near complex sections (why, not what)
- add/update doc notes in the most relevant canonical doc (
README.md, architecture, runbook, governance artifact, or feature doc) - prefer durable repo notes over long assistant narrative
- keep notes concise and maintainer-focused
If no suitable doc exists for important rationale:
- create
docs/decision-notes.md - append concise dated entries with context, decision, rationale, and impact
- link the note from the nearest canonical doc when appropriate
Consistency Checks
After doc updates, verify:
- commands in docs execute or are plausibly executable in current repo
- filenames/paths referenced exist
- env var names match code/config usage
- examples match current API/schema behavior
- related docs do not conflict
Cross-file consistency checks:
- README command snippets match detailed docs command snippets
- runbook terminology matches architecture/operations docs
- skill-referenced artifacts exist at documented paths
Documentation Quality Gates
A task touching behavior/config/workflow is incomplete unless:
- affected docs are updated
- README is present and current
- cross-skill artifact docs are reconciled
- known gaps are explicitly recorded
Priority Order for Doc Updates
- correctness-critical docs (runbooks, setup, migration/rollback)
- README and quick-start instructions
- architecture/design references
- supplementary examples and notes
If instructions are conflicting across docs:
- select a canonical source of truth
- update all non-canonical docs to align
- record the canonical source in the updated docs
New Repo Bootstrapping Rule
For repos with minimal docs:
- create
README.md - create
docs/architecture.md (or equivalent) if architecture is non-trivial - create
docs/operations.md for run/test/deploy/backup/restore basics - add links between these docs
Anti-Patterns
- code changes merged without doc updates
- creating redundant docs instead of updating canonical source
- command examples that no longer run
- stale env var lists
- hidden operational changes only mentioned in chat
When applying this skill, provide:
- doc impact map
- files updated/created
- key doc deltas
- validation performed (commands/links/path checks)
- known remaining doc gaps
Maintenance Cadence
For active repositories:
- perform lightweight doc drift review at least monthly
- perform full doc consistency review before major releases
- Token Reduction: maintain indexed chat artifact rules and concise doc hygiene.
- Regression Prevention: keep validation and rollback documentation aligned with risk controls.
- Effective Testing Methods: keep unit and Playwright testing documentation aligned with implementation updates.
- File Maintenance: perform deeper factuality/freshness lifecycle maintenance beyond change-driven doc sync.
- Project Backup: ensure backup/restore docs and runbooks remain current.
- Restore Drill: keep drill procedures and evidence requirements documented.
- Order of Operations: sequence doc updates correctly relative to implementation and safety gates.