@event4u/agent-config 9.17.0 → 9.18.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 (128) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +79 -182
  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 +40 -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/router_match.ts +301 -0
  118. package/src/scripts/annotate_r1_outcomes.ts +258 -0
  119. package/src/scripts/check_completion_review.ts +1140 -0
  120. package/src/scripts/compile_router.ts +20 -3
  121. package/src/scripts/dispatch_r2_reviewer.ts +968 -0
  122. package/src/scripts/eval_ui_triviality.ts +156 -0
  123. package/src/scripts/lint_abstraction_thresholds.ts +3 -1
  124. package/src/scripts/lint_plan_risk_register.ts +931 -0
  125. package/src/scripts/lint_trigger_collisions.ts +257 -0
  126. package/src/scripts/router_telemetry.ts +16 -290
  127. package/src/scripts/schemas/rule.schema.json +10 -0
  128. package/src/server/schemas/settings.ts +18 -0
@@ -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
@@ -28,6 +28,9 @@ packs: [legal-review-prep]
28
28
  trust:
29
29
  level: advisory
30
30
  human_review_required: true
31
+ collision_ok:
32
+ "controller": "'controller' is a GDPR role term (controller/processor) in the legal pack"
33
+ "review this contract": "the legal-pack contract-review gate — both floors must fire"
31
34
  ---
32
35
  <!-- agent-config:human-review-banner -->
33
36
  > HUMAN REVIEW REQUIRED · trust: advisory · owner: unknown
@@ -17,6 +17,9 @@ workspaces: [engineering]
17
17
  packs: [engineering-base]
18
18
  enforced_by:
19
19
  - "validator:src/scripts/lint_skill_frontmatter_safety.ts"
20
+ collision_ok:
21
+ "src/skills/": "skill authoring reviews tool grants and the egress leg"
22
+ "src/agent-src/commands/": "command authoring reviews the three trifecta legs"
20
23
  ---
21
24
 
22
25
  # Lethal-Trifecta Guard
@@ -31,6 +31,11 @@ workspaces: [agent-config-maintainer, engineering, gtm]
31
31
  packs: [ai-image, ai-video]
32
32
  enforced_by:
33
33
  - "validator:src/scripts/lint_media_policy_linkage.ts"
34
+ collision_ok:
35
+ "/image:": "routes the project-local media policy layer on the same surface"
36
+ "/audio:": "routes the media policy layer for audio surfaces"
37
+ "/video:": "routes the media policy layer for video surfaces"
38
+ "likeness": "likeness prompts must load the policy layer before generation"
34
39
  ---
35
40
 
36
41
  # Media Governance Routing
@@ -15,6 +15,8 @@ workspaces: [engineering]
15
15
  packs: [engineering-base]
16
16
  enforced_by:
17
17
  - "hook:minimal-safe-diff"
18
+ collision_ok:
19
+ "fix": "a fix is the smallest change that solves the stated problem"
18
20
  ---
19
21
 
20
22
  # Minimal Safe Diff
@@ -20,6 +20,8 @@ packs: [meta]
20
20
  enforced_by:
21
21
  - "validator:src/scripts/check_no_roadmap_refs.ts"
22
22
  - "validator:src/scripts/check_council_references.ts"
23
+ collision_ok:
24
+ "agents/roadmaps/": "roadmap edits are where transient-ref links get written"
23
25
  ---
24
26
 
25
27
  # No Transient References from Stable Artifacts
@@ -15,6 +15,8 @@ routes_to:
15
15
  - "skill:memory-consolidation"
16
16
  workspaces: [agent-config-maintainer, engineering]
17
17
  packs: [meta]
18
+ collision_ok:
19
+ "debug": "debug hypotheses belong in the session notes file"
18
20
  ---
19
21
 
20
22
  # Notes-First Reasoning
@@ -16,6 +16,8 @@ trust:
16
16
  install:
17
17
  default: false
18
18
  removable: true
19
+ collision_ok:
20
+ "phpstan": "phpstan findings are the PHP pattern floor's own quality surface"
19
21
  ---
20
22
 
21
23
  # Php Coding
@@ -12,6 +12,9 @@ triggers:
12
12
  self_contained: true
13
13
  workspaces: [engineering]
14
14
  packs: [engineering-base]
15
+ collision_ok:
16
+ "migration": "migrations add columns — multi-state fields should land as enums from the start"
17
+ "category": "a category field is the canonical enum candidate"
15
18
  ---
16
19
 
17
20
  # Prefer Enums Over Literal Values
@@ -25,6 +25,11 @@ applies_to_user_types:
25
25
  - "maintainer"
26
26
  workspaces: [agent-config-maintainer, engineering, gtm]
27
27
  packs: [ai-image, ai-video]
28
+ collision_ok:
29
+ "/image:": "provider-tier gate fires on the same generation surface"
30
+ "/audio:": "provider-tier gate for audio providers"
31
+ "/video:": "provider-tier gate for video providers"
32
+ "scripts/ai-image/adapters/": "adapter edits are the lifecycle contract's surface"
28
33
  ---
29
34
 
30
35
  # Provider Lifecycle Discipline