Process: session wrap-up protocol — doc-update, then clean-context review subagents

This commit is contained in:
2026-06-12 21:48:29 +03:00
parent d1ba921141
commit 5fe5aed50f
4 changed files with 48 additions and 0 deletions
+30
View File
@@ -43,3 +43,33 @@ See @AGENTS.md for project overview, architecture rules, and the AI developer pr
- No git actions unless explicitly invited.
- Run `npm run typecheck` and `npm test` after changes.
- Single-line commit subjects; no Co-Authored-By trailers.
## Session wrap-up protocol
When the user signals the session is wrapping (asks to commit, says it's done/wrapped),
run the review pass **before** anything is committed:
1. **Flush knowledge first — `/doc-update`, in-session.** Capture what this session
decided or discovered: rationale for non-obvious choices (to `docs/` or a code
comment at the site, whichever is the right home), spec/architecture gaps, decisions
made in conversation that never landed in writing. This step cannot be delegated —
only the session knows what was decided — and it runs first so the clean-context
reviewers below judge against recorded rationale instead of flagging deliberate
choices as oversights.
2. **Alignment — clean-context subagent.** Spawn an agent with no session context
beyond this prompt: "Read `.claude/skills/alignment/SKILL.md` and execute it against
the current uncommitted/staged diff. Fix directly per the skill, run typecheck and
tests, and return the skill's summary as your final message." The clean slate is the
point — the reviewer simulates the future maintainer and must not inherit the
session's rationalizations.
3. **Eng-council review — clean-context subagent, conditional.** Only when the session's
diff is structural (a new module or kind-instance, a refactor, a new dependency):
spawn an agent the same way to execute `.claude/skills/eng-council/SKILL.md` in the
matching review mode (refactor review / new-functionality review — never the sweep;
sweeps stay a deliberate act).
Run the subagents **sequentially**, not in parallel — both may edit the working tree.
Relay each report back to the user. Arbitrate findings that needed session context:
either accept them, or overrule them **and** record the missing rationale where the
reviewer looked for it — an overruled finding without a writing-down will recur. Then
commit only when invited.