@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
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: design
3
- description: "Stage 4 of 5 reads DESIGN-PLAN.md, spawns design-executor per task with wave coordination and parallel/sequential routing. Thin orchestrator."
3
+ description: "Stage 4 of 5 orchestrator that reads DESIGN-PLAN.md, partitions tasks by wave + parallel-safe flag, and spawns design-executor agents with the appropriate isolation (worktree for parallel batches, in-place for sequential tail). Use when DESIGN-PLAN.md is approved and ready for implementation."
4
4
  argument-hint: "[--auto] [--parallel]"
5
5
  user-invocable: true
6
6
  tools: Read, Write, Bash, Grep, Glob, Task, AskUserQuestion, mcp__gdd_state__get, mcp__gdd_state__transition_stage, mcp__gdd_state__update_progress, mcp__gdd_state__set_status, mcp__gdd_state__add_blocker, mcp__gdd_state__resolve_blocker, mcp__gdd_state__checkpoint
@@ -10,290 +10,72 @@ tools: Read, Write, Bash, Grep, Glob, Task, AskUserQuestion, mcp__gdd_state__get
10
10
 
11
11
  **Stage 4 of 5** in the get-design-done pipeline. Thin orchestrator. All design execution intelligence lives in `agents/design-executor.md`.
12
12
 
13
- ---
14
-
15
- ## Stage entry
16
-
17
- 1. Call `mcp__gdd_state__transition_stage` with `to: "design"`.
18
- - Gate failure surfaces `error.context.blockers` to the user; do not advance.
19
- - If the transition succeeds and the prior stage was already `design` with `status: in_progress`, this is a RESUME — use `task_progress` numerator as source of truth and skip tasks that already have a corresponding `.design/tasks/task-NN.md` file.
20
- 2. Call `mcp__gdd_state__get` → snapshot `state`; read `state.position.wave` to decide execution plan.
21
-
22
- Abort only if `.design/DESIGN-PLAN.md` is missing:
23
- > "No plan found. Run `/get-design-done:plan` first."
24
-
25
- ---
26
-
27
- ## Flag Parsing
28
-
29
- - `--auto` → `auto_mode=true` (no mid-stage prompts; architectural deviations still stop the individual task but continue with remaining tasks)
30
- - `--parallel` → `parallel_mode=true` (use worktree isolation for `Parallel: true` tasks)
13
+ Full procedure detail: `../../reference/design-procedure.md`.
31
14
 
32
15
  ---
33
16
 
34
- ## Pre-execution — Directionally-open check
35
-
36
- Scan DESIGN-PLAN.md for tasks marked as "directionally open" (exploration-appropriate — e.g., tasks whose acceptance criteria read "explore N directions" or "pick a visual approach"). If any are found, print:
37
-
38
- > "Tasks [IDs] appear directionally open — consider running `/gdd:sketch` first to explore variants before implementation."
39
-
40
- Skip if `auto_mode=true`.
17
+ ## Stage entry
41
18
 
42
- ## Pre-execution Project-local conventions
19
+ 1. `mcp__gdd_state__transition_stage` with `to: "design"`. Gate failure surfaces `error.context.blockers`; do not advance. Resume case: prior stage `design` + `status: in_progress` -> skip tasks where `.design/tasks/task-NN.md` already exists.
20
+ 2. `mcp__gdd_state__get` -> snapshot `state`; read `state.position.wave` for execution plan.
21
+ 3. Abort only if `.design/DESIGN-PLAN.md` is missing: "No plan found. Run `/get-design-done:plan` first."
43
22
 
44
- When spawning the executor, include any `./.claude/skills/design-*-conventions.md` files in `<required_reading>` so the executor sees project-local design conventions (typography, color, layout, motion, component, interaction decisions codified from prior sketch wrap-ups). Also include any `~/.claude/gdd/global-skills/*.md` files if the directory exists � global skills are cross-project conventions that inform but do not override project-local D-XX decisions.
23
+ Detail: `../../reference/design-procedure.md` §Stage entry.
45
24
 
46
25
  ---
47
26
 
48
- ### .stories.tsx Stub (when storybook project detected)
27
+ ## Flags + pre-execution checks
49
28
 
