Skip to content
SprecherEast
Issue 717

process: Code-writing skills, hooks and the review keep the knowledge layer in sync

Back to our plan
Done
processtoolingpriority: high

Type

process

Summary

Teach every step of the work to keep the knowledge layer in sync: the skill for writing code reads the note first and updates it after, the self-review asks about it, the independent review always looks for behavior changes and blocks when the note doesn't match, and a hook reminds the agent while it is still working. The CI check from the sync-gate sub-issue stays the real gate.

Problem

A check at the end catches a missing update late, after the work is done. Summary of the owner's direction (2026-11-06, Claude session, text, recorded on the epic): the code-writing skills, the hooks and the review must all know that documentation follows behavior, in particular when a content type's behavior, its properties or its events change; and the review always checks for behavior changes.

Proposed fix

  1. AGENTS.md. In "Where knowledge lives": what the knowledge layer is, where the index, the notes and the generated reference are, and the one rule (behavior changes and its note change in the same pull request). In step 2: the pull request states whether behavior changed.
  2. write-code skill. Before coding: read the index line and the note of the module you are about to change, and the generated page of any content type you touch, not the whole module. After coding: if behavior changed, update the note in the same pull request; if a content type, a route or a shared component changed, run npm run docs:generate.
  3. change-workflow skill. Step 3 runs npm run docs:check with the other local checks. Step 4 fills in the Knowledge section.
  4. self-review skill. A sixth item, Knowledge: list what a visitor, an editor or an agent would now see differently, and check the note says so.
  5. pr-review skill. A step that runs on every review: list every behavior change in the diff; find, for each, the sentence in the note or the generated page that now describes it. A change with no matching sentence is a Blocker. A Behavior change: none line that the diff contradicts is a Blocker.
  6. Guard rails. One more rule (documentation changes with behavior) and its row in "What enforces them".
  7. Claude Code hook (adapter only): after an edit to a file under a mapped path, if that module's note is unchanged compared with main, print one reminder per module per session. It never blocks; CI does. Codex has no hook and relies on AGENTS.md, the skills and CI.

Nothing here lives only in .claude/: the rule is in AGENTS.md and the skills, as the tool-adapters rule requires.

Acceptance criteria

  • Not done: Each of the seven changes above is made, and every changed file stays under 250 lines.
  • Not done: A reviewer following pr-review on a test pull request that changes behavior without changing the note reports a Blocker. The transcript or the review comment is linked from this issue.
  • Not done: The hook's logic has tests in .claude/hooks/rules.test.mjs, and editing a mapped file in a test session prints the reminder once.
  • Not done: No rule, procedure or fact was added only to .claude/.
  • Not done: The review of this PR lists it as a policy change the owner asked for, with the dated summary.

Files likely touched

AGENTS.md, .agents/skills/write-code/SKILL.md, .agents/skills/change-workflow/SKILL.md, .agents/skills/self-review/SKILL.md, .agents/skills/pr-review/SKILL.md, docs/guidelines/guard-rails.md, .claude/hooks/ (script, rules and tests), .claude/settings.json.

Must not touch

src/, .github/ (done in the sync-gate sub-issue), docs/process/.

Open questions

None for the owner.

Area

tooling

Priority

high


Generated by Claude Code, opens in a new tab

See it on GitHub, opens in a new tab