@event4u/agent-config 9.17.0 → 9.18.1

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 (131) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +122 -171
  3. package/dist/agent-src/commands/challenge-me/vision.md +5 -0
  4. package/dist/agent-src/commands/evals/rule-compliance-audit.json +46 -0
  5. package/dist/agent-src/commands/feature/plan.md +20 -0
  6. package/dist/agent-src/commands/feature/roadmap.md +19 -0
  7. package/dist/agent-src/commands/pr/create.md +29 -0
  8. package/dist/agent-src/commands/roadmap/create.md +29 -0
  9. package/dist/agent-src/commands/rule-compliance-audit.md +28 -5
  10. package/dist/agent-src/contexts/execution/plan-confidence-gate.md +133 -0
  11. package/dist/agent-src/rules/active-remediation.md +2 -0
  12. package/dist/agent-src/rules/architecture.md +2 -0
  13. package/dist/agent-src/rules/augment-edit-discipline.md +2 -0
  14. package/dist/agent-src/rules/brand-consistency.md +10 -62
  15. package/dist/agent-src/rules/brand-source-of-truth.md +62 -11
  16. package/dist/agent-src/rules/broken-access-control.md +4 -0
  17. package/dist/agent-src/rules/cli-output-handling.md +5 -0
  18. package/dist/agent-src/rules/code-comment-discipline.md +3 -0
  19. package/dist/agent-src/rules/commit-conventions.md +2 -0
  20. package/dist/agent-src/rules/cross-source-consistency.md +3 -0
  21. package/dist/agent-src/rules/design-fidelity.md +2 -0
  22. package/dist/agent-src/rules/doc-screenshot-hygiene.md +2 -0
  23. package/dist/agent-src/rules/docker-commands.md +4 -0
  24. package/dist/agent-src/rules/domain-adoption-policy.md +2 -0
  25. package/dist/agent-src/rules/domain-safety-disclaimer.md +5 -2
  26. package/dist/agent-src/rules/engineering-safety-floor.md +2 -0
  27. package/dist/agent-src/rules/framework-neutrality-in-generic-skills.md +9 -0
  28. package/dist/agent-src/rules/image-likeness-and-rights.md +4 -0
  29. package/dist/agent-src/rules/improve-before-implement.md +4 -0
  30. package/dist/agent-src/rules/laravel-routing.md +4 -0
  31. package/dist/agent-src/rules/legal-safety-floor.md +3 -0
  32. package/dist/agent-src/rules/lethal-trifecta-guard.md +3 -0
  33. package/dist/agent-src/rules/media-governance-routing.md +5 -0
  34. package/dist/agent-src/rules/minimal-safe-diff.md +2 -0
  35. package/dist/agent-src/rules/no-roadmap-references.md +2 -0
  36. package/dist/agent-src/rules/notes-first-reasoning.md +2 -0
  37. package/dist/agent-src/rules/php-coding.md +2 -0
  38. package/dist/agent-src/rules/prefer-enums-over-literals.md +3 -0
  39. package/dist/agent-src/rules/provider-lifecycle-discipline.md +5 -0
  40. package/dist/agent-src/rules/roadmap-ci-steps-policy.md +2 -0
  41. package/dist/agent-src/rules/roadmap-progress-sync.md +2 -0
  42. package/dist/agent-src/rules/rule-type-governance.md +2 -0
  43. package/dist/agent-src/rules/scale-discipline.md +3 -0
  44. package/dist/agent-src/rules/secret-vcs-guard.md +2 -0
  45. package/dist/agent-src/rules/security-sensitive-stop.md +9 -2
  46. package/dist/agent-src/rules/senior-engineering-discipline.md +6 -0
  47. package/dist/agent-src/rules/skill-quality.md +2 -0
  48. package/dist/agent-src/rules/source-confidentiality.md +4 -0
  49. package/dist/agent-src/rules/source-discovery-gate.md +3 -0
  50. package/dist/agent-src/rules/source-of-truth.md +2 -0
  51. package/dist/agent-src/rules/strategy-safety-floor.md +2 -0
  52. package/dist/agent-src/rules/think-before-action.md +5 -0
  53. package/dist/agent-src/rules/ui-audit-gate.md +2 -0
  54. package/dist/agent-src/skills/design-intelligence/SKILL.md +6 -180
  55. package/dist/agent-src/skills/design-intelligence/references/context-and-registers.md +100 -0
  56. package/dist/agent-src/skills/design-intelligence/references/integration-mapping.md +91 -0
  57. package/dist/agent-src/skills/design-review/SKILL.md +4 -141
  58. package/dist/agent-src/skills/design-review/references/review-communication.md +92 -0
  59. package/dist/agent-src/skills/design-review/references/verification-automation.md +61 -0
  60. package/dist/agent-src/skills/existing-ui-audit/SKILL.md +8 -27
  61. package/dist/agent-src/skills/existing-ui-audit/references/anti-slop-cross-reference.md +31 -0
  62. package/dist/agent-src/skills/fe-design/SKILL.md +4 -289
  63. package/dist/agent-src/skills/fe-design/references/design-patterns.md +227 -0
  64. package/dist/agent-src/skills/fe-design/references/design-read-and-memory.md +75 -0
  65. package/dist/agent-src/skills/roadmap-management/SKILL.md +10 -0
  66. package/dist/agent-src/skills/roadmap-writing/SKILL.md +12 -1
  67. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  68. package/dist/agent-src/templates/roadmaps.md +12 -0
  69. package/dist/agent-src/templates/scripts/work_engine/directives/ui/_fix_lane.ts +52 -0
  70. package/dist/agent-src/templates/scripts/work_engine/directives/ui/audit.ts +8 -0
  71. package/dist/agent-src/templates/scripts/work_engine/directives/ui/design.ts +6 -0
  72. package/dist/agent-src/templates/scripts/work_engine/intent/classify.ts +56 -4
  73. package/dist/cli/registry.js +2 -0
  74. package/dist/cli/registry.js.map +1 -1
  75. package/dist/cli-delegate/chunk-AIIUU73N.js +2040 -0
  76. package/dist/cli-delegate/{chunk-IMSXPRVH.js → chunk-ELMFOQPW.js} +11 -0
  77. package/dist/cli-delegate/chunk-LF2KKJ4Q.js +183 -0
  78. package/dist/cli-delegate/cmd_explain.js +36 -36
  79. package/dist/cli-delegate/cmd_export.js +1 -1
  80. package/dist/cli-delegate/cmd_handoff.js +203 -2228
  81. package/dist/cli-delegate/cmd_prune.js +1 -1
  82. package/dist/cli-delegate/cmd_route_audit.js +249 -0
  83. package/dist/cli-delegate/cmd_route_explain.js +285 -0
  84. package/dist/cli-delegate/cmd_settings_migrate.js +1 -1
  85. package/dist/cli-delegate/cmd_sync.js +1 -1
  86. package/dist/cli-delegate/cmd_uninstall.js +1 -1
  87. package/dist/cli-delegate/cmd_validate.js +1 -1
  88. package/dist/discovery/deprecation-report.md +1 -1
  89. package/dist/discovery/discovery-manifest.json +57 -57
  90. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  91. package/dist/discovery/discovery-manifest.summary.md +1 -1
  92. package/dist/discovery/orphan-report.md +1 -1
  93. package/dist/discovery/packs.json +2 -2
  94. package/dist/discovery/trust-report.md +1 -1
  95. package/dist/discovery/workspaces.json +2 -2
  96. package/dist/install/install.mjs +11 -0
  97. package/dist/mcp/registry-manifest.json +1 -1
  98. package/dist/mcp/server.json +2 -2
  99. package/dist/router.json +1 -1
  100. package/dist/server/schemas/settings.js +12 -0
  101. package/dist/server/schemas/settings.js.map +1 -1
  102. package/package.json +1 -1
  103. package/src/agent-src/templates/scripts/work_engine/directives/ui/_fix_lane.ts +52 -0
  104. package/src/agent-src/templates/scripts/work_engine/directives/ui/audit.ts +8 -0
  105. package/src/agent-src/templates/scripts/work_engine/directives/ui/design.ts +6 -0
  106. package/src/agent-src/templates/scripts/work_engine/intent/classify.ts +56 -4
  107. package/src/config/agent-settings.template.yml +46 -0
  108. package/src/config/evaluator-budgets.json +3 -3
  109. package/src/config/gate-coverage.yml +44 -0
  110. package/src/scripts/_cli/cmd_explain.ts +41 -36
  111. package/src/scripts/_cli/cmd_route_audit.ts +290 -0
  112. package/src/scripts/_cli/cmd_route_explain.ts +269 -0
  113. package/src/scripts/_dispatch.bash +23 -0
  114. package/src/scripts/_lib/git_env.ts +40 -0
  115. package/src/scripts/_lib/md_table.ts +27 -0
  116. package/src/scripts/_lib/planning_settings.ts +43 -0
  117. package/src/scripts/_lib/release_highlights.ts +279 -0
  118. package/src/scripts/_lib/router_match.ts +301 -0
  119. package/src/scripts/annotate_r1_outcomes.ts +258 -0
  120. package/src/scripts/check_completion_review.ts +1322 -0
  121. package/src/scripts/check_release_highlights.ts +60 -152
  122. package/src/scripts/compile_router.ts +20 -3
  123. package/src/scripts/dispatch_r2_reviewer.ts +969 -0
  124. package/src/scripts/eval_ui_triviality.ts +156 -0
  125. package/src/scripts/lint_abstraction_thresholds.ts +3 -1
  126. package/src/scripts/lint_plan_risk_register.ts +931 -0
  127. package/src/scripts/lint_trigger_collisions.ts +257 -0
  128. package/src/scripts/release.ts +47 -13
  129. package/src/scripts/router_telemetry.ts +16 -290
  130. package/src/scripts/schemas/rule.schema.json +10 -0
  131. package/src/server/schemas/settings.ts +18 -0