50
- After every new component file is created by the design-executor:
51
-
52
- Step 1 Check project detection (does not require server running):
53
- Bash: ls .storybook/ 2>/dev/null || grep '"storybook"' package.json 2>/dev/null
54
- Found storybook_project: true
55
- → Not found → skip .stories.tsx emission
56
-
57
- Step 2 — When storybook_project: true, emit a CSF stub alongside the component:
58
- File: `<same directory as component>/<ComponentName>.stories.tsx`
59
- Content follows CSF format (see `connections/storybook.md` for full template):
60
- - Import `Meta` and `StoryObj` from `@storybook/react`
61
- - Import the new component
62
- - `meta: Meta<typeof ComponentName>` with `title` and `parameters.a11y.test = 'error'`
63
- - Export `Default`, `Primary`, `Disabled` story variants
64
- Adjust `title` to match directory structure (e.g., `'Components/Button'` or `'Features/Auth/LoginForm'`)
65
-
66
- Note: the `.stories.tsx` stub is emitted whenever `storybook_project: true` regardless of whether
67
- the dev server is running. New components need stories even in offline/CI contexts.
29
+ - `--auto` -> `auto_mode=true` (no mid-stage prompts; architectural deviations stop the individual task but continue the rest).
30
+ - `--parallel` -> `parallel_mode=true` (use worktree isolation for `Parallel: true` tasks).
31
+ - **Directionally-open check** (skipped if `auto_mode`): scan DESIGN-PLAN.md for tasks whose criteria read "explore N directions" / "pick a visual approach" and suggest `/gdd:sketch` first.
32
+ - **Project-local conventions**: include any `./.claude/skills/design-*-conventions.md` and `~/.claude/gdd/global-skills/*.md` in every executor's `<required_reading>` — global conventions inform but do not override project-local D-XX decisions.
33
+ - **`.stories.tsx` stub**: after each new component file is created by the executor, emit a CSF stub alongside if `.storybook/` exists or `"storybook"` is in `package.json`, even with the dev server offline. Detail: `../../reference/design-procedure.md` §.stories.tsx Stub.
68
34
 
69
35
  ---
70
36
 
71
37
  ## Step 1 — Parse DESIGN-PLAN.md
72
38
 
73
- Read `.design/DESIGN-PLAN.md`. Partition tasks by `## Wave N` heading. Within each wave, partition by `Parallel: true` vs `Parallel: false`. Compute `total_tasks` for `task_progress` denominator.
74
-
75
- If resuming: skip tasks where `.design/tasks/task-NN.md` already exists.
39
+ Read `.design/DESIGN-PLAN.md`. Partition tasks by `## Wave N` heading. Within each wave, partition by `Parallel: true` vs `Parallel: false`. Compute `total_tasks` for the `task_progress` denominator. If resuming, skip tasks whose `.design/tasks/task-NN.md` already exists.
76
40
 
77
41
  ---
78
42
 
79
- ## Parallelism Decision (per wave, before spawning)
80
-
81
- For each wave:
82
- 1. Read `.design/config.json` `parallelism` (or defaults from `reference/config-schema.md`).
83
- 2. Collect candidates in the wave; check `Touches:`, `writes:`, `parallel-safe`, and `typical-duration-seconds` fields.
84
- 3. Apply rules in order from `reference/parallelism-rules.md` (hard → soft). Overlapping Touches split into sequential sub-waves.
85
- 4. Record the parallelism decision for this wave via `mcp__gdd_state__update_progress` with `task_progress: "<completed>/<total>"` and `status: "design_wave_<N>_parallelism: <parallel|serial>, reason=<short-reason>"` — the status string is the canonical carrier (mirrors the plan-stage convention from Plan 20-09; a dedicated tool may be added in a follow-on plan).
86
- 5. If `parallel`: spawn all candidates via concurrent `Task()` calls in one response. If `serial`: spawn sequentially.
87
-
88
- ### Executor prompt template (applies to every spawned design-executor)
89
-
90
- Every spawned executor receives the following STATE.md contract in its prompt:
91
-
92
- > **STATE.md mutation protocol** — When you complete a task in your assigned batch, update STATE.md ONLY via the `gdd-state` MCP tools. Specifically:
93
- > - Report task progress: `mcp__gdd_state__update_progress` with your new `task_progress` fraction.
94
- > - Add blockers: `mcp__gdd_state__add_blocker` with `{ stage: "design", date: <today>, text: "..." }`.
95
- > - Resolve your own blockers on fix: `mcp__gdd_state__resolve_blocker` with the blocker id.
96
- >
97
- > Do NOT `Read` + `Write` `.design/STATE.md` directly — the MCP tools enforce the lockfile and emit mutation events. Direct writes corrupt parallel state.
98
-
99
- Inline this protocol block verbatim inside every design-executor prompt in both the parallel-batch and sequential-tail spawns below. Concurrent executors (Phase 10.1 parallel mode) each emit `update_progress` calls; the lockfile (Plan 20-01) and event stream (Plan 20-06) serialize them safely.
100
-
101
43
  ## Step 2 — Wave-by-Wave Execution
