@hegemonart/get-design-done 1.28.0 → 1.28.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +78 -0
  4. package/SKILL.md +1 -1
  5. package/hooks/gdd-decision-injector.js +149 -3
  6. package/package.json +1 -1
  7. package/reference/adr-format.md +96 -0
  8. package/reference/apply-reflections-procedure.md +68 -0
  9. package/reference/architecture-vocabulary.md +102 -0
  10. package/reference/cache-policy.md +126 -0
  11. package/reference/compare-rubric.md +171 -0
  12. package/reference/connections-onboarding.md +417 -0
  13. package/reference/context-md-format.md +106 -0
  14. package/reference/darkmode-audit-procedure.md +258 -0
  15. package/reference/debug-feedback-loops.md +119 -0
  16. package/reference/design-procedure.md +304 -0
  17. package/reference/discover-procedure.md +204 -0
  18. package/reference/explore-procedure.md +267 -0
  19. package/reference/health-mcp-detection.md +44 -0
  20. package/reference/health-skill-length-report.md +69 -0
  21. package/reference/heuristics.md +84 -0
  22. package/reference/milestone-completeness-rubric.md +87 -0
  23. package/reference/peer-cli-protocol.md +161 -0
  24. package/reference/plan-procedure.md +278 -0
  25. package/reference/registry.json +169 -1
  26. package/reference/registry.schema.json +1 -1
  27. package/reference/router-rules.md +84 -0
  28. package/reference/scan-procedure.md +731 -0
  29. package/reference/shared-preamble.md +78 -6
  30. package/reference/skill-authoring-contract.md +128 -0
  31. package/reference/start-procedure.md +115 -0
  32. package/reference/style-doc-procedure.md +150 -0
  33. package/reference/threat-modeling.md +101 -0
  34. package/reference/verify-procedure.md +512 -0
  35. package/scripts/validate-skill-length.cjs +283 -0
  36. package/skills/add-backlog/SKILL.md +1 -0
  37. package/skills/analyze-dependencies/SKILL.md +33 -122
  38. package/skills/apply-reflections/SKILL.md +1 -40
  39. package/skills/audit/SKILL.md +3 -1
  40. package/skills/bandit-status/SKILL.md +31 -66
  41. package/skills/benchmark/SKILL.md +15 -55
  42. package/skills/brief/SKILL.md +12 -1
  43. package/skills/cache-manager/SKILL.md +3 -57
  44. package/skills/check-update/SKILL.md +38 -75
  45. package/skills/compare/SKILL.md +29 -269
  46. package/skills/complete-cycle/SKILL.md +1 -1
  47. package/skills/connections/SKILL.md +21 -427
  48. package/skills/continue/SKILL.md +1 -0
  49. package/skills/darkmode/SKILL.md +32 -287
  50. package/skills/debug/SKILL.md +11 -8
  51. package/skills/design/SKILL.md +27 -245
  52. package/skills/discover/SKILL.md +26 -133
  53. package/skills/discuss/SKILL.md +18 -2
  54. package/skills/explore/SKILL.md +40 -205
  55. package/skills/fast/SKILL.md +1 -0
  56. package/skills/figma-write/SKILL.md +2 -2
  57. package/skills/health/SKILL.md +11 -33
  58. package/skills/help/SKILL.md +1 -0
  59. package/skills/list-assumptions/SKILL.md +1 -0
  60. package/skills/map/SKILL.md +8 -31
  61. package/skills/new-cycle/SKILL.md +3 -1
  62. package/skills/next/SKILL.md +1 -0
  63. package/skills/note/SKILL.md +1 -0
  64. package/skills/optimize/SKILL.md +21 -44
  65. package/skills/pause/SKILL.md +1 -0
  66. package/skills/peer-cli-add/SKILL.md +26 -108
  67. package/skills/peer-cli-customize/SKILL.md +22 -42
  68. package/skills/peers/SKILL.md +33 -57
  69. package/skills/plan/SKILL.md +33 -220
  70. package/skills/plant-seed/SKILL.md +1 -0
  71. package/skills/pr-branch/SKILL.md +1 -0
  72. package/skills/progress/SKILL.md +1 -7
  73. package/skills/quality-gate/SKILL.md +34 -166
  74. package/skills/quick/SKILL.md +1 -0
  75. package/skills/reapply-patches/SKILL.md +1 -0
  76. package/skills/recall/SKILL.md +1 -0
  77. package/skills/resume/SKILL.md +1 -0
  78. package/skills/review-backlog/SKILL.md +1 -0
  79. package/skills/router/SKILL.md +3 -59
  80. package/skills/scan/SKILL.md +36 -675
  81. package/skills/settings/SKILL.md +1 -0
  82. package/skills/ship/SKILL.md +1 -0
  83. package/skills/sketch/SKILL.md +1 -1
  84. package/skills/sketch-wrap-up/SKILL.md +13 -54
  85. package/skills/spike/SKILL.md +1 -1
  86. package/skills/spike-wrap-up/SKILL.md +12 -46
  87. package/skills/start/SKILL.md +13 -112
  88. package/skills/stats/SKILL.md +1 -0
  89. package/skills/style/SKILL.md +18 -140
  90. package/skills/synthesize/SKILL.md +1 -0
  91. package/skills/timeline/SKILL.md +1 -0
  92. package/skills/todo/SKILL.md +1 -0
  93. package/skills/turn-closeout/SKILL.md +36 -56
  94. package/skills/undo/SKILL.md +1 -0
  95. package/skills/update/SKILL.md +1 -0
  96. package/skills/verify/SKILL.md +42 -457
  97. package/skills/warm-cache/SKILL.md +3 -35
  98. package/skills/zoom-out/SKILL.md +26 -0
