@event4u/agent-config 10.2.0 → 10.4.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 (96) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +168 -256
  3. package/README.md +1 -1
  4. package/dist/agent-src/commands/analyze/reference-repo.md +62 -0
  5. package/dist/agent-src/commands/analyze.md +2 -1
  6. package/dist/agent-src/commands/design-system/capture.md +44 -0
  7. package/dist/agent-src/commands/design-system/generate.md +53 -0
  8. package/dist/agent-src/commands/design-system/import.md +63 -0
  9. package/dist/agent-src/commands/design-system.md +66 -0
  10. package/dist/agent-src/commands/roadmap/create.md +4 -1
  11. package/dist/agent-src/personas/advisors/first-principles.md +6 -0
  12. package/dist/agent-src/rules/active-remediation.md +53 -2
  13. package/dist/agent-src/rules/code-provenance.md +66 -4
  14. package/dist/agent-src/rules/content-quoting-floor.md +6 -0
  15. package/dist/agent-src/rules/design-fidelity.md +49 -3
  16. package/dist/agent-src/skills/design-review/references/verification-automation.md +23 -1
  17. package/dist/agent-src/skills/design-system-capture/SKILL.md +9 -0
  18. package/dist/agent-src/skills/design-system-capture/references/design-system-json.md +70 -0
  19. package/dist/agent-src/skills/fe-design/SKILL.md +27 -3
  20. package/dist/agent-src/skills/judge-synthesis/SKILL.md +30 -0
  21. package/dist/agent-src/skills/learning-to-rule-or-skill/SKILL.md +11 -0
  22. package/dist/agent-src/skills/roadmap-writing/SKILL.md +8 -8
  23. package/dist/agent-src/skills/skill-writing/SKILL.md +4 -0
  24. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  25. package/dist/agent-src/templates/persona.md +26 -0
  26. package/dist/agent-src/templates/roadmaps.md +27 -7
  27. package/dist/agent-src/templates/scripts/work_engine/directives/ui/design.ts +4 -1
  28. package/dist/agent-src/templates/skill.md +35 -1
  29. package/dist/cli/commands/commands.candidates.test.js +257 -0
  30. package/dist/cli/commands/commands.candidates.test.js.map +1 -0
  31. package/dist/cli/commands/commands.js +199 -0
  32. package/dist/cli/commands/commands.js.map +1 -1
  33. package/dist/cli/main.js +1 -0
  34. package/dist/cli/main.js.map +1 -1
  35. package/dist/cli/registry.js +1 -1
  36. package/dist/cli/registry.js.map +1 -1
  37. package/dist/cli-delegate/{chunk-E4RUZKXB.js → chunk-FV34EGEX.js} +1 -1
  38. package/dist/cli-delegate/chunk-RLN73PR5.js +157 -0
  39. package/dist/cli-delegate/{chunk-I5EAFRII.js → chunk-ZPSXJTLI.js} +2 -154
  40. package/dist/cli-delegate/cmd_conformance.js +672 -214
  41. package/dist/cli-delegate/cmd_doctor.js +1 -1
  42. package/dist/cli-delegate/cmd_handoff.js +8 -6
  43. package/dist/cli-delegate/cmd_session_recycle.js +5 -3
  44. package/dist/discovery/deprecation-report.md +1 -1
  45. package/dist/discovery/discovery-manifest.json +127 -22
  46. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  47. package/dist/discovery/discovery-manifest.summary.md +3 -3
  48. package/dist/discovery/dormancy-report.md +1 -1
  49. package/dist/discovery/orphan-report.md +1 -1
  50. package/dist/discovery/packs.json +9 -5
  51. package/dist/discovery/trust-report.md +2 -2
  52. package/dist/discovery/workspaces.json +8 -4
  53. package/dist/hooks/dispatch.js +1056 -411
  54. package/dist/mcp/registry-manifest.json +3 -3
  55. package/dist/mcp/server.json +2 -2
  56. package/dist/mcp/server.mjs +1103 -593
  57. package/dist/router.json +1 -1
  58. package/docs/guidelines/agent-infra/active-remediation-mechanics.md +54 -0
  59. package/docs/guidelines/design-antipatterns.md +79 -10
  60. package/docs/guidelines/design-fidelity-mechanics.md +120 -2
  61. package/package.json +1 -1
  62. package/src/agent-src/templates/scripts/work_engine/directives/ui/design.ts +4 -1
  63. package/src/config/gate-coverage.yml +65 -10
  64. package/src/config/gate-violation-baselines.json +6 -0
  65. package/src/config/review-prompt-binding-baseline.json +19 -0
  66. package/src/config/rule-enforcement-baseline.json +0 -1
  67. package/src/scripts/_dispatch.bash +1 -0
  68. package/src/scripts/_lib/design_system_import.ts +987 -0
  69. package/src/scripts/ai_council/clients.ts +15 -1
  70. package/src/scripts/check_ci_local_parity.ts +60 -6
  71. package/src/scripts/check_review_prompt_binding.ts +553 -0
  72. package/src/scripts/check_suppression_hygiene.ts +19 -3
  73. package/src/scripts/design_slop_rules.test.ts +37 -6
  74. package/src/scripts/design_slop_rules.ts +150 -22
  75. package/src/scripts/design_system_import.ts +264 -0
  76. package/src/scripts/dispatch_r2_reviewer.ts +15 -1
  77. package/src/scripts/hook_manifest.yaml +71 -2
  78. package/src/scripts/hooks/concern_registry.ts +4 -0
  79. package/src/scripts/hooks/dispatch_hook.ts +10 -0
  80. package/src/scripts/hooks/host_semantics.ts +2 -0
  81. package/src/scripts/hooks/spawn_guard_shadow_hook.ts +212 -0
  82. package/src/scripts/hooks/subagent_ledger_hook.ts +723 -0
  83. package/src/scripts/hooks/turn_end_gate_hook.ts +39 -2
  84. package/src/scripts/hooks/ui_route_nudge_hook.ts +55 -2
  85. package/src/scripts/lint_design_antipattern_parity.ts +201 -0
  86. package/src/scripts/lint_harvest_provenance.ts +483 -0
  87. package/src/scripts/lint_hook_manifest.ts +2 -0
  88. package/src/scripts/lint_rule_skill_pack_reach.ts +194 -13
  89. package/src/scripts/lint_skill_router_head.ts +254 -0
  90. package/src/scripts/report_consultation_rate.ts +126 -1
  91. package/src/scripts/run_skill_evals.ts +10 -5
  92. package/src/scripts/schemas/persona.schema.json +8 -0
  93. package/src/scripts/schemas/provenance-harvest.schema.json +39 -0
  94. package/src/scripts/sweep_dead_scan_roots.ts +51 -0
  95. package/tests/fixtures/hooks/subagent_start.json +7 -0
  96. package/tests/fixtures/hooks/subagent_stop.json +8 -0