@@ -20,6 +20,22 @@ packs:
20
20
  # /roadmap create
21
21
  ## Instructions
22
22
 
23
+ ### 0. Confidence gate (Gate C)
24
+
25
+ Before anything else, run the plan-confidence gate per
26
+ [`plan-confidence-gate`](../../contexts/execution/plan-confidence-gate.md):
27
+ read `planning.challenge_on_create` (missing = `true`), do the codebase
28
+ lookup, and assess the four 95%-conditions against the seed.
29
+
30
+ - **Confident** (all four hold) → emit the single marker line and continue
31
+ with step 1.
32
+ - **Uncertain** → route into `/challenge-me vision` with the ask as seed
33
+ (inline degrade protocol when the command is unavailable); the resulting
34
+ pitch pre-fills steps 3–4, and the C→R1 handoff state is written per the
35
+ context doc so the risk-review step re-asks nothing.
36
+ - **Explicit user bypass** ("just write it") → skip the gate for this turn;
37
+ count the bypass.
38
+
23
39
  ### 1. Determine location
24
40
 
25
41
  Ask the user (in their language) where the roadmap should be created:
@@ -99,6 +115,19 @@ Show the complete roadmap to the user and ask (in their language) if anything sh
99
115
  - If yes → apply changes, show again.
100
116
  - Repeat until the user says it's done.
