@sabaiway/agent-workflow-kit 20.2.0 → 22.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/CHANGELOG.md +85 -0
  2. package/README.md +7 -5
  3. package/SKILL.md +1 -1
  4. package/bin/install.mjs +10 -11
  5. package/capability.json +1 -1
  6. package/launchers/windsurf-workflow.md +3 -1
  7. package/migrations/3.0.0-hardened-core-loop.md +7 -6
  8. package/package.json +5 -2
  9. package/references/advisor-writers.md +1 -1
  10. package/references/contracts.md +11 -10
  11. package/references/modes/bootstrap.md +3 -3
  12. package/references/modes/commit-guard.md +1 -1
  13. package/references/modes/gates.md +2 -2
  14. package/references/modes/recommendations.md +3 -3
  15. package/references/modes/upgrade.md +6 -6
  16. package/references/scripts/{archive-caps.mjs → archives/archive-caps.mjs} +1 -1
  17. package/references/scripts/{archive-changelog.mjs → archives/archive-changelog.mjs} +7 -9
  18. package/references/scripts/{archive-decisions.mjs → archives/archive-decisions.mjs} +13 -10
  19. package/references/scripts/{archive-issues.mjs → archives/archive-issues.mjs} +7 -8
  20. package/references/scripts/{check-docs-size.mjs → docs-size/check-docs-size.mjs} +3 -4
  21. package/references/scripts/docs-size/index.mjs +2 -0
  22. package/references/scripts/family.json +45 -0
  23. package/references/scripts/family.mjs +90 -0
  24. package/references/scripts/gates/kit-command-gates.mjs +117 -0
  25. package/references/scripts/{migrate-gates.mjs → gates/migrate-gates.mjs} +263 -182
  26. package/references/scripts/{install-git-hooks.mjs → git-hooks/install-git-hooks.mjs} +50 -38
  27. package/references/scripts/run.mjs +90 -0
  28. package/references/scripts/shared/index.mjs +3 -0
  29. package/references/scripts/shared/project-root.mjs +11 -0
  30. package/references/scripts/spec-schema/index.mjs +2 -0
  31. package/references/scripts/test-reporter/reporter.mjs +130 -0
  32. package/references/shared/composition-handoff.md +1 -1
  33. package/references/shared/deploy-tail.md +2 -2
  34. package/references/templates/SPEC_TEMPLATE.md +1 -1
  35. package/references/templates/adr-record.md +3 -3
  36. package/tools/apply-danger-check.mjs +9 -5
  37. package/tools/atomic-write.mjs +3 -1
  38. package/tools/coverage-producer.mjs +76 -41
  39. package/tools/direct-run.mjs +2 -0
  40. package/tools/distribution-files/retired.mjs +99 -0
  41. package/tools/distribution-files/scripts.mjs +68 -52
  42. package/tools/ensure-configs.mjs +21 -21
  43. package/tools/ensure-ops.mjs +60 -18
  44. package/tools/ensure-specs.mjs +85 -47
  45. package/tools/ensure-vocabulary.mjs +4 -4
  46. package/tools/epic-shape-cli.mjs +1 -1
  47. package/tools/epic-shape-ledger.mjs +1 -1
  48. package/tools/epic-shape.mjs +1 -1
  49. package/tools/family-registry.mjs +3 -1
  50. package/tools/feedback-record-cli.mjs +1 -1
  51. package/tools/fold-scope.mjs +2 -2
  52. package/tools/gates-declaration.mjs +22 -14
  53. package/tools/gates-init.mjs +33 -17
  54. package/tools/git-hooks.mjs +90 -65
  55. package/tools/jev-connect.mjs +1 -1
  56. package/tools/jev-guide.mjs +1 -1
  57. package/tools/jev-skill.mjs +1 -1
  58. package/tools/known-footprint.mjs +7 -29
  59. package/tools/node-evidence.mjs +29 -15
  60. package/tools/now-cli.mjs +1 -1
  61. package/tools/payload-prune.mjs +53 -58
  62. package/tools/plan-shape-cli.mjs +1 -1
  63. package/tools/plan-shape.mjs +1 -1
  64. package/tools/project-rules/rules-record.mjs +1 -1
  65. package/tools/queue-audit-cli.mjs +1 -1
  66. package/tools/queue-audit.mjs +2 -2
  67. package/tools/queue-purge-archive.mjs +1 -1
  68. package/tools/queue-purge-cli.mjs +1 -1
  69. package/tools/queue-purge.mjs +1 -1
  70. package/tools/recommendations.mjs +37 -25
  71. package/tools/script-priors.mjs +31 -3
  72. package/tools/source-size/piles.mjs +1 -1
  73. package/tools/spec-adoption.mjs +1 -1
  74. package/tools/spec-check-ops.mjs +2 -2
  75. package/tools/spec-check.mjs +2 -2
  76. package/tools/spec-coverage.mjs +1 -1
  77. package/tools/tier-guide.mjs +1 -1
  78. package/tools/transition/index.mjs +1 -1
  79. package/tools/upgrade-runlist.mjs +3 -3
  80. package/tools/write-lanes.mjs +2 -2
  81. package/references/scripts/_expect-shim.mjs +0 -41
  82. package/references/scripts/archive-caps.test.mjs +0 -321
  83. package/references/scripts/archive-changelog.test.mjs +0 -560
  84. package/references/scripts/archive-conservation.test.mjs +0 -466
  85. package/references/scripts/archive-decisions.test.mjs +0 -1503
  86. package/references/scripts/archive-issues.test.mjs +0 -825
  87. package/references/scripts/archiver-structure.test.mjs +0 -84
  88. package/references/scripts/check-docs-size-cli.test.mjs +0 -325
  89. package/references/scripts/check-docs-size-ensure.test.mjs +0 -360
  90. package/references/scripts/check-docs-size.test.mjs +0 -395
  91. package/references/scripts/install-git-hooks-repo-exec.test.mjs +0 -185
  92. package/references/scripts/install-git-hooks.test.mjs +0 -241
  93. package/references/scripts/markdown-blocks.test.mjs +0 -310
  94. package/references/scripts/migrate-gates-branches.test.mjs +0 -302
  95. package/references/scripts/migrate-gates.test.mjs +0 -517
  96. package/references/scripts/spec-schema.test.mjs +0 -352
  97. /package/references/scripts/{markdown-blocks.mjs → shared/markdown-blocks.mjs} +0 -0
  98. /package/references/scripts/{spec-schema.mjs → spec-schema/spec-schema.mjs} +0 -0