102
44
 
103
- For each Wave in order (Wave 1, Wave 2, ...):
104
-
105
- ### Parallel batch (if `parallel_mode=true` AND any `Parallel: true` tasks in wave)
106
-
107
- Report the partition before spawning:
108
-
109
- ```
110
- ━━━ Wave [N] — parallel mode ━━━
111
- Parallel batch ([N] tasks — spawning concurrently):
112
- [01] [type]: [scope] — touches: [files]
113
- [02] [type]: [scope] — touches: [files]
114
-
115
- Sequential tail ([N] tasks):
116
- [03] [type]: [scope] — touches: [files]
117
-
118
- Spawning agents now...
119
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
120
- ```
121
-
122
- Spawn ALL `Parallel: true` tasks in this wave as concurrent `Task()` calls in ONE response. Each call uses `isolation: "worktree"`:
123
-
124
- ```
125
- Task("design-executor", """
126
- <required_reading>
127
- @.design/STATE.md
128
- @.design/DESIGN-PLAN.md
129
- @.design/DESIGN-CONTEXT.md
130
- @reference/[type-relevant].md
131
- </required_reading>
132
-
133
- You are the design-executor agent. Execute Task NN from DESIGN-PLAN.md.
134
-
135
- Prompt context:
136
- task_id: NN
137
- task_type: [type]
138
- task_scope: [scope]
139
- task_acceptance_criteria:
140
- - [criterion 1]
141
- - [criterion 2]
142
- wave: N
143
- is_parallel: true
144
- auto_mode: [true|false]
145
-
146
- Write .design/tasks/task-NN.md and make an atomic commit `feat(design-NN): [type] — [scope]`.
147
-
148
- Emit `## EXECUTION COMPLETE` when done.
149
- """, subagent_type="design-executor", isolation="worktree")
150
- ```
45
+ For each wave in order:
151
46
 
152
- Wait for all parallel tasks to emit `## EXECUTION COMPLETE`.
47
+ 1. **Parallelism decision (per wave)**: read `.design/config.json` `parallelism`, collect candidates, check `Touches:` / `writes:` / `parallel-safe` / `typical-duration-seconds`, apply `reference/parallelism-rules.md` hard->soft. Overlapping `Touches:` split into sequential sub-waves. Record verdict via `mcp__gdd_state__update_progress` with `status: "design_wave_<N>_parallelism: <parallel|serial>, reason=<short-reason>"`.
48
+ 2. **Executor STATE.md protocol** (inlined verbatim into every `design-executor` prompt): executors update STATE.md ONLY via `gdd-state` MCP tools — `update_progress`, `add_blocker`, `resolve_blocker`. NEVER `Read`+`Write` `.design/STATE.md` directly. The MCP tools enforce the lockfile (Plan 20-01) and emit mutation events (Plan 20-06) so concurrent executors serialize safely.
49
+ 3. **Parallel batch** (when `parallel_mode=true` AND any `Parallel: true` tasks in wave): announce the partition, spawn all `Parallel: true` tasks via concurrent `Task("design-executor", ..., isolation: "worktree")` calls in ONE response, wait for all `## EXECUTION COMPLETE` markers, merge worktrees (non-overlapping `Touches:` guarantees no conflicts; surface any conflict to the user before continuing), then `update_progress` + `checkpoint`.
50
+ 4. **Sequential tail** (`Parallel: false` or `parallel_mode=false`): spawn one `design-executor` at a time (no worktree isolation), waiting for each `## EXECUTION COMPLETE` and emitting `update_progress` per task; `checkpoint` after the final task of the wave.
153
51
 
154
- **Merge worktrees** (preserved from v2.1.0 do not redesign):
155
-
156
- ```
157
- ━━━ Parallel batch complete ━━━
158
- [✓/⚠/✗] Task 01 — [type]
159
- [✓/⚠/✗] Task 02 — [type]
160
-
161
- Merging worktrees...
162
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
163
- ```
164
-
165
- Merge each worktree branch back into the working directory. Each agent touched non-overlapping files (guaranteed by the conflict check on `Touches:` fields). If an unexpected merge conflict appears, flag it and ask the user to resolve before continuing.
166
-
167
- After merge, roll up the batch's progress:
168
-
169
- - Call `mcp__gdd_state__update_progress` with `task_progress: "<completed>/<total>"` and `status: "design_wave_<N>_parallel_batch_complete"`.
170
- - Call `mcp__gdd_state__checkpoint` — records the wave boundary in `<timestamps>` and bumps `last_checkpoint`.
171
-
172
- ### Sequential tail (Parallel: false tasks, or all tasks if `parallel_mode=false`)
173
-
174
- Announce each wave before starting:
175
-
176
- ```
177
- ━━━ Wave [N] — [N tasks] — sequential ━━━
178
- Tasks:
179
- [01] [type]: [scope]
180
- [02] [type]: [scope]
181
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
182
- ```
183
-
184
- Run one at a time. Same `Task("design-executor", ...)` pattern with `is_parallel: false` (no worktree isolation):
185
-
186
- ```
187
- Task("design-executor", """
188
- <required_reading>
189
- @.design/STATE.md
190
- @.design/DESIGN-PLAN.md
191
- @.design/DESIGN-CONTEXT.md
192
- @reference/[type-relevant].md
193
- </required_reading>
194
-
195
- You are the design-executor agent. Execute Task NN from DESIGN-PLAN.md.
196
-
197
- Prompt context:
198
- task_id: NN
199
- task_type: [type]
200
- task_scope: [scope]
201
- task_acceptance_criteria:
202
- - [criterion 1]
203
- - [criterion 2]
204
- wave: N
205
- is_parallel: false
206
- auto_mode: [true|false]
207
-
208
- Write .design/tasks/task-NN.md and make an atomic commit `feat(design-NN): [type] — [scope]`.
209
-
210
- Emit `## EXECUTION COMPLETE` when done.
211
- """, subagent_type="design-executor")
212
- ```
213
-
214
- After each task completes, call `mcp__gdd_state__update_progress` with the new `task_progress: "<completed>/<total>"` and `status: "design_wave_<N>_task_<NN>_complete"`.
215
-
216
- After the final sequential task of the wave, call `mcp__gdd_state__checkpoint` — records the wave boundary in `<timestamps>` and bumps `last_checkpoint`.
52
+ Full executor prompts (parallel + sequential variants) and the merge-worktrees protocol: `../../reference/design-procedure.md` §Step 2.
217
53
 
218
54
  ---
219
55
 
220
56
  ## Step 3 — Wave Checkpoint
221
57
 
222
- After each wave (unless `--auto` flag was passed):
223
-
224
- ```
225
- ━━━ Wave [N] complete ━━━
226
- ✓ [N] tasks complete
227
- ⚠ [N] deviations (see .design/tasks/ files)
228
-
229
- Ready for Wave [N+1]? (yes / review first)
230
- ━━━━━━━━━━━━━━━━━━━━━━━
231
- ```
232
-
233
- Skip checkpoint if `auto_mode=true`.
234
-
235
- ---
58
+ After each wave, unless `auto_mode=true`, prompt: "Ready for Wave [N+1]? (yes / review first)". Skip in `auto_mode`.
236
59
 
237
60
  ## Step 4 — Handle Deviations
238
61
 
239
- After each wave, check task-NN.md files for `status: deviation`. If any found:
240
-
241
- - Call `mcp__gdd_state__get` → read `state.blockers`; present affected task IDs and their blocker descriptions from the returned snapshot.
242
- - Offer: (a) stop stage, (b) continue remaining tasks
243
- - In `auto_mode`: continue automatically, log all deviations
244
- - When a blocker is addressed (fix committed by a follow-up task), call `mcp__gdd_state__resolve_blocker` with the blocker id to clear it from the live state.
62
+ Check task-NN.md files for `status: deviation`. If found: `mcp__gdd_state__get` -> read `state.blockers`, present affected task IDs + blocker descriptions, offer (a) stop, (b) continue. `auto_mode`: continue, log. When a blocker is later fixed by a follow-up task: `mcp__gdd_state__resolve_blocker`.
245
63
 
246
64
  ---
247
65
 
248
66
  ## State Update (exit)
249
67
 
250
- 1. Call `mcp__gdd_state__set_status` with `status: "design_complete"` — marks the stage completed without transitioning; verify calls `transition_stage` on its entry, keeping the transition atomic with the owning stage.
251
- 2. Call `mcp__gdd_state__checkpoint` — stamps `last_checkpoint` and appends a `design_completed_at` entry to `<timestamps>`.
252
-
253
- ---
68
+ 1. `mcp__gdd_state__set_status` -> `"design_complete"` — marks the stage complete WITHOUT transitioning (verify owns its own `transition_stage` on entry).
69
+ 2. `mcp__gdd_state__checkpoint` — stamps `last_checkpoint`, appends `design_completed_at` to `<timestamps>`.
254
70
 
255
71
  ## After Completion
256
72
 
257
- Print summary:
258
-
259
- ```
260
- ━━━ Design stage complete ━━━
261
- Tasks: [N] complete / [M] total
262
- Deviations: [N]
263
- Commits: [git log --oneline since stage start]
264
-
265
- Next: /get-design-done:verify
266
- → Scores the result against baseline, checks must-haves,
267
- runs NNG heuristic evaluation, and identifies gaps.
268
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
269
- ```
73
+ Print the `=== Design stage complete ===` summary (tasks complete/total, deviations, commits since stage start, next step `/get-design-done:verify`). Template: `../../reference/design-procedure.md` §After Completion.
270
74
 
271
75
  ---
272
76
 
273
- ### Figma Write Dispatch (after design-executor completes)
274
-
275
- After design-executor has finished and DESIGN-PLAN.md tasks are complete:
276
-
277
- 1. Read `figma:` status from `.design/STATE.md` `<connections>` (the unified remote MCP covers both reads and writes as of v1.0.7.1):
278
- - If `figma: not_configured` or `figma: unavailable` or absent → skip this block entirely (no prompt, no output)
279
- - If `figma: available` → proceed to step 2
280
-
281
- 2. Offer the user a prompt:
282
- ```
283
- figma write-back is available — propagate design decisions back to Figma?
284
- Modes: annotate (layer comments) | tokenize (variable bindings) | mappings (Code Connect)
285
- Run figma-write? (y/N):
286
- ```
77
+ ## Figma Write Dispatch
287
78
 
288
- 3. If user answers "y" or "yes":
289
- - Ask which mode: annotate / tokenize / mappings (or all)
290
- - Spawn `design-figma-writer` agent with the selected mode
291
- - Pass `--dry-run` flag if user requests preview first
292
-
293
- 4. If user answers "n", "N", or no response: skip silently.
294
-
295
- Note: This dispatch is always opt-in. The design stage never auto-runs figma-writer without user confirmation.
296
-
297
- ---
79
+ After all tasks finish, if STATE.md `<connections>` has `figma: available`, offer the user the figma-write opt-in prompt (modes: annotate / tokenize / mappings, with optional `--dry-run`). Spawn `design-figma-writer` with the selected mode on "yes"; skip silently on "no". NEVER auto-run without confirmation. Full prompt + dispatch logic: `../../reference/design-procedure.md` §Figma Write Dispatch.
298
80
 
299
81
  ## DESIGN COMPLETE
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: discover
3
- description: "Stage 1.5 of 4 — thin orchestrator that spawns design-context-builder (auto-detect + interview) and design-context-checker (6-dimension validator) to produce DESIGN-CONTEXT.md."
3
+ description: "Stage 1.5 of 4 orchestrator that probes Figma / Refero / Pinterest connections, spawns design-context-builder (auto-detect + interview) and (via lazy gate) design-context-checker (6-dimension validator), producing .design/DESIGN-CONTEXT.md. Use after /gdd:scan when a fast-path context build is wanted instead of the full /gdd:explore."
4
4
  argument-hint: "[--auto]"
5
5
  user-invocable: true
6
6
  ---
@@ -9,171 +9,64 @@ user-invocable: true
9
9
 
10
10
  **Stage 1.5 of 4.** Produces `.design/DESIGN-CONTEXT.md`.
11
11
 
12
+ Full procedure detail: `../../reference/discover-procedure.md`.
13
+
12
14
  ---
13
15
 
14
16
  ## State Integration
15
17
 
16
18
  1. Read `.design/STATE.md`.
17
- - 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."
18
- - If present and stage==discover and status==in_progress: RESUME continue existing interview; do not reset.
19
- - Otherwise: normal transition set frontmatter stage=discover, <position> stage=discover, status=in_progress, task_progress=0/1.
20
- 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).
21
-
22
- **A — Figma probe (variant-agnostic):**
23
-
24
- ```
25
- A1. ToolSearch({ query: "figma get_metadata use_figma", max_results: 10 })
26
- A2. Parse tool names matching /^mcp__([^_]*figma[^_]*)__(get_metadata|use_figma)$/i
27
- into read-capable and write-capable prefix sets.
28
- A3. Empty read set → figma: not_configured (skip all Figma paths)
29
- One or more matches → pick prefix via tiebreaker:
30
- (1) both-sets > reads-only,
31
- (2) `figma` > others,
32
- (3) non-`figma-desktop` > desktop,
33
- (4) alphabetical.
34
- A4. Call {prefix}get_metadata:
35
- Success → figma: available (prefix=mcp__<prefix>__, writes=<true|false>)
36
- Error → figma: unavailable
37
- ```
38
-
39
- **B — Refero probe (ToolSearch presence is sufficient — no tool call needed):**
40
-
41
- ```
42
- B1. ToolSearch({ query: "refero", max_results: 5 })
43
- B2. Empty result → refero: not_configured
44
- Non-empty → refero: available
45
- ```
46
-
47
- **C — Pinterest probe (ToolSearch-only, same pattern as Refero):**
48
-
49
- ```
50
- C1. ToolSearch({ query: "mcp-pinterest", max_results: 5 })
51
- C2. Empty result → pinterest: not_configured
52
- Non-empty → pinterest: available
53
- ```
54
-
55
- No live `pinterest_search` call at probe time — ToolSearch presence is sufficient. The synthesizer makes the actual search calls.
56
-
57
- 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.
58
- 3. Update last_checkpoint. Write STATE.md.
59
-
60
- ## Auto Mode
61
-
62
- Auto Mode CSS detection (when `auto_mode: true` is passed to the builder):
63
- 1. If tailwind.config.{js,cjs,mjs,ts} exists → Tailwind-only project
64
- - Skip CSS file grep
65
- - Parse tailwind.config for color palette, spacing scale, font families
66
- - Use tailwind.config values as the baseline style signal
67
- 2. Else → fall through to existing CSS file grep logic
68
-
69
- ## Step 1 — Spawn design-context-builder
19
+ - **Missing** -> create minimal skeleton from `reference/STATE-TEMPLATE.md` (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."
20
+ - **Present + stage==discover + status==in_progress** -> RESUME (continue interview; do not reset).
21
+ - **Otherwise** -> normal transition: set frontmatter stage=discover, `<position>` stage=discover, status=in_progress, task_progress=0/1.
22
+ 2. Probe connection availability. ToolSearch runs FIRST (MCP tools may be in the deferred tool set). Run three probes A (Figma, variant-agnostic with prefix tiebreaker), B (Refero, ToolSearch-only), C (Pinterest, ToolSearch-only). After all probes, write `<connections>` to STATE.md so the builder doesn't re-probe. Full probe specs: `../../reference/discover-procedure.md` §Connection Probes.
23
+ 3. Update `last_checkpoint`. Write STATE.md.
70
24
 
71
- Task("design-context-builder", """
72
- <required_reading>
73
- @.design/STATE.md
74
- @reference/audit-scoring.md
75
- @reference/anti-patterns.md
76
- </required_reading>
25
+ ---
77
26
 