101
117
 
118
+ ### 5b. Risk review (Gate R1) — after draft, before save
119
+
120
+ Unless the roadmap will be saved as `status: draft`, add a
121
+ `## Risk Register` per
122
+ [`plan-review-gates § 1`](../../../docs/contracts/plan-review-gates.md):
123
+ read the C→R1 handoff state from step 0 if present (resolved branches
124
+ seed the risk list — never re-ask them), identify the highest product and
125
+ implementation risks, rank descending, write a mitigation per row, and
126
+ anchor every row to a phase/step of this roadmap. No material risks → the
127
+ exact honest-null grammar from the contract. Self-review suffices.
128
+ `lint_plan_risk_register` enforces this at pre-push + CI; drafts are
129
+ exempt until flipped to ready.
130
+
102
131
  ### 6. Save the file
103
132
 
104
133
  - Generate a filename from the title: kebab-case, e.g. `optimize-webhook-jobs.md`.
@@ -5,11 +5,11 @@ pack: meta
5
5
  tier: 2
6
6
  visibility: internal
7
7
  skills: [rule-compliance-audit]
8
- description: Audit rule trigger quality, simulate activation, detect overlaps, and find never-activating rules
8
+ description: Audit rule trigger quality, simulate activation, detect overlaps, find never-activating rules, and replay the router matcher over recent prompts (route:audit)
9
9
  suggestion:
10
10
  eligible: true
11
- trigger_description: "audit my rules, check rule trigger quality"
12
- trigger_context: "maintainer working on .augment/rules/ files"
11
+ trigger_description: "audit my rules, check rule trigger quality, routing audit — which rules fired"
12
+ trigger_context: "maintainer working on .augment/rules/ files or questioning whether rules route"
13
13
  workspaces:
14
14
  - agent-config-maintainer
15
15
  packs:
@@ -121,7 +121,27 @@ ALWAYS-RULE HEALTH
121
121
  {name}: {line_count} lines — {✅ healthy | ⚠️ large (>100 lines) | ⚠️ could be auto}
122
122
  ```
123
123
 
124
- ### 6. Summary and recommendations
124
+ ### 6. Session routing audit (deterministic; the `/routing-audit` surface)
125
+
126
+ Replay the router's ONE shared matcher over the recent session — read-only,
127
+ no LLM call, deterministic:
128
+
129
+ ```bash
130
+ agent-config route:audit --last 10 # matched rules per recent user prompt
131
+ agent-config route:explain "<prompt>" # deep trace for one prompt
132
+ agent-config route:audit --weekly # rolling 7-day recorder render
133
+ ```
134
+
135
+ Render the matched-vs-should-have-matched review: for each audited prompt,
136
+ the tool prints the matched rules + triggers; flag prompts where a rule you
137
+ would expect is absent (should-have-matched is YOUR judgment as reviewer —
138
+ the tool never computes it). Every output opens with the measurement-level
139
+ header: **trigger matching only — what the host actually invoked is NOT
140
+ measured** (ADR-126). Recording (`--record`) is opt-in via
141
+ `telemetry.routing_recorder.enabled` (default off) and stores prompt digests,
142
+ never prompt text.
143
+
144
+ ### 7. Summary and recommendations
125
145
 
126
146
  ```
127
147
  ═══════════════════════════════════════════════
@@ -152,7 +172,10 @@ Wait for user to pick which recommendations to apply.
152
172
  ## Rules
153
173
 
154
174
  - **Do NOT modify any files** until the user approves recommendations.
155
- - **Do NOT run any scripts** — this is a pure analysis command.
175
+ - **Do NOT run any scripts** — this is a pure analysis command. Sole
176
+ carve-out: the read-only routing CLI in step 6 (`route:explain` /
177
+ `route:audit`), which is deterministic and writes nothing (the opt-in
178
+ `--record` flag is the one gated exception).
156
179
  - **Be honest about uncertainty** — if a trigger might or might not match, say "might miss".
157
180
  - **Always-rules are expensive** — flag any that could safely be auto.
158
181
  - **Auto-rules that never activate are dead weight** — flag them clearly.