@@ -60,8 +60,28 @@ A PROVIDED PROTOTYPE / DESIGN SYSTEM IS THE SPEC, NOT A SUGGESTION.
60
60
  BUILD IT 1:1. NEVER SWAP FONTS, CONTROLS, COMPONENTS, LAYOUT, SPACING,
61
61
  OR COLOUR — AND NEVER OMIT OR ADD AN ELEMENT — WITHOUT EXPLICIT CONFIRMATION.
62
62
  A "BETTER IDEA" IS A PROPOSAL TO SURFACE, NEVER A CHANGE TO MAKE.
63
+ WHENEVER THE SOURCE IS REACHABLE, THE SOURCE IS THE DATA BASIS.
64
+ A SCREENSHOT IS VALIDATION, NEVER THE INPUT YOU BUILD FROM,
65
+ WHILE ANY HIGHER RUNG IS REACHABLE. WHEN THE HANDOVER *IS* AN IMAGE,
66
+ THE IMAGE IS THE SPEC AND THE 1:1 FLOOR ABOVE APPLIES TO IT UNCHANGED.
67
+ WHERE THE ARTIFACT'S OWN MARKUP / CSS / JS IS STACK-COMPATIBLE, ADAPTING
68
+ THAT CODE IS THE DEFAULT — A FROM-SCRATCH RE-DERIVATION IS A DEVIATION
69
+ AND NEEDS THE SAME CONFIRMATION AS A SWAPPED CONTROL.
63
70
  ```
64
71
 
72
+ The qualifier is load-bearing, not hedging. Unqualified, the screenshot line
73
+ contradicts this rule's own opening sentence and its § What counts as the spec,
74
+ both of which name a screenshot as a legitimate spec — and it would forbid the
75
+ image-only handover class the rule exists to govern. What it forbids is
76
+ narrower: reaching for pixels **while the code is sitting there**.
77
+
78
+ The five new lines route to
79
+ [`design-fidelity-mechanics`](../docs/guidelines/design-fidelity-mechanics.md)
80
+ § Data-basis ladder (the first three) and § Adopt the code (the last two) —
81
+ including the scope line that keeps the adopt-the-code duty from colliding with
82
+ [`code-provenance`](code-provenance.md). Read that scope line before acting on
83
+ either rule; the boundary is stated from both sides.
84
+
65
85
  ## What counts as the spec
66
86
 
67
87
  A user-provided, finished design artifact the user points at and says "match
@@ -114,6 +134,21 @@ Two further handover shapes carry the artifact without any of the above:
114
134
  conventional location for a handed-over token/component set. The prefix is the
115
135
  vendor-scoped directory, never a bare `design-system/`, which is a normal
116
136
  source folder in a large fraction of frontend repos.
137
+ - **A third-party builder's share link — UNCOVERED, deliberately.** A page built
138
+ in Lovable / v0 / bolt and handed over as a link is a finished spec, and this
139
+ rule does not route it. The obvious trigger was tried on this branch and
140
+ **withdrawn**: matching is plain substring containment, so `https://v0.dev/`
141
+ also fires on `https://v0.dev/docs`, a pricing page, or a changelog link — it
142
+ would treat every mention of the tool's own site as a spec handover. That is
143
+ the `claude.ai` failure the capability-URL entry above exists to avoid, and by
144
+ this rule's own standard it is worse than the gap it closes. The alternatives
145
+ are a bare-host keyword (broader still) or guessing each vendor's share-path
146
+ segment, and a trigger built on a guessed path is not evidence.
147
+ **What closes it:** a verified share-path segment per vendor, or a
148
+ handover-word co-occurrence the matcher cannot express today. Until then the
149
+ class needs one word in the prompt, like any other unlisted filename.
150
+ `near-bare-host-mention` in the matrix pins the bare-host direction silent so
151
+ a future attempt cannot reintroduce the broad form unnoticed.
117
152
 
