align-docs · diff
git:20260724.ba2c70f to git:20260919.a9f7da5
47 added, 28 removed. Audit A to A.
---
name: align-docs
- description: "Use when repository docs, README, AGENTS.md, rules, plans, chronicles, or ATLAS are stale or current work changed their lifecycle; archives task history, with --clean for corpus-wide cleanup."
+ description: Align stale repository docs and task records; use --clean for a full documentation cleanup.
user-invocable: true
allowed-tools: Read, Edit, Write, Bash, Glob, Grep, AskUserQuestion
---
# Align docs
- Make the repository's existing knowledge easy for humans and agents to find and trust.
- Run it inside the development-skills workflow, after a conversation, or standalone. Inside an active workflow, continue that workflow instead of starting another. When prior context exists, include lasting knowledge gathered there; otherwise follow the default steps.
+ Make existing repository knowledge accurate and easy to find.
+ Continue an active workflow with its current task context and authorization.
+ Without task context, inspect only the entry layer and relevant references.
+ Exclude dependencies, caches, build output, and vendored content.
- Always leave this shared entry layer:
+ ## Entry layer
+ Preserve or establish the project's shared entry layer:
+
```text
- README.md # evidence-based human entry point
- AGENTS.md # under 70 lines; critical facts and rules index
- CLAUDE.md # exactly @AGENTS.md
- .agents/rules/ # scoped team/project rules; .gitkeep if empty
+ README.md # Human entry point.
+ AGENTS.md # Critical facts and scoped rules, under 70 lines.
+ CLAUDE.md # Exactly @AGENTS.md.
+ .agents/rules/ # Scoped project rules; .gitkeep if empty.
.claude/rules -> ../.agents/rules
- docs/ATLAS.md # curated routing map of the repo's knowledge
+ docs/ATLAS.md # Curated knowledge routes.
```
- Resolve the git root. Inspect the entry layer, manifests, their referenced paths, agent memory, and documents created, changed, or invalidated by the current task. Without prior task context, inspect the entry layer and its references only. Read enough reliable evidence to verify claims. Exclude dependencies, caches, build output, and vendored content.
-
- Report missing, stale, contradictory, duplicated, orphaned, or oversized knowledge before editing. A normal run may make safe in-scope fixes but never merges or deletes first-party documents.
-
- When prior task context proves that the current task changed a document's lifecycle, also move the resulting history with `git mv`:
-
- - a completed plan whose implementation is verified and whose durable decisions remain in a chronicle → `docs/plans/archive/`;
- - a chronicle that the task superseded or made obsolete → `docs/chronicles/archive/`, preserving decision prose and lifecycle links;
- - another document that the task superseded or made obsolete but whose unique history remains useful → an `archive/` beside its active collection.
+ Inspect these files, manifests, relevant agent memory, and documents affected by the current task.
+ Report conflicts or missing facts before making safe in-scope repairs.
+ A normal run never merges or deletes first-party documents and does not scan unrelated history for archive candidates.
+ Use [clean mode](references/clean-mode.md) for a requested full-corpus cleanup.
- Before archiving, move durable agent instructions to the right `.agents/rules/` file. Keep current owners and uncertain documents active, and make archive metadata match the path. This bounded normal run does not scan unrelated history for archive candidates.
+ ## Owners and evidence
- With `--clean`, follow [clean-mode.md](references/clean-mode.md); it applies these lifecycle rules to the full corpus, and its proposal gate replaces normal apply behavior.
+ Give each fact one owner: critical facts in AGENTS, scoped instructions in rules, execution in plans, reasons in chronicles.
+ Keep other useful knowledge in its clearest existing home.
+ Verify implementation claims against code and tests, runtime claims against telemetry, promises against contracts, and decision reasons against chronicles.
+ Report unresolved conflicts instead of choosing an unsupported claim.
- Give each fact one owner: brief always-read facts in AGENTS.md, scoped detail in `.agents/rules/`, execution in plans, decisions in chronicles, and other existing knowledge in its clearest current home. Prefer links over copies and preserve useful project-specific structure.
+ Preserve an existing AGENTS file's rules. Edit them only within the task's authorization; do not overwrite it with a template.
+ Use [agents-template.md](references/agents-template.md) only when creating or explicitly migrating the file.
+ Remove a leftover `align-docs:principles-customized` marker.
+ Keep personal machine facts in `.claude/CLAUDE.md` or global Codex instructions.
+ Ensure `.gitignore` ignores `.claude/CLAUDE.md` and `AGENTS.override.md`.
+ Capture lasting session facts absent from disk; with no session context, report `CAPTURE: NONE`.
- Resolve claims by what they describe: code, tests, and configuration for implementation; telemetry or live data for runtime state; approved contracts for promises; chronicles for rationale; and executable commands or CI for procedures. Report conflicts between authorities instead of guessing.
+ ## Lifecycle and routes
- Apply the [documentation contract](../../shared/documentation.md) within its stated scope.
+ Use the [documentation contract](../../shared/documentation.md) for metadata and lifecycle.
+ Archive only documents whose changed lifecycle the task establishes:
- Build `docs/ATLAS.md` without frontmatter, as a routing map, not an inventory: the filesystem and git already enumerate files. Route every recurring question or area to its authoritative home with a link and one when-to-open line. Be exhaustive only inside small curated scopes (entry points, rules, reference shelf); give self-indexing directories such as plans and chronicles one routing entry that explains their naming convention. Exclude fixtures, implementation-support Markdown, and ATLAS itself. No lifecycle columns — validity and work state live in each document's frontmatter.
+ - Completed plans with closed work and verified implementation move to `docs/plans/archive/`.
+ - Superseded or obsolete chronicles move to `docs/chronicles/archive/` with decision prose preserved.
+ - Other obsolete documents with useful history move to an adjacent `archive/`.
- An existing AGENTS.md is authoritative: report issues, never overwrite it or prepend the template. Create AGENTS.md from [agents-template.md](references/agents-template.md) only when the file is missing or the user explicitly asks to migrate. Delete a leftover `align-docs:principles-customized` marker. A rule owns its topic; AGENTS.md only links to it.
+ Keep current owners and uncertain documents active. Move durable instructions to their owner before archiving.
+ Use `git mv` for tracked files. Repair inbound links, moved-file links, paired IDs, and archive metadata.
- Keep personal machine facts in `.claude/CLAUDE.md` or the user's global Codex AGENTS file. Ensure `.gitignore` contains `.claude/CLAUDE.md` and `AGENTS.override.md`.
+ Build ATLAS without frontmatter. Route recurring questions to authoritative files with a link and a when-to-read sentence.
+ List small curated scopes, such as rules and reference notes, completely.
+ Give plans and chronicles one directory route that explains `YYYY-MM-DD__<slug>.md` and legacy `NNNN__` names.
+ Exclude fixtures, implementation-support Markdown, ATLAS itself, and lifecycle tables.
- Capture only lasting session facts that are absent from disk. A run without prior session context reports `CAPTURE: NONE`. Move useful memory to its owner; leave empty or generic memory for clean mode.
+ ## Check
- Finish by checking the AGENTS line budget, rule scopes, symlink, ignored personal files, README/manifests against disk, ATLAS routing (every area reachable, no excluded content), required frontmatter on changed docs, and Markdown links. Apply the [reduce-gate](../../shared/skill-authoring.md) to every changed instruction file.
+ Check the entry layer, scopes, symlink, ignored files, manifest claims, ATLAS routes, changed metadata, and Markdown links.
+ Run `uv run <plugin-root>/scripts/check_docs.py <repository-root>` from the installed plugin.
+ Use the project's documented `--legacy-before YYYY-MM-DD` cutoff when present.
+ The checker validates local file targets, paired IDs, names, and plan closure; it does not validate heading anchors or external URLs.
+ Report unrelated failures without expanding scope or claiming success.
+ Apply the [authoring contract](../../shared/skill-authoring.md) to changed instructions.