doc-steward
Keep agent-facing repository documentation predictable: put each fact at the
right residency, altitude, and volatility level; evaluate it deterministically
where possible; and gate every write.
Run commands from this skill directory. Every scripts/, references/, and
agents/ path below is relative to this file.
Route the request
Choose exactly one starting mode. Never cross from a read-only mode into a write
mode without explicit user intent.
| Mode |
Trigger |
Writes? |
Surface |
| DEFINE |
The user asks to explain or classify against the standard. |
No |
This skill + references |
| EVALUATE |
Default for audits, grading, drift, frontmatter, or routing checks. |
No* |
scripts/checks/doc_lint.py |
| ENFORCE |
The user explicitly asks to preview or apply fixes after an audit. |
Yes, only with --apply |
scripts/apply/enforce_apply.py |
| LEARN |
The user explicitly asks to retain one documentation lesson. |
Sink-dependent |
scripts/apply/learn_capture.py |
* EVALUATE changes no audited document. Pass --history only when the user
explicitly wants .doc-steward/history.jsonl updated.
DEFINE
Classify the target:
python3 scripts/checks/tier_assess.py <repo-root> --json
Precedence is --tier > explicit --config > auto-detection. Unknown offline
signals round down. An explicit --config may also set exclude_paths to
take target-relative subtrees out of audit scope — frozen archives and
vendored doc trees, where every finding is unfixable because the material is
not editable. Report what was excluded; a narrowed scope that goes unstated
reads as a clean audit.
Read references/standard-core.md for the three rulers, tier, profile, and
taxonomy. Use references/rule-catalog.md to distinguish spec-required rules
from house opinion.
Open references/templates.md only when the user requests required-document
checklists or skeletons.
DEFINE is complete when the requested standard, classification, and rule status
have been presented with no mutation. Stop unless the user also requested an
audit.
EVALUATE
Run the deterministic audit for the exact target:
python3 scripts/checks/doc_lint.py --target <repo-root> --json
Use --tier, --config, --fail-on, or --history only when the request
calls for them. Explicit YAML config needs PyYAML from requirements.txt;
no-config evaluation remains stdlib-only.
Run deep inspectors only when explicitly requested. Dispatch the applicable
read-only checklists in parallel when the harness supports it, otherwise apply
the same checklists sequentially:
agents/inspector-structure.md — residency, structure, duplication, no-ops.
agents/inspector-taxonomy.md — altitude and cross-tool wiring.
agents/inspector-staleness.md — volatility and implementation drift.
agents/inspector-design.md — DESIGN rules when the frontend profile fires.
Render the deterministic result as a fenced DOC-STEWARD REPORT. Follow
references/rubric.md for verdicts and finding format. Put deep-inspector
findings in a separate, unscored judgment appendix; never alter the
deterministic composite with them.
EVALUATE is complete only when:
- the report was freshly generated for the exact canonical target;
- every unavailable or failed checker appears under
skipped;
- every deterministic finding includes its catalog severity and remedy;
- every judgment finding cites
file:line and passes the quote-gate;
- the final output states target, tier/profile, dimensions, grade, findings,
skipped checks, whether history was enabled, and — when
exclude_paths was
configured — the excluded subtrees and the fact that they narrow the document
corpus only; and
- no audited document changed.
ENFORCE
Open references/apply-workflow.md and follow it completely. The essential
sequence is:
- Save a fresh default EVALUATE report outside the target worktree.
- Confirm the target is on an existing non-default feature branch with a fully
clean worktree. The script does not create or switch branches.
- Preview the exact dispositions without
--apply. Use --scaffold and
--link-map only for exact user-requested paths or mappings.
- Show the previewed write set and obtain explicit approval.
- Repeat the same command with
--apply.
- Inspect the complete diff and run target validation plus
git diff --check.
The classifier and LOW-RISK-AUTO allowlist live in
references/do-dont-table.md. ENFORCE never blind-deletes or overwrites a
present scaffold target. The script never stages, commits, pushes, or opens a
pull request; perform those repository actions only under separate user
authorization.
ENFORCE is complete only when every finding has a disposition, preflight and
verification succeeded, and the exact changed paths and remaining escalations
have been reported. If rollback verification fails, stop and report the target
for manual inspection.
LEARN
Open references/learning-sink.md and capture exactly one selected finding.
Learning is never implied by EVALUATE or ENFORCE. Keep the noop sink unless the
user explicitly supplies a trusted, reviewed adapter; capturing a lesson never
changes repository documentation.
LEARN is complete when the sink returns a success or safe rejection receipt and
no unapproved write-back occurred.
Read on demand
| Need |
Open |
| Three rulers, taxonomy, tiers, and profiles |
references/standard-core.md |
| Canonical rule ids and ownership |
references/rule-catalog.md |
| Score anchors, severity, quote-gate, and finding format |
references/rubric.md |
| Required-document skeletons |
references/templates.md |
| Preview, approval, apply, verification, and rollback |
references/apply-workflow.md |
| ENFORCE dispositions and auto-fix allowlist |
references/do-dont-table.md |
| LEARN redaction and sink contract |
references/learning-sink.md |
Invariants
- Read-only by default; writes require explicit mode and intent.
scripts/lib/rules.py is the rule catalog's single source of truth; regenerate
references/rule-catalog.md with scripts/gen_rule_catalog.py.
- Quote every judgment finding at
file:line; hypotheses are not findings.
- This package must pass its own deterministic audit, resolve every pointer, and
keep this entrypoint within the dogfood line budget.
1---2name: doc-steward3description: Audit agent docs. Use when checking structure, drift, or routing, explicitly previewing or applying fixes after an audit, or capturing a lesson. Not for prose copy-editing.4---56# doc-steward78Keep agent-facing repository documentation predictable: put each fact at the9right residency, altitude, and volatility level; evaluate it deterministically10where possible; and gate every write.1112Run commands from this skill directory. Every `scripts/`, `references/`, and13`agents/` path below is relative to this file.1415## Route the request1617Choose exactly one starting mode. Never cross from a read-only mode into a write18mode without explicit user intent.1920| Mode | Trigger | Writes? | Surface |21|---|---|---:|---|22| **DEFINE** | The user asks to explain or classify against the standard. | No | This skill + references |23| **EVALUATE** | Default for audits, grading, drift, frontmatter, or routing checks. | No* | `scripts/checks/doc_lint.py` |24| **ENFORCE** | The user explicitly asks to preview or apply fixes after an audit. | Yes, only with `--apply` | `scripts/apply/enforce_apply.py` |25| **LEARN** | The user explicitly asks to retain one documentation lesson. | Sink-dependent | `scripts/apply/learn_capture.py` |2627\* EVALUATE changes no audited document. Pass `--history` only when the user28explicitly wants `.doc-steward/history.jsonl` updated.2930## DEFINE31321. Classify the target:3334 ```bash35 python3 scripts/checks/tier_assess.py <repo-root> --json36 ```3738 Precedence is `--tier` > explicit `--config` > auto-detection. Unknown offline39 signals round down. An explicit `--config` may also set `exclude_paths` to40 take target-relative subtrees out of audit scope — frozen archives and41 vendored doc trees, where every finding is unfixable because the material is42 not editable. Report what was excluded; a narrowed scope that goes unstated43 reads as a clean audit.442. Read `references/standard-core.md` for the three rulers, tier, profile, and45 taxonomy. Use `references/rule-catalog.md` to distinguish spec-required rules46 from house opinion.473. Open `references/templates.md` only when the user requests required-document48 checklists or skeletons.4950DEFINE is complete when the requested standard, classification, and rule status51have been presented with no mutation. Stop unless the user also requested an52audit.5354## EVALUATE55561. Run the deterministic audit for the exact target:5758 ```bash59 python3 scripts/checks/doc_lint.py --target <repo-root> --json60 ```6162 Use `--tier`, `--config`, `--fail-on`, or `--history` only when the request63 calls for them. Explicit YAML config needs PyYAML from `requirements.txt`;64 no-config evaluation remains stdlib-only.652. Run deep inspectors only when explicitly requested. Dispatch the applicable66 read-only checklists in parallel when the harness supports it, otherwise apply67 the same checklists sequentially:68 - `agents/inspector-structure.md` — residency, structure, duplication, no-ops.69 - `agents/inspector-taxonomy.md` — altitude and cross-tool wiring.70 - `agents/inspector-staleness.md` — volatility and implementation drift.71 - `agents/inspector-design.md` — DESIGN rules when the frontend profile fires.723. Render the deterministic result as a fenced `DOC-STEWARD REPORT`. Follow73 `references/rubric.md` for verdicts and finding format. Put deep-inspector74 findings in a separate, unscored judgment appendix; never alter the75 deterministic composite with them.7677EVALUATE is complete only when:7879- the report was freshly generated for the exact canonical target;80- every unavailable or failed checker appears under `skipped`;81- every deterministic finding includes its catalog severity and remedy;82- every judgment finding cites `file:line` and passes the quote-gate;83- the final output states target, tier/profile, dimensions, grade, findings,84 skipped checks, whether history was enabled, and — when `exclude_paths` was85 configured — the excluded subtrees and the fact that they narrow the document86 corpus only; and87- no audited document changed.8889## ENFORCE9091Open `references/apply-workflow.md` and follow it completely. The essential92sequence is:93941. Save a fresh default EVALUATE report outside the target worktree.952. Confirm the target is on an existing non-default feature branch with a fully96 clean worktree. The script does not create or switch branches.973. Preview the exact dispositions without `--apply`. Use `--scaffold` and98 `--link-map` only for exact user-requested paths or mappings.994. Show the previewed write set and obtain explicit approval.1005. Repeat the same command with `--apply`.1016. Inspect the complete diff and run target validation plus `git diff --check`.102103The classifier and LOW-RISK-AUTO allowlist live in104`references/do-dont-table.md`. ENFORCE never blind-deletes or overwrites a105present scaffold target. The script never stages, commits, pushes, or opens a106pull request; perform those repository actions only under separate user107authorization.108109ENFORCE is complete only when every finding has a disposition, preflight and110verification succeeded, and the exact changed paths and remaining escalations111have been reported. If rollback verification fails, stop and report the target112for manual inspection.113114## LEARN115116Open `references/learning-sink.md` and capture exactly one selected finding.117Learning is never implied by EVALUATE or ENFORCE. Keep the `noop` sink unless the118user explicitly supplies a trusted, reviewed adapter; capturing a lesson never119changes repository documentation.120121LEARN is complete when the sink returns a success or safe rejection receipt and122no unapproved write-back occurred.123124## Read on demand125126| Need | Open |127|---|---|128| Three rulers, taxonomy, tiers, and profiles | `references/standard-core.md` |129| Canonical rule ids and ownership | `references/rule-catalog.md` |130| Score anchors, severity, quote-gate, and finding format | `references/rubric.md` |131| Required-document skeletons | `references/templates.md` |132| Preview, approval, apply, verification, and rollback | `references/apply-workflow.md` |133| ENFORCE dispositions and auto-fix allowlist | `references/do-dont-table.md` |134| LEARN redaction and sink contract | `references/learning-sink.md` |135136## Invariants137138- Read-only by default; writes require explicit mode and intent.139- `scripts/lib/rules.py` is the rule catalog's single source of truth; regenerate140 `references/rule-catalog.md` with `scripts/gen_rule_catalog.py`.141- Quote every judgment finding at `file:line`; hypotheses are not findings.142- This package must pass its own deterministic audit, resolve every pointer, and143 keep this entrypoint within the dogfood line budget.