78
- You are the design-context-builder agent. Auto-detect existing design system
79
- state via grep/glob before asking questions. Interview the user ONLY for areas
80
- where auto-detect returned no confident answer. Write .design/DESIGN-CONTEXT.md.
27
+ ## Auto Mode
81
28
 
82
- Baseline audit directory detection (ordered fallback chain):
83
- 1. If src/ exists → use src/
84
- 2. Elif app/ exists → use app/ (Next.js App Router)
85
- 3. Elif pages/ exists → use pages/ (Next.js Pages Router)
86
- 4. Elif lib/ exists → use lib/ (library-only projects)
87
- 5. Else → flag "layout unknown", skip baseline, note in DESIGN-CONTEXT.md
29
+ When `--auto` is passed to the builder: if `tailwind.config.{js,cjs,mjs,ts}` exists -> Tailwind-only project (skip CSS file grep, parse tailwind.config for palette/spacing/font, use those as the baseline style signal). Else fall through to the existing CSS file grep logic. Detail: `../../reference/discover-procedure.md` §Auto Mode.
88
30
 
89
- Common gray areas to probe during discovery (Area 7):
90
- 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?"
91
- 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)?"
92
- 3. Component rebuild vs restyle — when to keep existing component, when to rebuild from scratch. Ask: "For <component>, restyle in place or rebuild?"
31
+ ---
93
32
 