@@ -0,0 +1,133 @@
1
+ # Plan-Confidence Gate (Gate C)
2
+
3
+ Shared definition of the plan-confidence gate. Loaded by the gated
4
+ plan-authoring surfaces — [`/roadmap:create`](../../commands/roadmap/create.md),
5
+ the [`roadmap-writing`](../../skills/roadmap-writing/SKILL.md) skill,
6
+ [`/feature:plan`](../../commands/feature/plan.md), and
7
+ [`/feature:roadmap`](../../commands/feature/roadmap.md) — each of which links
8
+ here instead of restating the gate. Machine-checked grammars (the C→R1 state
9
+ schema, marker lines) are owned by
10
+ [`docs/contracts/plan-review-gates.md`](../../../docs/contracts/plan-review-gates.md);
11
+ this context carries the agent-side procedure.
12
+
13
+ ## Activation
14
+
15
+ Read `planning.challenge_on_create` from `.agent-settings.yml` once per task
16
+ and cache it. `true` or **missing key** → the gate is active. `false` → the
17
+ gate is inert: proceed with the surface's normal flow, no marker line, no
18
+ interview.
19
+
20
+ **Explicit user bypass wins for that turn** — bypass phrasings and their
21
+ equivalents drop the gate immediately
22
+ (`DE: "einfach schreiben", "Interview überspringen" · EN: "just write it", "skip the interview"`).
23
+ A bypass is **counted**, never punished: append a `gate_c_bypass` event to
24
+ `agents/evidence/metrics/gate-metrics.jsonl` (see
25
+ [`plan-review-gates § metrics`](../../../docs/contracts/plan-review-gates.md))
26
+ so gate erosion stays visible.
27
+
28
+ ## When it fires — and when NOT
29
+
30
+ **Fires** on a plan-artifact **authoring** ask reaching a gated surface: a new
31
+ roadmap, feature plan, or feature roadmap, or a from-scratch rewrite of one.
32
+
33
+ **Does NOT fire on:**
34
+
35
+ - checkbox flips, dashboard regens, archival moves, inbound-ref rewrites;
36
+ - prose-only or typo edits to an existing plan;
37
+ - `/roadmap:process-*` execution runs (execution is not authoring);
38
+ - artifacts that are not plans (ADRs, tickets, skills, rules).
39
+
40
+ ## Procedure
41
+
42
+ ### 1. Codebase first (challenge-me Step 0)
43
+
44
+ Before assessing confidence, run the lookup: existing routes, conventions,
45
+ prior similar features, the seed's cited files. **Never ask what `grep`,
46
+ `view`, or `codebase-retrieval` answers in seconds** — repo findings resolve
47
+ branches silently.
48
+
49
+ ### 2. Seed-time confidence assessment
50
+
51
+ The measure is the four 95%-conditions from
52
+ [`/challenge-me vision`](../../commands/challenge-me/vision.md) § "The four
53
+ 95% conditions". At seed time (before any interview turn) the check degrades
54
+ to: **does the ask already pin (a) the goal, (b) the scope boundary
55
+ (in/out), (c) the hard constraints, and (d) observable acceptance criteria —
56
+ without guessing?** Any gap → below 95%.
57
+
58
+ ### 3a. Confident path
59
+
60
+ All four hold → emit **exactly one** marker line, then proceed with the
61
+ surface's normal flow:
62
+
63
+ ```
64
+ > Confidence ≥ 95% — creating directly (planning.challenge_on_create)
65
+ ```
66
+
67
+ No second marker, no summary of the assessment — one line, then the work.
68
+
69
+ ### 3b. Uncertain path
70
+
71
+ Any gap → route into the [`/challenge-me vision`](../../commands/challenge-me/vision.md)
72
+ interview with the plan ask as seed. On reaching 95% (or the user firing
73
+ `!pitch`), the pitch feeds the surface's normal authoring flow — the same
74
+ mechanic as the existing `!roadmap` routing. The interview replaces the
75
+ surface's own clarification questions; it does not stack on top of them.
76
+
77
+ ### 3c. Inline degrade protocol (hosts without `/challenge-me`)
78
+
79
+ `/challenge-me` ships in the `product-reasoning` pack; the gate never
80
+ hard-depends on it. When the command is unavailable, run the interview
81
+ inline with the same stop conditions:
82
+
83
+ 1. **Resolve first** — derive goal / scope / constraints / AC from the ask
84
+ plus the codebase lookup (step 1); only genuinely open, load-bearing
85
+ branches survive.
86
+ 2. **One question per turn** — surface one load-bearing branch with a
87
+ recommended option (numbered options per `user-interaction`;
88
+ one-question-per-turn per `ask-when-uncertain`).
89
+ 3. **Repeat until** every surfaced branch is resolved AND no new
90
+ load-bearing branch appeared after the last answer AND the cached draft
91
+ summary (goal + in/out + constraints + AC) is stable for two turns.
92
+ 4. **Then author** via the surface's normal flow.
93
+
94
+ ### 4. C→R1 handoff — write the state file
95
+
96
+ On completing the gate (either path that ran an interview), write
97
+ `agents/runtime/state/gate-c-<plan-slug>.json` so the R1 risk pass never
98
+ re-asks resolved branches — the user is never interviewed twice for one
99
+ plan. Schema (canonical:
100
+ [`plan-review-gates § C→R1 handoff`](../../../docs/contracts/plan-review-gates.md)):
101
+ resolved branches, plan hash, timestamp, and a mandatory `transcript_ref`
102
+ (path + content hash of the interview transcript artifact).
103
+
104
+ **Write-path rule:** only the Gate C flow writes
105
+ `agents/runtime/state/gate-c-*.json`. This binds the **agent**; there is no
106
+ lint and no hook entry behind it, and the state file is gitignored so CI never
107
+ sees it — a human reading the diff is what catches a violation (stated
108
+ `enforced_by: none` in
109
+ [`plan-review-gates § 4.1`](../../../docs/contracts/plan-review-gates.md)).
110
+ The rule defends against silent agent shortcuts, not against the local human
111
+ (who holds the settings escape hatch anyway).
112
+ Confident-path runs (no interview) write no state file; R1 then runs its
113
+ risk pass fresh.
114
+
115
+ ## Non-goals
116
+
117
+ - **No execution authorization.** The gate ends where authoring ends — the
118
+ post-artifact hard stop (`scope-control § Authoring vs. implementation`)
119
+ is unchanged; no gate outcome licenses implementation.
120
+ - **No safety-floor changes.** Hard Floor, commit policy, and git-ops gates
121
+ are untouched by any gate path.
122
+ - **No firing on maintenance touches** (see "When it fires" above).
123
+
124
+ ## See also
125
+
126
+ - [`/challenge-me vision`](../../commands/challenge-me/vision.md) — the four
127
+ 95%-conditions and the interview this gate routes into.
128
+ - [`plan-review-gates`](../../../docs/contracts/plan-review-gates.md) — machine
129
+ grammars: C→R1 state schema, Risk Register, completion review.
130
+ - [`ask-when-uncertain`](../../rules/ask-when-uncertain.md) — the
131
+ one-question-per-turn floor the degrade protocol runs under.
132
+ - [`scope-control`](../../rules/scope-control.md) — the post-artifact hard
133
+ stop this gate never softens.
@@ -16,6 +16,8 @@ routes_to:
16
16
  - "guideline:agent-infra/active-remediation-mechanics"