118
153
  The trigger set is deliberately phrase-heavy on the German side and on
119
154
  `artifact`: a bare `artifact` keyword fires on "the CI build artifact is 40 MB".
@@ -121,9 +156,20 @@ The trigger set is deliberately phrase-heavy on the German side and on
121
156
  [`design_fidelity_routing.test.ts`](../../tests/scripts/design_fidelity_routing.test.ts)
122
157
  pins both halves — every class that must route, and the near-misses that must
123
158
  stay silent (fixture `daf-port-trigger-de`). Extending the set without adding a
124
- near-miss row there is how an over-broad trigger lands: each of the two triggers
125
- above ships with its own near-miss row (`near-claude-ai-chat-link`,
126
- `near-generic-design-system-dir`).
159
+ near-miss row there is how an over-broad trigger lands: each of the two shipped
160
+ trigger classes above carries its own near-miss row
161
+ (`near-claude-ai-chat-link`, `near-generic-design-system-dir`), and the
162
+ withdrawn builder-URL class left `near-bare-host-mention` behind so the broad
163
+ form stays pinned silent.
164
+
165
+ **The near-miss must test the direction the new trigger opens, not a direction
166
+ that was already closed.** The withdrawn class is the worked example: its first
167
+ near-miss row tested a protocol-less mention, which was silent *before* the
168
+ change and therefore could not have caught the over-broadness the change
169
+ introduced. The row that would have caught it is
170
+ `near-builder-host-non-handover-url` — a documentation URL on the same host —
171
+ and it exists only because a review asked for it after the trigger had already
172
+ shipped. Write that row first next time; it is the cheap half.
127
173
 
128
174
  Body migrated to [`guideline:design-fidelity-mechanics`](../docs/guidelines/design-fidelity-mechanics.md) (per P4 of `road-to-kernel-and-router.md`) — surgical visual edits (targeted-edit vs redesign-trigger discipline, stable anchors), asset & imagery discipline (owned-asset path, third-party delivery is self-hosted by default, real-imagery-as-proof, iconography floor, no unrequested filler), deviation-surfacing shape, failure-mode catalog, `daf-*` fixtures.
129
175
  Trigger-set above activates this routing on demand, independent of the discipline profile (ADR-110).
@@ -29,7 +29,25 @@ Don't just screenshot the default state. Capture:
29
29
 
30
30
  ### Mockup-to-code verification
31
31
 
32
- When implementing from a design mockup or screenshot:
32
+ **Branch on what the artifact actually is before you open anything.** The two
33
+ kinds carry different workflows, and running the image workflow over a code
34
+ artifact is the failure this branch exists to prevent — it rebuilds from pixels
35
+ what was handed over as source.
36
+
37
+ **Code artifact** — an HTML/JSX/Vue file, an archive, a repo, a live page whose
38
+ DOM you can reach:
39
+
40
+ 1. **Read the code** — it is the data basis (`design-fidelity-mechanics`
41
+ § Data-basis ladder, rungs 1–2). Markup, styles, scripts.
42
+ 2. **Implement** — adapting the artifact's own code where it is
43
+ stack-compatible; a from-scratch re-derivation is a deviation, not a default.
44
+ 3. **Screenshot afterwards** — for an after-the-fact visual diff only, never as
45
+ the input you built from.
46
+ 4. **Flag deviations** — including behaviour: a handler or keyframe that did not
47
+ survive is a deviation, not an implementation detail.
48
+
49
+ **Image artifact** — a PNG/JPG screenshot, a Figma export you cannot open as
50
+ source, a photograph of a whiteboard:
33
51
 
34
52
  1. **Open the mockup** — use the provided image/screenshot.