94
- Context:
95
- auto_mode: <true|false>
33
+ ## Step 1 — Spawn design-context-builder
96
34
 
97
- Output file: .design/DESIGN-CONTEXT.md
98
- Emit `## CONTEXT COMPLETE` when done.
99
- """)
35
+ Spawn `design-context-builder` -> `.design/DESIGN-CONTEXT.md`. The agent auto-detects via grep/glob first and interviews only for areas where auto-detect returned no confident answer. Baseline audit directory chain: `src/` -> `app/` -> `pages/` -> `lib/` -> flag "layout unknown". Common gray areas to probe (Area 7): font-change risk, token-layer introduction risk, component rebuild-vs-restyle. Wait for `## CONTEXT COMPLETE`, then update STATE.md `task_progress = 0.5`. Full prompt: `../../reference/discover-procedure.md` §Step 1.
100
36
 
101
- Wait for `## CONTEXT COMPLETE`. Update STATE.md task_progress = 0.5.
37
+ ---
102
38
 
103
39
  ## Step 1.75 — Lazy gate: should design-context-checker run? (Plan 10.1-04, D-21)
104
40
 
105
- Spawn the cheap Haiku gate before the full context-checker:
106
-
107
- Task("design-context-checker-gate", """
108
- <required_reading>
109
- @.design/STATE.md
110
- </required_reading>
41
+ Spawn the cheap Haiku gate `design-context-checker-gate` before the full checker. It applies the single-file heuristic (is `DESIGN-CONTEXT.md` in `git diff --name-only HEAD~1..HEAD`?) and emits JSON + `## GATE COMPLETE`. On `spawn: false`: append `lazy_skipped: true` telemetry row, skip Step 2, set STATE.md `<position>` as if checker passed. On `spawn: true`: proceed to Step 2. On first-run discover the gate always returns `spawn: true` (builder just wrote the file); the gate meaningfully short-circuits only on re-runs where the builder made no changes. Full prompt: `../../reference/discover-procedure.md` §Step 1.75.
111
42
 
