@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
@@ -28,6 +28,8 @@ self_contained: true
28
28
  workspaces: [agent-config-maintainer, engineering]
29
29
  packs: [meta]
30
30
  roles: [planner]
31
+ collision_ok:
32
+ "agents/roadmaps/": "roadmap steps must not schedule CI-shaped gates"
31
33
  ---
32
34
 
33
35
  # Roadmap CI-Steps Policy
@@ -14,6 +14,8 @@ packs: [meta]
14
14
  roles: [planner]
15
15
  enforced_by:
16
16
  - "hook:roadmap-progress"
17
+ collision_ok:
18
+ "agents/roadmaps/": "any roadmap touch regenerates the dashboard, same response"
17
19
  ---
18
20
 
19
21
  # Roadmap Progress Sync
@@ -8,6 +8,8 @@ routes_to:
8
8
  - "guideline:agent-infra/rule-type-governance"
9
9
  workspaces: [agent-config-maintainer]
10
10
  packs: [meta]
11
+ collision_ok:
12
+ "src/rules/": "the always-vs-auto choice fires on every rule edit"
11
13
  ---
12
14
 
13
15
  # Rule Type Governance
@@ -23,6 +23,9 @@ workspaces: [engineering]
23
23
  packs: [scale-discipline]
24
24
  trust:
25
25
  level: professional
26
+ collision_ok:
27
+ "migration": "R-A6 migration-safety owns reversibility/index/retention rules"
28
+ "schema": "schema change routes the persistence pack floor (R-A6/R-A2)"
26
29
  ---
27
30
 
28
31
  # Scale Discipline
@@ -25,6 +25,8 @@ workspaces: [engineering]
25
25
  packs: [engineering-base]
26
26
  enforced_by:
27
27
  - "validator:src/scripts/check_secret_leak.ts"
28
+ collision_ok:
29
+ "commit": "committing is the credential-leak moment this guard exists for"
28
30
  ---
29
31
 
30
32
  # Secret-in-VCS Guard
@@ -3,13 +3,18 @@ type: "auto"
3
3
  tier: "2a"
4
4
  alwaysApply: false
5
5
  description: "Security-sensitive paths (auth, billing, tenants, secrets, uploads, webhooks) — threat-model BEFORE editing"
6
+ # Trigger set disjoint from secret-vcs-guard by design (2026-08-04): bare
7
+ # `secret` / `password` belong to the VCS-write surface (secret-vcs-guard);
8
+ # this rule keeps the conversational security surface (editing auth/billing/
9
+ # tenant/webhook paths and secrets *infrastructure*, not committing a
10
+ # credential).
6
11
  triggers:
7
12
  - keyword: "auth"
8
13
  - keyword: "billing"
9
14
  - keyword: "tenant"
10
- - keyword: "secret"
11
15
  - keyword: "webhook"
12
- - keyword: "password"
16
+ - keyword: "oauth"
17
+ - keyword: "signing key"
13
18
  validator_ignore:
14
19
  - type: "substring"
15
20
  pattern: "../../docs/"
@@ -19,6 +24,8 @@ workspaces: [engineering]
19
24
  packs: [engineering-base]
20
25
  enforced_by:
21
26
  - "none"
27
+ collision_ok:
28
+ "tenant": "tenancy is a threat-model-before-edit surface"
22
29
  ---
23
30
 
24
31
  # Security-Sensitive Stop Rule
@@ -19,6 +19,12 @@ routes_to:
19
19
  - "skill:testing-anti-patterns"
20
20
  workspaces: [engineering]
21
21
  packs: [engineering-base]
22
+ collision_ok:
23
+ "migration": "migration = invisible-controls surface (reversible, indexed, tenant-scoped)"
24
+ "refactor": "a refactor must generalize, never overfit — the anchor applies"
25
+ "implement": "implementation = the invisible-controls checklist"
26
+ "endpoint": "endpoint row of the surface-to-controls table"
27
+ "component": "component work = generalize + reuse duty"
22
28
  ---
23
29
 
24
30
  # Senior Engineering Discipline