35
53
  2. **Implement** — build the UI component.
@@ -38,6 +56,10 @@ When implementing from a design mockup or screenshot:
38
56
 
39
57
  This is especially useful when the user provides a screenshot or Figma export as a reference.
40
58
 
59
+ > **Near-miss worth naming:** an HTML file *opened in a browser* is still a code
60
+ > artifact. The browser makes it look like an image; the file on disk is rung 1.
61
+ > Take the code path.
62
+
41
63
  ## Async-verifier pattern (keep the main context clean)
42
64
 
43
65
  For a review that needs browser probing, use an **async background verifier**
@@ -202,6 +202,15 @@ auto-installer (out of scope). Full schema is lazy-loaded from
202
202
  [`references/design-system-json.md`](references/design-system-json.md) — read it
203
203
  only when an import is requested.
204
204
 
205
+ **The supply path is real, and it is one command.** Where an extractor's output
206
+ is not already in this shape, run it through the three-lane adapter first —
207
+ `/design-system:import <file>`, which accepts a native artifact, a DTCG token
208
+ file, or an extraction tool's raw JSON and emits the contract. Lanes and
209
+ documented producers:
210
+ [`references/design-system-json.md`](references/design-system-json.md)
211
+ § Extractor compatibility. The adapter is offline and pure — it does not change
212
+ what this skill owns.
213
+
205
214
  **Import procedure:**
206
215
 
207
216
  1. Read `design-system.json`; reject it if `source` (kind + ref + captured_at)
@@ -71,3 +71,73 @@ brand wins). Precedence on import: registered brand tokens > confirmed
71
71
 
72
72
  The package **owns this contract**; it does **not** ship the crawler, the
73
73
  Playwright runtime, or a font-bundler.
74
+
75
+ ## Extractor compatibility — which crawler, and how its output gets here
76
+
77
+ The contract above says what this skill reads. This section says how a real
78
+ tool's output becomes that shape, so the answer to *"which crawler?"* lives in
79
+ the contract rather than in somebody's memory.
80
+
81
+ `src/scripts/design_system_import.ts` is a **pure, offline file transform** with
82
+ three input lanes. It reads a file and writes the contract shape to stdout — no
83
+ network, no browser, no crawl. That is the lock restated as code: a transform
84
+ that fetched would quietly become the crawler this package does not ship.
85
+
86
+ | Lane | Input | What it does |
87
+ |---|---|---|
88
+ | `native` | an existing `design-system.json` | Validates `source`, carries every other key verbatim. Past provenance the validation is **report-only** — a key whose shape contradicts the contract is flagged and kept, never dropped, because the import is a proposal a human reads. |
89
+ | `dtcg` | a W3C DTCG token file (`{$value, $type}` leaves) | Buckets by `$type`, so it works on any authoring tool's layering — **with two stated path exceptions**: `dimension` / `number` is genuinely ambiguous in DTCG (spacing, radius and font size share it), so the path breaks that tie, and a path segment named `dark` files a colour under the dark theme. Both are inferences and both are reported in the notes. Resolves `{alias.references}` to their values. Tokens with no contract bucket land in `_meta.unmapped` — which is why `component.button.paddingX` lands there rather than under spacing. |
90
+ | `dembrandt` | an extraction tool's raw JSON | Matches the documented top-level key names and accepts a small set of shapes per bucket. Motion durations/easings become the `motion` block; per-context profiles, hover deltas, WCAG results and breakpoints are **observation** and land in `_meta`. |
91
+
92
+ ```bash
93
+ # The command is the supported entry point:
94
+ /design-system:import <file>
95
+
96
+ # Or call the transform directly, from an installed package:
97
+ npx tsx node_modules/@event4u/agent-config/src/scripts/design_system_import.ts <file> \
98
+ [--lane native|dtcg|dembrandt] \
99
+ [--source-kind url|repo|dir --source-ref <ref>] [--captured-at <ISO>] \
100
+ [--format json|summary]
101
+ ```
102
+
103
+ **Documented producers.** Two extraction tools are known to emit input this
104
+ adapter consumes, and both are **user-installed and user-connected** — the
105
+ package ships the adapter, the instructions, and the validation, never the tool:
106
+
107
+ - **dembrandt** (MIT, npm) — the richest single source: computed-DOM tokens,
108
+ automatic motion extraction (duration scale, easing curves), component
109
+ observations, WCAG pairs, and a stdio MCP server. Feeds the `dembrandt` lane
110
+ directly, or the `dtcg` lane via its `--dtcg` export.
111
+ - **designlang** (MIT) — DTCG in primitive/semantic/composite layers plus
112
+ interaction states. Feeds the `dtcg` lane. Its own repo-writing feature is not
113
+ invoked; this package owns its projection.
114
+
115
+ A third, **extract-design-system**, emits plain W3C `tokens.json` and feeds the
116
+ same `dtcg` lane. Any other tool that can export DTCG works without a new lane.
117
+
118
+ **Provenance is mandatory on every lane, and its origin is recorded.** DTCG
119
+ carries no `source` block by construction, so the caller supplies one; the
120
+ result then carries `source._meta.provenance_origin: "caller"` rather than
121
+ `"input"`, so a reader can always tell an extracted provenance from an asserted
122
+ one. Neither one present is a rejection, not a default — you cannot confirm what
123
+ you cannot trace.
124
+
125
+ **A lane is never forced.** Where a real sample cannot be mapped without
126
+ inventing values, the adapter emits it as `_meta` observation and says so in a
127
+ note. An import that lands mostly under `_meta` is the designed degradation, not
128
+ a failure — it means the tool's shape moved, and the values are still in front
129
+ of the human instead of silently coerced into tokens.
130
+
131
+ **Parked, not adopted — runtime drift detection.** One documented producer also
132
+ ships a drift gate: `--compare <baseline>` against a captured baseline, with
133
+ distinct exit codes (0 clean · 1 drift · 2 usage · 67 threshold) and a
134
+ machine-readable `drift` key carrying per-token `changes[]`. That is a
135
+ *design-quality CI* capability, not an import one, and nothing in this package
136
+ asks for it today — recorded here as a candidate so the next reader finds it
137
+ already assessed, and taken up only if a design-quality roadmap asks for runtime
138
+ drift detection.
139
+
140
+ The compatibility matrix is committed as tests, not prose:
141
+ `tests/scripts/fixtures/design-system-import/` holds one input/expected pair per
142
+ lane, and that directory's README states which sample is a real capture and
143
+ which is derived from a tool's published output surface.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  model_tier: medium
3
3
  name: fe-design
