Scaffold the per-repository conventions the maintenance flow assumes:
- Agent Note tree — the
.agents/notes/{proposed,implemented,rejected,archived}/{class}/layout and the note format. - Bilingual pairing — the
foo.md+foo.zh.md+foo.i18n.yamltriplet convention and both switcher lines. - Documentation standard — the
docs/AGENTS.mdstructure, tier, budget, and slop rules thatdoc-standardsapplies. - Session discipline — the four standing-order lines that gate execution, verification, and destructive actions.
- Documentation budget gate — the self-contained
verify-doc-budgetsscript plus its manifest that enforce the standard's ceilings. - Change-scope tool — the
change-scopescript that reports a change's committed and worktree scope;pre-push-checksreads it. - Git hooks — the
lefthook.ymljobs that verify translation pairing, archived notes, and whitespace before commit. - Where they live — a line in the repository's root
AGENTS.mdpointing at the four doc locations; the tools land inscripts/andlefthook.yml, which need no pointer.
This is a prompt-driven skill, not a deterministic script. Explore, present what you found, confirm with the user, then write.
Process
1. Explore
Read what exists; do not assume:
AGENTS.mdat the repository root — is there already a documentation/decisions section?.agents/notes/— does the note tree already exist?docs/i18n/— does a bilingual pairing convention already exist?docs/AGENTS.md— does a documentation standard already exist?- The root
AGENTS.md— does a session-discipline block already exist? scripts/— does a documentation budget gate already exist?scripts/change-scope.mjs— does a change-scope helper already exist?lefthook.yml— do git hooks already exist?
2. Scaffold what is missing
- Agent Note tree: if
.agents/notes/is absent, create the lifecycle and class directories and a shortREADME.mdstating the note format —# Agent Note: <title>/Status: <status>, a first## Problemsection, then## Decision/## Alternatives considered/## Consequences. - Bilingual pairing: if no pairing convention exists, record the triplet rule and both switcher lines in a short
docs/i18n/README.md. - Documentation standard: if absent, create a short
docs/AGENTS.mdstating the tutorial/reference forms, the one-home-per-fact taxonomy, word budgets, and the slop checklist;doc-standardsowns the workflow that applies it. - Session discipline: append the four standing-order lines to the root
AGENTS.md:
Act only on an explicit execution signal and confirmed scope; otherwise ask one clarifying question.
A red check blocks the commit: fix it or explain it in the same turn, and name every failed check in the final report.
Inspect a file before editing or describing it; never present content as read or work as done that you have not verified.
Destructive or irreversible actions (deletions, history rewrites, force-push) require an explicit, named confirmation.
- Documentation budget gate: copy this skill's
scripts/verify-doc-budgets.mjsinto the host'sscripts/andscripts/doc-budgets.manifest.template.jsontoscripts/doc-budgets.manifest.json; then adjust the ceilings to the host's always-loaded docs. The gate runs asnode scripts/verify-doc-budgets.mjs, and--listprints the table. - Change-scope tool: copy this skill's
scripts/change-scope.mjsinto the host'sscripts/;pre-push-checksrunsnode scripts/change-scope.mjs --base <ref>(optionally with--head <ref>) to report the committed and worktree scope of a change. - Git hooks: copy this skill's
scripts/lefthook.template.ymlto the host'slefthook.ymlandscripts/install-lefthook.mjsbeside it; it verifies translation pairing on staged consistency records, verifies archived notes, and checks staged whitespace. The pairing and archive jobs need the host's pairing and archive gates copied into itsscripts/first; the whitespace job runs everywhere. Activate withnpm run install-lefthook. - Record the pointers: add a line to the root
AGENTS.mdpointing at the note rules, the pairing contract, the documentation standard, and the session discipline.
3. Confirm before writing
Present each scaffolded piece and its destination; write only after the user confirms.
4. Hand off
Once scaffolded, the governance run (ask ask-demon to govern the docs) audits and enforces the standard going forward.