@@ -10,6 +10,8 @@ workspaces: [agent-config-maintainer]
10
10
  packs: [meta]
11
11
  enforced_by:
12
12
  - "validator:src/scripts/skill_linter.ts"
13
+ collision_ok:
14
+ "src/skills/": "every skill edit passes the executable-quality floor"
13
15
  ---
14
16
 
15
17
  # Skill Quality
@@ -19,6 +19,10 @@ workspaces: [agent-config-maintainer]
19
19
  packs: [meta]
20
20
  enforced_by:
21
21
  - "validator:src/scripts/check_no_external_sources.ts"
22
+ collision_ok:
23
+ "src/skills/": "skill prose must not name derivation sources"
24
+ "src/rules/": "rule prose must not name derivation sources"
25
+ "agents/roadmaps/": "harvest/comparison roadmaps stay anonymized"
22
26
  ---
23
27
 
24
28
  # Source Confidentiality
@@ -17,6 +17,9 @@ routes_to:
17
17
  - "skill:source-discovery"
18
18
  workspaces: [engineering]
19
19
  packs: [engineering-base]
20
+ collision_ok:
21
+ "endpoint": "an unconfirmed endpoint shape needs evidence before code"
22
+ "schema": "a DB schema is the canonical structure to verify from a real source"
20
23
  ---
21
24
 
22
25
  # Source Discovery — evidence before structure
@@ -14,6 +14,8 @@ workspaces: [agent-config-maintainer]
14
14
  packs: [meta]
15
15
  enforced_by:
16
16
  - "validator:src/scripts/check_condensation.ts"
17
+ collision_ok:
18
+ ".augment/": "the projection is read-only — edits belong in src/"
17
19
  ---
18
20
 
19
21
  # Source of Truth
@@ -33,6 +33,8 @@ packs: [founder-strategy]
33
33
  trust:
34
34
  level: advisory
35
35
  human_review_required: true
36
+ collision_ok:
37
+ "category": "'category' is positioning vocabulary (category design) in the strategy pack"
36
38
  ---
37
39
  <!-- agent-config:human-review-banner -->
38
40
  > HUMAN REVIEW REQUIRED · trust: advisory · owner: unknown
@@ -17,6 +17,11 @@ triggers:
17
17
  self_contained: true
18
18
  workspaces: [engineering]
19
19
  packs: [engineering-base]
20
+ collision_ok:
21
+ "refactor": "analyze-before-modify floor fires on any refactor"
22
+ "implement": "analyze-first floor on any implementation"
23
+ "debug": "targeted inspection over brute force while debugging"
24
+ "fix": "no blind trial-and-error on fixes — max 2 retries"
20
25
  ---
21
26
 
22
27
  # think-before-action
@@ -14,6 +14,8 @@ routes_to:
14
14
  - "skill:typography-system"
15
15
  workspaces: [agent-config-maintainer, engineering]
16
16
  packs: [frontend-design]
17
+ collision_ok:
18
+ "component": "no new component without audit findings — its core subject"
17
19
  ---
18
20
 
19
21
  # UI Audit Gate
@@ -49,100 +49,12 @@ Provenance + licenses: [`ATTRIBUTION.md`](ATTRIBUTION.md); manifest:
49
49
  layout pattern / chart type / icon system fits this product.
50
50
  - Stack-idiom lookup before writing UI code (`--stack` axis).
51
51
 