4
- description: "Frontend design heuristics — and, outside the ticket engine, the loop that applies them: audit, brief, build, review. Use when building or changing any UI, not only when planning one."
4
+ description: "Frontend design heuristics — and, outside the ticket engine, the loop that applies them: audit, brief, inventory, build, review. Use when building or changing any UI, not only when planning one."
5
5
  personas:
6
6
  - frontend-engineer
7
7
  domain: engineering
@@ -40,8 +40,32 @@ else runs the loop.
40
40
  `layout`, `components`, `states`, `microcopy`, `a11y`. `states` means all
41
41
  five of `empty`, `loading`, `error`, `success`, `disabled` — a brief missing
42
42
  one is unfinished, not concise.
43
- 3. **Build** — against the audit's primitives, in the project's stack.
44
- 4. **Review** — run [`design-review`](../design-review/SKILL.md) before calling
43
+ 3. **Inventory — only when an artifact was provided, and before you build.**
44
+ List the artifact's **interactions, keyframes, and script includes** from its
45
+ source (`design-fidelity-mechanics` § Data-basis ladder — read it, do not
46
+ look at a picture of it). Then place **every** listed item in exactly one
47
+ bucket, using the engine's own names (`apply.ts`, `COVERAGE_BUCKETS`) so the
48
+ two surfaces read the same. **Nothing enforces that they stay the same** —
49
+ this is a copied vocabulary, not a shared constant, and no test pins it;
50
+ renaming a bucket in the engine leaves this list stale and silent:
51
+
52
+ | Bucket | Meaning |
53
+ |---|---|
54
+ | `honoured` | carried over as-is |
55
+ | `translated` | carried over in a different shape (a handler became a framework binding) |
56
+ | `flagged` | **not** carried over — with the reason, in the output |
57
+
58
+ Dropping a handler stays allowed; hiding one does not. An item in no bucket
59
+ is the failure this step exists to catch — "missing JavaScript" is what it
60
+ looks like from the user's side. Inside the engine this is enforced
61
+ (`apply.ts`, `COVERAGE_BUCKETS`, an unaccounted item is a halt); out here it
62
+ is a duty you carry, and nothing checks it for you. (fixture:
63
+ `daf-adhoc-port-coverage`.)
64
+ 4. **Build** — against the audit's primitives, in the project's stack. Where the
65
+ artifact's own markup/CSS/JS is stack-compatible, adapt **that code**;
66
+ re-deriving it from scratch is a deviation needing confirmation
67
+ (`design-fidelity-mechanics` § Adopt the code).
68
+ 5. **Review** — run [`design-review`](../design-review/SKILL.md) before calling
45
69
  it done, and scope the verdict honestly: render-scoped when you can render
46
70
  it, otherwise explicitly static-scoped, naming which checks actually ran.
47
71
  "Looks good" with neither scope named is a verdict without evidence.
@@ -103,6 +103,36 @@ contested.
103
103
  Each entry carries **provenance**: which judge(s) raised it. Never merge two
104
104
  judges' findings into one unattributed line.