@@ -0,0 +1,204 @@
1
+ ---
2
+ name: discover-procedure
3
+ type: meta-rules
4
+ version: 1.0.0
5
+ phase: 28.5
6
+ tags: [discover, procedure, extracted, pipeline-stage, connection-probe, design-context-builder]
7
+ last_updated: 2026-05-18
8
+ ---
9
+
10
+ Source: extracted from `skills/discover/SKILL.md` (Phase 28.5 rework — D-10 extract-then-link).
11
+ The skill's load-bearing workflow stays in `../skills/discover/SKILL.md`; this file holds the
12
+ detail the agent reaches for when executing a specific step (state integration, three
13
+ connection probes, design-context-builder + design-context-checker agent prompts, lazy gate
14
+ prompt, auto-mode CSS detection).
15
+
16
+ # Discover Procedure
17
+
18
+ Detailed procedure for the get-design-done `discover` Stage 1.5 orchestrator. Companion to
19
+ `../skills/discover/SKILL.md`. Read this file when executing a specific discover step.
20
+
21
+ ---
22
+
23
+ ## State Integration
24
+
25
+ 1. Read `.design/STATE.md`.
26
+ - If missing: create minimal skeleton from `reference/STATE-TEMPLATE.md` with stage=discover, status=in_progress, task_progress=0/1, and log warning: "STATE.md not found — created fresh. If this is a resumed session, run /get-design-done:scan first."
27
+ - If present and stage==discover and status==in_progress: RESUME — continue existing interview; do not reset.
28
+ - Otherwise: normal transition — set frontmatter stage=discover, <position> stage=discover, status=in_progress, task_progress=0/1.
29
+ 2. **Probe connection availability** — ToolSearch runs FIRST because MCP tools may be in the deferred tool set. This is the canonical probe pattern (spec lives in `connections/connections.md`; copied inline because SKILL.md has no include mechanism — if the probe pattern changes, update all stages that copied it). See §Connection Probes below.
30
+ 3. Update last_checkpoint. Write STATE.md.
31
+
32
+ ---
33
+
34
+ ## Connection Probes
35
+
36
+ ### A — Figma probe (variant-agnostic)
37
+
38
+ ```
39
+ A1. ToolSearch({ query: "figma get_metadata use_figma", max_results: 10 })
40
+ A2. Parse tool names matching /^mcp__([^_]*figma[^_]*)__(get_metadata|use_figma)$/i
41
+ into read-capable and write-capable prefix sets.
42
+ A3. Empty read set -> figma: not_configured (skip all Figma paths)
43
+ One or more matches -> pick prefix via tiebreaker:
44
+ (1) both-sets > reads-only,
45
+ (2) `figma` > others,
46
+ (3) non-`figma-desktop` > desktop,
47
+ (4) alphabetical.
48
+ A4. Call {prefix}get_metadata:
49
+ Success -> figma: available (prefix=mcp__<prefix>__, writes=<true|false>)
50
+ Error -> figma: unavailable
51
+ ```
52
+
53
+ ### B — Refero probe (ToolSearch presence is sufficient — no tool call needed)
54
+
55
+ ```
56
+ B1. ToolSearch({ query: "refero", max_results: 5 })
57
+ B2. Empty result -> refero: not_configured
58
+ Non-empty -> refero: available
59
+ ```
60
+
61
+ ### C — Pinterest probe (ToolSearch-only, same pattern as Refero)
62
+
63
+ ```
64
+ C1. ToolSearch({ query: "mcp-pinterest", max_results: 5 })
65
+ C2. Empty result -> pinterest: not_configured
66
+ Non-empty -> pinterest: available
67
+ ```
68
+
69
+ No live `pinterest_search` call at probe time — ToolSearch presence is sufficient. The synthesizer makes the actual search calls.
70
+
71
+ After all probes (A, B, C), update `.design/STATE.md` `<connections>` with the results and continue. Downstream stages (design-context-builder) read `<connections>` from STATE.md rather than re-probing.
72
+
73
+ ---
74
+
75
+ ## Auto Mode
76
+
77
+ Auto Mode CSS detection (when `auto_mode: true` is passed to the builder):
78
+
79
+ 1. If tailwind.config.{js,cjs,mjs,ts} exists -> Tailwind-only project
80
+ - Skip CSS file grep
81
+ - Parse tailwind.config for color palette, spacing scale, font families
82
+ - Use tailwind.config values as the baseline style signal
83
+ 2. Else -> fall through to existing CSS file grep logic
84
+
85
+ ---
86
+
87
+ ## Step 1 — Spawn design-context-builder
88
+
89
+ ```
90
+ Task("design-context-builder", """
91
+ <required_reading>
92
+ @.design/STATE.md
93
+ @reference/audit-scoring.md
94
+ @reference/anti-patterns.md
95
+ </required_reading>
96
+
97
+ You are the design-context-builder agent. Auto-detect existing design system
98
+ state via grep/glob before asking questions. Interview the user ONLY for areas
99
+ where auto-detect returned no confident answer. Write .design/DESIGN-CONTEXT.md.
100
+
101
+ Baseline audit directory detection (ordered fallback chain):
102
+ 1. If src/ exists -> use src/
103
+ 2. Elif app/ exists -> use app/ (Next.js App Router)
104
+ 3. Elif pages/ exists -> use pages/ (Next.js Pages Router)
105
+ 4. Elif lib/ exists -> use lib/ (library-only projects)
106
+ 5. Else -> flag "layout unknown", skip baseline, note in DESIGN-CONTEXT.md
107
+
108
+ Common gray areas to probe during discovery (Area 7):
109
+ 1. font-change risk — switching type families when existing UI has body copy in a specific family. Ask: "Is the current body font intentional or inherited? OK to change?"
110
+ 2. token-layer introduction risk — adding CSS custom properties to a codebase that uses direct values. Ask: "Do you want design tokens (--primary, --surface) or inline values (hex, rgb)?"
111
+ 3. Component rebuild vs restyle — when to keep existing component, when to rebuild from scratch. Ask: "For <component>, restyle in place or rebuild?"
112
+
113
+ Context:
114
+ auto_mode: <true|false>
115
+
116
+ Output file: .design/DESIGN-CONTEXT.md
117
+ Emit `## CONTEXT COMPLETE` when done.
118
+ """)
119
+ ```
120
+
121
+ Wait for `## CONTEXT COMPLETE`. Update STATE.md task_progress = 0.5.
122
+
123
+ ---
124
+
125
+ ## Step 1.75 — Lazy gate: should design-context-checker run? (Plan 10.1-04, D-21)
126
+
127
+ Spawn the cheap Haiku gate before the full context-checker:
128
+
129
+ Task("design-context-checker-gate", """
130
+ <required_reading>
131
+ @.design/STATE.md
132
+ </required_reading>
133
+
134
+ You are the design-context-checker-gate.
135
+
136
+ Context:
137
+ diff_files: <git diff --name-only HEAD~1..HEAD>
138
+ diff_body: (not needed — single-file heuristic)
139
+ baseline_sha: <HEAD~1>
140
+
141
+ Apply the heuristic (DESIGN-CONTEXT.md in diff_files?). Emit JSON + `## GATE COMPLETE`.
142
+ """)
143
+
144
+ Wait for `## GATE COMPLETE`. Parse JSON:
145
+
146
+ - `spawn: false` -> append `lazy_skipped: true` telemetry row for `design-context-checker`, skip Step 2, set STATE.md `<position>` as if checker passed (rationale: DESIGN-CONTEXT.md didn't change, last validation still holds), emit `design-context-checker skipped — <rationale>`.
147
+ - `spawn: true` -> proceed to Step 2 as currently written.
148
+
149
+ **Note:** On first-run discover, the builder just wrote DESIGN-CONTEXT.md so the gate returns `spawn: true`. The gate meaningfully short-circuits only on re-runs where the builder made no changes.
150
+
151
+ **Parallel synthesizer note:** discover does not spawn parallel researchers in v1, so `skills/synthesize/` is not wired here. If future variants spawn N parallel interviewers/auto-detectors, wire synthesize between dispatch and collate as in `skills/map/` Step 3.5.
152
+
153
+ ---
154
+
155
+ ## Step 2 — Spawn design-context-checker
156
+
157
+ ```
158
+ Task("design-context-checker", """
159
+ <required_reading>
160
+ @.design/STATE.md
161
+ @.design/DESIGN-CONTEXT.md
162
+ </required_reading>
163
+
164
+ You are the design-context-checker agent. Validate DESIGN-CONTEXT.md across
165
+ 6 dimensions. Return APPROVED or BLOCKED with per-dimension verdicts.
166
+
167
+ Emit `## CONTEXT CHECK COMPLETE` when done.
168
+ """)
169
+ ```
170
+
171
+ Wait for `## CONTEXT CHECK COMPLETE`.
172
+
173
+ ---
174
+
175
+ ## Step 3 — Handle checker verdict
176
+
177
+ If APPROVED: proceed to state update.
178
+ If BLOCKED: present dimensions that BLOCKED to user, offer fix-and-retry loop (re-spawn builder with specific fix instructions). Do not proceed to planning.
179
+
180
+ ---
181
+
182
+ ## State Update (exit)
183
+
184
+ 1. Set <position> status=completed, task_progress=1/1.
185
+ 2. Set <timestamps> discover_completed_at=<ISO 8601 now>.
186
+ 3. Update last_checkpoint. Write STATE.md.
187
+
188
+ ---
189
+
190
+ ## After Writing
191
+
192
+ ```
193
+ === Discovery complete ===
194
+ Saved: .design/DESIGN-CONTEXT.md
195
+
196
+ Baseline score: [N]/100 ([grade])
197
+ Key issues: [top issue 1], [top issue 2], [top issue 3]
198
+
199
+ Next: /get-design-done:plan
200
+ -> Decomposes your context into executable design tasks.
201
+ ==========================
202
+ ```
203
+
204
+ Do not proceed to planning automatically unless `--auto` was passed.
@@ -0,0 +1,267 @@
1
+ ---
2
+ name: explore-procedure
3
+ type: meta-rules
4
+ version: 1.0.0
5
+ phase: 28.5
6
+ tags: [explore, procedure, extracted, pipeline-stage, connection-probe, design-interview, i18n]
7
+ last_updated: 2026-05-18
8
+ ---
9
+
10
+ Source: extracted from `skills/explore/SKILL.md` (Phase 28.5 rework — D-10 extract-then-link).
11
+ The skill's load-bearing workflow stays in `../skills/explore/SKILL.md`; this file holds the
12
+ detail the agent reaches for when executing a specific step (six connection probes, 21st.dev
13
+ prior-art check, inventory scan grep, design interview protocol, i18n probe, decision
14
+ recording).
15
+
16
+ # Explore Procedure
17
+
18
+ Detailed procedure for the get-design-done `explore` Stage 2 orchestrator. Companion to
19
+ `../skills/explore/SKILL.md`. Read this file when executing a specific step; the SKILL.md
20
+ keeps the load-bearing workflow + decision tree, this file holds the deep methodology.
21
+
22
+ ---
23
+
24
+ ## Stage entry
25
+
26
+ All STATE.md persistence in this skill goes through `gdd-state` MCP tools — no direct edits. The skill writes to `.design/STATE.md` (connections, decisions, progress, checkpoint) via those tools, and to plain design docs (DESIGN.md / DESIGN-DEBT.md / DESIGN-CONTEXT.md) via `Write`.
27
+
28
+ 1. Call `mcp__gdd_state__transition_stage` with `to: "explore"`.
29
+ - On success: proceed to probes.
30
+ - On gate failure: emit blockers to the user (do not advance). Each blocker is a line in the `error.context.blockers` array; print them verbatim.
31
+ 2. Call `mcp__gdd_state__get` with no arguments — snapshot the parsed state into a local `state` variable for downstream steps.
32
+
33
+ ---
34
+
35
+ ## Step 1 — Connection probe
36
+
37
+ Probe connection availability (the batched write lands at the end of this step — see "Commit probe results" below):
38
+
39
+ **A — Figma probe (variant-agnostic):**
40
+ ```
41
+ ToolSearch({ query: "figma get_metadata use_figma", max_results: 10 })
42
+ Parse tool names matching /^mcp__([^_]*figma[^_]*)__(get_metadata|use_figma)$/i
43
+ into read-capable and write-capable prefix sets.
44
+ Empty read set -> figma: not_configured
45
+ One+ matches -> pick prefix via tiebreaker:
46
+ (1) both-sets > reads-only,
47
+ (2) `figma` > others,
48
+ (3) non-`figma-desktop` > desktop,
49
+ (4) alphabetical.
50
+ Then call {prefix}get_metadata:
51
+ success -> figma: available (prefix=mcp__<prefix>__, writes=<true|false>)
52
+ error -> figma: unavailable
53
+ ```
54
+
55
+ **B — Refero probe:**
56
+ ```
57
+ ToolSearch({ query: "refero", max_results: 5 })
58
+ Empty -> refero: not_configured
59
+ Non-empty -> refero: available
60
+ ```
61
+
62
+ **C — 21st.dev probe:**
63
+ ```
64
+ ToolSearch({ query: "mcp__21st", max_results: 5 })
65
+ Empty -> 21st-dev: not_configured
66
+ Non-empty -> 21st-dev: available
67
+ ```
68
+
69
+ **D — Magic Patterns probe:**
70
+ ```
71
+ ToolSearch({ query: "mcp__magic_patterns", max_results: 5 })
72
+ Empty -> magic-patterns: not_configured
73
+ Non-empty -> magic-patterns: available
74
+ ```
75
+
76
+ **E — paper.design probe:**
77
+ ```
78
+ ToolSearch({ query: "mcp__paper", max_results: 5 })
79
+ Empty -> paper-design: not_configured
80
+ Non-empty -> call mcp__paper-design__get_selection; success -> available; error -> unavailable
81
+ ```
82
+
83
+ **F — pencil.dev probe (file-based):**
84
+ ```bash
85
+ find . -name "*.pen" -not -path "*/node_modules/*" 2>/dev/null | head -1
86
+ Empty -> pencil-dev: not_configured
87
+ Found -> pencil-dev: available
88
+ ```
89
+
90
+ ## Commit probe results
91
+
92
+ After all probes complete, commit results in a single call:
93
+
94
+ `mcp__gdd_state__probe_connections` with `probe_results` = an array of `{ name, status }` entries — one per probed connection. Example:
95
+
96
+ ```json
97
+ {
98
+ "probe_results": [
99
+ { "name": "figma", "status": "available" },
100
+ { "name": "refero", "status": "not_configured" },
101
+ { "name": "preview", "status": "unavailable" }
102
+ ]
103
+ }
104
+ ```
105
+
106
+ Unspecified connections keep their existing value. Do NOT issue multiple `probe_connections` calls — the tool is designed for a single batch write per stage.
107
+
108
+ ## Step 1.5 — 21st.dev Prior-Art Check (when 21st-dev: available)
109
+
110
+ If `state.connections.21st-dev === "not_configured"` (from the snapshot captured at stage entry): skip this step entirely.
111
+
112
+ When the explore stage identifies any greenfield component in scope (component name from BRIEF.md or user request that does not yet have an implementation file):
113
+
114
+ 1. `21st_magic_component_search(component_name, limit: 3)`
115
+ 2. Evaluate top result:
116
+ - **fit >= 80%**: add `<prior-art>` block to DESIGN.md:
117
+ ```xml
118
+ <prior-art source="21st.dev" component="<name>" fit="<score>%" id="<component_id>">
119
+ Recommendation: adopt — do not build custom. Confirm with design-executor.
120
+ </prior-art>
121
+ ```
122
+ - **fit < 80%**: note top candidate in DESIGN.md as a reference, proceed with custom build:
123
+ ```xml
124
+ <prior-art source="21st.dev" component="<name>" fit="<score>%" id="<component_id>">
125
+ Low fit — noted for reference. Building custom component.
126
+ </prior-art>
127
+ ```
128
+ 3. If `svgl_get_brand_logo` is available and explore scope includes brand logo assets: call `svgl_get_brand_logo(brand_name)` for each required brand asset; add SVG results to `.design/assets/` and note in DESIGN.md.
129
+
130
+ If no greenfield components in scope: skip this step.
131
+
132
+ ---
133
+
134
+ ## Step 2 — Inventory scan (unless `--skip-scan`)
135
+
136
+ **Map pre-check:** If `.design/map/` exists and all 5 files (`tokens.md`, `components.md`, `visual-hierarchy.md`, `a11y.md`, `motion.md`) are present AND fresher than `src/` (mtime), consume them as the inventory source and skip the grep pass. Otherwise proceed with grep below and, after Step 4, suggest running `/gdd:map` for richer parallel-scanned data on the next cycle.
137
+
138
+ **Parallelism decision (before any multi-agent spawn):**
139
+ 1. Read `.design/config.json` `parallelism` (or defaults from `reference/config-schema.md`).
140
+ 2. Apply rules from `reference/parallelism-rules.md` (hard -> soft).
141
+ 3. Record the verdict via `mcp__gdd_state__set_status` with a short status label (e.g., `status: "explore_parallel"` or `"explore_serial"`) carrying the stage/verdict/reason/agents payload.
142
+ 4. If verdict is `parallel`, dispatch via multiple `Task()` calls in one response; if `serial`, spawn sequentially.
143
+
144
+ Run the canonical scan grep/glob inventory (preserves PLAT-01/02 POSIX ERE patterns from Phase 1):
145
+
146
+ - **Component detection** — `Glob` for `**/*.{tsx,jsx,vue,svelte}`; count exports, identify shared UI primitives.
147
+ - **Color extraction** — `Grep` for hex (`#[0-9a-fA-F]{3,8}`), `rgb(`, `hsl(`, Tailwind arbitrary color classes; dedupe.
148
+ - **Typography scan** — Grep font-family declarations, Tailwind `font-*`, `text-*` size classes; identify type scale.
149
+ - **Motion scan** — Grep `transition`, `animate-`, `@keyframes`, `framer-motion` imports.
150
+ - **Token detection** — Check for `tailwind.config.{js,cjs,mjs,ts}`, CSS custom properties (`--*`), design-token JSON.
151
+ - **Layout detection** — Ordered fallback: `src/` -> `app/` -> `pages/` -> `lib/` -> unknown.
152
+
153
+ Write findings to:
154
+ - `.design/DESIGN.md` — current design system inventory + baseline score
155
+ - `.design/DESIGN-DEBT.md` — prioritized debt roadmap
156
+
157
+ Record scan progress: call `mcp__gdd_state__update_progress` with `task_progress: "<completed>/<total>"` to reflect the scan pass.
158
+
159
+ ### Step 2.x — i18n readiness probe (informational)
160
+
161
+ Phase 28 D-04 probe — 3-state classification, **informational only**. NO gate, NO blocking, NO required-action. Output appears as a single line in the explore report.
162
+
163
+ Classification logic (matches `./reference/i18n.md` §Explore Integration Spec):
164
+
165
+ ```txt
166
+ 1. Read package.json (dependencies + devDependencies).
167
+
168
+ 2. Check against library matrix:
169
+ react-intl, next-intl, i18next, vue-i18n, formatjs, lingui
170
+ >=1 library found in deps or devDeps -> state = "framework-managed"
171
+ -> STOP, emit line, exit probe.
172
+
173
+ 3. Else (no library):
174
+ grep -RE "Intl\.(DateTimeFormat|NumberFormat|PluralRules|RelativeTimeFormat|ListFormat|Collator|Segmenter)" src/
175
+ >=1 match -> state = "partial"
176
+ -> emit line, exit probe.
177
+
178
+ 4. Else: state = "none"
179
+ -> emit line, exit probe.
180
+ ```
181
+
182
+ Output line in explore report (single informational line, per D-04):
183
+
184
+ ```txt
185
+ Localization readiness: framework-managed | partial | none
186
+ ```
187
+
188
+ (Exactly one of the three values, single line.) A consumer downstream (a planning agent, a roadmap reviewer, the user) can act on the signal if a gap is meaningful for the project, but the probe itself never forces a step — surface signal, do not bolt on a new pillar (D-07 orthogonal-lens discipline).
189
+
190
+ ## Step 2.5 — Detect prior sketches and project-local conventions
191
+
192
+ **Sketches**: If `.design/sketches/` exists, list all sketch slugs — group by those with `WINNER.md` (completed wrap-ups) vs without (pending). Call `mcp__gdd_state__set_status` with a brief note (e.g., `status: "explore_sketches_present"`) so downstream stages see the history. Include the inventory in DESIGN.md under a "Prior Explorations" section.
193
+
194
+ **Project-local skills**: Read any `./.claude/skills/design-*-conventions.md` files if present. Include their content in DESIGN-CONTEXT.md under a `<project_conventions>` section — these are codified decisions from prior `/gdd:sketch-wrap-up` runs or manual edits, and they override defaults.
195
+
196
+ **Global skills**: If `~/.claude/gdd/global-skills/` exists and contains `.md` files (other than README.md), read them and prepend their content to the `<project_conventions>` section under a `<global_conventions>` sub-block. Global skills represent cross-project personal conventions. They inform but do not override project-local decisions — when a project-local D-XX decision conflicts with a global skill, the project-local decision wins.
197
+
198
+ ---
199
+
200
+ ## Step 3 — Design interview (unless `--skip-interview`)
201
+
202
+ **Run this inline — do NOT spawn `design-discussant` as a subagent.** Subagent UI tools (`AskUserQuestion`) only render the native picker when called from the top-level skill context; spawning a Task() degrades the interview to plain markdown in chat (broken in Claude Desktop).
203
+
204
+ ### 3.a — Pre-load context
205
+
206
+ Read in this order:
207
+ 1. `state.decisions` from the snapshot captured at stage entry — existing D-XX entries (do NOT re-ask anything covered). If the snapshot is stale, refresh by calling `mcp__gdd_state__get`.
208
+ 2. `.design/BRIEF.md` — problem statement, audience, constraints
209
+ 3. `.design/DESIGN.md` — auto-detected inventory from Step 2
210
+ 4. `.design/DESIGN-CONTEXT.md` if it exists — `<gray_areas>` block lists unresolved topics
211
+ 5. `./.claude/skills/design-*-conventions.md` if any — locked project conventions, treat as authoritative
212
+
213
+ If `state.connections` shows `figma: available`, read the resolved `prefix=` from the same entry and call `{prefix}get_variable_defs`, then draft tentative D-XX entries (mark `(tentative — confirm with user)`) before asking.
214
+
215
+ ### 3.b — Identify question set
216
+
217
+ Build the list of areas needing input. Skip any area already answered by an existing D-XX or covered by a project convention. Default coverage:
218
+
219
+ - Cycle goal / outcome that matters most
220
+ - Audience and primary use context
221
+ - Brand direction (only if no tokens detected in DESIGN.md)
222
+ - Color primitives (only if no palette detected)
223
+ - Typography scale (only if no type system detected)
224
+ - Spacing scale (only if no spacing tokens detected)
225
+ - Motion preferences (only if no motion patterns detected)
226
+ - Any `<gray_areas>` from DESIGN-CONTEXT.md
227
+
228
+ ### 3.c — Ask, one question at a time
229
+
230
+ For each area, call `AskUserQuestion` with a single focused question. Provide 4 concrete options plus "Other" / "Skip" where it helps. Do not batch questions into one call. Do not print the question as markdown — always go through the tool.
231
+
232
+ Reject generic answers ("modern", "clean", "professional"). If the answer is vague, ask one follow-up before recording.
233
+
234
+ ### 3.d — Record after each answer
235
+
236
+ After each confirmed answer:
237
+ 1. Call `mcp__gdd_state__add_decision` with the decision payload. The tool assigns the next `D-NN` id and persists atomically. Format the summary as:
238
+ ```
239
+ [Category] Decision summary — short rationale
240
+ ```
241
+ 2. Append one JSON line to `.design/learnings/question-quality.jsonl` (create if absent):
242
+ ```json
243
+ {"ts":"<iso>","question_id":"Q-NN","question_text":"<verbatim>","answer_summary":"<one sentence>","quality":"high|medium|low|skipped","evidence":"<why>","cycle":"<active-cycle-slug>"}
244
+ ```
245
+ Quality classification: `skipped` if user picked Skip / "doesn't matter"; `low` if < 10 words and not a specific value; `medium` if hedged ("maybe", "I think", "not sure"); `high` otherwise.
246
+ 3. `add_decision` commits incrementally — the decision survives a crash mid-interview without an explicit save step.
247
+
248
+ ### 3.e — Produce DESIGN-CONTEXT.md
249
+
250
+ When all questions are answered, write `.design/DESIGN-CONTEXT.md` summarizing the locked decisions, remaining gray areas, and any Figma-sourced tentatives that were confirmed or rejected. Set frontmatter `status: complete`.
251
+
252
+ ---
253
+
254
+ ## Step 4 — Close out explore
255
+
256
+ - If the synthesizer (or equivalent mapper batch) ran in Step 2, call `mcp__gdd_state__update_progress` with `task_progress: "<mappers-completed>/<mappers-total>"` and `status: "explore_mappers_done"` before advancing.
257
+ - Call `mcp__gdd_state__checkpoint` — bumps `frontmatter.last_checkpoint` + appends a timestamp entry.
258
+ - Stage advance to `plan` happens at the next stage's entry (the plan skill will transition from its own entry step); do not edit frontmatter directly from this skill.
259
+
260
+ ## After Writing
261
+
262
+ ```
263
+ === Explore complete ===
264
+ Saved: .design/DESIGN.md, .design/DESIGN-DEBT.md, .design/DESIGN-CONTEXT.md
265
+ Next: @get-design-done plan
266
+ =========================
267
+ ```
@@ -0,0 +1,44 @@
1
+ ---
2
+ name: health-mcp-detection
3
+ type: heuristic
4
+ version: 1.0.0
5
+ phase: 28.5
6
+ tags: [health, mcp, detection, gdd-mcp, registration-nudge]
7
+ last_updated: 2026-05-18
8
+ ---
9
+
10
+ # Health MCP-Registration Detection Procedure
11
+
12
+ Extracted from `skills/health/SKILL.md` per Phase 28.5 D-10 (extract-then-link, never delete content).
13
+ This file documents the canonical procedure for inspecting whether `gdd-mcp` (Phase 27.7+) is
14
+ registered with any installed harness and rendering a one-line status row after the health
15
+ table. The procedure is non-blocking by design: any failure path renders `unknown` rather
16
+ than crashing the skill.
17
+
18
+ ## Dismissal check
19
+
20
+ 1. Read `.design/config.json` (if present). Parse JSON inside a try/catch.
21
+ 2. If `config.mcp_nudge === false`, SKIP this step entirely (render nothing).
22
+ 3. On parse failure: default to `mcp_nudge=true` (show the row) — fail-safe per threat T-27.7-04-05.
23
+
24
+ ## Detection
25
+
26
+ 1. Read `.claude/settings.local.json` (or equivalent harness settings file) and inspect its `mcpServers` object — alternatively run `claude mcp list` / `codex mcp list` if a CLI is available (see fallback below).
27
+ 2. Preferred invocation via the install-lib: call `detectMcpRegistration()` from `scripts/lib/install/mcp-register.cjs`. Returns `{harnesses: [{harness, present, registered}], summary}`.
28
+
29
+ ## Row rendering
30
+
31
+ Based on the detection result, render exactly ONE of these row strings:
32
+
33
+ - When `claude` and `codex` both present + both registered:
34
+ `MCP server: registered with claude+codex`
35
+ - When only one harness is present and registered:
36
+ `MCP server: registered with claude` (or `MCP server: registered with codex`)
37
+ - When at least one harness is present but `gdd-mcp` is NOT in its registered list:
38
+ `MCP server: not registered (run: npx @hegemonart/get-design-done --register-mcp; dismiss: .design/config.json#mcp_nudge=false)`
39
+ - When neither harness CLI is found on PATH:
40
+ `MCP server: unknown (claude/codex CLI not found)`
41
+
42
+ ## Fallback (if `mcp-register.cjs` not yet shipped)
43
+
44
+ Skip this step silently with status `MCP server: unknown`. This step is non-blocking — failures here MUST NOT crash the SKILL.
@@ -0,0 +1,69 @@
1
+ # Health skill — skill-length report subsection
2
+
3
+ Phase 28.5-11 / D-11 reference. Read by `skills/health/SKILL.md` to render the
4
+ "Skill-length report" subsection after the standard health checks.
5
+
6
+ ## JSON shape (from `validate-skill-length.cjs --quiet --json`)
7
+
8
+ ```jsonc
9
+ {
10
+ "summary": {
11
+ "total": 70, // number of SKILL.md files under skills/
12
+ "clean": 70, // skills with 0 errors and 0 warnings
13
+ "warnings": 0, // skills with >=100 lines but <250 (D-01 warn band)
14
+ "blockers": 0 // skills with any block-level error (>=250 lines,
15
+ // missing frontmatter field, description out of
16
+ // range, disable-model-invocation non-whitelisted)
17
+ },
18
+ "skills": [
19
+ {
20
+ "name": "...", // skill folder name (matches skills/<name>/SKILL.md)
21
+ "path": "...", // absolute path to the file on disk
22
+ "lines": 0, // wc -l semantics
23
+ "descriptionLength": 0, // length of frontmatter.description string
24
+ "hasRequiredFields": true,
25
+ "level": "clean", // "clean" | "warn" | "block"
26
+ "errors": [{ "code": "...", "message": "..." }],
27
+ "warnings": [{ "code": "...", "message": "..." }],
28
+ "reasons": ["..."] // human-readable summary lines
29
+ }
30
+ ]
31
+ }
32
+ ```
33
+
34
+ ## Render contract
35
+
36
+ The health skill prints two lines after the existing checks table:
37
+
38
+ ```
39
+ Skill-length: <total> total | <clean> clean | <warnings> warn (>=100) | <blockers> block (>=250)
40
+ All skills within contract.
41
+ ```
42
+
43
+ If `summary.blockers > 0`, replace the second line with one indented row per
44
+ blocker entry (skills where `level === "block"`):
45
+
46
+ ```
47
+ Skill-length: 70 total | 67 clean | 2 warn (>=100) | 1 block (>=250)
48
+ - <name> (<lines> lines)
49
+ ```
50
+
51
+ ## Thresholds (D-01)
52
+
53
+ - `warn >=100` — skill flagged as advisory; CI emits `::warning::` annotation
54
+ but does not fail the build.
55
+ - `block >=250` — skill flagged as blocker; CI emits `::error::` and fails
56
+ the build via exit code 2.
57
+
58
+ ## Strict description-format (D-02)
59
+
60
+ `STRICT_DESCRIPTION=1` / `--strict-description` is OFF by default. Phase 33
61
+ will graduate the strict `<what>. Use when <triggers>.` regex from advisory
62
+ to hard-block based on A/B evidence at
63
+ `.design/research/description-format-ab.md`.
64
+
65
+ ## Cross-link from health
66
+
67
+ - `skills/health/SKILL.md` — emits the report after the main checks table.
68
+ - `scripts/validate-skill-length.cjs` — provides the JSON.
69
+ - `tests/phase-28.5-baseline.test.cjs` — locks the post-rework distribution.
@@ -269,3 +269,87 @@ For each NNG heuristic (H-01 through H-10), rate 0–4:
269
269
  - 75–89: Good, minor issues
270
270
  - 60–74: Acceptable, improvement needed
271
271
  - <60: Significant UX problems, redesign required
272
+
273
+ ---
274
+
275
+ ## Dependency-cycle detection
276
+
277
+ Algorithm consumed by `skills/analyze-dependencies/SKILL.md` Analysis 4. Detects cycles
278
+ in the `@`-reference graph (File A → File B → File A) by DFS with path-tracking.
279
+
280
+ **Input:** adjacency map `{from: [to, ...]}` built from `.design/intel/graph.json#edges`.
281
+
282
+ **Algorithm:**
283
+
284
+ ```text
285
+ visited = {}; path = []; cycles = []
286
+ function dfs(node):
287
+ if node in path:
288
+ cycle_start = path.index(node)
289
+ cycles.append(path[cycle_start:] + [node])
290
+ return
291
+ if node in visited: return
292
+ visited.add(node); path.append(node)
293
+ for neighbor in adjacency[node]: dfs(neighbor)
294
+ path.pop()
295
+ ```
296
+
297
+ **Bias notes:** the DFS visits each node at most once per traversal, so duplicate cycles
298
+ across multiple entry points are deduped by the `visited` guard. The `path.index(node)`
299
+ slice captures only the cycle suffix; nodes before the entry point are not part of the
300
+ cycle. Pre-existing acyclic chains stay invisible — only back-edges surface.
301
+
302
+ ---
303
+
304
+ ## Version-cadence
305
+
306
+ Reference for `skills/check-update/SKILL.md` and `skills/complete-cycle/SKILL.md` when
307
+ comparing versions across releases.
308
+
309
+ **Delta classification** (consumer of `.design/update-cache.json#delta`):
310
+
311
+ | Delta | Meaning | When |
312
+ |-------|---------|------|
313
+ | `major` | Breaking change | `current.major < latest.major` |
314
+ | `minor` | New features | Major same; `current.minor < latest.minor` |
315
+ | `patch` | Bug fixes only | Major + minor same; `current.patch < latest.patch` |
316
+ | `off-cadence` | Insertion-style version (`.5`, `.6`, `.7`) | Listed in `OFF_CADENCE_VERSIONS` in `tests/semver-compare.test.cjs` |
317
+ | `none` | Same version | All segments equal |
318
+
319
+ **Off-cadence handling:** versions like `v1.14.5`, `v1.27.5`, `v1.28.5` slot between regular
320
+ minor bumps. They register via `OFF_CADENCE_VERSIONS.add('<version>')` in
321
+ `tests/semver-compare.test.cjs`. The semver-compare test treats them as if they had a
322
+ canonical predecessor (`v1.28.5` after `v1.28.0`, not `v1.28.4`).
323
+
324
+ **Preview-suffix trap:** model IDs with `-preview` (`gpt-5-preview` vs `gpt-5`) drift — today's
325
+ preview is tomorrow's GA. Tooling MUST store the parent name in `provider_model_id` and treat
326
+ the suffix as decorative. See `./peer-cli-protocol.md` for the peer-CLI-side context.
327
+
328
+ ---
329
+
330
+ ## Optimization rules
331
+
332
+ Reference catalog for `skills/optimize/SKILL.md`. Four deterministic rules; rule-based
333
+ analysis applied in order. Each rule inspects per-agent aggregates from
334
+ `.design/agent-metrics.json` and emits zero or more rows to the recommendations table.
335
+
336
+ **R1 — Low cache hit rate.**
337
+ - *Condition:* `total_spawns >= --min-spawns` AND `cache_hit_rate < 0.20`.
338
+ - *Emit:* `"Consider batching tasks for agent {agent} — cache hit rate is {rate*100}%. Investigate cache-aligned ordering (see reference/shared-preamble.md) and whether input paths can be normalized."`
339
+ - *Proposed action:* Batch similar tasks; confirm shared-preamble import ordering.
340
+
341
+ **R2 — Expensive and rarely lazy-skipped.**
342
+ - *Condition:* `total_cost_usd > 0.50` AND `lazy_skip_rate < 0.10`.
343
+ - *Emit:* `"Agent {agent} is expensive (${cost}) and rarely skipped ({rate*100}% lazy-skip). Consider adding a lazy gate heuristic at agents/{agent}-gate.md (see plan 10.1-04 pattern)."`
344
+ - *Proposed action:* Add lazy-gate agent.
345
+
346
+ **R3 — Tier override churn.**
347
+ - *Condition:* Multiple telemetry rows show recorded `tier` differing from frontmatter `default-tier` (e.g., frontmatter `opus` but measured rows consistently `haiku` from budget.json override or soft-threshold downgrade).
348
+ - *Emit:* `"Tier override churn detected for {agent}: frontmatter says {frontmatter-tier} but measured tier is {measured-tier} in {N} of last {M} rows. Consider updating frontmatter default-tier or removing the budget.json override."`
349
+ - *Proposed action:* Update frontmatter default-tier OR prune budget.json `tier_overrides` entry.
350
+
351
+ **R4 — Typical duration drift.**
352
+ - *Condition:* Measured `typical_duration_seconds` (computed as avg wall-clock between paired spawn/complete rows; fall back to frontmatter when pairing unavailable) differs from frontmatter `typical-duration-seconds` by more than 50%.
353
+ - *Emit:* `"Typical duration for {agent} has drifted: frontmatter {old}s vs measured {new}s ({delta_pct}% drift). Update frontmatter typical-duration-seconds: {new}."`
354
+ - *Proposed action:* Edit `agents/{agent}.md` frontmatter.
355
+ - *Note:* v1 only computes wall-clock duration when telemetry ledger carries both spawn AND complete rows with matching correlation IDs. If unavailable, R4 flags "insufficient data" rather than emitting a false proposal. Phase 11 reflector can add a PostToolUse writer.