package/CHANGELOG.md CHANGED
@@ -4,6 +4,91 @@ Semantically versioned ([semver](https://semver.org)), newest first. The `versio
4
4
  is the current release. `upgrade` mode reads a project's `docs/ai/.workflow-version` and applies
5
5
  every `migrations/<version>-<slug>.md` newer than it, in semver order.
6
6
 
7
+ ## 22.0.0 — a red unit-test gate prints only its failures, through one gate form the upgrade moves you to (AD-221)
8
+
9
+ **A failing unit-test gate now prints a few lines per failing test instead of the whole test log.** The kit's
10
+ unit-test gate runs through the stable command, `node scripts/agent-workflow/run.mjs unit-tests <your test paths>`,
11
+ and its new test reporter prints, for each failing test only, the file and line, the test's names, why it failed,
12
+ the expected and actual values and the code line, then one totals line. Your next `/agent-workflow-kit upgrade` moves
13
+ a gate an earlier kit wrote with no question; the one thing that step asks is whether to add the coverage check.
14
+
15
+ - **The kit test reporter.** `scripts/agent-workflow/test-reporter/reporter.mjs` reads only the Node test runner's
16
+ events: a passing test, a suite heading and the coverage table print nothing; a file that failed to load prints its
17
+ error line; on a red run, each diagnostic prints one line, so a red run never reads green; a part it cannot render
18
+ prints one line and the run goes on. It never throws, and the gate's exit code stays the runner's. The upgrade's
19
+ `configs` step places it with `run.mjs` on every deployment with Node evidence, even after a no to the enforcement
20
+ scripts.
21
+ - **One gate form.** The command's sixth name, `unit-tests`, runs `node --test` with the lcov reporter under
22
+ `AW_GIT_DIR` and the kit reporter on stdout, every argument handed to the runner; it refuses an unset or empty
23
+ `AW_GIT_DIR` by name. It is the one form that reads as a coverage producer, bare or behind the verified per-PM
24
+ `exec` wrapper; `lcovProducer: true` is still the other way.
25
+ - **The move, with no question.** The upgrade's `gates-migration` step now runs the migration with `--apply`: it
26
+ switches every gate an earlier kit wrote (`node --test` with its reporter flags, under any id, marked or not) to the
27
+ command with the same test paths, and extends the unmarked `unit-tests` gate written as `node --test <paths>`, the
28
+ kit's or your own, to it; every gate it moves or removes prints with its `was:`, and a second run writes nothing. A gate whose
29
+ tail carries a flag is reported CUSTOMIZED with the command's line as its recovery; a gate the kit never wrote is
30
+ never touched. The extended gate writes an lcov, so a coverage checker you declared over no producer reads it: a
31
+ plain run that read green can read red after the move.
32
+ - **The coverage check stays optional.** Where a gate produces the lcov and no checker is declared, the step adds
33
+ nothing and prints one `OFFER coverage-check` line with its own `--apply --add-checker` command, which the agent runs
34
+ only on your explicit yes; the offer comes back on each upgrade until then. A row of yours already holding the id
35
+ `coverage-check` withholds only that add, with one line, and stops no move.
36
+ - **A retired check leaves only when its file is gone.** A `review-ledger` or `fold-completeness` gate is removed only
37
+ when its target is proven absent; a target that is a file, a directory or a link, or a `~` or `$` token, keeps the
38
+ gate CUSTOMIZED.
39
+ - **One guard on every write.** The fill and the migration write the form only while
40
+ `scripts/agent-workflow/run.mjs` is byte-equal to the running kit's and the reporter is a regular file; otherwise the
41
+ fill withholds its `node --test` script and the migration keeps the gate, each with one line naming the path and the
42
+ upgrade (a directory or a link there is cleared by hand first).
43
+ - **A kept earlier gate is named, not silent.** It still runs, with the full runner log, but no longer reads as a
44
+ producer. Every coverage-checker line, in the migration, the fill, the `no-producer` defect and the advisor's
45
+ `gates-inert` item, states one fact (`no gate before it is a producer this kit reads`; the lines that withhold the
46
+ checker: `no declared gate is a producer this kit reads`) and one remedy; why a gate was
47
+ kept rides that gate's own line, and the line of a gate the guard keeps ends that once its cause is resolved, the
48
+ upgrade moves it with no question.
49
+ Where an earlier kit's gate the upgrade can move stands, the defect and the advisor name `/agent-workflow-kit upgrade`.
50
+ - **Breaking, for tools reading the kit's exports.** `coverage-producer.mjs` drops `UNIT_TESTS_COVERAGE_FLAGS` and
51
+ `KNOWN_COVERAGE_FLAG_SETS`; `COVERAGE_PRODUCER_BODY` is now the command body.
52
+
53
+ ## 21.0.0 — the kit's scripts live in one folder, `scripts/agent-workflow/`, run through one stable command (AD-220)
54
+
55
+ **Your project's `scripts/` stops being a pile of kit files.** Every kit script now lives in one folder the kit alone
56
+ writes, `scripts/agent-workflow/`, and your hook, gates and docs name one command that will not move again:
57
+ `node scripts/agent-workflow/run.mjs <name>`. One plain `/agent-workflow-kit upgrade` with your chat yes moves a
58
+ project that holds the 25 flat kit files.
59
+
60
+ - **The kit folder.** It holds runtime files only, laid out by meaning: `run.mjs`, `docs-size/`, `spec-schema/`,
61
+ `archives/` and `git-hooks/`, plus `shared/`. No kit test suite is deployed, and no published package carries one;
62
+ your commit hook no longer runs the kit's tests. Your size check already leaves the folder alone (20.1.0).
63
+ - **The stable command.** `node scripts/agent-workflow/run.mjs <name> [arguments...]` runs `docs-size`,
64
+ `archive-changelog`, `archive-issues`, `archive-decisions` or `install-git-hooks` with every argument unchanged; any
65
+ other name exits 2 with the list of known names. The names are a public contract every later release answers.
66
+ - **The move, in one upgrade run.** The `configs` step places the kit folder and, once
67
+ `scripts/agent-workflow/run.mjs` stands, removes each flat kit file whose replacement stands or that has none, printing `scripts/<name>: removed — the kit's scripts live in
68
+ scripts/agent-workflow/`; a file whose bytes are not the kit's, a link, a directory or an unreadable file is named
69
+ and left; a file whose replacement is not placed yet is kept and waits for the next run.
70
+ - **Your consumers switch in the same upgrade.** The `gates-migration` step switches each flat gate to the command on
71
+ your yes; the `hook-checks` item rewrites a managed commit hook to the command (an unmanaged hook stays yours); the
72
+ agent edits the documented `package.json` scripts. After the removal the upgrade names each `scripts/*.test.mjs` of
73
+ your own with the line that keeps it on every commit (`scripts/pre-commit.local`), prints one `git grep` line that
74
+ finds every other file naming an old path, and, in a visible deployment, one line to commit the change together and
75
+ merge it into every branch you still commit on.
76
+ - **After a no.** On a project with a `package.json`, an upgrade places the caps and index check and the ADR rotator
77
+ even after a no to the enforcement offer; the changelog and issue rotators and the hook still wait for a yes. The kit's
78
+ texts and the ADR rotator's own printed lines run a script of the kit folder only through the command.
79
+ - **Stated limits, each with its fix.** A no on the hook item stops every commit at Node's error naming a removed file
80
+ until you apply the item or run `node scripts/agent-workflow/run.mjs install-git-hooks`. A no on the gates apply
81
+ leaves those gates failing until you apply it. A checkout that does not carry the move yet (a branch forked earlier)
82
+ commits with the kit's checks skipped, under one line naming the fix, and its old installer refuses the new hook,
83
+ until you merge the move into it. In a project named `agent-workflow` the new hook carries the old installer's
84
+ marker, so that installer rewrites the hook to the old paths instead, and every commit in a moved checkout stops at
85
+ Node's error naming a removed file until `node scripts/agent-workflow/run.mjs install-git-hooks`, run in a moved
86
+ checkout, writes it back.
87
+
88
+ MAJOR: every deployed kit script changes path, the upgrade removes the flat files, and the package no longer carries
89
+ the suites. Contracts: script-family revision 7, kit-command revision 6, distribution-files revision 23, init-project
90
+ revision 30.
91
+
7
92
  ## 20.2.0 — the project rules check is offered as a gate of every project (AD-219)
8
93
 
9
94
  **Your project's rules can now stop a red gate run, not only a commit.** The check that each rules theme's effective
package/README.md CHANGED
@@ -117,12 +117,14 @@ your-repo/
117
117
  ├── tech_reference.md ← configs & patterns
118
118
  ├── pages/ ← one spec per page/route
119
119
  └── history/ ← changelog archive (HOT→WARM→COLD)
120
- + scripts/ ← caps · index · archive (installed on a yes)
120
+ + scripts/agent-workflow/ ← caps · index · archive (the kit folder)
121
121
  + pre-commit hook ← keeps it all honest (installed on a yes)
122
122
  ```
123
123
 
124
- The Markdown memory is **stack-agnostic**; the `scripts/` + pre-commit hook are the **Node path**
125
- (dependency-free, `node --test`). They are offered on every project because the agent host runs them; a committer without Node on PATH gets a loud hook failure.
124
+ The Markdown memory is **stack-agnostic**; the kit folder `scripts/agent-workflow/` + pre-commit hook are the
125
+ **Node path** (dependency-free). They are offered on every project because the agent host runs them; a committer without Node on PATH gets a loud hook failure.
126
+ On a project with a `package.json`, an upgrade places the caps and index check and the ADR rotator even after a no;
127
+ the changelog and issue rotators and the hook still wait for a yes.
126
128
 
127
129
  Two **visibility** modes, chosen at deploy time: **visible** (committed with the repo) or **hidden**
128
130
  (same files in-tree but git-ignored via the project-local `.git/info/exclude`, so the repo "looks
@@ -288,7 +290,7 @@ block aside, which is written current on every run).
288
290
  - **Plan lifecycle** — a capped plan (goal and boundary, module ledger, verification), ephemeral plan files, and a mandatory Cleanup phase.
289
291
  - **No silent failures** — every guard that rejects an action logs structured context.
290
292
 
291
- The dependency-free **Node** enforcement scripts (`node --test`, no package manager assumed) and their hook are offered on every project because the agent host runs them; a committer without Node on PATH gets a loud hook failure.
293
+ The dependency-free **Node** enforcement scripts (no package manager assumed) and their hook are offered on every project because the agent host runs them; a committer without Node on PATH gets a loud hook failure.
292
294
 
293
295
  ---
294
296
 
@@ -363,7 +365,7 @@ agent-workflow-kit/
363
365
  │ ├── modes/ ← one file per mode (deploy/upgrade/… procedures)
364
366
  │ ├── shared/ ← shared contracts (footer · hand-off · tail)
365
367
  │ ├── templates/ ← AGENTS.md + every docs/ai file
366
- │ ├── scripts/ ← caps / archive / index + tests
368
+ │ ├── scripts/ ← the script family: manifest, stable command, modules
367
369
  │ └── contracts.md ← visibility / language / attribution rules
368
370
  ├── tools/ ← family tooling:
369
371
  │ ├── manifest/ ← capability-manifest schema + validator
package/SKILL.md CHANGED
@@ -3,7 +3,7 @@ name: agent-workflow-kit
3
3
  description: Deploy or upgrade a portable AI-agent memory-and-workflow system in any project. Use when the user wants to bootstrap `docs/ai/` + an entry-point `AGENTS.md` (+ `CLAUDE.md` alias) + cap/archive/index enforcement in a new or existing repo, set up the Memory Map and session protocols, install the docs-rotation pre-commit hook, or run `/agent-workflow-kit` / `/agent-workflow-kit upgrade`. Triggers on phrases like "set up the memory system", "deploy the AI workflow here", "bootstrap docs/ai", "upgrade the workflow". New to the epic, story and task tier? Run `/agent-workflow-kit tier`. A typed decision with a confidence from Jev? Run `/agent-workflow-kit jev`.
4
4
  disable-model-invocation: true
5
5
  metadata:
6
- version: '20.2.0'
6
+ version: '22.0.0'
7
7
  ---
8
8
 
9
9
  # agent-workflow-kit
package/bin/install.mjs CHANGED
@@ -36,8 +36,8 @@ import { dirname, resolve, sep } from 'node:path';
36
36
  import { fileURLToPath } from 'node:url';
37
37
  import { homedir } from 'node:os';
38
38
  import { spawnSync } from 'node:child_process';
39
- import { copyTreeRefresh } from '../tools/fs-safe.mjs';
40
- import { assertInstallableHome, prunePayload } from '../tools/payload-prune.mjs';
39
+ import { assertContainedRealPath, copyTreeRefresh } from '../tools/fs-safe.mjs';
40
+ import { assertInstallableHome, prunePayload, rerunCommand } from '../tools/payload-prune.mjs';
41
41
  // Dependency-free semver, shared with the family registry's bridge freshness probe (one leaf, no
42
42
  // second drifting copy). The null-on-unparseable contract is load-bearing here: legacy installs
43
43
  // predate any version stamp, so an unparseable side means "no gate", never a false ordering.
@@ -129,10 +129,9 @@ const lstatNoFollow = (path) => {
129
129
  }
130
130
  };
131
131
 
132
- // The symlink-traversal guard + the recursive refresh copy now live in tools/fs-safe.mjs (shared,
133
- // dependency-injectable, unit-tested in isolation). install.mjs consumes copyTreeRefresh, which guards
134
- // every dest via assertContainedRealPath internally. The local lstatNoFollow above stays for the
135
- // pre-flight check on the target root itself (a nicer error than letting the copy throw).
132
+ // The symlink-traversal guard + the recursive refresh copy live in tools/fs-safe.mjs (shared, unit-tested
133
+ // in isolation); copyTreeRefresh guards every dest via assertContainedRealPath. The local lstatNoFollow
134
+ // above serves the pre-flight check on the target root and is the prune's no-follow probe.
136
135
 
137
136
  const parseArgs = (argv) => {
138
137
  const dirFlag = argv.indexOf('--dir');
@@ -361,15 +360,15 @@ const main = async () => {
361
360
  process.exit(1);
362
361
  }
363
362
 
364
- assertInstallableHome(target);
363
+ const owner = { name: 'agent-workflow-kit', prefix: '[agent-workflow-kit]', noun: 'kit home',
364
+ rerun: rerunCommand('npx @sabaiway/agent-workflow-kit@latest init', target, !args.dir && !process.env.AGENT_WORKFLOW_KIT_DIR) };
365
+ assertInstallableHome(target, owner);
365
366
  await mkdir(target, { recursive: true });
366
367
  for (const entry of PAYLOAD.filter((e) => existsSync(resolve(PKG_ROOT, e)))) {
367
368
  copyTreeRefresh(resolve(PKG_ROOT, entry), resolve(target, entry), target);
368
369
  }
369
- const prune = prunePayload({ packageRoot: PKG_ROOT, home: target, payload: PAYLOAD });
370
- for (const line of prune.lines) {
371
- console.log(line);
372
- }
370
+ const prune = prunePayload({ packageRoot: PKG_ROOT, home: target, payload: PAYLOAD, owner }, { assertContainedRealPath, lstatNoFollow });
371
+ prune.lines.forEach((line) => console.log(line));
373
372
  // Verb keyed on the OBSERVED version relation (cmp), never on mere presence: null (fresh install,
374
373
  // or a legacy/unstamped one whose prior version is unknowable) → "installed"; -1 → a real update;
375
374
  // 0 → already current (the copy still ran — see the note below); 1 is reachable only under
package/capability.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "schema": 1,
4
4
  "name": "agent-workflow-kit",
5
5
  "kind": "composition-root",
6
- "version": "20.2.0",
6
+ "version": "22.0.0",
7
7
  "provides": [],
8
8
  "roles": {},
9
9
  "detect": {
@@ -26,7 +26,9 @@ reinvent any of it here; the kit's `SKILL.md` is the single source of truth.
26
26
  attribution) as ONE structured multi-question prompt; record each answer individually,
27
27
  write nothing until ALL are answered** →
28
28
  create `AGENTS.md` (+ `CLAUDE.md` symlink) from `<KIT_DIR>/references/templates/` →
29
- deploy `docs/ai/` → offer the enforcement scripts + pre-commit hook (on a yes: copy `<KIT_DIR>/references/scripts/*.mjs`, install the hook) →
29
+ deploy `docs/ai/` → offer the enforcement scripts + pre-commit hook (on a yes: copy
30
+ `<KIT_DIR>/references/scripts/<path>` of each deployed entry to `scripts/agent-workflow/<path>`, install the hook
31
+ with `node scripts/agent-workflow/run.mjs install-git-hooks`) →
30
32
  wire/hide per visibility → stamp `docs/ai/.workflow-version`.
31
33
  4. Report what was filled with real data vs left as TODO, then **ask before committing** —
32
34
  never auto-commit.
@@ -14,12 +14,13 @@ loudly, never silently.
14
14
  ## Steps
15
15
 
16
16
  1. **Node floor:** ensure Node **>= 22** (the built-in lcov reporter the loop consumes).
17
- 2. **Gates declaration:** preview the consented migration —
18
- `node <installed-kit>/references/scripts/migrate-gates.mjs --kit-tools <installed-kit>/tools --cwd <project>`
19
- — then re-run with `--apply` on an explicit yes. It removes retired ledger/fold gates,
20
- wires the lcov reporters into the canonical `unit-tests` cmd, appends the canonical
21
- `coverage-check` gate LAST, and cleans retired git-dir stores. CUSTOMIZED entries are
22
- reported with a paste-ready recovery — resolve them by hand.
17
+ 2. **Gates declaration:** the upgrade's `gates-migration` step runs the migration with no question —
18
+ `node <installed-kit>/references/scripts/gates/migrate-gates.mjs --kit-tools <installed-kit>/tools --cwd <project> --apply`.
19
+ It removes a retired ledger/fold gate whose target is proven absent, moves the canonical
20
+ `unit-tests` cmd onto the stable kit command, moves a declared `coverage-check` gate LAST, and
21
+ cleans retired git-dir stores; it adds the canonical checker only on the user's yes, through
22
+ its printed `--apply --add-checker` line. CUSTOMIZED entries are reported with a paste-ready
23
+ recovery — resolve them by hand.
23
24
  3. **Review receipts:** receipts minted by pre-3.0.0/4.0.0 bridge wrappers carry no `posture`
24
25
  field and STOP satisfying the review-state gate (fail-closed, the probe-marker precedent).
25
26
  Refresh the placed bridges (init/upgrade does this), then re-run the required reviews.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sabaiway/agent-workflow-kit",
3
- "version": "20.2.0",
3
+ "version": "22.0.0",
4
4
  "description": "Portable, cross-agent memory & workflow for AI coding agents — Claude Code, Codex, Cursor, Devin Desktop. One command deploys an AGENTS.md entry point + docs/ai context with cap/archive/index enforcement into any repo.",
5
5
  "keywords": [
6
6
  "ai-agents",
@@ -54,7 +54,10 @@
54
54
  "!bin/*.test.mjs",
55
55
  "!tools/**/*.test.mjs",
56
56
  "!tools/manifest/fixtures/**",
57
- "!tools/project-rules/fixtures/**"
57
+ "!tools/project-rules/fixtures/**",
58
+ "!references/scripts/**/*.test.mjs",
59
+ "!references/scripts/archives/index.mjs",
60
+ "!references/scripts/test-support/**"
58
61
  ],
59
62
  "engines": {
60
63
  "node": ">=22"
@@ -13,7 +13,7 @@
13
13
  | sandbox-provision.installable | user | user step |
14
14
  | review-recipe | user | user step |
15
15
  | gates-declaration | chat | gates-init.mjs |
16
- | gates-inert | chat | gates-init.mjs |
16
+ | gates-inert | chat | gates-init.mjs, upgrade |
17
17
  | gates-inert.unfillable | user | user step |
18
18
  | gates-inert.no-verification | chat | gates-init.mjs |
19
19
  | gates-inert.producer-unrecognized | user | user step |
@@ -18,10 +18,10 @@ The user chooses at bootstrap whether the AI artifacts are visible in the repo o
18
18
  **explicit up-front question** (bootstrap step 2), never an assumed default. The two modes then
19
19
  diverge:
20
20
 
21
- - **visible** — artifacts are committed. When a `package.json` exists and the enforcement scripts are in place, wire the project's `package.json` scripts (`docs:check` / `docs:index` / `docs:index:check` / `docs:archive` / `docs:archive:check` / `docs:archive:issues` / `docs:archive:issues:check` / `prepare: node scripts/install-git-hooks.mjs`); add a minimal `.gitignore` (`docs/plans/`, `.claude/settings.local.json`) either way. This is the canonical model.
22
- - **hidden** (in-tree) — same files on disk, but the repo "looks normal": the AI/agent footprint is git-ignored via **one managed block in the project-local `.git/info/exclude`** (resolved with `git rev-parse --git-path info/exclude` — never the machine-global `core.excludesFile`, which would affect every repo on the host; **AD-014** amends **AD-006**). The kit's `tools/hide-footprint.mjs` is the single writer: it covers `KIT_OWN_PATHS ∪ the present subset of KNOWN_FOOTPRINT` (the full footprint table below — the kit's own artifacts **and** every other AI/agent tool's files). Per path: a **tracked** file → **ASK** (an exclude does nothing for it; only `git rm --cached` un-tracks it — the tool prints that command and never runs it); an untracked path already covered by a **tracked `.gitignore`** → dropped (redundant); a **present** file whose name is generic enough to be ambiguous (`falsePositiveRisk`) → **ASK**; everything else → **hidden**. `asks` are excluded from the block unless explicitly opted in. **Verify** treats a path as hidden only when it is **untracked AND ignored by our project-local block** (or a tracked `.gitignore`) — being ignored by the global excludes does **not** count. Re-running re-derives the block wholesale (sorted/deduped) → a clean re-run is a **zero-diff** no-op. On an existing global-excludes deployment the tool **detects + reports the residual legacy machine-global block and keeps it** (a harmless double-ignore; the local block wins precedence); removal is the advisor's `footprint-global` item, which the agent applies on the user's yes after its check — its `--remove-global` mode prints the removed lines as a restorable backup — since another of the user's hidden repos on the same host may rely on the same root-anchored global lines. **Do not edit `package.json`** — that is a tracked change and would leak; the pre-commit hook (always untracked in `.git/hooks/`) calls the scripts via `node scripts/<x>.mjs` directly. Windows is supported (text edit, no symlinks; CRLF preserved).
21
+ - **visible** — artifacts are committed. When a `package.json` exists and the enforcement scripts are in place, wire the project's `package.json` scripts (`docs:check: node scripts/agent-workflow/run.mjs docs-size` / `docs:index: node scripts/agent-workflow/run.mjs docs-size --write-index` / `docs:index:check: node scripts/agent-workflow/run.mjs docs-size --check-index` / `docs:archive: node scripts/agent-workflow/run.mjs archive-changelog` / `docs:archive:check: node scripts/agent-workflow/run.mjs archive-changelog --check` / `docs:archive:issues: node scripts/agent-workflow/run.mjs archive-issues` / `docs:archive:issues:check: node scripts/agent-workflow/run.mjs archive-issues --check` / `prepare: node scripts/agent-workflow/run.mjs install-git-hooks`); add a minimal `.gitignore` (`docs/plans/`, `.claude/settings.local.json`) either way. This is the canonical model.
22
+ - **hidden** (in-tree) — same files on disk, but the repo "looks normal": the AI/agent footprint is git-ignored via **one managed block in the project-local `.git/info/exclude`** (resolved with `git rev-parse --git-path info/exclude` — never the machine-global `core.excludesFile`, which would affect every repo on the host; **AD-014** amends **AD-006**). The kit's `tools/hide-footprint.mjs` is the single writer: it covers `KIT_OWN_PATHS ∪ the present subset of KNOWN_FOOTPRINT` (the full footprint table below — the kit's own artifacts **and** every other AI/agent tool's files). Per path: a **tracked** file → **ASK** (an exclude does nothing for it; only `git rm --cached` un-tracks it — the tool prints that command and never runs it); an untracked path already covered by a **tracked `.gitignore`** → dropped (redundant); a **present** file whose name is generic enough to be ambiguous (`falsePositiveRisk`) → **ASK**; everything else → **hidden**. `asks` are excluded from the block unless explicitly opted in. **Verify** treats a path as hidden only when it is **untracked AND ignored by our project-local block** (or a tracked `.gitignore`) — being ignored by the global excludes does **not** count. Re-running re-derives the block wholesale (sorted/deduped) → a clean re-run is a **zero-diff** no-op. On an existing global-excludes deployment the tool **detects + reports the residual legacy machine-global block and keeps it** (a harmless double-ignore; the local block wins precedence); removal is the advisor's `footprint-global` item, which the agent applies on the user's yes after its check — its `--remove-global` mode prints the removed lines as a restorable backup — since another of the user's hidden repos on the same host may rely on the same root-anchored global lines. **Do not edit `package.json`** — that is a tracked change and would leak; the pre-commit hook (always untracked in `.git/hooks/`) calls the scripts through `node scripts/agent-workflow/run.mjs <name>` directly. Windows is supported (text edit, no symlinks; CRLF preserved).
23
23
 
24
- **Visibility changes what git sees — never how the agent works (the load-bearing invariant).** Both modes carry the **same** working memory and run the **same** session protocol: `docs/ai` and the deployed workflow artifacts (`AGENTS.md`, the added `scripts/`) are read at session start and maintained on task completion **identically** whether visible or hidden. (Hidden mode git-ignores a *wider* footprint — other AI/agent tools' files too — but that is only a **visibility** surface; the working memory the agent actually reads and maintains is `docs/ai` plus those artifacts.) Hidden mode only makes the repo *look* normal to git; it is **never** a license to skip, defer, or down-prioritise a doc/state update. The single difference is the destination: in hidden mode those updates live on disk and never enter a commit (the footprint is excluded), so a commit there carries only the project's own tracked files while `docs/ai` is still kept current locally — **git-ignored ≠ optional-to-maintain**. An agent that reads "git-ignored / `git status` clean" and infers the working memory is optional has the model backwards. (This is why bootstrap/upgrade never wire hidden-mode docs into a commit, yet the session protocol still mandates maintaining them.)
24
+ **Visibility changes what git sees — never how the agent works (the load-bearing invariant).** Both modes carry the **same** working memory and run the **same** session protocol: `docs/ai` and the deployed workflow artifacts (`AGENTS.md`, the kit folder `scripts/agent-workflow/`) are read at session start and maintained on task completion **identically** whether visible or hidden. (Hidden mode git-ignores a *wider* footprint — other AI/agent tools' files too — but that is only a **visibility** surface; the working memory the agent actually reads and maintains is `docs/ai` plus those artifacts.) Hidden mode only makes the repo *look* normal to git; it is **never** a license to skip, defer, or down-prioritise a doc/state update. The single difference is the destination: in hidden mode those updates live on disk and never enter a commit (the footprint is excluded), so a commit there carries only the project's own tracked files while `docs/ai` is still kept current locally — **git-ignored ≠ optional-to-maintain**. An agent that reads "git-ignored / `git status` clean" and infers the working memory is optional has the model backwards. (This is why bootstrap/upgrade never wire hidden-mode docs into a commit, yet the session protocol still mandates maintaining them.)
25
25
 
26
26
  **Known AI/agent footprint** (the `KNOWN_FOOTPRINT` registry in `tools/known-footprint.mjs`; this table is its human mirror, kept in sync by review — D11):
27
27
 
@@ -43,9 +43,9 @@ diverge:
43
43
  | `/.aider.input.history` | Aider | file | no | input history |
44
44
  | `/.continue/` | Continue | dir | no | project config dir |
45
45
 
46
- The kit's OWN footprint (`KIT_OWN_PATHS`) — `AGENTS.md`, `CLAUDE.md`, `docs/ai/` (subsumes the stamp), the added `scripts/*.mjs`, `docs/plans/`, `.claude/settings.local.json`, `.claude/settings.json` (hidden-only — visible mode commits it), and `.mcp.json` (the `mcp` mode's registration; hidden-only for the same reason, and it carries an absolute machine path) — is always a candidate in hidden mode.
46
+ The kit's OWN footprint (`KIT_OWN_PATHS`) — `AGENTS.md`, `CLAUDE.md`, `docs/ai/` (subsumes the stamp), the kit folder `scripts/agent-workflow/`, `docs/plans/`, `.claude/settings.local.json`, `.claude/settings.json` (hidden-only — visible mode commits it), and `.mcp.json` (the `mcp` mode's registration; hidden-only for the same reason, and it carries an absolute machine path) — is always a candidate in hidden mode.
47
47
 
48
- `.agent-workflow/` is the family's reserved folder. No kit tool writes there: every kit script, the spec layer's four pair files included, is written over with no copy kept. The copies an earlier release kept there are the user's, outside the kit's own paths: no kit tool overwrites, deletes or hides them, and the folder's own `.gitignore` (`*`) an earlier release wrote keeps git from seeing them in either visibility mode. The kit's literal search never walks into the reserved `.agent-workflow` folder, at any depth, unless that folder or a path inside it is named as a target, and the plan-shape checks never walk into it, so an unnamed copy there never stands beside the live file in their results.
48
+ `.agent-workflow/` is the family's reserved folder. No kit tool writes there: every kit script, the kit folder `scripts/agent-workflow/` whole, is written over with no copy kept. The copies an earlier release kept there are the user's, outside the kit's own paths: no kit tool overwrites, deletes or hides them, and the folder's own `.gitignore` (`*`) an earlier release wrote keeps git from seeing them in either visibility mode. The kit's literal search never walks into the reserved `.agent-workflow` folder, at any depth, unless that folder or a path inside it is named as a target, and the plan-shape checks never walk into it, so an unnamed copy there never stands beside the live file in their results.
49
49
 
50
50
  Not in this version: a fully-external hidden mode (artifacts relocated outside the repo tree).
51
51
  Deferred to a later release + migration.
@@ -94,10 +94,10 @@ On `upgrade`, a pre-1.2.0 deployment with no block gets one (the agent asks, def
94
94
  ## Reserved names and channels
95
95
 
96
96
  Every name the kit bundles and writes over on an upgrade is the kit's, and an edit there is never a
97
- customization: every kit script, the spec layer's four pair files (`scripts/spec-schema.mjs`,
98
- `scripts/spec-schema.test.mjs`, `scripts/check-docs-size.mjs`, `scripts/check-docs-size.test.mjs`)
99
- included, the hook installer set, the kit rules files `docs/ai/rules/<theme>.md` and the kit agent
100
- files (the five the kit bundles for `.claude/agents/` — `changelog-skeleton.md`, `executor.md`,
97
+ customization: every kit script, the kit folder `scripts/agent-workflow/` whole, the spec layer's
98
+ files and the command `scripts/agent-workflow/run.mjs` in it, the hook installer set, the kit rules
99
+ files `docs/ai/rules/<theme>.md` and the kit agent files (the five the kit bundles for
100
+ `.claude/agents/` — `changelog-skeleton.md`, `executor.md`,
101
101
  `gate-triage.md`, `mechanical-sweep.md`, `review-lens.md` — and each configured
102
102
  `review-lens-<model>-<effort>.md`) and, within a hook you wired, the kit hook files
103
103
  `.claude/hooks/agent-workflow-gates.mjs` and `.claude/hooks/state-block-guard.mjs` are written over
@@ -110,7 +110,8 @@ Also the kit's: the onboarding note of `docs/ai/orchestration.json`, its `_READM
110
110
  upgrade with no question and no copy kept, every recipe kept; a note of your own goes in AGENTS.md, outside the kit
111
111
  block's two workflow:kit comment lines.
112
112
  A declaration seeded once from a template and never
113
- replaced by the upgrade's ensures (a migration rewrites one only on the user's explicit yes) is the
113
+ replaced by the upgrade's ensures (the gates migration moves an earlier kit's gates with no
114
+ question and adds the coverage checker only on the user's yes) is the
114
115
  user's own file. A customization goes into one of nine channels instead:
115
116
 
116
117
  - **Your own commit checks** go in the local hook file `scripts/pre-commit.local`: the managed
@@ -25,8 +25,8 @@ Requires: ${CLAUDE_SKILL_DIR}/references/shared/report-footer.md · ${CLAUDE_SKI
25
25
  4. **Choose agent attribution — answered in the step-2 batch.** May the agent attribute work to itself / to AI — `Co-Authored-By` trailers, "Generated with …" footers, "AI"/agent/model mentions in code, comments, commit messages, PR titles/bodies, or docs? **Default to `off`** (no agent/AI mention anywhere) unless they opt in — people are routinely surprised to find an AI listed as a repo contributor. Carry the answer into the `{{AGENT_ATTRIBUTION}}` slot of the *Attribution* block when `AGENTS.md` is created (step 5). **If `off`**, the advisor's `attribution` item of step 11 sets the harness setting in the project's `.claude/settings.json`, applied on the user's yes after its check — the trailer is added by the harness, so a doc directive alone won't stop it. See [Attribution contract](${CLAUDE_SKILL_DIR}/references/contracts.md#attribution-contract).
26
26
  5. **Entry-point doc.** If `AGENTS.md` / `CLAUDE.md` already exist (step-1 recon), do **not** overwrite — show the user and ask whether to merge or replace. Otherwise create `AGENTS.md` (the cross-agent standard — Codex / Cursor / Devin Desktop / Copilot read it natively) from `${CLAUDE_SKILL_DIR}/references/templates/AGENTS.md`, and symlink `CLAUDE.md -> AGENTS.md` (`ln -s AGENTS.md CLAUDE.md`) for Claude Code — single source, no duplication. For nested context, add a subdir `AGENTS.md` (+ a `CLAUDE.md` symlink beside it for Claude Code).
27
27
  6. **Deploy `docs/ai/`.** Create every `docs/ai/` file + `pages/` + the seed `adr/` store + the seed `specs/` store from `${CLAUDE_SKILL_DIR}/references/templates/` (the template loop deploys every template except `AGENTS.md`, `adr-record.md` and `SPEC_TEMPLATE.md` — the latter two are skill-home authoring references, never deployed). This deploys the HOT ADR window **`docs/ai/decisions.md`** and the seed navigator **`docs/ai/adr/log.md`** (its `adr/` subdir copies in wholesale), the spec store root **`docs/ai/specs/index.md`** (its `specs/` subdir copies in wholesale), the `.md` docs, **and** the four seeded, user-editable strict-JSON configs: **`docs/ai/orchestration.json`** (the per-project recipe defaults the `procedures` advisor reads), **`docs/ai/gates.json`** (the project's gate declaration — seeded as the no-consent EMPTY list; FILLING it is the consented `gates-init` preview, `${CLAUDE_SKILL_DIR}/references/modes/gates.md`), **`docs/ai/autonomy.json`** (the per-project autonomy policy — seeded SPARSE with the onboarding note only, so it is exactly the computed defaults until the user declares levels via `/agent-workflow-kit set-autonomy` or by hand), and **`docs/ai/vehicles.json`** (the executor vehicle's model, effort and fallback as a setting the kit's readers resolve into one posture; the placed executor's body follows it, and the bundled review lens's model and effort, `opus` / `high` by default, follow its optional `review-lens` section — seeded once, hand-edited, never clobbered). Keep each `.md` file's frontmatter (`type / lastUpdated / scope / staleAfter / owner / maxLines`); the `.json` seeds carry no frontmatter (the docs cap-validator globs `*.md` only, so they are inherently skipped).
28
- 7. **Fill templates** per the table below. **Then materialize the navigator, as the last `docs/ai` step:** the entry point declares `docs/ai/index.md` always-loaded and it is a GENERATED artifact with no template, so run `node ${CLAUDE_SKILL_DIR}/references/scripts/check-docs-size.mjs --ensure-index --root=<project>` and relay its one outcome line (`ensure-index: regenerated` / `already-current`, or a `write-refused` / `probe-failed` line naming the offending path — either is a STOP: resolve it before reporting the deploy, since the navigator the entry point declares does not exist yet). The generator runs from **this skill's own directory**, so a project with **no Node runtime** is covered too: the agent host runs it, and step 8's copy is not a precondition.
29
- 8. **Offer enforcement on every project, preview-first.** Explain in one line that the dependency-free Node scripts are available because the agent host already runs their step-7 navigator; the only skip condition is that the agent host cannot run them. Run the `enforcement` item's check line, `node ${CLAUDE_SKILL_DIR}/tools/apply-danger-check.mjs --variant enforcement --cwd <project>`: its result is the preview — each script the kit places into the project's `scripts/` with its bytes and the installer it runs with its bytes. Ask once on that result; on a yes copy them by its apply line with that digest, run by the consent route of `${CLAUDE_SKILL_DIR}/references/modes/recommendations.md`: the copy is create-only and the project's installer installs the pre-commit hook. On a no, skip the hook and say so; a check that refuses (exit 1 or 3) or an apply that exits 6 leaves no script the kit placed — say so with its output and fill the command slots as on a no. On a no the docs command slots name no project-local command — fill `env_commands.md` and the `Docs caps + index freshness` row of `AGENTS.md` with the same note: the caps + index gate run from the agent's own skill copy (the step-7 `--root=<project>` form) and the archive rotations need the scripts deployed. Never write the skill's absolute path into a deployed doc. They self-configure (project name from `package.json` or, without one, the directory basename; hierarchical/on-demand sections auto-discovered). The hook calls `node scripts/<x>.mjs` directly, so a committer without `node` on PATH gets the hook's own loud failure.
28
+ 7. **Fill templates** per the table below. **Then materialize the navigator, as the last `docs/ai` step:** the entry point declares `docs/ai/index.md` always-loaded and it is a GENERATED artifact with no template, so run `node ${CLAUDE_SKILL_DIR}/references/scripts/docs-size/check-docs-size.mjs --ensure-index --root=<project>` and relay its one outcome line (`ensure-index: regenerated` / `already-current`, or a `write-refused` / `probe-failed` line naming the offending path — either is a STOP: resolve it before reporting the deploy, since the navigator the entry point declares does not exist yet). The generator runs from **this skill's own directory**, so a project with **no Node runtime** is covered too: the agent host runs it, and step 8's copy is not a precondition.
29
+ 8. **Offer enforcement on every project, preview-first.** Explain in one line that the dependency-free Node scripts are available because the agent host already runs their step-7 navigator; the only skip condition is that the agent host cannot run them. Run the `enforcement` item's check line, `node ${CLAUDE_SKILL_DIR}/tools/apply-danger-check.mjs --variant enforcement --cwd <project>`: its result is the preview — each script the kit places into the kit folder `scripts/agent-workflow/` with its bytes and the installer it runs with its bytes. Ask once on that result; on a yes copy them by its apply line with that digest, run by the consent route of `${CLAUDE_SKILL_DIR}/references/modes/recommendations.md`: the copy is create-only and the project's installer installs the pre-commit hook. On a no, skip the hook and say so; a check that refuses (exit 1 or 3) or an apply that exits 6 leaves no script the kit placed — say so with its output and fill the command slots as on a no. On a no the docs command slots name no project-local command — fill `env_commands.md` and the `Docs caps + index freshness` row of `AGENTS.md` with the same note: the caps + index gate run from the agent's own skill copy (the step-7 `--root=<project>` form) and the archive rotations need the scripts deployed. Never write the skill's absolute path into a deployed doc. They self-configure (project name from `package.json` or, without one, the directory basename; hierarchical/on-demand sections auto-discovered). The hook calls `node scripts/agent-workflow/run.mjs <name>` directly, so a committer without `node` on PATH gets the hook's own loud failure.
30
30
  9. **Wire / hide** per visibility (see [Visibility contract](${CLAUDE_SKILL_DIR}/references/contracts.md#visibility-contract)). The pre-commit hook is the installer's decision at step 8's apply; over a pre-commit hook the installer did not write, that apply exits 6 with the installer's output naming the hook, and moving it aside is the user's own step. Once the gate declaration is final-run-capable, the advisor's `commit-guard` item binds commits to the green `run-gates --final` receipt; it is applied the same way, its check line first.
31
31
  - **visible** — when a `package.json` exists and step 8's apply exited 0, wire its scripts (never create one for this); add the minimal `.gitignore` either way. **Do not run the hide tool.**
32
32
  - **hidden** — run the kit's hide writer (one managed block in the **project-local** `.git/info/exclude`, covering the kit's own artifacts **and** every known AI/agent tool's footprint — never the machine-global excludes): `node ${CLAUDE_SKILL_DIR}/tools/hide-footprint.mjs --dir <project> --dry-run` **first** (changes nothing, prints the plan), then the same without `--dry-run`. Handle what it surfaces, in plain language (never the tool's internal terms):
@@ -64,5 +64,5 @@ Fill strategy:
64
64
  | `tech_reference.md` | Carry over real configs/patterns found in deps. |
65
65
  | `active_plan.md`, `handover.md` | TODO seed (e.g. "Bootstrap session — fill domain sections after first real work"). |
66
66
  | `decisions.md` | The HOT ADR window — seed `AD-001` (adopting this memory system), newest at the bottom. |
67
- | `adr/log.md` | The seed navigator — deployed as-is (the generator over the seeded HOT); regenerated by `archive-decisions.mjs` where the enforcement scripts are deployed (installed on a yes), otherwise it stays the seed — never hand-edited either way. |
67
+ | `adr/log.md` | The seed navigator — deployed as-is (the generator over the seeded HOT); regenerated by `node scripts/agent-workflow/run.mjs archive-decisions` wherever the kit folder holds the rotator, otherwise it stays the seed — never hand-edited either way. |
68
68
  | `known_issues.md`, `changelog.md`, `pages/shared-patterns.md` | Empty template / first bootstrap entry. |
@@ -18,7 +18,7 @@ Run `node ${CLAUDE_SKILL_DIR}/tools/commit-guard.mjs --check [--cwd <dir>]` —
18
18
 
19
19
  **The empty-commit lane is a PASS that attests NOTHING — and it consults no receipt.** A content-free fingerprint over a CLEAN index means the index contributes no tree-content delta, so the commit changes no tree content: `git commit --allow-empty`, a message- or signature-only `--amend`, an empty merge. (What such a commit DOES change — its message, its parents, its signature — was never in the guard's domain.) The guard passes and says exactly that, because its whole claim is about the bytes a commit carries and here there are none. The receipt arms are SKIPPED rather than satisfied: the content-free fingerprint is the one value every clean moment shares, so a receipt found there cannot be correlated to THIS moment or base — letting it decide would make the outcome depend on which stray moment the store recorded last, the same reason `flow-check`'s `#65` rung steps over a content-free RED. The flow arm still runs (the commit still moves HEAD, and the chain bookkeeping is about that), with its own fingerprint-keyed correlations dropped through the explicit `treeCarriesBytes: false` the guard declares — the checker never derives that fact, because a routine clean-tree check still wants those rungs.
20
20
 
21
- **Wiring:** this repo's dogfood rides `scripts/install-git-hooks.mjs`; a consumer install is a consented surface (init/recommendations) — the hook INSTALLER resolves the installed kit location at install time and writes the RESOLVED invocation into the hook it places (no runtime guessing). The final-run ordering that keeps the guard green is D13: stage everything FIRST → run the reviews on the staged tree → `run-gates --final` → commit immediately (any index/worktree mutation after the final run re-stales the receipt).
21
+ **Wiring:** this repo's dogfood rides the hook `node scripts/agent-workflow/run.mjs install-git-hooks` installs; a consumer install is a consented surface (init/recommendations) — the hook INSTALLER resolves the installed kit location at install time and writes the RESOLVED invocation into the hook it places (no runtime guessing). The final-run ordering that keeps the guard green is D13: stage everything FIRST → run the reviews on the staged tree → `run-gates --final` → commit immediately (any index/worktree mutation after the final run re-stales the receipt).
22
22
 
23
23
  **The deliberate partial commit is BLOCKED — stated, accepted.** Refusal 1 means staging a subset on purpose no longer commits: a pathspec commit (`git commit --only <path>`, `git commit <path>`) hands the hook a temporary index carrying less than the verified tree, and that is exactly the capture blindness this arm closes. No opt-out flag exists, deliberately — the guard's whole claim is that the committed bytes ARE the verified bytes, and a flag that suspends it would suspend the claim. An intentional partial commit stays `--no-verify` territory.
24
24
 
@@ -25,9 +25,9 @@ Declared gates can also be **auto-approved** (no permission prompt on a byte-exa
25
25
 
26
26
  **Candidate lines — the kit's own checkers (opt-in, one consented verb).** `control-bytes`, `plan-shape`, `spec-check`, `spec-coverage` and `project-rules` can each be declared as a gate of your project: `node ${CLAUDE_SKILL_DIR}/tools/checker-gates.mjs --cwd <project>` previews them and writes nothing. Each is offered only over a state where its checker runs by design: `control-bytes` over a `.git` directory or gitfile at the project root, `plan-shape` and `project-rules` on any deployment, `spec-check` over a regular `docs/ai/specs/index.md`, `spec-coverage` over a regular `docs/ai/spec-coverage.json` beside that store root. An offered checker prints its paste-ready entry line; the upgrade's `tier` ask writes the offered entries on your explicit yes — add-only, placed by the rule below, not stamp-gated, after the preview printed the disclosure below. An entry it wrote is removed by hand from `docs/ai/gates.json`: the verb never un-declares. `epic-shape` and `queue-audit` take a project operand and `doc-parity` checks only the kit's own package, so none of them is offered.
27
27
 
28
- **Consent-gated filling — the init preview, not part of the runner (D9).** The template `gates.json` is seeded EMPTY; FILLING it is a consented preview at init (`node ${CLAUDE_SKILL_DIR}/tools/gates-init.mjs --cwd <project>`, dry-run by default — prints the derived entries and **writes NOTHING**; `--apply [--only <id>]…` writes exactly the consented entries on your explicit yes; add-only, id collisions refused). **Placement, not blind appending:** a consented entry lands at the END, except that a non-checker entry goes **BEFORE** a trailing canonical coverage checker — that checker must stay last, so appending after it would write a declaration the validator refuses, leaving a hand edit as the only lane on any final-capable declaration. Existing entries are never modified, removed or reordered. The offer derivation is **closed-world** (AD-052): only a terminating-class script NAME (test / lint / type-check / build — never dev/watch/serve, never a write-mode or release/publish/deploy variant) whose BODY is a member of the literal runner allowlist is offered — membership, never blocklist screening: the worst case is a legit command not offered, never a dangerous one offered. The offered cmd is the uniform hook-free **`COREPACK_ENABLE_NETWORK=0 <pm> exec -- <allowlisted-body>`** — `exec` runs a command, not a named script, so no pre/post hook can fire (npm/pnpm/yarn alike; never `<pm> run <name>`, which re-exposes hooks), and the Corepack env prefix blocks a hostile `packageManager` pin from fetching the PM binary before exec. npm is pinned `--offline --script-shell /bin/sh`; pnpm/yarn refuse an absent runner without network (a user-installed cache/global/PATH runner executing is user machine state — part of the disclosed residual); a family without a verified fail-closed exec contract is WITHHELD loudly. A screened-out body is always named — and when nothing but kit checkers remains, the preview says so in plain words: the offer carries **no project-verification gate at all**. **Disclose before the yes** (the preview prints it): gates.json is a PRIVILEGED file — the wired hook auto-approves byte-exact declared commands — and a script gate runs project-controlled tooling the preview does not sandbox (safe-by-construction = the OFFER DERIVATION). At upgrade, step 3's run-list changes an existing gates.json only through the consented legacy migration and, under the `tier` ask, `tools/checker-gates.mjs` (`${CLAUDE_SKILL_DIR}/references/modes/upgrade.md`).
28
+ **Consent-gated filling — the init preview, not part of the runner (D9).** The template `gates.json` is seeded EMPTY; FILLING it is a consented preview at init (`node ${CLAUDE_SKILL_DIR}/tools/gates-init.mjs --cwd <project>`, dry-run by default — prints the derived entries and **writes NOTHING**; `--apply [--only <id>]…` writes exactly the consented entries on your explicit yes; add-only, id collisions refused). **Placement, not blind appending:** a consented entry lands at the END, except that a non-checker entry goes **BEFORE** a trailing canonical coverage checker — that checker must stay last, so appending after it would write a declaration the validator refuses, leaving a hand edit as the only lane on any final-capable declaration. Existing entries are never modified, removed or reordered. The offer derivation is **closed-world** (AD-052): only a terminating-class script NAME (test / lint / type-check / build — never dev/watch/serve, never a write-mode or release/publish/deploy variant) whose BODY is a member of the literal runner allowlist is offered — membership, never blocklist screening: the worst case is a legit command not offered, never a dangerous one offered. The offered cmd is the uniform hook-free **`COREPACK_ENABLE_NETWORK=0 <pm> exec -- <allowlisted-body>`** — `exec` runs a command, not a named script, so no pre/post hook can fire (npm/pnpm/yarn alike; never `<pm> run <name>`, which re-exposes hooks), and the Corepack env prefix blocks a hostile `packageManager` pin from fetching the PM binary before exec. npm is pinned `--offline --script-shell /bin/sh`; pnpm/yarn refuse an absent runner without network (a user-installed cache/global/PATH runner executing is user machine state — part of the disclosed residual); a family without a verified fail-closed exec contract is WITHHELD loudly. A screened-out body is always named — and when nothing but kit checkers remains, the preview says so in plain words: the offer carries **no project-verification gate at all**. **Disclose before the yes** (the preview prints it): gates.json is a PRIVILEGED file — the wired hook auto-approves byte-exact declared commands — and a script gate runs project-controlled tooling the preview does not sandbox (safe-by-construction = the OFFER DERIVATION). At upgrade, step 3's run-list changes an existing gates.json only through the legacy migration, which moves an earlier kit's gates with no question, and, under the `tier` ask, `tools/checker-gates.mjs` (`${CLAUDE_SKILL_DIR}/references/modes/upgrade.md`).
29
29
 
30
- **The coverage PRODUCER and the canonical checker are declared together or not at all.** `coverage-check` READS an lcov; something must WRITE it, and a checker with no producer PASSES (`skipped-no-lcov`) certifying nothing. A **producer** is a CLOSED set of full command forms, never a substring probe: the suite body `node --test --experimental-test-coverage --test-reporter=lcov --test-reporter-destination="${AW_GIT_DIR:?exported by run-gates}/agent-workflow-lcov.info" --test-reporter=spec --test-reporter-destination=stdout` (optionally + the project's own test paths), bare or behind ONE verified per-PM `exec` wrapper. A cmd that merely MENTIONS the destination (in an `echo`, as a bare substring) or carries a PARTIAL flag set is **not** one. The tail must be path-shaped — path/glob/quoting bytes only, nothing that could sequence, redirect or substitute a command, no plain leading `-`. **Residual:** the screen judges SOURCE bytes — brace *sequence* expansion can produce others (`{Y..a}`), though bash never re-scans an expansion result as syntax, so such a byte is literal argument data, not an operator; the leading-`-` rule is first-order only (`'--flag'`, `{path,--flag}` pass); neither proves the lcov SURVIVES — "producer" means *configured with the reporters*, and a run producing none is caught at runtime as `skipped-no-lcov`. The destination rides `AW_GIT_DIR`, exported to every gate child on plain and `--final` runs alike (`AW_LCOV_FILE` is `--final`-only), so one cmd survives the unmet-producer preflight in both modes; the `:?` is the required-parameter form, so a hand-run with `AW_GIT_DIR` unset or empty fails naming it instead of writing the lcov to the filesystem ROOT (a STALE exported value is not caught), and the preflight counts it as a reference (a `${VAR:-…}` fallback stays unmatched). Recognition is APPEND-ONLY — every destination form the kit has emitted stays a producer, so an earlier kit's declaration never re-reads as customized; emission uses the newest alone. Recognition never WIDENS: a suite the closed set cannot express declares itself with **`"lcovProducer": true`** — the ONE other way to be a producer. Only the literal `true` claims (a string is a loud refusal); the claim binds the DECLARATION, never the run (a marked gate producing no lcov still ends `skipped-no-lcov` / `attested=no`); and it is FORWARD-ONLY — an older kit rejects a marker-carrying declaration by name (exit 5) instead of reading a claim it cannot honor. On BOTH declaration paths: the fill preview WIRES those reporters onto a `node --test` body — the one allowlist member producing lcov unaided, every other body is emitted unchanged — WITHHOLDS the `coverage-check` candidate, with a named note, when neither the offer nor the declaration carries a producer; and `--apply` REFUSES a checker with no producer, a checker that is not LAST (an ORDERING refusal about entries that are ALREADY declared — reorder by hand; the fill places new entries before a trailing checker but never reorders what it did not write), or a SECOND canonical checker. The legacy migration likewise never ADDS the checker into a producer-less declaration, and reports an already-declared one as INERT. A producer declared AFTER the checker leaves it just as inert (it reads nothing, or stale bytes) — ORDER is the rule. An already-declared inert pair, and a matrix of nothing but kit checkers, are surfaced by the advisor's `gates-inert` item (`${CLAUDE_SKILL_DIR}/references/modes/recommendations.md`); its cause-A remedy is the fill preview when the checker is LAST and the project's own scripts yield an offerable producer (the placement rule lands it before the checker), and the user's own step otherwise.
30
+ **The coverage PRODUCER and the canonical checker are declared together or not at all.** `coverage-check` READS an lcov; something must WRITE it, and a checker with no producer PASSES (`skipped-no-lcov`) certifying nothing. A **producer** is ONE full command form, never a substring probe: the suite body `node scripts/agent-workflow/run.mjs unit-tests` (optionally + the project's own test paths), bare or behind ONE verified per-PM `exec` wrapper. That is the stable kit command's `unit-tests` name: `node --test` with the lcov reporter under `AW_GIT_DIR` and the kit test reporter on stdout (a red run prints only its failures and the totals line). A cmd that merely MENTIONS the body (in an `echo`, inside quotes, after `true &&`), another name of the command, or `node --test` with a reporter flag set is **not** one. The tail must be path-shaped — path/glob/quoting bytes only, nothing that could sequence, redirect or substitute a command, no plain leading `-`, so no flag: the command hands every argument to the runner, and `--test-reporter=dot` would add a reporter. **Residual:** the screen judges SOURCE bytes — brace *sequence* expansion can produce others (`{Y..a}`), though bash never re-scans an expansion result as syntax, so such a byte is literal argument data, not an operator; the leading-`-` rule is first-order only (`'--flag'`, `{path,--flag}` pass); neither proves the lcov SURVIVES — "producer" means *configured with the reporters*, and a run producing none is caught at runtime as `skipped-no-lcov`. The destination rides `AW_GIT_DIR`, exported to every gate child on plain and `--final` runs alike (`AW_LCOV_FILE` is `--final`-only); the command refuses an unset or empty `AW_GIT_DIR` by name, exit 1, instead of writing the lcov to the filesystem ROOT (a STALE exported value is not caught). **One guard on every write of the form:** the fill and the migration write the body only while the project's `scripts/agent-workflow/run.mjs` is a regular file byte-equal to the running kit's own and `scripts/agent-workflow/test-reporter/reporter.mjs` is a regular file; otherwise the fill withholds its `node --test` script and the migration keeps the gate, each with one line naming the first failing path and its remedy. **Every form an earlier kit wrote is moved, with no question:** `node --test` with a reporter flag set an earlier kit wrote is no producer; the upgrade's migration SWITCHES such a gate (any id, marked or not) to the same exec prefix, the body and its path tail (printed `SWITCH` with its `was:`), and reports one whose tail carries a flag as CUSTOMIZED with the command's suite line. Until moved, such a gate still runs, but no producer precedes the checker: the fill refuses the write and the advisor names `/agent-workflow-kit upgrade`. Recognition never WIDENS: a suite the closed set cannot express declares itself with **`"lcovProducer": true`** — the ONE other way to be a producer. Only the literal `true` claims (a string is a loud refusal); the claim binds the DECLARATION, never the run (a marked gate producing no lcov still ends `skipped-no-lcov` / `attested=no`); and it is FORWARD-ONLY — an older kit rejects a marker-carrying declaration by name (exit 5) instead of reading a claim it cannot honor. On BOTH declaration paths: the fill preview offers a `node --test` body as the command body under the guard — the one allowlist member producing lcov unaided, every other body is emitted unchanged — WITHHOLDS the `coverage-check` candidate, with a named note, when neither the offer nor the declaration carries a producer; and `--apply` REFUSES a checker with no producer, a checker that is not LAST (an ORDERING refusal about entries that are ALREADY declared — reorder by hand; the fill places new entries before a trailing checker but never reorders what it did not write), or a SECOND canonical checker. The legacy migration adds the checker only with `--apply --add-checker`, on the user's yes, never into a producer-less declaration. A producer declared AFTER the checker leaves it just as inert (it reads nothing, or stale bytes) — ORDER is the rule. An already-declared inert pair, and a matrix of nothing but kit checkers, are surfaced by the advisor's `gates-inert` item (`${CLAUDE_SKILL_DIR}/references/modes/recommendations.md`); its cause-A remedy is the fill preview when the checker is LAST and the project's own scripts yield an offerable producer (the placement rule lands it before the checker), and the user's own step otherwise.
31
31
 
32
32
  **The marker as it appears in a declaration** — the three required keys plus the boolean, nothing else:
33
33
 
@@ -35,12 +35,12 @@ A variant's posture note, where its key has one, is printed by `init` from this
35
35
  - `read-lane` — enabling the opt-in read-only compound lane auto-approves *compounds* (and singles) of the seeded read-only core that carry ZERO shell metaprogramming: an UNATTENDED trust extension, bounded by the audited read-only core (never a command outside it; prompt-bypass only, never a sandbox bypass) and applied regardless of which of those core commands you seeded as individual settings rules. It is a PROJECT-PERSISTENT declaration in `docs/ai/lanes.json` — every future session, subagents' Bash too where the host fires hooks on subagent Bash, and (committed) every checkout. The item renders while the hook is wired and the lane is off, whatever the placed hook's bytes; its apply is the `gate-hook --read-lane` preview, whose own currency check refuses a stale hook (a pre-1.48 hook never reads `lanes.json`). A stale or absent hook under it is a planned file of the kit item `gate-hook.not-current`, applied before the offers. The agent applies the enable offer on the chat yes, and the kit item with no question after the check; `init` applies that kit item on its one y as the route the user may take instead. Risk profile: a bounded read-only trust-posture extension — no write/exec exposure beyond the audited core.
36
36
  - `worktrees-dir` — the agent applies the item on the chat yes after the check: one `sandbox.filesystem.allowWrite` entry naming the worktrees parent itself, written to this copy's `.claude/settings.local.json` only, never the committed project settings, the parent created when missing. `init` applies it on the batch terminal yes as the route the user may take instead. Where the host honors the key, the entry widens the OS-sandbox WRITE surface to the whole parent dir: every sibling path under it (other repositories included) becomes agent-writable, for every later session and every worktree provisioned afterwards. Narrow it BEFORE the first apply: point `docs/ai/worktrees.json` `parentDir` at a dedicated dir — no apply removes an entry, so an earlier one stays until the user deletes it. A parent that is the home or holds it renders `worktrees-dir.home` instead, the user's own step. **Convergence** is two-path: a declared `sandbox.filesystem.allowWrite` entry covering the probed dir (either settings scope — `~` and `~/…` resolve against home, and coverage is path-segment-aware, so a grant on a sibling or on a child never counts), or the dir-bound acknowledgement `worktreesDirAck` in the family-owned `docs/ai/acks.json`, recorded by the `ack-write --lane worktrees-dir` line the `recipe:` line carries — the ack fallback for a host that ignores the key, run only on the user's word, instead of the grant; against a trusted host NO no ack renders. Neither is proof of write CAPABILITY: the provision preflight's real create+delete probe stays the runtime truth, and the ack is bound to the **resolved probe dir**, so the item re-fires only when that resolved dir changes. Risk profile: a real write-surface widening where honored — scope it deliberately.
37
37
 
38
- - `gates-inert` — the gate matrix is DECLARED but verifies nothing, and the two causes have different remedies, so the item renders a different apply for each. **Cause A** — a canonical `coverage-check` gate with no producer gate declared BEFORE it (none at all, or one declared after it, which writes the lcov too late): the run certifies no coverage of its own — `coverage=not-run` when nothing wrote an lcov, or a verdict over STALE bytes an earlier run left in the git dir, which is worse because it reads as `coverage=certified`. The remedy needs the producer to run BEFORE the checker — declared or MOVED there. When the checker is the LAST declared gate and the project's own scripts yield an offerable producer, the fill PLACES that producer before it, so the apply is the ordinary `gates-init` dry-run preview. Otherwise — no offerable producer, or a checker that is not last — it is the user item `gates-inert.unfillable`: the user's own step is to edit `docs/ai/gates.json` (the exact producer form lives in `${CLAUDE_SKILL_DIR}/references/modes/gates.md`), because the fill never reorders entries it did not write. **Cause B** — every declared gate is one of the kit's own canonical checkers, so the matrix runs no project-verification command at all: the apply is the `gates-init` dry-run preview, the same consent-gated seeder the `gates-declaration` item renders, and after the SAME confirmation you run the `--apply` line it prints. Neither cause changes any gate result, exit code or receipt — the item adds no enforcement, only the offer. Risk profile: `docs/ai/gates.json` is a PRIVILEGED file (a declared gate is auto-approvable by the wired hook), so both causes land in the same place — where the fill can help, it declares a project-controlled command on your explicit yes; where it cannot, the edit is the user's own step.
38
+ - `gates-inert` — the gate matrix is DECLARED but verifies nothing, and the two causes have different remedies, so the item renders a different apply for each. **Cause A** — a canonical `coverage-check` gate with no producer gate declared BEFORE it (none at all, or one declared after it, which writes the lcov too late): the run certifies no coverage of its own — `coverage=not-run` when nothing wrote an lcov, or a verdict over STALE bytes an earlier run left in the git dir, which is worse because it reads as `coverage=certified`. The remedy needs the producer to run BEFORE the checker — declared or MOVED there. When the checker is the LAST declared gate and the project's own scripts yield an offerable producer, the fill PLACES that producer before it, so the apply is the ordinary `gates-init` dry-run preview. Otherwise — no offerable producer, or a checker that is not last — it is the user item `gates-inert.unfillable`: the user's own step is to edit `docs/ai/gates.json` (the exact producer form lives in `${CLAUDE_SKILL_DIR}/references/modes/gates.md`), because the fill never reorders entries it did not write. When the declaration carries, anywhere, a gate in a form an earlier kit wrote that the upgrade moves (one whose tail holds only test paths), or the fill withheld its `node --test` script because the kit folder does not hold this kit's command and reporter, the apply is `/agent-workflow-kit upgrade` in place of both: it moves an earlier kit's gate with no question, or a line of its report names what stops it. **Cause B** — every declared gate is one of the kit's own canonical checkers, so the matrix runs no project-verification command at all: the apply is the `gates-init` dry-run preview, the same consent-gated seeder the `gates-declaration` item renders, and after the SAME confirmation you run the `--apply` line it prints. Neither cause changes any gate result, exit code or receipt — the item adds no enforcement, only the offer. Risk profile: `docs/ai/gates.json` is a PRIVILEGED file (a declared gate is auto-approvable by the wired hook), so both causes land in the same place — where the fill can help, it declares a project-controlled command on your explicit yes; where it cannot, the edit is the user's own step.
39
39
 
40
40
  - `source-size` — the arms differ by what the declared gate IS. **`adopted-elsewhere`** — the gate runs a DIFFERENT real copy of this checker (a vendored deployment): the practice runs, the advisor cannot resolve it as its own sibling, and the realpath anchor does not widen (that stops a lookalike). So the convergence is the ack writer's preview (`--lane source-size-copy` → `sourceSizeCopyAck`), never `--adopt`, which would mint and then be refused by the fill on the declared id. The fingerprint binds the declared claims AS AUTHORED, sorted, not resolved paths, so a second external copy re-fires it. **`id-squatter`** — a gate carries the `source-size` id and is not this checker under any reading: it claims the practice while nothing measures module size, so it is the user's own step (rename the id, or repoint the cmd at this `--check`). **`unminted`**, for both copies: a gate refusing every run over an authored or incomplete record (over an absent one the check judges layout alone), attention, and NO acknowledgement silences it; only the verb differs (with the gate declared elsewhere, `--write-baseline`). **`schema-1`** — the check stops on a minted schema-1 config, so this arm comes first: its `--write-baseline` line carries NO reason (a pinned one would launder a raise; a raise riding the move refuses and you relay it), every run until the move. **`layout`** — on a config with no layout record, the record of the piles already there comes first, as its own item: a no writes nothing and the item returns every run; its `recipe:` line names the branch states, and `source-size.layout` is applied before the `hook-checks` check line runs, whose layout line follows that record. **`piles`** — each recorded pile with no queue row gets one, at the end of the queue's Later bucket; a write the queue's own declared check would refuse is not made and the stated skip says why. Risk profile: `docs/ai/gates.json` is a PRIVILEGED file, so every arm here either records an acknowledgement or hands you an edit — the kit declares nothing on its own.
41
41
  - `gate-hook` — the offer wires the hook on the harness lane: the agent applies it on the chat yes after the check; `init` previews and applies it on the terminal yes as the route the user may take instead. Over a wired hook the key renders the kit item `gate-hook.not-current` instead: the placed hook file is absent or differs from the body the kit writes for it. An older body validates your declaration through its OWN baked copy and goes dark on a key it does not know, such as `lcovProducer` (present, whatever its value), so every gate prompts again with no error anywhere. The agent applies the kit item with no question after the check, whose result names the file with its new digest, and the old one too over a differing file; it writes only the hook file. Risk profile: the offer places a hook file and wires one settings entry; the kit item writes one hook file with the kit's body; the declaration is never touched.
42
- - `enforcement` — copies the bundled `references/scripts/*.mjs` runnable scripts and their tests, then runs the project's own hook installer, which installs the pre-commit hook. The lane is harness: the agent applies the item on the chat yes after the check, whose result shows each script the kit places with its bytes and the installer it runs with its bytes; `init` applies it on the batch terminal yes as the route the user may take instead. The copy is create-only: an existing file stands and nothing is written through a link, and the offer renders only when `scripts/` is absent or a plain directory contains no bundled basename. The hook invokes `node` directly, so a committer without it on PATH gets a loud failure. The installer refuses to overwrite a pre-commit hook it did not write: an install it refuses removes the scripts this apply copied, and the item is offered again with the installer's output shown; over a pre-commit hook the installer did not write the item is not offered — its skip names the user's own step. Risk profile: local tooling and a Git hook are added on the chat yes after the check, or on init's y.
43
- - `hook-checks` — the agent applies the item on the chat yes after the check; `init` applies it on the terminal y as the route the user may take instead. Risk profile: future commits stop on the rules check and, where judged, on the size check's findings — lines, aggregate and layout; over a clone with no pre-commit hook the installer writes its whole hook, so commits also stop on its docs, archive and `scripts/` test lines.
42
+ - `enforcement` — copies the bundled runtime files of `references/scripts/` into the kit folder `scripts/agent-workflow/`, then runs the project's own hook installer, which installs the pre-commit hook. The lane is harness: the agent applies the item on the chat yes after the check, whose result shows each script the kit places with its bytes and the installer it runs with its bytes; `init` applies it on the batch terminal yes as the route the user may take instead. The copy is create-only: an existing file stands and nothing is written through a link, and the offer renders only on no Node evidence. The hook invokes `node` directly, so a committer without it on PATH gets a loud failure. The installer refuses to overwrite a pre-commit hook it did not write: an install it refuses removes the scripts this apply copied, and the item is offered again with the installer's output shown; over a pre-commit hook the installer did not write the item is not offered — its skip names the user's own step. Risk profile: local tooling and a Git hook are added on the chat yes after the check, or on init's y.
43
+ - `hook-checks` — the agent applies the item on the chat yes after the check; `init` applies it on the terminal y as the route the user may take instead. Risk profile: future commits stop on the rules check and, where judged, on the size check's findings — lines, aggregate and layout; over a clone with no pre-commit hook the installer writes its whole hook, so commits also stop on its docs and archive lines.
44
44
  - `attribution` — the agent applies the item on the chat yes after the check, setting one key in the project `.claude/settings.json`; `init` applies it on the terminal y as the route the user may take instead. An existing "includeCoAuthoredBy": false already converges the item unless an "attribution" key sets a commit or PR text; a local-scope override is the user's own edit. Risk profile: one settings key, nothing widened.
45
45
  - `footprint-global` — the agent applies the item on the chat yes after the check, which prints each line it removes; `init` applies it on the terminal y as the route the user may take instead. Another of the user's repositories may rely on the same lines: a no keeps the block, and the item returns at the next run. The apply prints the removed lines as a backup. Risk profile: lines removed from the machine-global excludes file.
46
46
  - `mcp-channel` — the offer is to REGISTER the kit's read-only stdio MCP server in this project on the harness lane: a registration is a command your MCP client will RUN. The agent applies it on the chat yes after the check; `init` previews the exact entry and applies it on the terminal y as the route the user may take instead. What the registration buys: path questions and literal searches become typed tool calls whose arguments are named JSON fields instead of a string handed to a shell, so a pipe, a redirect or a quote inside a pattern or a path stays DATA and is never interpreted. Posture: the server is a **read-only child of your client** (path/type/size/line facts and literal search over this project root; no write and no exec API), and like the client itself it runs **outside the Bash sandbox** — the sandbox is not what bounds it, the server's own root containment is. The two allow rules it adds make those two tools promptless and nothing else. The **`.differing`** arm is also a harness item: an `agent-workflow` entry already stands in `.mcp.json` and **structurally differs** from what this kit copy would write (another kit copy, a hand-edited path, an added `env`; the comparison ignores key order, so re-serialized identical bytes are the same registration). The check shows the entry standing in `.mcp.json` and the entry it would write; the chat yes confirms the replacement. `init` previews `mcp --replace` and replaces only on the terminal y. Stated limit: this item does **not** detect a `disabledMcpjsonServers` veto, so a converged `mcp-channel` means *what the mode writes is in place*, not *the client will load it* — see `${CLAUDE_SKILL_DIR}/references/modes/mcp.md`. Risk profile: a new read-only channel your client will launch; no write or exec exposure; a differing registration is replaced only on the checked chat yes or the terminal y and every other declaration is kept.