105
105
 
106
+ ### 4b. Mark an uncited assertion — never drop it
107
+
108
+ A panelist assertion carrying neither fresh evidence produced this run (a
109
+ `file:line`, a command's output, a diff hunk) nor a citation is **marked
110
+ `uncited`** where it appears. It still ships.
111
+
112
+ ```
113
+ FLAG THE UNCITED ASSERTION. NEVER DROP IT.
114
+ A SUPPRESSED FINDING IS INDISTINGUISHABLE FROM A FINDING NOBODY MADE.
115
+ ```
116
+
117
+ The distinction is load-bearing and it is the reason this is a marking rule
118
+ rather than a filter: an unevidenced assertion may still be the most valuable
119
+ line in the report — a judge noticing something it could not yet prove is
120
+ exactly the signal a human wants. What the reader needs is to know which
121
+ category they are reading, not to be protected from one of them.
122
+
123
+ **Drop was considered and rejected against this file.** The formulation this
124
+ was adapted from offers "drop or flag"; the drop half contradicts § 4's
125
+ Advisory tier three paragraphs up — *"Emitted in full, never elided … a finding
126
+ that reached a judge and not the reader was suppressed by the aggregator"*.
127
+ Taking it would have put two rules in one skill in direct conflict, with the
128
+ newer one silently winning. Marking satisfies the same goal (the reader can
129
+ tell evidence from assertion) at zero information cost.
130
+
131
+ Scope: this marks **panelist** assertions inside a synthesis. It does not reach
132
+ the reviewed change, and it is not the `code-provenance` knowledge-layer
133
+ obligation, which governs what a durable artefact asserts rather than what a
134
+ transient review does.
135
+
106
136
  ### 5. Overall recommendation
107
137
 
108
138
  One sentence, not a number: `block` (any worst-tier verdict), `revise` (any
@@ -31,6 +31,17 @@ Use this skill when:
31
31
  a repeated phase pattern via
32
32
  [`extract_audit_patterns.ts`](../../../scripts/extract_audit_patterns.ts)
33
33
  — the pattern's `count` ≥ 2 already satisfies the repetition gate
34
+ * A comparative analysis handed over a **`### SEED —` block** from its
35
+ `## Seeds` section ([`/analyze:reference-repo`](../../agent-src/commands/analyze/reference-repo.md)
36
+ § 6). This is an accepted intake shape: the block already carries the
37
+ proposed name, kind, target template, one-line description, and the
38
+ `Extends instead?` answer, so step 4's overlap search starts from a stated
39
+ candidate rather than a blank page — it does **not** skip that search, and a
40
+ seed whose `Extends instead?` line is missing is incomplete intake, not a
41
+ shortcut. The repetition gate is satisfied differently here: the evidence is
42
+ the anchored ADOPT/ADAPT verdict behind the seed rather than a recurrence
43
+ count — a mechanism confirmed once against a named own-repo defect is not the
44
+ one-off case the gate exists to filter.
34
45
 
35
46
  Do not use this skill when:
36
47
 
@@ -152,14 +152,14 @@ Sign-off" phases are authoring bugs; replace each with an
152
152
  agent-verifiable check (a command, a targeted test, a grep). Never
153
153
  restate run-time safety floors as steps.
154
154
 
155
- Gate-test before any checkpoint: *"Could the agent clear this with a
156
- tool or command during the run?"* Yes → step, not gate. No →
157
- structured `## Blockers` entry (§ 5b), distinguishing per rule 22:
158
- **human gate** (only a human can decide/authorize — Hard-Floor
159
- authorization, billable spend, contested decision) vs **external
160
- blocker** (agent cannot resolve but CAN probe status — CI run, package
161
- release, upstream PR; `Resolved when:` carries the probe, owner is
162
- not a human). Merge is never a completion requirement — it may appear
155
+ Gate-test — three rungs in order (rule 22 owns the detail): **1.** agent-clearable
156
+ by tool/command → step. **2.** has a technical answer a council could reach → still
157
+ a step, first action runs the council; a contested *technical* decision is never a
158
+ human gate while one is configured (`agent-config council:status`). **3.** what
159
+ survives both → `## Blockers` (§ 5b): **human gate** (only a human can
160
+ decide/authorize — Hard-Floor authorization, billable spend, or preference / risk
161
+ appetite / product intent) vs **external blocker** (agent cannot resolve but CAN
162
+ probe status — CI run, package release, upstream PR; `Resolved when:` carries the probe, owner is not a human). Merge is never a completion requirement — it may appear
163
163
  as a blocker only when later roadmap work depends on the merged state.
164
164
  `lint_roadmap_complexity` warns on human-gate patterns in every mode.
165
165
 
@@ -102,6 +102,10 @@ Do NOT create a skill or rule for:
102
102
  → See `docs/guidelines/agent-infra/size-and-scope.md` for full limits.
103
103
 
104
104
  * Target: 300–900 words. Review for split above 1200 words. Strongly consider split above 1500 words.
105
+ * Over the 400-line K6 cap → the **router-head contract** in `templates/skill.md`
106
+ applies: entry head (when-to-use · mode table · routing) plus one `tasks/` or
107
+ `references/` file per mode, and the head never inlines more than one mode's
108
+ procedure. Gated by `lint_skill_router_head` with a shrink-only allowlist.
105
109
  * If multiple workflows exist → split into multiple skills
106
110
  * If two skills overlap heavily → merge
107
111
  * If a skill becomes "read the guideline" → it lost its purpose, restore the workflow
@@ -39,7 +39,7 @@ schema_version: 1
39
39
  # CI guard: a release bump of `package.json` must update this value
40
40
  # in lockstep — see scripts/check_template_pin_drift.ts (road-to-
41
41
  # portable-runtime-and-update-check P3.3).
42
- agent_config_version: "10.2.0"
42
+ agent_config_version: "10.4.0"
43
43
 
44
44
  # --- Project identity ---
45
45
  project:
@@ -38,6 +38,32 @@ source: package
38
38
  - mode optional — advisory link to a role-contracts workflow mode
39
39
  - version required — semantic version; bump on breaking changes
40
40
  - source required — "package" for personas shipped in dist/agent-src/
41
+ - sources optional — harvest_id list this persona may cite as external
42
+ doctrine (provenance/harvests.jsonl). OMIT IT unless you mean
43
+ one of the two scoped states; absent is the normal case and
44
+ the one every existing persona is in.
45
+ -->
46
+
47
+ <!-- SOURCES — an epistemic scope, not a bibliography.
48
+
49
+ A persona declares a voice. `sources:` optionally declares what that voice is
50
+ allowed to assert as *external doctrine* — as opposed to its own reasoning,
51
+ which needs no declaration and is never restricted.
52
+
53
+ | State | Meaning |
54
+ |---|---|
55
+ | field absent | Unscoped. Today's behaviour for every persona; nothing changes. |
56
+ | `sources: []` | Explicitly asserts nothing harvested — its positions are its own. |
57
+ | `sources: [id, …]` | May cite those harvest ids as doctrine. |
58
+
59
+ Every declared id must resolve to a row in `provenance/harvests.jsonl`;
60
+ `lint_harvest_provenance` fails an id that does not. Do NOT invent a row to
61
+ populate the field — an empty ledger and an absent field is the correct
62
+ resting state, and `[]` is for a persona where the distinction is worth
63
+ stating out loud.
64
+
65
+ This does not touch the Unique-Questions heuristic. A scoped persona still
66
+ earns its place by asking what nobody else asks.
41
67
  -->
42
68
 
43
69
  # {Role name}
@@ -197,9 +197,22 @@ Templates for roadmap files stored in `agents/roadmaps/` or `{module_root}/{Modu
197
197
  "user approves", "looks good", or "sign-off".
198
198
  - A **human gate** is allowed only when only a human can **decide or
199
199
  authorize**: a Hard-Floor action (deploy, prod data/infra),
200
- billable spend, or a contested product / architecture decision.
201
- Record it as a structured `## Blockers` entry (rule 20) — never as
202
- an inline checkbox step scattered through phases.
200
+ billable spend, or a decision bound to the user's own preference,
201
+ risk appetite, or product intent.
202
+ - A **contested technical decision is not a human gate while a
203
+ council is configured.** Which design is sound, whether a contract
204
+ still holds, which of N implementations to pick — these have
205
+ technical answers, and `decision_resolution` already classes a
206
+ contract or architecture change as `medium_impact → council`
207
+ (`docs/contracts/ai-council-config.md`). Authoring them as human
208
+ gates contradicts that classification and spends the user's
209
+ attention on a question the council answers. Run it, record the
210
+ verdict in the phase, and the gate becomes a step.
211
+ `agent-config council:status` says whether one is configured —
212
+ never infer it from the project tree (`council-availability`).
213
+ Record a genuine gate as a structured `## Blockers` entry
214
+ (rule 20) — never as an inline checkbox step scattered through
215
+ phases.
203
216
  - An **external dependency is a blocker, not a human gate**, whenever
204
217
  the agent can probe its status (CI run finished, package version
205
218
  published, upstream PR merged, API reachable, DNS propagated):
@@ -216,10 +229,17 @@ Templates for roadmap files stored in `agents/roadmaps/` or `{module_root}/{Modu
216
229
  `security-sensitive-stop`, and `commit-policy` fire at run time on
217
230
  their own; an authored "STOP: confirm with user before X" duplicates
218
231
  them and only adds interruptions.
219
- Gate-test before writing any checkpoint: *"Could the agent clear this
220
- with a tool or command during the run?"* Yes → it is a step, not a
221
- gate. No → structured blocker with a decidable `Resolved when:`,
222
- owned by a human only when the blocker is a genuine human gate.
232
+ Gate-test before writing any checkpoint, asked in this order:
233
+ 1. *"Could the agent clear this with a tool or command during the
234
+ run?"* Yes → it is a step, not a gate.
235
+ 2. *"Does it have a technical answer a council could reach?"* Yes →
236
+ it is a step whose first action runs the council.
237
+ 3. Only what survives both — preference, risk appetite, product
238
+ intent, authorization, spend — becomes a structured blocker with
239
+ a decidable `Resolved when:`, owned by a human.
240
+ Stopping at question 1 is the authoring bug this ordering exists to
241
+ prevent: it sends every decision the agent cannot compute straight to
242
+ the user, including the ones the council exists to answer.
223
243
  `task lint-roadmap-complexity` warns on human-gate step patterns,
224
244
  human-gate phase headings, and human-approval exit criteria.
225
245
 
@@ -345,7 +345,10 @@ function _halt_provided_without_contract(
345
345
  '> 1. Proceed — port it with those five losses on the record; `apply` ' +
346
346
  'still has to report what it honoured, translated, and flagged',
347
347
  '> 2. Supply a `design-system.json` — its token values are then ' +
348
- 'honoured verbatim instead of re-derived',
348
+ 'honoured verbatim instead of re-derived. Already have an ' +
349
+ "extractor's output in another shape? `/design-system:import " +
350
+ '<file>` maps a DTCG token file or an extraction tool\'s raw JSON ' +
351
+ 'into this contract offline.',
349
352
  '> 3. Abort — drop this UI request',
350
353
  '',
351
354
  '**Recommendation: 2 — Supply the contract** — it is the only option ' +
@@ -207,8 +207,42 @@ Before considering a skill complete, verify it passes all 5 checks:
207
207
  - [ ] **K3: No obvious content** — doesn't teach the model what it already knows; only project-specific conventions and non-obvious patterns
208
208
  - [ ] **K4: Has Gotcha section** — documents real failure patterns, not theoretical advice; seeded with 2-3 entries
209
209
  - [ ] **K5: Has Output format** — numbered list with 2-4 deliverables describing what the skill produces
210
- - [ ] **K6: Under 400 lines** — if larger, extract reference tables or templates into separate files in the skill folder
210
+ - [ ] **K6: Under 400 lines** — if larger, restructure as a router head per the contract below (gate: `lint_skill_router_head`)
211
211
  - [ ] **English only** — all content in English
212
212
  - [ ] **No duplication** — doesn't repeat rules or guidelines that are already enforced elsewhere
213
213
  - [ ] **No "Related skills" section for mid-tier / untiered skills** — the agent discovers them via `<available_skills>` descriptions; cross-links waste tokens. Senior-tier skills (`tier: senior`) MUST include the block per `skill-quality.md` § Senior-Tier Required Structure (linter-enforced).
214
214
 
215
+ ## The router-head contract (K6, over the cap)
216
+
217
+ A `SKILL.md` over the 400-line cap restructures instead of growing. The shape:
218
+
219
+ | Part | Holds | Budget |
220
+ |---|---|---|
221
+ | **Entry head** — `SKILL.md` | When-to-use · a mode table · the routing that picks a mode · anything true across *all* modes | the cap |
222
+ | **Mode bodies** — `tasks/*.md` or `references/*.md` in the skill folder | One file per mode: the procedure, its examples, its tables | unbudgeted |
223
+
224
+ One binding constraint on the head: **it never inlines the procedure body for
225
+ more than one mode.** A head that carries mode A in full and points at modes
226
+ B and C has not been restructured — it has been relabelled, and the next edit
227
+ will grow it back.
228
+
229
+ ### What this contract does NOT claim
230
+
231
+ It does not claim a token win. The host loads `SKILL.md` whole on trigger, and
232
+ whether it then follows a pointer into `tasks/` is host behaviour **nothing in
233
+ this tree observes**. Anyone proposing a retrofit of an existing oversized skill
234
+ on activation grounds is asserting something currently unmeasurable, and
235
+ ADR-202's lesson binds: an activation claim goes behind a measured instrument or
236
+ it is not made.
237
+
238
+ What the contract does is narrower and real: the 400-line cap was already this
239
+ repo's published position, sitting in a checklist nothing enforced. The gate
240
+ makes an existing contract true for **new** skills. Restructuring the current
241
+ offenders is a separate decision with its own evidence bar.
242
+
243
+ ### Grandfathering
244
+
245
+ `lint_skill_router_head` carries a shrink-only allowlist seeded with the skills
246
+ that already exceed the cap. Entries may be removed, never added — a new
247
+ oversized monolith fails the gate rather than joining the list.
248
+