@hegemonart/get-design-done 1.59.3 → 1.59.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 (155) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +61 -0
  4. package/SKILL.md +2 -0
  5. package/figma-plugin/README.md +61 -0
  6. package/figma-plugin/code.ts +36 -0
  7. package/figma-plugin/manifest.json +12 -0
  8. package/figma-plugin/package-lock.json +35 -0
  9. package/figma-plugin/package.json +12 -0
  10. package/figma-plugin/src/export-variables.ts +144 -0
  11. package/figma-plugin/src/payload-schema.ts +250 -0
  12. package/figma-plugin/tsconfig.json +16 -0
  13. package/figma-plugin/ui.html +44 -0
  14. package/hooks/budget-enforcer.ts +134 -7
  15. package/hooks/gdd-intel-trigger.js +3 -3
  16. package/package.json +6 -1
  17. package/reference/DEPRECATIONS.md +3 -3
  18. package/reference/live-mode-integration.md +1 -1
  19. package/reference/registry.json +1 -1
  20. package/reference/runtime-models.md +15 -15
  21. package/reference/schemas/generated.d.ts +4 -0
  22. package/reference/schemas/runtime-models.schema.json +5 -0
  23. package/reference/skill-metadata.md +4 -4
  24. package/reference/skill-placeholders.md +2 -2
  25. package/scripts/build-skills.cjs +146 -0
  26. package/scripts/generate-skill-frontmatter.cjs +243 -0
  27. package/scripts/lib/bandit-router/integration.cjs +38 -0
  28. package/scripts/lib/install/installer.cjs +133 -1
  29. package/scripts/lib/manifest/scaffolder.cjs +1 -1
  30. package/scripts/lib/manifest/schemas/skills.schema.json +1 -1
  31. package/scripts/lib/manifest/skills.json +1 -1
  32. package/scripts/lib/new-addendum.cjs +1 -1
  33. package/scripts/skill-templates/README.md +90 -0
  34. package/scripts/skill-templates/add-backlog/SKILL.md +48 -0
  35. package/scripts/skill-templates/analyze-dependencies/SKILL.md +95 -0
  36. package/scripts/skill-templates/apply-reflections/SKILL.md +109 -0
  37. package/scripts/skill-templates/apply-reflections/apply-reflections-procedure.md +170 -0
  38. package/scripts/skill-templates/audit/SKILL.md +79 -0
  39. package/scripts/skill-templates/bandit-reset/SKILL.md +91 -0
  40. package/scripts/skill-templates/bandit-status/SKILL.md +94 -0
  41. package/scripts/skill-templates/benchmark/SKILL.md +65 -0
  42. package/scripts/skill-templates/bootstrap-ds/SKILL.md +43 -0
  43. package/scripts/skill-templates/brief/SKILL.md +145 -0
  44. package/scripts/skill-templates/budget/SKILL.md +45 -0
  45. package/scripts/skill-templates/cache-manager/SKILL.md +66 -0
  46. package/scripts/skill-templates/cache-manager/cache-policy.md +126 -0
  47. package/scripts/skill-templates/check-update/SKILL.md +98 -0
  48. package/scripts/skill-templates/compare/SKILL.md +82 -0
  49. package/scripts/skill-templates/compare/compare-rubric.md +171 -0
  50. package/scripts/skill-templates/complete-cycle/SKILL.md +81 -0
  51. package/scripts/skill-templates/connections/SKILL.md +71 -0
  52. package/scripts/skill-templates/connections/connections-onboarding.md +608 -0
  53. package/scripts/skill-templates/context/SKILL.md +137 -0
  54. package/scripts/skill-templates/continue/SKILL.md +24 -0
  55. package/scripts/skill-templates/darkmode/SKILL.md +76 -0
  56. package/scripts/skill-templates/darkmode/darkmode-audit-procedure.md +258 -0
  57. package/scripts/skill-templates/debug/SKILL.md +41 -0
  58. package/scripts/skill-templates/debug/debug-feedback-loops.md +119 -0
  59. package/scripts/skill-templates/design/SKILL.md +118 -0
  60. package/scripts/skill-templates/design/design-procedure.md +304 -0
  61. package/scripts/skill-templates/discuss/SKILL.md +96 -0
  62. package/scripts/skill-templates/do/SKILL.md +45 -0
  63. package/scripts/skill-templates/explore/SKILL.md +118 -0
  64. package/scripts/skill-templates/explore/explore-procedure.md +267 -0
  65. package/scripts/skill-templates/export/SKILL.md +30 -0
  66. package/scripts/skill-templates/extract-learnings/SKILL.md +114 -0
  67. package/scripts/skill-templates/fast/SKILL.md +91 -0
  68. package/scripts/skill-templates/figma-extract/SKILL.md +64 -0
  69. package/scripts/skill-templates/figma-write/SKILL.md +50 -0
  70. package/scripts/skill-templates/graphify/SKILL.md +49 -0
  71. package/scripts/skill-templates/health/SKILL.md +99 -0
  72. package/scripts/skill-templates/health/health-mcp-detection.md +44 -0
  73. package/scripts/skill-templates/health/health-skill-length-report.md +69 -0
  74. package/scripts/skill-templates/help/SKILL.md +60 -0
  75. package/scripts/skill-templates/instinct/SKILL.md +111 -0
  76. package/scripts/skill-templates/list-assumptions/SKILL.md +61 -0
  77. package/scripts/skill-templates/list-pins/SKILL.md +27 -0
  78. package/scripts/skill-templates/live/SKILL.md +98 -0
  79. package/scripts/skill-templates/locale/SKILL.md +51 -0
  80. package/scripts/skill-templates/map/SKILL.md +89 -0
  81. package/scripts/skill-templates/migrate/SKILL.md +70 -0
  82. package/scripts/skill-templates/migrate-context/SKILL.md +123 -0
  83. package/scripts/skill-templates/new-addendum/SKILL.md +81 -0
  84. package/scripts/skill-templates/new-cycle/SKILL.md +37 -0
  85. package/scripts/skill-templates/new-project/SKILL.md +53 -0
  86. package/scripts/skill-templates/new-skill/SKILL.md +90 -0
  87. package/scripts/skill-templates/next/SKILL.md +68 -0
  88. package/scripts/skill-templates/note/SKILL.md +48 -0
  89. package/scripts/skill-templates/openrouter-status/SKILL.md +86 -0
  90. package/scripts/skill-templates/optimize/SKILL.md +97 -0
  91. package/scripts/skill-templates/override/SKILL.md +86 -0
  92. package/scripts/skill-templates/paper-write/SKILL.md +54 -0
  93. package/scripts/skill-templates/pause/SKILL.md +77 -0
  94. package/scripts/skill-templates/peer-cli-add/SKILL.md +88 -0
  95. package/scripts/skill-templates/peer-cli-add/peer-cli-protocol.md +161 -0
  96. package/scripts/skill-templates/peer-cli-customize/SKILL.md +89 -0
  97. package/scripts/skill-templates/peers/SKILL.md +96 -0
  98. package/scripts/skill-templates/pencil-write/SKILL.md +54 -0
  99. package/scripts/skill-templates/pin/SKILL.md +37 -0
  100. package/scripts/skill-templates/plan/SKILL.md +105 -0
  101. package/scripts/skill-templates/plan/plan-procedure.md +278 -0
  102. package/scripts/skill-templates/plant-seed/SKILL.md +48 -0
  103. package/scripts/skill-templates/pr-branch/SKILL.md +32 -0
  104. package/scripts/skill-templates/progress/SKILL.md +107 -0
  105. package/scripts/skill-templates/quality-gate/SKILL.md +90 -0
  106. package/scripts/skill-templates/quality-gate/threat-modeling.md +101 -0
  107. package/scripts/skill-templates/quick/SKILL.md +44 -0
  108. package/scripts/skill-templates/reapply-patches/SKILL.md +32 -0
  109. package/scripts/skill-templates/recall/SKILL.md +75 -0
  110. package/scripts/skill-templates/reflect/SKILL.md +85 -0
  111. package/scripts/skill-templates/reflect/procedures/capability-gap-scan.md +119 -0
  112. package/scripts/skill-templates/report-issue/SKILL.md +53 -0
  113. package/scripts/skill-templates/report-issue/report-issue-procedure.md +119 -0
  114. package/scripts/skill-templates/resume/SKILL.md +93 -0
  115. package/scripts/skill-templates/review-backlog/SKILL.md +46 -0
  116. package/scripts/skill-templates/review-decisions/SKILL.md +42 -0
  117. package/scripts/skill-templates/roi/SKILL.md +54 -0
  118. package/scripts/skill-templates/rollout-status/SKILL.md +35 -0
  119. package/scripts/skill-templates/router/SKILL.md +89 -0
  120. package/scripts/skill-templates/router/capability-gap-emitter.md +65 -0
  121. package/scripts/skill-templates/router/router-pick-emitter.md +78 -0
  122. package/scripts/skill-templates/router/router-rules.md +84 -0
  123. package/scripts/skill-templates/settings/SKILL.md +87 -0
  124. package/scripts/skill-templates/ship/SKILL.md +48 -0
  125. package/scripts/skill-templates/sketch/SKILL.md +78 -0
  126. package/scripts/skill-templates/sketch-wrap-up/SKILL.md +92 -0
  127. package/scripts/skill-templates/skill-manifest/SKILL.md +79 -0
  128. package/scripts/skill-templates/spike/SKILL.md +67 -0
  129. package/scripts/skill-templates/spike-wrap-up/SKILL.md +86 -0
  130. package/scripts/skill-templates/start/SKILL.md +67 -0
  131. package/scripts/skill-templates/start/start-procedure.md +115 -0
  132. package/scripts/skill-templates/state/SKILL.md +106 -0
  133. package/scripts/skill-templates/stats/SKILL.md +51 -0
  134. package/scripts/skill-templates/style/SKILL.md +71 -0
  135. package/scripts/skill-templates/style/style-doc-procedure.md +150 -0
  136. package/scripts/skill-templates/synthesize/SKILL.md +94 -0
  137. package/scripts/skill-templates/timeline/SKILL.md +66 -0
  138. package/scripts/skill-templates/todo/SKILL.md +64 -0
  139. package/scripts/skill-templates/turn-closeout/SKILL.md +95 -0
  140. package/scripts/skill-templates/undo/SKILL.md +31 -0
  141. package/scripts/skill-templates/unlock-decision/SKILL.md +54 -0
  142. package/scripts/skill-templates/unpin/SKILL.md +31 -0
  143. package/scripts/skill-templates/update/SKILL.md +56 -0
  144. package/scripts/skill-templates/using-gdd/SKILL.md +78 -0
  145. package/scripts/skill-templates/verify/SKILL.md +113 -0
  146. package/scripts/skill-templates/verify/verify-procedure.md +511 -0
  147. package/scripts/skill-templates/warm-cache/SKILL.md +81 -0
  148. package/scripts/skill-templates/watch-authorities/SKILL.md +82 -0
  149. package/scripts/skill-templates/zoom-out/SKILL.md +26 -0
  150. package/sdk/cli/commands/build.ts +2 -2
  151. package/sdk/cli/index.js +2 -2
  152. package/sdk/cli/index.ts +1 -1
  153. package/skills/README.md +22 -14
  154. package/skills/help/SKILL.md +28 -55
  155. package/skills/new-skill/SKILL.md +5 -5