112
- You are the design-context-checker-gate.
43
+ **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, wire synthesize between dispatch and collate as in `skills/map/` Step 3.5.
113
44
 
114
- Context:
115
- diff_files: <git diff --name-only HEAD~1..HEAD>
116
- diff_body: (not needed — single-file heuristic)
117
- baseline_sha: <HEAD~1>
118
-
119
- Apply the heuristic (DESIGN-CONTEXT.md in diff_files?). Emit JSON + `## GATE COMPLETE`.
120
- """)
121
-
122
- Wait for `## GATE COMPLETE`. Parse JSON:
123
-
124
- - `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>`.
125
- - `spawn: true` → proceed to Step 2 as currently written.
126
-
127
- **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.
128
-
129
- **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.
45
+ ---
130
46
 
131
47
  ## Step 2 — Spawn design-context-checker
132
48
 
133
- Task("design-context-checker", """
134
- <required_reading>
135
- @.design/STATE.md
136
- @.design/DESIGN-CONTEXT.md
137
- </required_reading>
49
+ Spawn `design-context-checker` with `<required_reading>` on STATE.md + DESIGN-CONTEXT.md. The agent validates DESIGN-CONTEXT.md across 6 dimensions and returns APPROVED or BLOCKED with per-dimension verdicts. Wait for `## CONTEXT CHECK COMPLETE`. Full prompt: `../../reference/discover-procedure.md` §Step 2.
138
50
 