17
17
  workspaces: [engineering]
18
18
  packs: [engineering-base]
19
+ collision_ok:
20
+ "refactor": "an explicit clean-up/refactor ask is the remediation ladder's own trigger"
19
21
  ---
20
22
 
21
23
  # Active Remediation
@@ -11,6 +11,8 @@ routes_to:
11
11
  - "skill:module-detect-on-the-fly"
12
12
  workspaces: [agent-config-maintainer, engineering]
13
13
  packs: [meta]
14
+ collision_ok:
15
+ "controller": "thin-handler floor on controller work"
14
16
  ---
15
17
 
16
18
  # Architecture Rules
@@ -17,6 +17,8 @@ validator_ignore:
17
17
  reason: "Rule scopes the portability gate to the uncondensed authoring tree."
18
18
  workspaces: [agent-config-maintainer]
19
19
  packs: [meta]
20
+ collision_ok:
21
+ ".augment/": "portability + sync floors for the .augment tree"
20
22
  ---
21
23
 
22
24
  # Augment Edit Discipline
@@ -1,15 +1,8 @@
1
1
  ---
2
- type: "auto"
2
+ type: "manual"
3
3
  tier: "2a"
4
- description: "Generated UI/copy/assets check against active brand tokens + voice profile — untraceable values are flagged off-brand"
5
- triggers:
6
- - keyword: "brand"
7
- - keyword: "on-brand"
8
- - keyword: "off-brand"
9
- - keyword: "brand voice"
10
- - keyword: "brand tokens"
11
- - phrase: "brand consistency"
12
- - phrase: "on brand"
4
+ description: "Merged into brand-source-of-truth (2026-08-04) — every emitted colour/type/spacing/voice choice traces to a brand token or voice rule"
5
+ alwaysApply: false
13
6
  applies_to_user_types:
14
7
  - "creator"
15
8
  - "developer"
@@ -21,56 +14,11 @@ packs: [brand]
21
14
 
22
15
  # Brand Consistency
23
16
 
24
- Brand is the layer that *constrains* UI, copy, and assets — not a coat of paint
25
- applied after. This is a concrete Validation gate: emitted artifacts are checked
26
- against the **active brand tokens and voice profile**, and anything that cannot
27
- be traced back to one is flagged off-brand. It mirrors the design-intelligence
28
- principle that **audit findings outrank corpus suggestions** — the consumer's
29
- brand outranks any generated default.
17
+ **Iron Law.** Every emitted colour, type, spacing, and voice choice traces to a
18
+ brand token or a voice rule — a value that traces to neither is off-brand.
30
19
 