52
- ## Cross-task design memory — read DESIGN.md / PRODUCT.md first
53
-
54
- Before running the corpus grounding or producing any design brief, check
55
- the project root for `DESIGN.md` and/or `PRODUCT.md` (written by
56
- `design-system-capture`). If they exist:
57
-
58
- 1. Read `DESIGN.md` — apply its captured visual decisions (radius, shadows,
59
- motion, spacing) as **project constraints** that take precedence over
60
- corpus suggestions. The corpus fills gaps; DESIGN.md overrides.
61
- 2. Read `PRODUCT.md` — note interaction patterns that affect the design
62
- (e.g., destructive-action policy, empty-state approach) so the brief
63
- is consistent with existing product conventions.
64
- 3. After generating the design brief: if a decision was made that isn't yet
65
- in DESIGN.md (e.g., chose a specific shadow for a new elevated surface),
66
- flag it for capture: *"Suggest adding to DESIGN.md: elevated surface shadow = …"*
67
-
68
- Boundary vs `brand-to-tokens`/`.tokens.json`:
69
- - `.tokens.json` = primitive definitions (gray-700 = #374151)
70
- - `DESIGN.md` = usage decisions (elevated surfaces use the gray-700 shadow, 8px radius)
71
- Both are consumed; DESIGN.md takes precedence for usage questions.
72
-
73
- ## Register — brand vs product
74
-
75
- Determine the design register before grounding (see
76
- [`docs/guidelines/design-modes.md`](../../../docs/guidelines/design-modes.md)):
77
- **brand mode** ("the impression IS the product" — marketing, landing, consumer
78
- first-impression) prioritizes distinctive selection; **product mode** ("design
79
- serves the task" — dashboard, admin, workflow) prioritizes earned familiarity
80
- and accessibility. The register changes which corpus selections are appropriate
81
- (distinctive palette/typography in brand mode; predictable, semantic in product
82
- mode). State the register in the Design Read line below.
83
-
84
- **Embedded vs standalone (a third discriminator).** UI **embedded inside a host
85
- surface** — a widget in a slide, a card in a chat, a panel in someone else's
86
- app — follows a **flatter charter** than a greenfield standalone page:
87
- restrained weights, hairline borders, no atmospherics/gradients/shadows that
88
- would fight the host. Select the register per surface (embedded → flat;
89
- standalone → the brand/product register above) — it is a selector, not a fixed
90
- token set (no values vendored; the host's tokens win).
91
-
92
- ## Design Read — articulate intent before generating
93
-
94
- Before producing any design brief or making any style selection, emit one
95
- line that declares the design read:
96
-
97
- ```
98
- Reading this as: <page-kind> for <audience>, <vibe> language, leaning <design-system>.
99
- ```
100
-
101
- Examples:
102
- - `Reading this as: SaaS dashboard for internal ops teams, functional language, leaning Radix/shadcn.`
103
- - `Reading this as: marketing landing for B2C consumer product, playful editorial, leaning custom tokens.`
104
- - `Reading this as: admin panel for technical users, dense/utilitarian language, leaning data-grid primitives.`
105
-
106
- **If context is incomplete:** state so and proceed exploratory — *"Design context incomplete: no audience defined; proposing exploratory direction, expect revision after audience is clarified."* Do NOT block on missing context; do NOT prompt the user with a gate; state the gap and continue.
107
-
108
- ### Taste Dials — quantify, infer, emit
109
-
110
- If `DESIGN.md` declares `## Taste Dials`, use those values. Otherwise infer
111
- three 1–10 dials from the brief and append them to the Design Read line
112
- (`… · dials V/M/D = 6/3/4`) so the user can correct them; on confirmation,
113
- suggest persisting to `DESIGN.md` (via `design-system-capture`). Dials are a
114
- config, not a vibe — never re-infer when `DESIGN.md` already sets them
115
- (no drift across sessions).
116
-
117
- **Dial Inference Table** (brief signal → Variance / Motion / Density, 1–10):
118
-
119
- | Brief signal | V | M | D |
120
- |---|---|---|---|
121
- | minimal / calm / editorial / clean | 3–5 | 2–4 | 2–4 |
122
- | trust / regulated / public-sector / fintech | 3–4 | 2–3 | 4–6 |
123
- | default / unstated | 5–6 | 3–4 | 4–5 |
124
- | data-dense / dashboard / admin / cockpit | 4–6 | 2–3 | 7–9 |
125
- | bold / playful / expressive / awards / Dribbble | 8–10 | 7–10 | 3–5 |
126
-
127
- **Dial → downstream levers** (how a dial value changes generation):
128
-
129
- | Dial | Low (1–3) | High (8–10) |
130
- |---|---|---|
131
- | Variance | symmetric grids, one layout family | asymmetry, varied layout families, off-grid accents |
132
- | Motion | static / `prefers-reduced-motion`-first, opacity-only | choreographed scroll/stagger (still GPU-only, still reduced-motion alt) |
133
- | Density | generous whitespace, large spacing scale, few items/viewport | tight spacing scale, more information per viewport |
134
-
135
- Dials persist in `DESIGN.md`; the stack executors (`tailwind-engineer`,
136
- `react-shadcn-ui`, `blade-ui`, `flux`) read `DESIGN.md` and honour them.
137
-
138
- **Anti-Default Discipline — first-impulse check:** Before committing to any
139
- design direction, cross-check your first impulse against the current-generation
140
- tells in [`design-antipatterns.md`](../../../docs/guidelines/design-antipatterns.md)
141
- (§ Current-generation tells — the warm-editorial C5+T2+T7 signature and the
142
- previous-generation C1/C2 gradient) plus the L1/L2 layout defaults. If a tell
143
- was your first reach, name a different direction or explicitly justify why this
144
- brief genuinely calls for it. (The finalization cross-check against the full
145
- catalog is under *Anti-slop discipline* below.)
52
+ ## Section index — load on demand
53
+
54
+ Load the reference file whose sections the task needs — never all of them by default:
55
+
56
+ - [`references/context-and-registers.md`](references/context-and-registers.md) — Cross-task design memory — read DESIGN.md / PRODUCT.md first · Register — brand vs product · Design Read — articulate intent before generating
57
+ - [`references/integration-mapping.md`](references/integration-mapping.md) — `MASTER.md` + page overrides ↔ `state.ui_design` (mapping) · Grounding the review/polish a11y gate (charts + contrast) · Stack guidance (`--stack` axis) · Diagram-type routing — route on the verb · Interplay (who owns what)
146
58
 
147
59
  ## Honesty / real-system grounding
148
60
 
@@ -229,51 +141,6 @@ pairings: query `https://fonts.google.com/specimen/<Family>` (or the
229
141
  `webfonts` API) for metadata, OR propose the nearest curated pairing and
230
142
  say why. Never invent pairing metadata.
231
143
 
232
- ## `MASTER.md` + page overrides ↔ `state.ui_design` (mapping)
233
-
234
- The upstream cross-session memory pattern maps onto our delivery state:
235
-
236
- | Upstream artifact | Our state | Notes |
237
- |---|---|---|
238
- | `design-system/<project>/MASTER.md` | `state.ui_design` (project-level brief: style, tokens, typography, anti-patterns) | The state is the source of truth during a run. |
239
- | `design-system/<project>/pages/<page>.md` | per-page override entries inside `state.ui_design` (e.g. `pages.<page>` dict) | Page rules override project rules for that page only. |
240
-
241
- File persistence stays **opt-in** (`ground … --persist <dir>`) and writes
242
- under the consumer's project as a durable artifact for multi-session
243
- consistency; on a fresh session, re-hydrate `state.ui_design` from
244
- `MASTER.md` + the page file before re-running `design`.
245
-
246
- ## Grounding the review/polish a11y gate (charts + contrast)
247
-
248
- The `review`/`polish` steps gate on `state.ui_review.a11y`. Ground two
249
- finding classes instead of ad-hoc judgment:
250
-
251
- - **Chart-type findings** — the grounding CLI (`ground` via
252
- ./scripts-run) — `…/ground search --manifest … --domain
253
- chart "<data shape>"` → `Accessibility Grade`, `A11y Fallback`,
254
- `Color Guidance` columns justify "wrong chart type / missing colorblind
255
- fallback" findings with a citable row.
256
- - **Contrast findings** — `--domain color "<product>"` returns the
257
- WCAG-adjusted token set; a finding that a hex pair deviates from the
258
- adopted set cites the row instead of eyeballing ratios. Auditing
259
- *method* stays with [`accessibility-auditor`](../accessibility-auditor/SKILL.md).
260
-
261
- ## Stack guidance (`--stack` axis)
262
-
263
- Per-framework Do/Don't corpora (16 stacks) ride the same manifest:
264
-
265
- ```bash
266
- ./scripts-run <skills-root>/corpus-grounding/scripts/ground search \
267
- --manifest <skills-root>/design-intelligence/data/manifest.json \
268
- --stack react "list rerender memo" [--filter "Severity=HIGH"]
269
- ```
270
-
271
- Stack executors ([`blade-ui`](../blade-ui/SKILL.md),
272
- [`livewire`](../livewire/SKILL.md), [`flux`](../flux/SKILL.md),
273
- [`react-shadcn-ui`](../react-shadcn-ui/SKILL.md),
274
- [`tailwind-engineer`](../tailwind-engineer/SKILL.md)) pull idiomatic
275
- guidance + docs URLs from here instead of memory.
276
-
277
144
  ## Output format
278
145
 
279
146
  1. Grounded brief candidates per `state.ui_design` slot (layout,
@@ -294,47 +161,6 @@ guidance + docs URLs from here instead of memory.
294
161
  already covers — audit findings outrank corpus suggestions.
295
162
  - Do NOT hide low confidence — the user signs off on the gaps too.
296
163
 
297
- ## Diagram-type routing — route on the verb
298
-
299
- Choose a visualization by the *intent verb*, not the noun. Count the nouns
300
- before you draw (input-complexity triage): 1–2 → inline prose or a single
301
- shape; 3–7 → one diagram; 8+ → split or summarize, never one dense picture.
302
-
303
- | The user asks… | Intent | Draw |
304
- |---|---|---|
305
- | "how does X **work** / flow" | illustrative (intuition) | flowchart / sequence — illustrative default |
306
- | "what is X's **architecture** / structure" | reference (structural) | structural diagram (boxes + typed edges) |
307
- | a **cycle** / loop / lifecycle | — | a **stepper widget**, never a hand-drawn ring |
308
- | a **DB schema / ERD** / entity relations | — | **mermaid**, never hand-placed SVG |
309
-
310
- ### Geometric pre-checks (run BEFORE finalizing an SVG/diagram)
311
-
312
- Ranked by failure rate — procedures, not constants:
313
-
314
- 1. **viewBox safety** — compute the lowest + rightmost element (plus a buffer)
315
- and set the viewBox from that; never assume the default fits.
316
- 2. **arrow-through-box trace** — trace every arrow's path and confirm it does
317
- not cross through an unrelated box before drawing it.
318
- 3. **box-width-from-longest-label** — size each box from its longest label
319
- before placing it, so text never overflows.
320
-
321
- (Reference-only: any color/easing/frame values come from the consumer's tokens
322
- or a maintained upstream — this skill vendors no drawn-asset corpus.)
323
-
324
- ## Interplay (who owns what)
325
-
326
- | Concern | Owner |
327
- |---|---|
328
- | What already exists (components, tokens) | [`existing-ui-audit`](../existing-ui-audit/SKILL.md) — mandatory pre-step; audit findings outrank corpus suggestions |
329
- | What to build (grounded selection) | **this skill** |
330
- | Stack-agnostic heuristics + flow | [`fe-design`](../fe-design/SKILL.md) — invokes this skill for grounding |
331
- | Orchestration gates + locks | `directives/ui/{design,review,polish}.ts` — never import the engine |
332
- | WCAG audit method | [`accessibility-auditor`](../accessibility-auditor/SKILL.md) |
333
- | Token authoring | [`design-tokens`](../design-tokens/SKILL.md) |
334
- | Lo-fi structure exploration (pre-selection) | [`wireframe`](../wireframe/SKILL.md) — disposable greyscale variants |
335
- | Multiple hi-fi options (post-selection) | [`design-variations`](../design-variations/SKILL.md) — grounds each variation via this skill |
336
- | Fixed-canvas slide decks | [`html-deck`](../html-deck/SKILL.md) — own medium, still corpus-grounded |
337
-
338
164
  ## Gotchas
339
165
 
340
166
  - Corpus grounds **pre-action selection** — do not use it as mid-task
@@ -0,0 +1,100 @@
1
+ # design-intelligence — context and registers
2
+
3
+ > Section-level entry point of the `design-intelligence` skill (progressive
4
+ > disclosure, 2026-08-04). Content moved VERBATIM from SKILL.md —
5
+ > load this file when the section index in SKILL.md routes here.
6
+
7
+ ## Cross-task design memory — read DESIGN.md / PRODUCT.md first
8
+
9
+ Before running the corpus grounding or producing any design brief, check
10
+ the project root for `DESIGN.md` and/or `PRODUCT.md` (written by
11
+ `design-system-capture`). If they exist:
12
+
13
+ 1. Read `DESIGN.md` — apply its captured visual decisions (radius, shadows,
14
+ motion, spacing) as **project constraints** that take precedence over
15
+ corpus suggestions. The corpus fills gaps; DESIGN.md overrides.
16
+ 2. Read `PRODUCT.md` — note interaction patterns that affect the design
17
+ (e.g., destructive-action policy, empty-state approach) so the brief
18
+ is consistent with existing product conventions.
19
+ 3. After generating the design brief: if a decision was made that isn't yet
20
+ in DESIGN.md (e.g., chose a specific shadow for a new elevated surface),
21
+ flag it for capture: *"Suggest adding to DESIGN.md: elevated surface shadow = …"*
22
+
23
+ Boundary vs `brand-to-tokens`/`.tokens.json`:
24
+ - `.tokens.json` = primitive definitions (gray-700 = #374151)
25
+ - `DESIGN.md` = usage decisions (elevated surfaces use the gray-700 shadow, 8px radius)
26
+ Both are consumed; DESIGN.md takes precedence for usage questions.
27
+
28
+ ## Register — brand vs product
29
+
30
+ Determine the design register before grounding (see
31
+ [`docs/guidelines/design-modes.md`](../../../../docs/guidelines/design-modes.md)):
32
+ **brand mode** ("the impression IS the product" — marketing, landing, consumer
33
+ first-impression) prioritizes distinctive selection; **product mode** ("design
34
+ serves the task" — dashboard, admin, workflow) prioritizes earned familiarity
35
+ and accessibility. The register changes which corpus selections are appropriate
36
+ (distinctive palette/typography in brand mode; predictable, semantic in product
37
+ mode). State the register in the Design Read line below.
38
+
39
+ **Embedded vs standalone (a third discriminator).** UI **embedded inside a host
40
+ surface** — a widget in a slide, a card in a chat, a panel in someone else's
41
+ app — follows a **flatter charter** than a greenfield standalone page:
42
+ restrained weights, hairline borders, no atmospherics/gradients/shadows that
43
+ would fight the host. Select the register per surface (embedded → flat;
44
+ standalone → the brand/product register above) — it is a selector, not a fixed
45
+ token set (no values vendored; the host's tokens win).
46
+
47
+ ## Design Read — articulate intent before generating
48
+
49
+ Before producing any design brief or making any style selection, emit one
50
+ line that declares the design read:
51
+
52
+ ```
53
+ Reading this as: <page-kind> for <audience>, <vibe> language, leaning <design-system>.
54
+ ```
55
+
56
+ Examples:
57
+ - `Reading this as: SaaS dashboard for internal ops teams, functional language, leaning Radix/shadcn.`
58
+ - `Reading this as: marketing landing for B2C consumer product, playful editorial, leaning custom tokens.`
59
+ - `Reading this as: admin panel for technical users, dense/utilitarian language, leaning data-grid primitives.`
60
+
61
+ **If context is incomplete:** state so and proceed exploratory — *"Design context incomplete: no audience defined; proposing exploratory direction, expect revision after audience is clarified."* Do NOT block on missing context; do NOT prompt the user with a gate; state the gap and continue.
62
+
63
+ ### Taste Dials — quantify, infer, emit
64
+
65
+ If `DESIGN.md` declares `## Taste Dials`, use those values. Otherwise infer
66
+ three 1–10 dials from the brief and append them to the Design Read line
67
+ (`… · dials V/M/D = 6/3/4`) so the user can correct them; on confirmation,
68
+ suggest persisting to `DESIGN.md` (via `design-system-capture`). Dials are a
69
+ config, not a vibe — never re-infer when `DESIGN.md` already sets them
70
+ (no drift across sessions).
71
+
72
+ **Dial Inference Table** (brief signal → Variance / Motion / Density, 1–10):
73
+
74
+ | Brief signal | V | M | D |
75
+ |---|---|---|---|
76
+ | minimal / calm / editorial / clean | 3–5 | 2–4 | 2–4 |
77
+ | trust / regulated / public-sector / fintech | 3–4 | 2–3 | 4–6 |
78
+ | default / unstated | 5–6 | 3–4 | 4–5 |
79
+ | data-dense / dashboard / admin / cockpit | 4–6 | 2–3 | 7–9 |
80
+ | bold / playful / expressive / awards / Dribbble | 8–10 | 7–10 | 3–5 |
81
+
82
+ **Dial → downstream levers** (how a dial value changes generation):
83
+
84
+ | Dial | Low (1–3) | High (8–10) |
85
+ |---|---|---|
86
+ | Variance | symmetric grids, one layout family | asymmetry, varied layout families, off-grid accents |
87
+ | Motion | static / `prefers-reduced-motion`-first, opacity-only | choreographed scroll/stagger (still GPU-only, still reduced-motion alt) |
88
+ | Density | generous whitespace, large spacing scale, few items/viewport | tight spacing scale, more information per viewport |
89
+
90
+ Dials persist in `DESIGN.md`; the stack executors (`tailwind-engineer`,
91
+ `react-shadcn-ui`, `blade-ui`, `flux`) read `DESIGN.md` and honour them.
92
+
93
+ **Anti-Default Discipline — first-impulse check:** Before committing to any
94
+ design direction, cross-check your first impulse against the current-generation
95
+ tells in [`design-antipatterns.md`](../../../../docs/guidelines/design-antipatterns.md)
96
+ (§ Current-generation tells — the warm-editorial C5+T2+T7 signature and the
97
+ previous-generation C1/C2 gradient) plus the L1/L2 layout defaults. If a tell
98
+ was your first reach, name a different direction or explicitly justify why this
99
+ brief genuinely calls for it. (The finalization cross-check against the full
100
+ catalog is under *Anti-slop discipline* below.)
@@ -0,0 +1,91 @@
1
+ # design-intelligence — integration mapping
2
+
3
+ > Section-level entry point of the `design-intelligence` skill (progressive
4
+ > disclosure, 2026-08-04). Content moved VERBATIM from SKILL.md —
5
+ > load this file when the section index in SKILL.md routes here.
6
+
7
+ ## `MASTER.md` + page overrides ↔ `state.ui_design` (mapping)
8
+
9
+ The upstream cross-session memory pattern maps onto our delivery state:
10
+
11
+ | Upstream artifact | Our state | Notes |
12
+ |---|---|---|
13
+ | `design-system/<project>/MASTER.md` | `state.ui_design` (project-level brief: style, tokens, typography, anti-patterns) | The state is the source of truth during a run. |
14
+ | `design-system/<project>/pages/<page>.md` | per-page override entries inside `state.ui_design` (e.g. `pages.<page>` dict) | Page rules override project rules for that page only. |
15
+
16
+ File persistence stays **opt-in** (`ground … --persist <dir>`) and writes
17
+ under the consumer's project as a durable artifact for multi-session
18
+ consistency; on a fresh session, re-hydrate `state.ui_design` from
19
+ `MASTER.md` + the page file before re-running `design`.
20
+
21
+ ## Grounding the review/polish a11y gate (charts + contrast)
22
+
23
+ The `review`/`polish` steps gate on `state.ui_review.a11y`. Ground two
24
+ finding classes instead of ad-hoc judgment:
25
+
26
+ - **Chart-type findings** — the grounding CLI (`ground` via
27
+ ./scripts-run) — `…/ground search --manifest … --domain
28
+ chart "<data shape>"` → `Accessibility Grade`, `A11y Fallback`,
29
+ `Color Guidance` columns justify "wrong chart type / missing colorblind
30
+ fallback" findings with a citable row.
31
+ - **Contrast findings** — `--domain color "<product>"` returns the
32
+ WCAG-adjusted token set; a finding that a hex pair deviates from the
33
+ adopted set cites the row instead of eyeballing ratios. Auditing
34
+ *method* stays with [`accessibility-auditor`](../accessibility-auditor/SKILL.md).
35
+
36
+ ## Stack guidance (`--stack` axis)
37
+
38
+ Per-framework Do/Don't corpora (16 stacks) ride the same manifest:
39
+
40
+ ```bash
41
+ ./scripts-run <skills-root>/corpus-grounding/scripts/ground search \
42
+ --manifest <skills-root>/design-intelligence/data/manifest.json \
43
+ --stack react "list rerender memo" [--filter "Severity=HIGH"]
44
+ ```
45
+
46
+ Stack executors ([`blade-ui`](../blade-ui/SKILL.md),
47
+ [`livewire`](../livewire/SKILL.md), [`flux`](../flux/SKILL.md),
48
+ [`react-shadcn-ui`](../react-shadcn-ui/SKILL.md),
49
+ [`tailwind-engineer`](../tailwind-engineer/SKILL.md)) pull idiomatic
50
+ guidance + docs URLs from here instead of memory.
51
+
52
+ ## Diagram-type routing — route on the verb
53
+
54
+ Choose a visualization by the *intent verb*, not the noun. Count the nouns
55
+ before you draw (input-complexity triage): 1–2 → inline prose or a single
56
+ shape; 3–7 → one diagram; 8+ → split or summarize, never one dense picture.
57
+
58
+ | The user asks… | Intent | Draw |
59
+ |---|---|---|
60
+ | "how does X **work** / flow" | illustrative (intuition) | flowchart / sequence — illustrative default |
61
+ | "what is X's **architecture** / structure" | reference (structural) | structural diagram (boxes + typed edges) |
62
+ | a **cycle** / loop / lifecycle | — | a **stepper widget**, never a hand-drawn ring |
63
+ | a **DB schema / ERD** / entity relations | — | **mermaid**, never hand-placed SVG |
64
+
65
+ ### Geometric pre-checks (run BEFORE finalizing an SVG/diagram)
66
+
67
+ Ranked by failure rate — procedures, not constants:
68
+
69
+ 1. **viewBox safety** — compute the lowest + rightmost element (plus a buffer)
70
+ and set the viewBox from that; never assume the default fits.
71
+ 2. **arrow-through-box trace** — trace every arrow's path and confirm it does
72
+ not cross through an unrelated box before drawing it.
73
+ 3. **box-width-from-longest-label** — size each box from its longest label
74
+ before placing it, so text never overflows.
75
+
76
+ (Reference-only: any color/easing/frame values come from the consumer's tokens
77
+ or a maintained upstream — this skill vendors no drawn-asset corpus.)
78
+
79
+ ## Interplay (who owns what)
80
+
81
+ | Concern | Owner |
82
+ |---|---|
83
+ | What already exists (components, tokens) | [`existing-ui-audit`](../existing-ui-audit/SKILL.md) — mandatory pre-step; audit findings outrank corpus suggestions |
84
+ | What to build (grounded selection) | **this skill** |
85
+ | Stack-agnostic heuristics + flow | [`fe-design`](../fe-design/SKILL.md) — invokes this skill for grounding |
86
+ | Orchestration gates + locks | `directives/ui/{design,review,polish}.ts` — never import the engine |
87
+ | WCAG audit method | [`accessibility-auditor`](../accessibility-auditor/SKILL.md) |
88
+ | Token authoring | [`design-tokens`](../design-tokens/SKILL.md) |
89
+ | Lo-fi structure exploration (pre-selection) | [`wireframe`](../wireframe/SKILL.md) — disposable greyscale variants |
90
+ | Multiple hi-fi options (post-selection) | [`design-variations`](../design-variations/SKILL.md) — grounds each variation via this skill |
91
+ | Fixed-canvas slide decks | [`html-deck`](../html-deck/SKILL.md) — own medium, still corpus-grounded |