@@ -0,0 +1,118 @@
1
+ ---
2
+ name: gdd-explore
3
+ description: "Stage 2 of 5 - unified exploration merging inventory grep + design interview. Probes 6 connections, scans the codebase, conducts the AskUserQuestion interview, and writes .design/DESIGN.md + DESIGN-DEBT.md + DESIGN-CONTEXT.md. Use after {{command_prefix}}brief to map the existing system and lock decisions before planning. Activates for requests involving researching design direction, gathering references, or exploring visual options."
4
+ argument-hint: "[--skip-interview] [--skip-scan] [--incremental] [--full]"
5
+ tools: Read, Write, Bash, Grep, Glob, Task, AskUserQuestion, mcp__gdd_state__get, mcp__gdd_state__transition_stage, mcp__gdd_state__probe_connections, mcp__gdd_state__update_progress, mcp__gdd_state__set_status, mcp__gdd_state__add_blocker, mcp__gdd_state__checkpoint, mcp__gdd_state__add_decision
6
+ ---
7
+
8
+ # Get Design Done - Explore
9
+
10
+ **Role:** You are the Explore stage. Stage 2 of 5 in the get-design-done pipeline.
11
+
12
+ **Purpose:** Unified exploration merging the former `scan` (inventory grep) and `discover` (context interview) stages. Produces `.design/DESIGN.md`, `.design/DESIGN-DEBT.md`, and `.design/DESIGN-CONTEXT.md`.
13
+
14
+ Full procedure detail: `./explore-procedure.md`.
15
+
16
+ ---
17
+
18
+ ## Stage entry
19
+
20
+ All STATE.md persistence goes through `gdd-state` MCP tools - no direct edits. Plain design docs (DESIGN.md / DESIGN-DEBT.md / DESIGN-CONTEXT.md) use `Write`.
21
+
22
+ 1. `mcp__gdd_state__transition_stage` with `to: "explore"`. On gate failure: print blockers from `error.context.blockers` verbatim, do not advance.
23
+ 2. `mcp__gdd_state__get` (no args) -> snapshot `state` for downstream steps.
24
+
25
+ ---
26
+
27
+ ## Step 1 - Connection probe
28
+
29
+ Probe six connections, then batch-write results via ONE `mcp__gdd_state__probe_connections` call (unspecified connections keep their existing value):
30
+
31
+ - **A - Figma** (variant-agnostic): ToolSearch + regex parse of `get_metadata` / `use_figma` prefixes -> tiebreaker selection (`both-sets > reads-only`, `figma > others`, `non-figma-desktop`, alphabetical) -> live `{prefix}get_metadata` call -> `available` / `unavailable` / `not_configured` (with `prefix=` + `writes=`).
32
+ - **B - Refero**: ToolSearch presence sufficient.
33
+ - **C - 21st.dev**: ToolSearch `mcp__21st` presence.
34
+ - **D - Magic Patterns**: ToolSearch `mcp__magic_patterns` presence.
35
+ - **E - paper.design**: ToolSearch `mcp__paper` + live `get_selection` call.
36
+ - **F - pencil.dev**: `find . -name "*.pen"` file-presence.
37
+
38
+ Full probe specs + commit-results JSON shape: `./explore-procedure.md` §Step 1.
39
+
40
+ ## Step 1.5 - 21st.dev Prior-Art Check (when `21st-dev: available`)
41
+
42
+ For each greenfield component in scope: `21st_magic_component_search(component_name, limit: 3)`. Fit >= 80% -> add `<prior-art>` block to DESIGN.md recommending adoption; fit < 80% -> note as reference, build custom. If `svgl_get_brand_logo` available and brand assets are in scope, call per logo and save SVGs to `.design/assets/`. Skip entirely if no greenfield components in scope. Detail: `./explore-procedure.md` §Step 1.5.
43
+
44
+ ---
45
+
46
+ ## Step 2 - Inventory scan (unless `--skip-scan`)
47
+
48
+ **Map pre-check**: if `.design/map/` exists with all 5 files (`tokens.md`, `components.md`, `visual-hierarchy.md`, `a11y.md`, `motion.md`) fresher than `src/`, consume them and skip the grep pass. Otherwise grep and, after Step 4, suggest `{{command_prefix}}map` for the next cycle.
49
+
50
+ **Parallelism decision**: read `.design/config.json` + `reference/parallelism-rules.md`. Record verdict via `mcp__gdd_state__set_status` (`"explore_parallel"` / `"explore_serial"`). Parallel -> multiple `Task()` in one response; serial -> sequential.
51
+
52
+ **Incremental batching (Phase 53, default)**: `--incremental` (default; `--full` opts out) runs the change classifier first via the fingerprint store, groups the DesignContext graph into Louvain community batches, and dispatches mappers per the verdict (SKIP=0, PARTIAL=affected batches only, FULL=all). Engine: `scripts/lib/explore-parallel-runner` + `scripts/lib/mappers/incremental-discover.cjs`; dispatch concurrency comes from `concurrency-tuner.cjs`. Detail: `./explore-procedure.md` §Incremental Batching.
53
+
54
+ Run the canonical scan grep/glob inventory (POSIX ERE, preserving PLAT-01/02): component detection (Glob `**/*.{tsx,jsx,vue,svelte}`), color extraction (hex / rgb / hsl / Tailwind arbitrary), typography scan (font-family / Tailwind `font-*` / `text-*`), motion scan (`transition` / `animate-` / `@keyframes` / `framer-motion`), token detection (tailwind.config / CSS custom properties / token JSON), layout detection (ordered fallback `src/` -> `app/` -> `pages/` -> `lib/` -> unknown). Write `.design/DESIGN.md` + `.design/DESIGN-DEBT.md`. Then `mcp__gdd_state__update_progress` for scan progress. Detail: `./explore-procedure.md` §Step 2.
55
+
56
+ **Step 2.x - i18n readiness probe (informational, per D-04)**: check `package.json` deps against `{react-intl, next-intl, i18next, vue-i18n, formatjs, lingui}` -> `framework-managed`; else grep `Intl.(DateTimeFormat|NumberFormat|...)` in `src/` -> `partial`; else `none`. Emit single line `Localization readiness: <state>` in the report. NO gate, NO blocking - surface signal only (D-07). Detail: `./explore-procedure.md` §Step 2.x.
57
+
58
+ ## Step 2.5 - Detect prior sketches and project-local conventions
59
+
60
+ - **Sketches**: list `.design/sketches/*` slugs, group by `WINNER.md` present (completed) vs absent (pending). Record via `mcp__gdd_state__set_status: "explore_sketches_present"`. Include in DESIGN.md "Prior Explorations" section.
61
+ - **Project-local skills**: read `./.claude/skills/design-*-conventions.md` -> include in DESIGN-CONTEXT.md `<project_conventions>` (these override defaults).
62
+ - **Global skills**: `~/.claude/gdd/global-skills/*.md` (other than README) -> prepend to `<project_conventions>` under `<global_conventions>` sub-block. Project-local D-XX wins on conflict.
63
+
64
+ ## Step 2.6 - Graph review (gate then reviewer)
65
+
66
+ Runs only when Step 2's mapper batch + synthesizer produced `.design/context-graph.json`. Skip the whole step if the file is absent (pre-Phase-52 project, or `--skip-scan`).
67
+
68
+ 1. **Gate first (cheap Haiku check).** Spawn `design-context-reviewer-gate` via `Task()` with the classifier signal from Step 2's incremental batching pass: `change_pct` (fingerprint classifier `pct`), `classifier_action` (`SKIP` / `PARTIAL_UPDATE` / `ARCHITECTURE_UPDATE` / `FULL_UPDATE`), and `graph_path: ".design/context-graph.json"`. Gate emits a single-line `{spawn, rationale}` JSON decision then `## GATE COMPLETE`.
69
+ 2. **If `spawn: false`**: record `mcp__gdd_state__set_status: "explore_graph_review_skipped"`, log the gate `rationale` (e.g., "project change 3% < 5% threshold"), set telemetry `lazy_skipped: true`. Done - proceed to Step 3.
70
+ 3. **If `spawn: true`**: spawn `design-context-reviewer` via `Task()` with `<required_reading>` pointing at `.design/STATE.md`, `.design/context-graph.json`, `reference/design-context-schema.md`, `reference/design-context-tag-vocab.md`. The reviewer runs `scripts/validate-design-context.cjs --json` as the deterministic floor (checks 1/2/3/5) then layers the semantic checks (4/6/7/8/9) and returns the 9-check verdict inline (`APPROVED` or `REJECT`).
71
+ 4. **Capture verdict (read-only contract).** The reviewer does NOT write `.design/DESIGN-CONTEXT-REVIEW.md` - it is `reads-only: true, writes: []`. WARN findings surface through `scripts/lib/health-mirror#getHealthChecks` as `status: 'warn'`; a hard-reject maps to `status: 'fail'`. Record the overall verdict via `mcp__gdd_state__set_status: "explore_graph_review_approved"` (or `"_rejected"`).
72
+ 5. **On REJECT**: record `mcp__gdd_state__add_blocker` with the reviewer's blocking-issues list verbatim. Do not advance to Step 3 until the synthesizer or the implicated mapper is re-run. On `APPROVED` (with or without WARNs): proceed.
73
+
74
+ ---
75
+
76
+ ## Step 3 - Design interview (unless `--skip-interview`)
77
+
78
+ **Run inline - NEVER spawn `design-discussant` as a subagent.** `AskUserQuestion` only renders the native picker from the top-level skill context; spawning degrades to plain markdown (broken in Claude Desktop).
79
+
80
+ - **3.a Pre-load context**: state.decisions snapshot -> BRIEF.md -> DESIGN.md -> DESIGN-CONTEXT.md `<gray_areas>` -> project conventions. If `figma: available`, call `{prefix}get_variable_defs` and draft tentative D-XX entries.
81
+ - **3.b Identify question set**: skip areas already covered by D-XX or project convention. Default coverage: cycle goal, audience, brand direction (if no tokens), color/typography/spacing primitives (if undetected), motion preferences, gray areas from DESIGN-CONTEXT.md.
82
+ - **3.c Ask one at a time**: `AskUserQuestion` with 4 concrete options + "Other" / "Skip". Reject generic answers ("modern", "clean") with one follow-up.
83
+ - **3.d Record after each answer**: `mcp__gdd_state__add_decision` (atomic, auto-assigns D-NN); append a quality-classified JSON line to `.design/learnings/question-quality.jsonl`.
84
+ - **3.e Produce DESIGN-CONTEXT.md**: summarize locked decisions, remaining gray areas, Figma tentatives. Frontmatter `status: complete`.
85
+
86
+ Full interview protocol + JSON line schema: `./explore-procedure.md` §Step 3.
87
+
88
+ ---
89
+
90
+ ## Step 4 - Close out explore
91
+
92
+ - If the synthesizer / mapper batch ran in Step 2: `mcp__gdd_state__update_progress` with `task_progress: "<done>/<total>"`, `status: "explore_mappers_done"`.
93
+ - If Step 2.6 ran the graph review: ensure the verdict status is recorded (`explore_graph_review_approved` / `_rejected` / `_skipped`); on `_rejected` do NOT checkpoint until re-run.
94
+ - `mcp__gdd_state__checkpoint` - bumps `last_checkpoint`.
95
+ - Stage advance to `plan` happens at the next stage's entry (plan owns its own `transition_stage`); do not edit frontmatter directly.
96
+
97
+ ## After Writing
98
+
99
+ Print: "=== Explore complete ===\nSaved: .design/DESIGN.md, .design/DESIGN-DEBT.md, .design/DESIGN-CONTEXT.md\nNext: @get-design-done plan".
100
+
101
+ <HARD-GATE>
102
+ Do NOT transition to plan (or invoke `{{command_prefix}}plan`) until BOTH `.design/DESIGN.md` AND `.design/DESIGN-CONTEXT.md` are committed AND the user has approved them. If this project uses a custom `.design` location, read the artifact paths from `.design/STATE.md` rather than assuming the default.
103
+ </HARD-GATE>
104
+
105
+ ## Rationalizations - Thought to Reality
106
+
107
+ The shortcut excuses an agent reaches for during explore, and the drift each one introduces:
108
+
109
+ | Thought | Reality |
110
+ |---------|---------|
111
+ | "I already know this codebase, I can skip the inventory scan." | An unscanned codebase hides the tokens/components you'll duplicate - the grep pass exists to stop you reinventing what's there. |
112
+ | "The six connection probes are noise, I'll assume Figma is off." | A skipped probe means a wrong connection assumption silently breaks the design stage's tool dispatch. |
113
+ | "`--skip-interview` is fine, the brief covered it." | The interview locks the gray areas the brief left fuzzy; skipping it ships undecided D-XX into planning. |
114
+ | "I'll batch all the interview questions to save round-trips." | Batched questions overwhelm the user and smuggle in coupled assumptions - one-at-a-time keeps each decision clean. |
115
+ | "DESIGN-DEBT.md is optional, the scan was clean enough." | Unrecorded debt resurfaces as an unexplained constraint three stages later with no provenance. |
116
+ | "Prior sketches and project conventions don't apply this cycle." | Ignored conventions get overridden by defaults, producing inconsistency the audit will flag against the rest of the system. |
117
+
118
+ ## EXPLORE COMPLETE
@@ -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 essential 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 essential 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 `{{command_prefix}}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 `{{command_prefix}}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,30 @@
1
+ ---
2
+ name: gdd-export
3
+ description: "Packages a completed design cycle (.design artifacts + decisions + screenshots) into a stakeholder-shareable artifact - self-contained HTML, print-styled PDF (Paged.js-compatible), or a Notion page. Redacts secrets; --pseudonymize masks identity for external sharing; --pr posts the HTML preview as a PR comment. Use to hand a design-review packet to PMs/execs/brand who aren't in the repo."
4
+ argument-hint: "<cycle-id> --format html|pdf|notion [--pseudonymize] [--pr]"
5
+ user-invocable: true
6
+ tools: Read, Write, Bash, Glob, Grep, ToolSearch, Task
7
+ ---
8
+
9
+ # {{command_prefix}}export
10
+
11
+ Turns a completed cycle's in-repo design output into a shareable artifact. Closes the gap that `.design/*.md` lives only in the repo - stakeholders not in code can't consume it. The format contract + source set live in `../../reference/export-formats.md`; the Notion write-path in `../../connections/notion.md`.
12
+
13
+ ## Steps
14
+
15
+ 1. **Resolve the cycle.** `<cycle-id>` (or the current cycle from `.design/STATE.md`). Read the **source set**: `EXPERIENCE.md` (Phase 19.5), `.design/DESIGN.md`, `.design/DESIGN-VERIFICATION.md`, `.design/DESIGN-AUDIT.md` (if present), the decision log, and any Preview/Chromatic screenshots.
16
+ 2. **Redact (always) + pseudonymize (opt-in).** Pass every section through `scripts/lib/redact.cjs` (secrets). If `--pseudonymize`, additionally apply `scripts/lib/pseudonymize.cjs` (git identity / paths / hostname) for external sharing. Honor `GDD_DISABLE_NOTION` for the notion format.
17
+ 3. **Assemble per `--format`:**
18
+ - **`html`** (default) - `node -e "require('scripts/lib/export/build-html.cjs').buildHtml({...})"` → a **self-contained** HTML (inline CSS, base64-embedded screenshots, no external refs). Write to `.design/export/<cycle>.html`.
19
+ - **`pdf`** - the same `buildHtml({ ..., print: true })` (Paged.js-compatible `@page` print CSS). Write `.design/export/<cycle>.print.html`; instruct the user to render it via Paged.js / headless-Chrome (GDD ships **no** PDF runtime - D-02).
20
+ - **`notion`** - probe the Notion MCP (`ToolSearch({query:"notion"})`); if `available`, create a page from the same source (nested toggles + image upload) per `connections/notion.md`; if `not_configured`/disabled → degrade to the `html` format + a note.
21
+ 4. **`--pr`** - hand the generated HTML preview to `agents/pr-commenter.md` (via `Task`) to post as a PR comment (degrade-to-noop if no PR / pr-commenter unavailable).
22
+ 5. **Print the artifact path** (and the Notion URL / PR comment status when applicable).
23
+
24
+ ## Do Not
25
+
26
+ - Do not add a PDF/markdown runtime dependency (`paged`/`puppeteer`/`pdfkit`/a markdown lib) - `build-html.cjs` is pure and the PDF is render-it-yourself print HTML (D-02).
27
+ - Do not emit an un-redacted artifact - redact is mandatory; pseudonymize is the external-sharing opt-in.
28
+ - Do not block on Notion/PR - both degrade to a noop / the html file.
29
+
30
+ ## EXPORT COMPLETE
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: gdd-extract-learnings
3
+ description: "Extracts project-specific design patterns and decisions from .design/ artifacts and writes them to .design/learnings/. Optionally proposes updates to reference/ files for user review."
4
+ tools: Bash, Read, Write, Glob, Grep
5
+ ---
6
+
7
+ # {{command_prefix}}extract-learnings
8
+
9
+ **Role:** Scan `.design/` artifacts for recurring patterns, successful decisions, and validated approaches. Write structured learnings to `.design/learnings/`. Optionally propose additions to tracked `reference/` files for the user to review and approve.
10
+
11
+ ## When to run
12
+
13
+ - After `{{command_prefix}}complete-cycle` (auto-suggested by complete-cycle skill)
14
+ - After a major verify/audit pass surfaces new patterns
15
+ - Manually, to checkpoint what the project has learned
16
+
17
+ ## Protocol
18
+
19
+ ### Step 1 - Gather source artifacts
20
+
21
+ Collect content from available `.design/` files:
22
+
23
+ ```bash
24
+ ls .design/*.md 2>/dev/null
25
+ ```
26
+
27
+ Read (if present): DESIGN-CONTEXT.md, DESIGN-VERIFICATION.md, DESIGN-DEBT.md, DESIGN-SUMMARY.md, CYCLES.md
28
+
29
+ ### Step 2 - Invoke gdd-learnings-extractor agent
30
+
31
+ Delegate extraction to the `gdd-learnings-extractor` agent, passing it the list of available files. The agent extracts structured learning entries.
32
+
33
+ ### Step 3 - Write learnings artifact
34
+
35
+ The agent writes or appends to `.design/learnings/LEARNINGS.md`.
36
+
37
+ Layout of `.design/learnings/LEARNINGS.md`:
38
+
39
+ ```markdown
40
+ # Project Learnings
41
+
42
+ ## <Category> — <Date>
43
+
44
+ ### L-<NN>: <Title>
45
+
46
+ **Source:** <which .design/ file and section>
47
+ **Pattern type:** decision | anti-pattern | validated-approach | token-convention | component-convention
48
+ **Confidence:** high | medium | low
49
+ **Summary:** <1-2 sentences>
50
+ **Evidence:** <quote or paraphrase from source>
51
+ **Proposed reference update:** <yes — see proposal below | no>
52
+
53
+ ---
54
+ ```
55
+
56
+ ### Step 3b - Dual-emit atomic instinct units (Phase 51)
57
+
58
+ Alongside the prose `LEARNINGS.md`, emit atomic instinct units for every learning the extractor tags as an `instinct-candidate`. A learning is an `instinct-candidate` when it states a single trigger plus a one-line response - the same shape the reflector emits. Broader narrative learnings stay prose-only.
59
+
60
+ For each `instinct-candidate`, build a unit per `reference/instinct-format.md` (frontmatter: `id`, `trigger`, `confidence` from 0.3 to 0.9, `domain`, `scope`, `project_id`, `source`, `cycles_seen`, `first_seen`, `last_seen`, plus a short body). Set `source: extract-learnings`. Carry the learning's confidence (high / medium / low) into the numeric field (roughly 0.8 / 0.55 / 0.35), capped at 0.9.
61
+
62
+ Write each unit through the store engine `scripts/lib/instinct-store.cjs` rather than by hand:
63
+
64
+ ```bash
65
+ node "${CLAUDE_PLUGIN_ROOT}/scripts/lib/instinct-store.cjs" add --scope project
66
+ ```
67
+
68
+ If the engine exposes a module API only, drive `add(unit, { scope: 'project', baseDir })` from a short `node -e` script. The engine owns de-duplication and `cycles_seen` bookkeeping; do not pre-merge.
69
+
70
+ The prose `LEARNINGS.md` is **retained read-only for one minor version** so existing readers keep working while tooling migrates to the units. Keep writing it; do not drop the prose path in this version.
71
+
72
+ ### Step 4 - Reference file proposal (optional)
73
+
74
+ After writing LEARNINGS.md, check each learning entry with `Proposed reference update: yes`.
75
+
76
+ For each such entry: generate a proposed addition to the appropriate `reference/` file (e.g., `reference/heuristics.md`, `reference/anti-patterns.md`).
77
+
78
+ Print the proposal to the terminal and ask the user to review:
79
+
80
+ ```
81
+ ━━━ Reference update proposal ━━━
82
+
83
+ Learning L-03 suggests adding to reference/anti-patterns.md:
84
+
85
+ ### Anti-pattern: Overloaded primary button
86
+ Using the primary button style for more than one action per screen
87
+ reduces clarity and violates Nielsen's heuristic #4 (consistency).
88
+ Evidence: DESIGN-VERIFICATION.md, cycle 3.
89
+
90
+ Accept this update? [y/n/edit]
91
+ ```
92
+
93
+ If user types `y`: write the addition to the reference file.
94
+ If user types `n`: mark the learning as "proposal declined" in LEARNINGS.md.
95
+ If user types `edit`: open the proposed text for the user to modify, then write.
96
+
97
+ ### Step 5 - Summary
98
+
99
+ ```
100
+ ━━━ Learnings extracted ━━━
101
+ Source files scanned: <N>
102
+ Learnings written: <N>
103
+ Reference proposals: <N> (<M> accepted)
104
+ Output: .design/learnings/LEARNINGS.md
105
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━
106
+ ```
107
+
108
+ ## Required reading (conditional)
109
+
110
+ @.design/intel/decisions.json (if present)
111
+ @.design/intel/patterns.json (if present)
112
+ @.design/learnings/LEARNINGS.md (if present)
113
+
114
+ ## EXTRACT-LEARNINGS COMPLETE
@@ -0,0 +1,91 @@
1
+ ---
2
+ name: gdd-fast
3
+ description: "Trivial inline design task. No subagents, no planning documents, no pipeline stages. Just do the thing described. Activates for requests involving a single quick design fix, a one-shot change, or a fast targeted edit."
4
+ argument-hint: "<task description>"
5
+ tools: Read, Write, Edit, Bash, Grep, Glob
6
+ disable-model-invocation: true
7
+ ---
8
+
9
+ # {{command_prefix}}fast
10
+
11
+ The leanest possible execution path. No subagents, no STATE.md update, no DESIGN-*.md artifacts. Read the target file, apply the change inline, commit.
12
+
13
+ ## When to use
14
+
15
+ - "Change this button's border-radius to 8px"
16
+ - "Add a hover state to the nav links"
17
+ - "Fix the mobile breakpoint on the hero"
18
+ - Single-file or single-component obvious changes
19
+
20
+ ## When NOT to use
21
+
22
+ - Multi-component changes.
23
+ - Anything touching tokens used across the app.
24
+ - Anything requiring a design decision (taste, tradeoff, scope).
25
+ - Use `{{command_prefix}}quick` or the full pipeline instead.
26
+
27
+ ## Steps
28
+
29
+ 1. Parse the task description from the argument.
30
+ 2. Use Grep/Glob to locate the target file(s). If ambiguous (>2 candidates), stop and ask the user which to edit - do not guess.
31
+ 3. Read the target file(s).
32
+ 4. Apply the described change with Edit.
33
+ 5. Run a relevant sanity check (grep for the old value to confirm it's gone; grep for the new value to confirm it's in).
34
+ 6. Commit with message: `fix: <task description>` (one commit, one change).
35
+ 7. Print: "Done: <summary of what changed>."
36
+
37
+ ## Do Not
38
+
39
+ - No subagent spawns.
40
+ - No `.design/` writes.
41
+ - No STATE.md mutation.
42
+ - No pipeline stage invocation.
43
+ - Do not proceed if the change turns out to be non-trivial - bail out and recommend `{{command_prefix}}quick` or the full pipeline.
44
+ - Do not skip the `capability_gap` emit on bail-out - Stage-0 telemetry depends on it (Phase 29 D-01).
45
+
46
+ ## Emitting capability_gap on no-skill-match
47
+
48
+ If step 2 cannot locate any candidate files for the task description (or all candidates are filtered out as off-topic), or if the change in step 4 turns out to be non-trivial in a way that has no obvious resolution without a dedicated skill/agent, emit ONE `capability_gap` event before returning control to the user. This feeds Phase 29 Stage-0 telemetry - the reflector pattern-detection pass (Plan 29-02) and aggregation (Plan 29-03) read these events from the chain file (`.design/gep/events.jsonl`) to surface recurring capability gaps in `{{command_prefix}}apply-reflections`.
49
+
50
+ Synchronous emitter call (via Bash):
51
+
52
+ ```bash
53
+ node -e '
54
+ const { appendChainEvent } = require("./scripts/lib/event-chain.cjs");
55
+ const { createHash, randomUUID } = require("node:crypto");
56
+ const intent = process.env.GDD_INTENT || "";
57
+ const payload = {
58
+ event_id: randomUUID(),
59
+ parent_event_id: null,
60
+ source: "fast",
61
+ context_hash: createHash("sha256").update(intent).digest("hex"),
62
+ intent_summary: intent.slice(0, 256),
63
+ suggested_kind: "skill",
64
+ evidence_refs: [],
65
+ };
66
+ appendChainEvent({
67
+ agent: "fast",
68
+ outcome: "capability_gap",
69
+ payload,
70
+ type: "capability_gap",
71
+ timestamp: new Date().toISOString(),
72
+ sessionId: process.env.GDD_SESSION_ID || "fast-cli",
73
+ });
74
+ '
75
+ ```
76
+
77
+ Notes:
78
+ - `evidence_refs` is empty `[]` for fast (no trajectory in `{{command_prefix}}fast` - that path is too lean by design).
79
+ - `parent_event_id` is null (root event for the fast bail-out).
80
+ - `suggested_kind` is `"skill"` because fast bail-outs are usually narrow primitives, not multi-step workflows. Plan 29-03's aggregator may upgrade to `"agent"` if a `context_hash` cluster shows multi-step usage.
81
+ - The emitter MUST NOT block - `appendChainEvent` already swallows IO errors via its existing try/catch (see `scripts/lib/event-chain.cjs:97-105`).
82
+ - The 7-field payload is preserved verbatim through `appendChainEvent`'s opaque-extras pattern; the chain row carries `type`, `timestamp`, `sessionId`, `payload` as opaque caller-supplied fields and is projected back to the events-schema envelope shape by readers (Plan 29-03 aggregator).
83
+
84
+ Trigger conditions:
85
+ - **Trigger 1**: Step 2 returns zero candidate files for the task description (target is genuinely missing).
86
+ - **Trigger 2**: Step 2 returns more than 2 candidates AND the user bail-out in step 2 fires (stop and ask).
87
+ - **Trigger 3**: Step 4 reveals the change is non-trivial in a way that has no obvious primitive resolution (the `## Do Not` "Do not proceed" line fires).
88
+
89
+ MCP-probe failures (connection down, transport-layer errors) do NOT emit `capability_gap` - those are Phase 22 connection-status concerns (D-08).
90
+
91
+ ## FAST COMPLETE