31
- ## The Iron Law
32
-
33
- ```
34
- EVERY EMITTED COLOUR, TYPE, SPACING, AND VOICE CHOICE TRACES TO A BRAND TOKEN
35
- OR A VOICE RULE. A VALUE THAT TRACES TO NEITHER IS OFF-BRAND.
36
- NEVER SHIP AN ASSET THE ACTIVE BRAND CANNOT ACCOUNT FOR.
37
- ```
38
-
39
- ## What this gates
40
-
41
- - **Colour / type / spacing** in generated UI or assets that is not one of the
42
- active brand tokens (from `state.ui_design` or the consumer's `.tokens.json`).
43
- A raw hex / font / px value with no token behind it is off-brand.
44
- - **Copy and microcopy** whose register contradicts the active voice profile
45
- (e.g. playful copy under an authoritative `Ruler` voice).
46
- - **Generated brand assets** (logo, banner, social) emitted without injecting the
47
- registered brand tokens — raw generation is allowed only when no brand layer
48
- exists (graceful fallback), never as a silent override of one that does.
49
-
50
- ## When it fires
51
-
52
- A brand layer is active for the run (a `.tokens.json` / `state.ui_design` brand
53
- profile or a confirmed `brand-strategy` / `brand-identity` constraint set) AND a
54
- UI / copy / asset is being emitted or reviewed.
55
-
56
- ## When NOT to fire
57
-
58
- - No brand layer exists yet (greenfield) — there is nothing to validate against;
59
- generation proceeds on the brief, and `brand-strategy` / `brand-identity`
60
- define the tokens first.
61
- - The user explicitly scopes an exploration ("just show options") with no
62
- commitment to an on-brand deliverable.
63
- - Non-brand surfaces: scripts, CLI output, internal tooling.
64
-
65
- ## How to surface a violation
66
-
67
- Name the off-brand value, the token/voice rule it should have matched, and the
68
- fix — do not silently rewrite. Untraceable value → "off-brand: `<value>` has no
69
- brand token; nearest is `<token>`" so the human decides token-or-exception.
70
-
71
- ## See also
72
-
73
- - [`brand-source-of-truth`](brand-source-of-truth.md) — establishes which brand profile is authoritative for the run.
74
- - [`brand-identity`](../skills/brand-identity/SKILL.md) — defines the tokens this gate validates against.
75
- - [`brand-to-tokens`](../skills/brand-to-tokens/SKILL.md) — emits the DTCG `.tokens.json` source of truth.
76
- - [`design-intelligence`](../skills/design-intelligence/SKILL.md) — the "audit findings outrank corpus" precedent this gate mirrors.
20
+ Body merged into [`brand-source-of-truth`](brand-source-of-truth.md) § Iron
21
+ Law 2 (rule hygiene, 2026-08-04): the two rules shared triggers (`brand
22
+ tokens`, `brand voice`) and one subject — the consumer brand as the run's
23
+ authority. This file stays as a pointer so inbound references keep resolving;
24
+ it is `type: manual` (reference-only, no router emission).
@@ -1,12 +1,17 @@
1
1
  ---
2
2
  type: "auto"
3
3
  tier: "2a"
4
- description: "Consumer brand tokens + voice profile are the run's source of truth — the corpus fills gaps, never overrides"
4
+ description: "Consumer brand tokens + voice profile are the run's source of truth — the corpus fills gaps, never overrides; emitted values that trace to no token are flagged off-brand"
5
5
  triggers:
6
+ - keyword: "brand"
7
+ - keyword: "on-brand"
8
+ - keyword: "off-brand"
6
9
  - keyword: "brand tokens"
7
10
  - keyword: "brand voice"
8
11
  - keyword: "brand guide"
9
12
  - keyword: "brand profile"
13
+ - phrase: "brand consistency"
14
+ - phrase: "on brand"
10
15
  - phrase: "brand source of truth"
11
16
  applies_to_user_types:
12
17
  - "creator"
@@ -19,18 +24,35 @@ packs: [brand]
19
24
 
20
25
  # Brand Source of Truth
21
26
 
22
- A precedence rule, light by design. When a consumer already has a brand —
23
- registered tokens (`.tokens.json`), a voice profile, a brand guide — that brand
24
- is authoritative for the run. The curated `brand` corpus (archetypes, colour
25
- psychology, type principles) is a **gap-filler**, never an override.
27
+ A precedence rule plus its validation gate (merged from the former
28
+ `brand-consistency` rule, 2026-08-04 — the pair shared triggers and one
29
+ subject). When a consumer already has a brand — registered tokens
30
+ (`.tokens.json`), a voice profile, a brand guide — that brand is authoritative
31
+ for the run. The curated `brand` corpus (archetypes, colour psychology, type
32
+ principles) is a **gap-filler**, never an override.
26
33
 
27
- ## The Iron Law
34
+ Brand is the layer that *constrains* UI, copy, and assets — not a coat of paint
35
+ applied after. The gate half is a concrete Validation gate: emitted artifacts
36
+ are checked against the **active brand tokens and voice profile**, and anything
37
+ that cannot be traced back to one is flagged off-brand. It mirrors the
38
+ design-intelligence principle that **audit findings outrank corpus
39
+ suggestions** — the consumer's brand outranks any generated default.
40
+
41
+ ## Iron Law 1 — precedence
28
42
 
29
43
  ```
30
44
  CONSUMER BRAND TOKENS AND VOICE WIN. THE CORPUS FILLS GAPS ONLY.
31
45
  NEVER OVERWRITE A REGISTERED BRAND VALUE WITH A CORPUS DEFAULT.
32
46
  ```
33
47
 
48
+ ## Iron Law 2 — the consistency gate
49
+
50
+ ```
51
+ EVERY EMITTED COLOUR, TYPE, SPACING, AND VOICE CHOICE TRACES TO A BRAND TOKEN
52
+ OR A VOICE RULE. A VALUE THAT TRACES TO NEITHER IS OFF-BRAND.
53
+ NEVER SHIP AN ASSET THE ACTIVE BRAND CANNOT ACCOUNT FOR.
54
+ ```
55
+
34
56
  ## Precedence order
35
57
 
36
58
  1. **Consumer brand profile** — registered `.tokens.json`, voice profile, brand
@@ -39,16 +61,42 @@ NEVER OVERWRITE A REGISTERED BRAND VALUE WITH A CORPUS DEFAULT.
39
61
  3. **The brand corpus** — archetype / colour / type / messaging defaults, used
40
62
  only where 1 and 2 are silent, and always surfaced as corpus-sourced.
41
63
 
64
+ ## What the gate covers
65
+
66
+ - **Colour / type / spacing** in generated UI or assets that is not one of the
67
+ active brand tokens (from `state.ui_design` or the consumer's `.tokens.json`).
68
+ A raw hex / font / px value with no token behind it is off-brand.
69
+ - **Copy and microcopy** whose register contradicts the active voice profile
70
+ (e.g. playful copy under an authoritative `Ruler` voice).
71
+ - **Generated brand assets** (logo, banner, social) emitted without injecting the
72
+ registered brand tokens — raw generation is allowed only when no brand layer
73
+ exists (graceful fallback), never as a silent override of one that does.
74
+
42
75
  ## When it fires
43
76
 
44
- Any brand decision while a consumer brand profile is present — to keep the
45
- corpus from quietly replacing a value the brand already defines.
77
+ - **Precedence half:** any brand decision while a consumer brand profile is
78
+ present — to keep the corpus from quietly replacing a value the brand already
79
+ defines.
80
+ - **Gate half:** a brand layer is active for the run (a `.tokens.json` /
81
+ `state.ui_design` brand profile or a confirmed `brand-strategy` /
82
+ `brand-identity` constraint set) AND a UI / copy / asset is being emitted or
83
+ reviewed.
46
84
 
47
85
  ## When NOT to fire
48
86
 
49
87
  - No consumer brand exists (greenfield) — the corpus is the only ground; use it,
50
- marked as corpus-sourced, until `brand-identity` defines real tokens.
51
- - Non-brand surfaces.
88
+ marked as corpus-sourced, until `brand-identity` defines real tokens. There is
89
+ nothing to validate against; generation proceeds on the brief, and
90
+ `brand-strategy` / `brand-identity` define the tokens first.
91
+ - The user explicitly scopes an exploration ("just show options") with no
92
+ commitment to an on-brand deliverable.
93
+ - Non-brand surfaces: scripts, CLI output, internal tooling.
94
+
95
+ ## How to surface a violation
96
+
97
+ Name the off-brand value, the token/voice rule it should have matched, and the
98
+ fix — do not silently rewrite. Untraceable value → "off-brand: `<value>` has no
99
+ brand token; nearest is `<token>`" so the human decides token-or-exception.
52
100
 
53
101
  ## Design register note
54
102
 
@@ -61,6 +109,9 @@ for the full Brand-mode vs Product-mode discriminator.
61
109
 
62
110
  ## See also
63
111
 
64
- - [`brand-consistency`](brand-consistency.md) — validates emitted artifacts against the authoritative brand profile this rule establishes.
112
+ - [`brand-consistency`](brand-consistency.md) — pointer stub; its body lives here since the 2026-08-04 merge.
65
113
  - [`brand`](../skills/brand/SKILL.md) — the gap-fill corpus this rule subordinates to consumer brand.
114
+ - [`brand-identity`](../skills/brand-identity/SKILL.md) — defines the tokens the gate validates against.
115
+ - [`brand-to-tokens`](../skills/brand-to-tokens/SKILL.md) — emits the DTCG `.tokens.json` source of truth.
116
+ - [`design-intelligence`](../skills/design-intelligence/SKILL.md) — the "audit findings outrank corpus" precedent the gate mirrors.
66
117
  - [`docs/guidelines/design-modes.md`](../docs/guidelines/design-modes.md) — brand vs product register discriminator and routing.
@@ -19,6 +19,10 @@ routes_to:
19
19
  - "skill:multi-tenancy"
20
20
  workspaces: [engineering]
21
21
  packs: [engineering-base]
22
+ collision_ok:
23
+ "controller": "controllers return user data — the ownership/tenant check floor"
24
+ "endpoint": "every data-returning endpoint needs the three negative tests"
25
+ "tenant": "cross-tenant isolation is this rule's core subject"
22
26
  ---
23
27
 
24
28
  # Broken Access Control
@@ -30,6 +30,11 @@ routes_to:
30
30
  - "skill:rtk-output-filtering"
31
31
  workspaces: [agent-config-maintainer, engineering]
32
32
  packs: [meta]
33
+ collision_ok:
34
+ "phpstan": "phpstan output is verbose — rtk wrap applies"
35
+ "composer": "composer output is verbose — rtk wrap applies"
36
+ "docker": "docker output is verbose — rtk wrap applies"
37
+ "rector": "rector output is verbose — rtk wrap applies"
33
38
  ---
34
39
 
35
40
  # Cli Output Handling
@@ -17,6 +17,9 @@ routes_to:
17
17
  - "guideline:code-clarity"
18
18
  workspaces: [engineering]
19
19
  packs: [engineering-base]
20
+ collision_ok:
21
+ "refactor": "refactors churn comments — the keep/drop discipline applies"
22
+ "implement": "fresh implementation is where over-commenting lands"
20
23
  ---
21
24
 
22
25
  # Code Comment Discipline
@@ -10,6 +10,8 @@ routes_to:
10
10
  - "skill:conventional-commits-writing"
11
11
  workspaces: [engineering]
12
12
  packs: [engineering-base]
13
+ collision_ok:
14
+ "commit": "format floor for every commit message"
13
15
  ---
14
16
 
15
17
  # Commit Conventions
@@ -23,6 +23,9 @@ routes_to:
23
23
  - "guideline:agent-infra/cross-source-consistency-mechanics"
24
24
  workspaces: [engineering, product]
25
25
  packs: [engineering-base, product-basic]
26
+ collision_ok:
27
+ "mockup": "a mockup is a second source — discrepancy check against the ticket text"
28
+ "screenshot": "a screenshot is a second source — discrepancy check"
26
29
  ---
27
30
 
28
31
  # Cross-Source Consistency
@@ -32,6 +32,8 @@ routes_to:
32
32
  - "guideline:design-fidelity-mechanics"
33
33
  workspaces: [engineering]
34
34
  packs: [engineering-base, frontend-design]
35
+ collision_ok:
36
+ "mockup": "a provided mockup is the spec — 1:1 fidelity floor"
35
37
  ---
36
38
 
37
39
  # Design Fidelity
@@ -25,6 +25,8 @@ applies_to_user_types:
25
25
  - "all"
26
26
  workspaces: [agent-config-maintainer, construction, engineering, finance, founder, gtm, legal-review-prep, ops, product, small-business]
27
27
  packs: [meta]
28
+ collision_ok:
29
+ "screenshot": "a screenshot shipping into docs is the PII/anonymization gate"
28
30
  ---
29
31
 
30
32
  # Doc-Screenshot Hygiene
@@ -11,6 +11,10 @@ routes_to:
11
11
  - "skill:docker"
12
12
  workspaces: [engineering]
13
13
  packs: [engineering-base]
14
+ collision_ok:
15
+ "artisan": "artisan runs inside the project container, never on the host"
16
+ "composer": "composer runs inside the project container"
17
+ "docker": "its own core subject"
14
18
  ---
15
19
 
16
20
  # Docker Commands
@@ -16,6 +16,8 @@ routes_to:
16
16
  - "guideline:agent-infra/domain-adoption-gates"
17
17
  workspaces: [agent-config-maintainer]
18
18
  packs: [meta]
19
+ collision_ok:
20
+ "src/skills/": "a skill in a fresh vertical is exactly the domain-gate surface"
19
21
  ---
20
22
 
21
23
  # Domain Adoption Policy
@@ -11,9 +11,10 @@ triggers:
11
11
  - keyword: "symptoms"
12
12
  - keyword: "dosage"
13
13
  - keyword: "medication"
14
+ # `valuation` / `DCF` moved to finance-safety-floor (2026-08-04) — that
15
+ # pack floor already carried both; this rule keeps the advisory-shaped
16
+ # finance triggers the floor does not cover.
14
17
  - keyword: "investment memo"
15
- - keyword: "valuation"
16
- - keyword: "DCF"
17
18
  - keyword: "tax position"
18
19
  - keyword: "strategic recommendation"
19
20
  - keyword: "board memo"
@@ -39,6 +40,8 @@ applies_to_user_types:
39
40
  - "creator"
40
41
  workspaces: [agent-config-maintainer, construction, engineering, finance, founder, gtm, legal-review-prep, ops, product, small-business]
41
42
  packs: [meta]
43
+ collision_ok:
44
+ "review this contract": "contract review is advisory-shaped — the not-legal-advice footer floor"
42
45
  ---
43
46
 
44
47
  # Domain Safety — Advisory Disclaimer
@@ -26,6 +26,8 @@ routes_to:
26
26
  - "skill:threat-modeling"
27
27
  workspaces: [engineering]
28
28
  packs: [engineering-base]
29
+ collision_ok:
30
+ "migration": "a prod migration is a hard-floor evidence surface (rollback path, blast radius)"
29
31
  ---
30
32
 
31
33
  # Engineering Safety Floor
@@ -34,6 +34,15 @@ workspaces: [agent-config-maintainer]
34
34
  packs: [meta]
35
35
  enforced_by:
36
36
  - "validator:src/scripts/lint_framework_leakage.ts"
37
+ collision_ok:
38
+ "src/skills/": "generic skills must not mandate a stack — fires on skill edits"
39
+ "src/rules/": "rule edits are checked for framework leakage"
40
+ "src/agent-src/commands/": "command edits are checked for framework leakage"
41
+ "artisan": "artisan named in a generic artifact is leakage — the lint surface"
42
+ "eloquent": "eloquent named in a generic artifact is leakage — the lint surface"
43
+ "formrequest": "FormRequest named in a generic artifact is leakage — the lint surface"
44
+ "phpstan": "phpstan named in a generic artifact is leakage — the lint surface"
45
+ "rector": "rector named in a generic artifact is leakage — the lint surface"
37
46
  ---
38
47
 
39
48
  # framework-neutrality-in-generic-skills
@@ -18,6 +18,10 @@ applies_to_user_types:
18
18
  self_contained: true
19
19
  workspaces: [agent-config-maintainer, engineering, gtm]
20
20
  packs: [ai-image]
21
+ collision_ok:
22
+ "/image:": "rights/likeness gate on the image-generation surface"
23
+ "likeness": "its own core subject — the rights gate"
24
+ "scripts/ai-image/adapters/": "adapter edits touch the likeness-gated generation path"
21
25
  ---
22
26
 
23
27
  # Image Likeness and Rights
@@ -16,6 +16,10 @@ validator_ignore:
16
16
  reason: "Rule cites the authoring tree when describing where examples live."
17
17
  workspaces: [engineering]
18
18
  packs: [engineering-base]
19
+ collision_ok:
20
+ "migration": "a migration is a significant behavioural change — the pre-implementation checks apply"
21
+ "refactor": "refactor = significant change; the demand gate + three checks apply"
22
+ "implement": "its own core trigger — pre-implementation validation"
19
23
  ---
20
24
 
21
25
  # Improve Before Implement
@@ -16,6 +16,10 @@ trust:
16
16
  install:
17
17
  default: false
18
18
  removable: true
19
+ collision_ok:
20
+ "artisan": "artisan is a Laravel-flavoured PHP routing cue — load the laravel skill"
21
+ "eloquent": "eloquent is a Laravel routing cue"
22
+ "formrequest": "FormRequest is a Laravel routing cue"
19
23
  ---
20
24
 
21
25
  # Laravel Routing