139
- You are the design-context-checker agent. Validate DESIGN-CONTEXT.md across
140
- 6 dimensions. Return APPROVED or BLOCKED with per-dimension verdicts.
141
-
142
- Emit `## CONTEXT CHECK COMPLETE` when done.
143
- """)
144
-
145
- Wait for `## CONTEXT CHECK COMPLETE`.
51
+ ---
146
52
 
147
53
  ## Step 3 — Handle checker verdict
148
54
 
149
- If APPROVED: proceed to state update.
150
- If BLOCKED: present dimensions that BLOCKED to user, offer fix-and-retry loop
151
- (re-spawn builder with specific fix instructions). Do not proceed to planning.
55
+ - **APPROVED** -> proceed to state update.
56
+ - **BLOCKED** -> present blocked dimensions to user, offer fix-and-retry loop (re-spawn builder with specific fix instructions). Do not proceed to planning.
152
57
 
153
58
  ---
154
59
 
155
60
  ## State Update (exit)
156
61
 
157
- 1. Set <position> status=completed, task_progress=1/1.
158
- 2. Set <timestamps> discover_completed_at=<ISO 8601 now>.
159
- 3. Update last_checkpoint. Write STATE.md.
62
+ 1. Set `<position>` `status=completed`, `task_progress=1/1`.
63
+ 2. Set `<timestamps>` `discover_completed_at=<ISO 8601 now>`.
64
+ 3. Update `last_checkpoint`. Write STATE.md.
160
65
 
161
66
  ---
162
67
 
163
68
  ## After Writing
164
69
 
165
- ```
166
- ━━━ Discovery complete ━━━
167
- Saved: .design/DESIGN-CONTEXT.md
168
-
169
- Baseline score: [N]/100 ([grade])
170
- Key issues: [top issue 1], [top issue 2], [top issue 3]
171
-
172
- Next: /get-design-done:plan
173
- → Decomposes your context into executable design tasks.
174
- ━━━━━━━━━━━━━━━━━━━━━━━━━
175
- ```
176
-
177
- Do not proceed to planning automatically unless `--auto` was passed.
70
+ Print the "=== Discovery complete ===" block with saved path, baseline score, top key issues, and next step (`/get-design-done:plan`). Do not proceed to planning automatically unless `--auto` was passed. Template: `../../reference/discover-procedure.md` §After Writing.
178
71
 
179
72
  ## DISCOVER COMPLETE
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: gdd-discuss
3
- description: "Adaptive design interview spawns design-discussant to gather decisions via one-question-at-a-time questioning. Writes D-XX decisions to STATE.md <decisions> block."
3
+ description: "Adaptive design interview command that spawns design-discussant in normal / --all / --spec mode to gather decisions via one-question-at-a-time AskUserQuestion, writing D-XX entries to STATE.md <decisions>. Use when locking design decisions outside the main pipeline or backfilling missing context."
4
4
  argument-hint: "[topic] [--all] [--spec] [--cycle <name>]"
5
5
  tools: Read, Write, Task
6
6
  ---
@@ -47,7 +47,23 @@ Emit `## DISCUSS COMPLETE` when done.
47
47
 
48
48
  Use only the modes the user actually passed. Missing flags → `<mode>normal</mode>`.
49
49
 
50
- ## Step 4 — Report
50
+ ## Step 4 — Inline glossary maintenance (CONTEXT.md)
51
+
52
+ When a fuzzy phrase is resolved into a sharper term, or a new domain concept is named
53
+ during the interview: write to `./CONTEXT.md` IMMEDIATELY (do NOT batch). Use the schema
54
+ in `./../../reference/context-md-format.md` — H2 heading per term, body paragraph,
55
+ optional `**Aliases:**` line for term-merging. Multi-context repos use `CONTEXT-MAP.md`
56
+ plus per-area `<area>/CONTEXT.md`. CONTEXT.md is lazy-created on the first term write.
57
+
58
+ ## Step 5 — Session wrap: ADR-offer scan
59
+
60
+ For each decision recorded this session, check ALL three criteria from
61
+ `./../../reference/adr-format.md`: (a) **hard-to-reverse**, (b) **surprising-without-context**,
62
+ (c) **real-tradeoff**. If ALL three hold, offer to author `docs/adr/NNNN-<slug>.md`. If
63
+ ANY criterion fails, the decision stays in STATE.md `<decisions>`. Routine choices are
64
+ NEVER auto-promoted.
65
+
66
+ ## Step 6 — Report
51
67
 
52
68
  Wait for `## DISCUSS COMPLETE`. Re-read STATE.md. Count new D-XX entries since Step 1. Print:
53
69