@hegemonart/get-design-done 1.59.2 → 1.59.4

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 (161) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +56 -0
  4. package/SKILL.md +2 -0
  5. package/agents/design-advisor.md +1 -1
  6. package/agents/design-context-checker-gate.md +0 -1
  7. package/agents/design-context-checker.md +0 -1
  8. package/agents/design-context-reviewer-gate.md +0 -1
  9. package/agents/design-context-reviewer.md +0 -1
  10. package/agents/design-integration-checker-gate.md +0 -1
  11. package/agents/design-integration-checker.md +0 -1
  12. package/agents/design-plan-checker.md +0 -1
  13. package/agents/design-verifier-gate.md +0 -1
  14. package/agents/design-verifier.md +0 -1
  15. package/agents/prototype-gate.md +0 -1
  16. package/agents/quality-gate-runner.md +0 -1
  17. package/figma-plugin/README.md +61 -0
  18. package/figma-plugin/code.ts +36 -0
  19. package/figma-plugin/manifest.json +12 -0
  20. package/figma-plugin/package-lock.json +35 -0
  21. package/figma-plugin/package.json +12 -0
  22. package/figma-plugin/src/export-variables.ts +144 -0
  23. package/figma-plugin/src/payload-schema.ts +250 -0
  24. package/figma-plugin/tsconfig.json +16 -0
  25. package/figma-plugin/ui.html +44 -0
  26. package/hooks/gdd-intel-trigger.js +3 -3
  27. package/package.json +6 -1
  28. package/reference/DEPRECATIONS.md +3 -3
  29. package/reference/live-mode-integration.md +1 -1
  30. package/reference/registry.json +1 -1
  31. package/reference/skill-metadata.md +4 -4
  32. package/reference/skill-placeholders.md +2 -2
  33. package/scripts/build-skills.cjs +146 -0
  34. package/scripts/generate-skill-frontmatter.cjs +243 -0
  35. package/scripts/lib/manifest/scaffolder.cjs +1 -1
  36. package/scripts/lib/manifest/schemas/skills.schema.json +1 -1
  37. package/scripts/lib/manifest/skills.json +1 -1
  38. package/scripts/lib/new-addendum.cjs +1 -1
  39. package/scripts/skill-templates/README.md +90 -0
  40. package/scripts/skill-templates/add-backlog/SKILL.md +48 -0
  41. package/scripts/skill-templates/analyze-dependencies/SKILL.md +95 -0
  42. package/scripts/skill-templates/apply-reflections/SKILL.md +109 -0
  43. package/scripts/skill-templates/apply-reflections/apply-reflections-procedure.md +170 -0
  44. package/scripts/skill-templates/audit/SKILL.md +79 -0
  45. package/scripts/skill-templates/bandit-reset/SKILL.md +91 -0
  46. package/scripts/skill-templates/bandit-status/SKILL.md +94 -0
  47. package/scripts/skill-templates/benchmark/SKILL.md +65 -0
  48. package/scripts/skill-templates/bootstrap-ds/SKILL.md +43 -0
  49. package/scripts/skill-templates/brief/SKILL.md +145 -0
  50. package/scripts/skill-templates/budget/SKILL.md +45 -0
  51. package/scripts/skill-templates/cache-manager/SKILL.md +66 -0
  52. package/scripts/skill-templates/cache-manager/cache-policy.md +126 -0
  53. package/scripts/skill-templates/check-update/SKILL.md +98 -0
  54. package/scripts/skill-templates/compare/SKILL.md +82 -0
  55. package/scripts/skill-templates/compare/compare-rubric.md +171 -0
  56. package/scripts/skill-templates/complete-cycle/SKILL.md +81 -0
  57. package/scripts/skill-templates/connections/SKILL.md +71 -0
  58. package/scripts/skill-templates/connections/connections-onboarding.md +608 -0
  59. package/scripts/skill-templates/context/SKILL.md +137 -0
  60. package/scripts/skill-templates/continue/SKILL.md +24 -0
  61. package/scripts/skill-templates/darkmode/SKILL.md +76 -0
  62. package/scripts/skill-templates/darkmode/darkmode-audit-procedure.md +258 -0
  63. package/scripts/skill-templates/debug/SKILL.md +41 -0
  64. package/scripts/skill-templates/debug/debug-feedback-loops.md +119 -0
  65. package/scripts/skill-templates/design/SKILL.md +118 -0
  66. package/scripts/skill-templates/design/design-procedure.md +304 -0
  67. package/scripts/skill-templates/discuss/SKILL.md +96 -0
  68. package/scripts/skill-templates/do/SKILL.md +45 -0
  69. package/scripts/skill-templates/explore/SKILL.md +118 -0
  70. package/scripts/skill-templates/explore/explore-procedure.md +267 -0
  71. package/scripts/skill-templates/export/SKILL.md +30 -0
  72. package/scripts/skill-templates/extract-learnings/SKILL.md +114 -0
  73. package/scripts/skill-templates/fast/SKILL.md +91 -0
  74. package/scripts/skill-templates/figma-extract/SKILL.md +64 -0
  75. package/scripts/skill-templates/figma-write/SKILL.md +50 -0
  76. package/scripts/skill-templates/graphify/SKILL.md +49 -0
  77. package/scripts/skill-templates/health/SKILL.md +99 -0
  78. package/scripts/skill-templates/health/health-mcp-detection.md +44 -0
  79. package/scripts/skill-templates/health/health-skill-length-report.md +69 -0
  80. package/scripts/skill-templates/help/SKILL.md +60 -0
  81. package/scripts/skill-templates/instinct/SKILL.md +111 -0
  82. package/scripts/skill-templates/list-assumptions/SKILL.md +61 -0
  83. package/scripts/skill-templates/list-pins/SKILL.md +27 -0
  84. package/scripts/skill-templates/live/SKILL.md +98 -0
  85. package/scripts/skill-templates/locale/SKILL.md +51 -0
  86. package/scripts/skill-templates/map/SKILL.md +89 -0
  87. package/scripts/skill-templates/migrate/SKILL.md +70 -0
  88. package/scripts/skill-templates/migrate-context/SKILL.md +123 -0
  89. package/scripts/skill-templates/new-addendum/SKILL.md +81 -0
  90. package/scripts/skill-templates/new-cycle/SKILL.md +37 -0
  91. package/scripts/skill-templates/new-project/SKILL.md +53 -0
  92. package/scripts/skill-templates/new-skill/SKILL.md +90 -0
  93. package/scripts/skill-templates/next/SKILL.md +68 -0
  94. package/scripts/skill-templates/note/SKILL.md +48 -0
  95. package/scripts/skill-templates/openrouter-status/SKILL.md +86 -0
  96. package/scripts/skill-templates/optimize/SKILL.md +97 -0
  97. package/scripts/skill-templates/override/SKILL.md +86 -0
  98. package/scripts/skill-templates/paper-write/SKILL.md +54 -0
  99. package/scripts/skill-templates/pause/SKILL.md +77 -0
  100. package/scripts/skill-templates/peer-cli-add/SKILL.md +88 -0
  101. package/scripts/skill-templates/peer-cli-add/peer-cli-protocol.md +161 -0
  102. package/scripts/skill-templates/peer-cli-customize/SKILL.md +89 -0
  103. package/scripts/skill-templates/peers/SKILL.md +96 -0
  104. package/scripts/skill-templates/pencil-write/SKILL.md +54 -0
  105. package/scripts/skill-templates/pin/SKILL.md +37 -0
  106. package/scripts/skill-templates/plan/SKILL.md +105 -0
  107. package/scripts/skill-templates/plan/plan-procedure.md +278 -0
  108. package/scripts/skill-templates/plant-seed/SKILL.md +48 -0
  109. package/scripts/skill-templates/pr-branch/SKILL.md +32 -0
  110. package/scripts/skill-templates/progress/SKILL.md +107 -0
  111. package/scripts/skill-templates/quality-gate/SKILL.md +90 -0
  112. package/scripts/skill-templates/quality-gate/threat-modeling.md +101 -0
  113. package/scripts/skill-templates/quick/SKILL.md +44 -0
  114. package/scripts/skill-templates/reapply-patches/SKILL.md +32 -0
  115. package/scripts/skill-templates/recall/SKILL.md +75 -0
  116. package/scripts/skill-templates/reflect/SKILL.md +85 -0
  117. package/scripts/skill-templates/reflect/procedures/capability-gap-scan.md +119 -0
  118. package/scripts/skill-templates/report-issue/SKILL.md +53 -0
  119. package/scripts/skill-templates/report-issue/report-issue-procedure.md +119 -0
  120. package/scripts/skill-templates/resume/SKILL.md +93 -0
  121. package/scripts/skill-templates/review-backlog/SKILL.md +46 -0
  122. package/scripts/skill-templates/review-decisions/SKILL.md +42 -0
  123. package/scripts/skill-templates/roi/SKILL.md +54 -0
  124. package/scripts/skill-templates/rollout-status/SKILL.md +35 -0
  125. package/scripts/skill-templates/router/SKILL.md +89 -0
  126. package/scripts/skill-templates/router/capability-gap-emitter.md +65 -0
  127. package/scripts/skill-templates/router/router-pick-emitter.md +78 -0
  128. package/scripts/skill-templates/router/router-rules.md +84 -0
  129. package/scripts/skill-templates/settings/SKILL.md +87 -0
  130. package/scripts/skill-templates/ship/SKILL.md +48 -0
  131. package/scripts/skill-templates/sketch/SKILL.md +78 -0
  132. package/scripts/skill-templates/sketch-wrap-up/SKILL.md +92 -0
  133. package/scripts/skill-templates/skill-manifest/SKILL.md +79 -0
  134. package/scripts/skill-templates/spike/SKILL.md +67 -0
  135. package/scripts/skill-templates/spike-wrap-up/SKILL.md +86 -0
  136. package/scripts/skill-templates/start/SKILL.md +67 -0
  137. package/scripts/skill-templates/start/start-procedure.md +115 -0
  138. package/scripts/skill-templates/state/SKILL.md +106 -0
  139. package/scripts/skill-templates/stats/SKILL.md +51 -0
  140. package/scripts/skill-templates/style/SKILL.md +71 -0
  141. package/scripts/skill-templates/style/style-doc-procedure.md +150 -0
  142. package/scripts/skill-templates/synthesize/SKILL.md +94 -0
  143. package/scripts/skill-templates/timeline/SKILL.md +66 -0
  144. package/scripts/skill-templates/todo/SKILL.md +64 -0
  145. package/scripts/skill-templates/turn-closeout/SKILL.md +95 -0
  146. package/scripts/skill-templates/undo/SKILL.md +31 -0
  147. package/scripts/skill-templates/unlock-decision/SKILL.md +54 -0
  148. package/scripts/skill-templates/unpin/SKILL.md +31 -0
  149. package/scripts/skill-templates/update/SKILL.md +56 -0
  150. package/scripts/skill-templates/using-gdd/SKILL.md +78 -0
  151. package/scripts/skill-templates/verify/SKILL.md +113 -0
  152. package/scripts/skill-templates/verify/verify-procedure.md +511 -0
  153. package/scripts/skill-templates/warm-cache/SKILL.md +81 -0
  154. package/scripts/skill-templates/watch-authorities/SKILL.md +82 -0
  155. package/scripts/skill-templates/zoom-out/SKILL.md +26 -0
  156. package/sdk/cli/commands/build.ts +2 -2
  157. package/sdk/cli/index.js +2 -2
  158. package/sdk/cli/index.ts +1 -1
  159. package/skills/README.md +22 -14
  160. package/skills/help/SKILL.md +28 -55
  161. package/skills/new-skill/SKILL.md +5 -5
@@ -0,0 +1,170 @@
1
+ ---
2
+ name: apply-reflections-procedure
3
+ type: heuristic
4
+ version: 1.3.0
5
+ phase: 30.5
6
+ tags: [apply-reflections, proposal, frontmatter, reference, budget, question, global-skill, incubator, kfm-candidate]
7
+ last_updated: 2026-05-21
8
+ ---
9
+
10
+ # Apply-Reflections - Per-Type Procedure
11
+
12
+ Extracted from `skills/apply-reflections/SKILL.md` per Phase 28.5 D-10 (extract-then-link,
13
+ never delete content). The orchestrator loop in `apply-reflections` (resolve file → parse →
14
+ review loop → summary) stays in the SKILL. The per-proposal-type apply logic below moves
15
+ here because it is content-class methodology, not workflow.
16
+
17
+ ## Apply Logic by Proposal Type
18
+
19
+ After the user chooses `a` (apply) or `e` (edit-then-apply) in the review loop, branch by
20
+ the proposal's bracketed type tag.
21
+
22
+ ### [FRONTMATTER]
23
+
24
+ 1. Extract agent name from Change field (e.g., `agents/design-verifier.md`)
25
+ 2. Read the agent file
26
+ 3. Find the frontmatter line matching the field being changed
27
+ 4. Use Edit tool to update the specific line
28
+ 5. Append `**Applied**: <date>` to the proposal in reflections file
29
+
30
+ ### [REFERENCE]
31
+
32
+ 1. Extract target file path from Change field (e.g., `reference/heuristics.md`)
33
+ 2. If file exists: append the drafted text using Edit tool
34
+ 3. If file doesn't exist: create it with a minimal header + the drafted text using Write tool
35
+ 4. Append `**Applied**: <date>` to proposal in reflections file
36
+
37
+ ### [BUDGET]
38
+
39
+ 1. Read `.design/budget.json`
40
+ 2. Locate the key path from the Change field (e.g., `design-verifier.per_run_cap_usd`)
41
+ 3. Update the value
42
+ 4. Write updated JSON back to `.design/budget.json`
43
+ 5. Append `**Applied**: <date>` to proposal in reflections file
44
+
45
+ ### [QUESTION]
46
+
47
+ 1. Read `agents/design-discussant.md`
48
+ 2. Find the question text specified in the Change field
49
+ 3. If pruning: remove the question lines using Edit tool
50
+ 4. If rewording: replace the question text using Edit tool
51
+ 5. Append `**Applied**: <date>` to proposal in reflections file
52
+
53
+ ### [GLOBAL-SKILL]
54
+
55
+ 1. Extract target filename from Change field (e.g., `design-color-conventions.md`)
56
+ 2. Ensure `~/.claude/gdd/global-skills/` directory exists (create with `mkdir -p` if not)
57
+ 3. If target file exists: append new content using Edit tool (add a `---` separator first)
58
+ 4. If target file doesn't exist: create with header + content using Write tool:
59
+
60
+ ```markdown
61
+ # <Topic> Conventions (Global)
62
+ *Promoted from project: <project-name>, cycle: <cycle-slug>*
63
+
64
+ <content>
65
+ ```
66
+
67
+ 5. Print: "Global skill written to ~/.claude/gdd/global-skills/<name>.md - auto-loads in all future gdd sessions"
68
+ 6. Append `**Applied**: <date>` to proposal in reflections file
69
+
70
+ ### [INCUBATOR]
71
+
72
+ Incubator drafts come from `scripts/lib/incubator-author.cjs` (Phase 29-04). They live at
73
+ `.design/reflections/incubator/<slug>/` and contain `manifest.json` + `DRAFT.md` + (optional) `ORIGIN.md`.
74
+
75
+ Use `scripts/lib/apply-reflections/incubator-proposals.cjs` for all actions.
76
+
77
+ **Discovery + render** (once per cycle):
78
+
79
+ 1. Call `discoverIncubatorDrafts()` → `Array<Draft>`. Skip malformed entries silently (already warned on stderr by the helper).
80
+ 2. For each draft: call `renderProposal(draft)` and print the returned markdown block. The user sees a header (slug + kind), a diff vs the nearest existing artifact (or "net-new"), an Origin section listing capability-gap signals, and the full draft body.
81
+ 3. Prompt: `(a) accept (r) reject (d) defer (e) edit (q) quit`.
82
+
83
+ **Per-action behavior:**
84
+
85
+ 1. **accept** - call `applyAccept(draft, { registryPath, repoRoot })`.
86
+ - The helper calls `validateScope(draft.target_path)` from `scripts/validate-incubator-scope.cjs` **before** any write. Out-of-scope paths throw and the registry stays untouched. This is the non-bypassable scope guard (D-05).
87
+ - On success: target artifact written, `reference/registry.json` appended with `{ slug, path, added, origin: 'incubator' }`, incubator subdir removed last (T-29.05-04 - partial-failure leaves draft retryable).
88
+ - Print: "Accepted - promoted to <target_path>; registered."
89
+ - Append `**Applied**: <date>` to the proposal block.
90
+
91
+ 2. **reject** - call `applyReject(draft)`. Only the incubator subdir is removed; registry is untouched. Append `**Reviewed: rejected**` to the reflections file.
92
+
93
+ 3. **defer** - no-op. Print "Deferred - draft re-surfaces next run." Append `**Reviewed: deferred**`.
94
+
95
+ 4. **edit** - call `applyEdit(draft)` (uses `$EDITOR` or the `editorCmd` array option). On clean exit, the helper reloads the draft and the caller re-runs `renderProposal` + the prompt. On non-zero exit, the original draft is preserved unchanged.
96
+
97
+ **Stage-1 gate (D-01 - no auto-flip):**
98
+
99
+ 1. At the start of the cycle, call `checkStage1Gate({ gateSpecPath, statePath, registryPath })`. The call is **read-only** - never mutates state. The returned `{ thresholdMet, summary, optInRecorded }` is informational.
100
+ 2. If `thresholdMet && !optInRecorded`, surface a one-time prompt:
101
+ ```
102
+ Stage-1 capability-gap authoring threshold met: <summary>
103
+ Enable incubator-draft promotion? (y/N)
104
+ ```
105
+ 3. **Only on explicit `y`**, call `recordOptIn({ statePath, confirmedBy })`. The function is idempotent - a second call detects the existing record and returns `{ alreadyRecorded: true }`. Never call it on any other input.
106
+
107
+ **Why this is gated.** The `[INCUBATOR]` proposal class can write executable surface (agents + skills) into the plugin runtime. Both Phase 29 D-01 (no auto-flip) and D-05 (scope guard) exist because that surface has integration-test and security implications that exceed reflector autonomy. `validateScope` keeps the file landing zone confined to `agents/<slug>.md` or `skills/<slug>/SKILL.md`. The Stage-1 gate keeps the *whether* of opting in to incubator authoring under explicit user control even after the data threshold says we have enough signal.
108
+
109
+ **Bandit-fairness gate on `accept` (Phase 29 Plan 06 / CONTEXT D-04).**
110
+
111
+ When the `accept` action promotes an incubator draft, the bandit-router arms for the freshly-promoted agent/skill MUST be bootstrapped with `prior_class: 'promoted_incubator'`. This invokes a conservative `Beta(2, 8)` bootstrap prior (posterior mean 0.2) instead of the optimistic Phase 23.5 informed prior - the bandit-fairness gate IS the staging mechanism (D-04: no separate two-step ratify split). The conservative prior suppresses preferential selection until ~8-10 successful pulls accumulate.
112
+
113
+ Call shape (whether eagerly invoked on promotion or via first-pull lazy bootstrap):
114
+
115
+ ```javascript
116
+ const bandit = require('./scripts/lib/bandit-router.cjs');
117
+ // Per arm bootstrapped for the freshly-promoted agent:
118
+ bandit.update({
119
+ agent: '<promoted-slug>',
120
+ bin: '<touches-bin>',
121
+ tier: '<chosen-tier>',
122
+ reward: <bernoulli>,
123
+ prior_class: 'promoted_incubator', // Phase 29 Plan 06 / D-04 — Beta(2,8) staging
124
+ });
125
+ // Or for the delegate-aware case (Plan 27-07):
126
+ bandit.updateWithDelegate({
127
+ agent: '<promoted-slug>',
128
+ bin: '<touches-bin>',
129
+ tier: '<chosen-tier>',
130
+ delegate: '<peer-cli-or-none>',
131
+ reward: <bernoulli>,
132
+ prior_class: 'promoted_incubator',
133
+ });
134
+ ```
135
+
136
+ Omitting `prior_class` reverts to Phase 23.5 informed-prior bootstrap (non-breaking). The reward math is unchanged - `prior_class` only affects bootstrap.
137
+
138
+ ### [KFM-CANDIDATE]
139
+
140
+ Known-failure-mode catalogue proposals come from `scripts/lib/reflector-kfm-proposer.cjs` (Phase 30.5-03 D-05). They live at `.design/reflections/incubator/kfm-<slug>/CATALOGUE-ENTRY.md` and contain a single fenced ```yaml block pre-filled with the Phase 30.5 schema-v2 11-field shape (`id` + `pattern` + `diagnosis` + `remedy` + `severity` + `propose_report` + `symptom` + `root_cause` + `fix` + `related_phases` + `first_observed_cycle`). Two of those — `pattern` and `fix` — are `TODO:` placeholders the reflector cannot infer; the user fills them via the **edit** action before accepting.
141
+
142
+ Two upstream signals share this draft surface (D-06):
143
+ - `capability_gap` clusters of size ≥3 with no existing-entry match (Phase 29-03 aggregator + `failure-mode-matcher.match()`).
144
+ - `kfm-candidate` events from the Phase 30.5-03 Task 2 authority-watcher whitelist (D-06 - single events bypass the ≥3 gate).
145
+
146
+ Use `scripts/lib/reflector-kfm-proposer.cjs` for all actions:
147
+
148
+ **Discovery + render** (once per cycle):
149
+
150
+ 1. Glob `.design/reflections/incubator/kfm-*/CATALOGUE-ENTRY.md` → list pending KFM drafts.
151
+ 2. For each draft: read the body, show the origin header (source, parent event ids OR article url) + the proposed yaml block.
152
+ 3. Prompt: `(a) accept (r) reject (d) defer (e) edit (q) quit`.
153
+
154
+ **Per-action behavior:**
155
+
156
+ 1. **accept** - call `applyAccept(draftPath, { repoRoot })`.
157
+ - The helper re-stamps the proposed `id` with the next available `KFM-NNN` from the catalogue (avoids collisions when multiple drafts promote in the same run).
158
+ - Appends a `### KFM-NNN — <symptom heading>` section into `reference/known-failure-modes.md` with the yaml block intact.
159
+ - Appends a `reference/registry.json` entry: `{ name: 'known-failure-modes/kfm-NNN', path: 'reference/known-failure-modes.md', type: 'failure-mode', phase: 30.5, origin: 'incubator-kfm', added: '<ISO date>' }`.
160
+ - Removes the incubator subdir LAST (partial-failure leaves the draft retryable).
161
+ - Print: "Accepted - promoted to KFM-NNN in reference/known-failure-modes.md."
162
+ - Append `**Applied**: <date>` to the proposal entry (when surfaced from a reflections file).
163
+
164
+ 2. **reject** - call `applyReject(draftPath)`. Only the incubator subdir is removed; catalogue + registry untouched. Print: "Rejected - draft removed."
165
+
166
+ 3. **defer** - call `applyDefer(draftPath, { deferredUntil })` where `deferredUntil` is an ISO date (default: today + 30d). The helper stamps `deferred_until: <ISO>` into the draft body. Print: "Deferred - draft re-surfaces next run."
167
+
168
+ 4. **edit** - call `applyEdit(draftPath)` which returns the draft path. The caller opens `$EDITOR` on the path; on clean exit, re-discover the draft and re-prompt. Typical edits: replace `pattern: 'TODO: ...'` with a conservative regex, replace `fix: 'TODO: ...'` with a step-by-step user-runnable remedy, set `severity` if `medium` default is wrong.
169
+
170
+ **Why this is gated.** `reference/known-failure-modes.md` feeds Phase 30's `triage-matcher.cjs` BEFORE the consent prompt - a bad entry could mute legitimate issue reports. The user-review gate is non-negotiable (D-05). The proposer is strictly proposal-only; the canonical catalogue only changes via the accept action.
@@ -0,0 +1,79 @@
1
+ ---
2
+ name: gdd-audit
3
+ description: "Run a design audit by spawning design-auditor, design-integration-checker, and (optionally) design-verifier + design-reflector agents, then printing a consolidated 7-pillar score summary. Use when the user wants to score the current design, retroactively verify a completed cycle, or quickly re-check after a fix. Activates for requests involving scoring an existing design, retroactively reviewing quality, or re-checking after a fix."
4
+ argument-hint: "[--retroactive] [--quick] [--no-reflect]"
5
+ tools: Read, Write, Task, Glob, Bash
6
+ ---
7
+
8
+ # {{command_prefix}}audit
9
+
10
+ Wraps the existing `design-auditor`, `design-verifier`, and `design-integration-checker` agents - no new auditor logic here. Parses flags, spawns the right combination, prints summary.
11
+
12
+ For the 7-pillar scoring rubric this skill aggregates, see `../../reference/audit-scoring.md`. For the shared design-quality pillar set that frames the score categories, see `../../reference/shared-preamble.md`.
13
+
14
+ ## Modes
15
+
16
+ ### Default
17
+ Spawn `design-auditor` (7-pillar scoring 1–4) in parallel with `design-integration-checker`. After both finish, read `.design/DESIGN-AUDIT.md` and `.design/DESIGN-INTEGRATION.md` and print a consolidated summary (scores + top 3 findings each).
18
+
19
+ After the auditor and integration checker complete, check if `.design/learnings/` exists and contains at least one `.md` file. If so - and unless `--no-reflect` is passed - spawn `design-reflector` for the current cycle. Append the reflection proposal count to the audit summary: "Reflection: N proposals → review with `{{command_prefix}}apply-reflections`".
20
+
21
+ ### `--retroactive`
22
+ Spawn `design-verifier` with cycle-span scope. Verifier reads all tasks completed in the current cycle (from STATE.md `<completed_tasks>` list for the active `cycle:` ID) and uses `DESIGN-PLAN.md` goals as the reference baseline for what "should have been done." Output: `.design/DESIGN-VERIFICATION.md` with per-task pass/fail.
23
+
24
+ ### `--quick`
25
+ Run only `design-auditor` (skip `design-integration-checker`). Faster health check when integration isn't the concern.
26
+
27
+ ## Steps
28
+
29
+ 1. Parse args for `--retroactive`, `--quick`, and `--no-reflect`.
30
+ 2. Verify `.design/STATE.md` exists; abort if not (suggest `{{command_prefix}}new-project`).
31
+ 3. Spawn the appropriate agents (Task tool). Default and `--retroactive` spawn two agents; `--quick` spawns one.
32
+ 4. Wait for completion, then read each output file and print a summary:
33
+ - Auditor scores per pillar
34
+ - Integration check pass/fail
35
+ - Verifier pass/fail per task (retroactive mode)
36
+ 5. **Reflection step** (default + retroactive modes only, skipped with `--no-reflect` or `--quick`):
37
+ - Check if `.design/learnings/` exists and has ≥1 `.md` file
38
+ - If yes: spawn `design-reflector` for the current cycle slug (read from STATE.md)
39
+ - After completion: count proposal types and append to summary
40
+ 6. Recommend next action based on findings (e.g., "Score 2/4 on typography - run `{{command_prefix}}discuss typography` to gather decisions").
41
+
42
+ ## Registered Audit Agents
43
+
44
+ | Agent | Trigger | Output |
45
+ |---|---|---|
46
+ | `design-auditor` | Default, retroactive | `.design/DESIGN-AUDIT.md` |
47
+ | `design-integration-checker` | Default, retroactive | `.design/DESIGN-INTEGRATION.md` |
48
+ | `design-verifier` | `--retroactive` only | `.design/DESIGN-VERIFICATION.md` |
49
+ | `design-reflector` | Default + retroactive when learnings exist | `.design/reflections/<slug>.md` |
50
+
51
+ ## Do Not
52
+
53
+ - Do not modify source files.
54
+ - Do not rerun stages; this is a read-only audit.
55
+
56
+ ## Step 7 - Update notice (post-closeout surface)
57
+
58
+ After the consolidated audit summary has been printed (and any reflection-proposal count appended), emit the plugin-update banner if one is present:
59
+
60
+ ```bash
61
+ [ -f .design/update-available.md ] && cat .design/update-available.md
62
+ ```
63
+
64
+ Written by `hooks/update-check.sh`; suppressed mid-pipeline and when the latest release is dismissed.
65
+
66
+ ## Rationalizations - Thought to Reality
67
+
68
+ The excuses an agent reaches for to skip or thin out an audit, and the drift each one misses:
69
+
70
+ | Thought | Reality |
71
+ |---------|---------|
72
+ | "The audit passed last cycle, I can skip it this cycle." | Per-cycle audit catches drift the prior pass couldn't see; a skipped review is exactly where regressions accumulate unnoticed. |
73
+ | "`--quick` is fine, integration isn't the concern here." | Dropping the integration-checker hides orphaned decisions - wiring breaks even when the 7-pillar score looks healthy. |
74
+ | "I can eyeball the scores instead of spawning the auditor." | The auditor's rubric scores seven pillars consistently; an eyeballed review drifts toward whatever the agent already believes. |
75
+ | "Reflection proposals are optional polish, skip the reflector." | The reflector turns this cycle's learnings into next-cycle improvements; skipping it lets the same mistakes repeat. |
76
+ | "I'll modify the source while I'm in here fixing findings." | Audit is read-only by contract; editing source mid-audit invalidates the very scores you're producing. |
77
+ | "Retroactive mode is overkill for a finished cycle." | Retroactive verification is the only check on tasks that shipped without per-task verify - skipping it leaves a completed cycle unaudited. |
78
+
79
+ ## AUDIT COMPLETE
@@ -0,0 +1,91 @@
1
+ ---
2
+ name: gdd-bandit-reset
3
+ description: "Confirm-then-reset the per-(agent, bin, delegate) bandit posterior - backs up .design/telemetry/posterior.json to posterior.json.bak, then clears it to a fresh empty envelope. Mutation companion to read-only bandit-status. Use when the posterior is corrupted/unparseable, after a major agent/skill roster change invalidates accumulated arms, or when you deliberately want to rebootstrap adaptive routing from informed priors."
4
+ argument-hint: "[--yes to skip the confirmation prompt]"
5
+ tools: Read, Write, Bash, AskUserQuestion
6
+ disable-model-invocation: true
7
+ ---
8
+
9
+ # gdd-bandit-reset
10
+
11
+ ## Role
12
+
13
+ You are a deterministic, destructive maintenance skill. You are the ONLY skill that clears the bandit posterior - the mutation companion to read-only `{{command_prefix}}bandit-status`. You read the posterior path declared by `scripts/lib/bandit-router.cjs`'s `DEFAULT_POSTERIOR_PATH` (`.design/telemetry/posterior.json`), REQUIRE explicit confirmation, back the file up to `posterior.json.bak`, then overwrite it with a fresh empty envelope so the next bandit pull rebootstraps from informed priors. See `./reference/bandit-integration.md` for setup, interpretation, and convergence guidance.
14
+
15
+ ## Invocation Contract
16
+
17
+ - **Input**: optional `--yes` to skip the interactive confirmation (for non-interactive/automated runs).
18
+ - **Output**: a Markdown reset receipt to stdout (backup path + arms cleared + envelope written).
19
+
20
+ ## Procedure
21
+
22
+ ### 1. Locate the posterior file
23
+
24
+ Read `.design/telemetry/posterior.json` (path declared by `scripts/lib/bandit-router.cjs`'s `DEFAULT_POSTERIOR_PATH` - never hardcode a different path). Missing → nothing to reset; emit and skip to Section 5 (Record):
25
+
26
+ ```
27
+ ## Bandit Posterior Reset
28
+
29
+ No posterior file found at `.design/telemetry/posterior.json` — nothing to reset.
30
+
31
+ The next bandit pull with `adaptive_mode: full` will bootstrap a fresh posterior from informed priors. See `reference/bandit-integration.md`.
32
+ ```
33
+
34
+ If present, count the arms (`arms.length`, treating a missing/non-array `arms` as `0`) so the confirmation and receipt can report what will be cleared. A corrupted/unparseable file is still resettable - report `arms: unknown (file unparseable)` and continue.
35
+
36
+ ### 2. Require explicit confirmation
37
+
38
+ This is a DESTRUCTIVE operation. Do NOT proceed without confirmation.
39
+
40
+ - If `--yes` was passed, skip straight to Section 3.
41
+ - Otherwise, prompt via AskUserQuestion: "Reset the bandit posterior at `.design/telemetry/posterior.json`? This clears <N> learned arms. A backup will be written to `posterior.json.bak` first." with options **Reset** and **Cancel**.
42
+ - On **Cancel** (or any non-affirmative answer), abort WITHOUT touching either the posterior or the backup, and emit:
43
+
44
+ ```
45
+ ## Bandit Posterior Reset — Cancelled
46
+
47
+ No changes made. The posterior at `.design/telemetry/posterior.json` is untouched (<N> arms).
48
+ ```
49
+
50
+ Then skip to Section 5 (Record) with `reset: false`.
51
+
52
+ ### 3. Back up the current posterior
53
+
54
+ Copy the live posterior to `.design/telemetry/posterior.json.bak` (sibling backup) BEFORE clearing it, so the previous state is always recoverable. Overwrite any existing `.bak` from a prior reset. If the backup write fails, ABORT before clearing; never clear without a successful backup.
55
+
56
+ ### 4. Clear to a fresh empty envelope
57
+
58
+ Overwrite `.design/telemetry/posterior.json` with a fresh empty envelope matching `scripts/lib/bandit-router.cjs`'s `loadPosterior()` shape (`SCHEMA_VERSION` = `1.0.0`, current ISO `generated_at`, empty `arms`):
59
+
60
+ ```json
61
+ {
62
+ "schema_version": "1.0.0",
63
+ "generated_at": "<ISO>",
64
+ "arms": []
65
+ }
66
+ ```
67
+
68
+ Write atomically where possible (`.tmp` + rename, mirroring `savePosterior()`). Then emit the receipt:
69
+
70
+ ```
71
+ ## Bandit Posterior Reset
72
+
73
+ Posterior cleared. The next bandit pull with `adaptive_mode: full` will rebootstrap from informed priors.
74
+
75
+ - Backup: `.design/telemetry/posterior.json.bak`
76
+ - Arms cleared: <N>
77
+ - Fresh envelope: `.design/telemetry/posterior.json` (schema_version 1.0.0, 0 arms)
78
+
79
+ Restore the previous state with: `cp .design/telemetry/posterior.json.bak .design/telemetry/posterior.json`
80
+ Verify the cleared state with `{{command_prefix}}bandit-status`. See `reference/bandit-integration.md`.
81
+ ```
82
+
83
+ ### 5. Record
84
+
85
+ Append one JSONL line to `.design/skill-records.jsonl`: `{"skill":"gdd-bandit-reset","ts":"<ISO>","reset":<bool>,"arms_cleared":<count>,"backup_written":<bool>}`. The skill mutates ONLY the posterior (+ its `.bak`) and appends to skill-records.jsonl (telemetry); it touches no other state.
86
+
87
+ ## Cross-references
88
+
89
+ - `{{command_prefix}}bandit-status` - read-only companion; inspect the posterior before/after a reset.
90
+ - `./reference/bandit-integration.md` - operator guide; interpretation patterns and when a reset is warranted.
91
+ - `scripts/lib/bandit-router.cjs` - posterior shape, `DEFAULT_POSTERIOR_PATH`, `SCHEMA_VERSION`, `loadPosterior()`, `savePosterior()`, `reset()`.
@@ -0,0 +1,94 @@
1
+ ---
2
+ name: gdd-bandit-status
3
+ description: "Surface read-only per-(agent, bin, delegate) bandit posterior snapshot - alpha/beta/mean/stddev/count/last-used per arm. Phase 27.5 (v1.27.5) diagnostic. Use when investigating 'why did the bandit pick tier X for agent Y?' or when verifying posterior convergence after enabling adaptive_mode: full."
4
+ argument-hint: ""
5
+ tools: Read, Bash
6
+ ---
7
+
8
+ # gdd-bandit-status
9
+
10
+ ## Role
11
+
12
+ You are a deterministic, read-only diagnostic skill. You do not spawn agents and do not modify the posterior. You read `.design/telemetry/posterior.json` (path declared by `scripts/lib/bandit-router.cjs`'s `DEFAULT_POSTERIOR_PATH`), aggregate per-`(agent, bin, delegate, tier)` arm state, and emit a single Markdown table. Read-only per Phase 27.5 D-11 - to reset, use `{{command_prefix}}bandit-reset` (Phase 23.5). See `./reference/bandit-integration.md` for setup, interpretation, and convergence guidance.
13
+
14
+ ## Invocation Contract
15
+
16
+ - **Input**: none.
17
+ - **Output**: a Markdown bandit-status table to stdout. The table is the entire output.
18
+
19
+ ## Procedure
20
+
21
+ ### 1. Locate the posterior file
22
+
23
+ Read `.design/telemetry/posterior.json`. Missing → emit empty-state message:
24
+
25
+ ```
26
+ ## Bandit Posterior Snapshot
27
+
28
+ No posterior data yet — run a few pipeline cycles with `adaptive_mode: full` first.
29
+
30
+ No posterior data found at `.design/telemetry/posterior.json`.
31
+
32
+ Possible reasons:
33
+ - `adaptive_mode` is `static` or `hedge` (bandit silent — see `.design/budget.json`).
34
+ - No spawns have fired since Phase 27.5 wiring landed.
35
+ - Posterior was cleared via `{{command_prefix}}bandit-reset`.
36
+
37
+ See `reference/bandit-integration.md` for setup guidance.
38
+ ```
39
+
40
+ Skip to Section 4 (Record). Parse failure (truncated/corrupted) → emit `Posterior file exists but is unparseable. Run {{command_prefix}}bandit-reset to start fresh, or restore from a backup.`
41
+
42
+ ### 2. Parse the posterior
43
+
44
+ Schema:
45
+
46
+ ```json
47
+ {
48
+ "schema_version": "1.0.0",
49
+ "generated_at": "<ISO>",
50
+ "arms": [{ "agent": "...", "bin": "...", "tier": "...", "delegate": "...", "alpha": N, "beta": N, "last_used": "...", "count": N }]
51
+ }
52
+ ```
53
+
54
+ The `delegate` field is optional - absent = Phase 23.5 legacy slice (rendered as `-` in the table).
55
+
56
+ ### 3. Render the table
57
+
58
+ Compute per arm: `mean = alpha / (alpha + beta)` (3 decimals), `stddev = sqrt(alpha*beta / ((alpha+beta)^2 * (alpha+beta+1)))` (3 decimals).
59
+
60
+ Sort by `(agent ASC, bin ASC, delegate ASC where '-' first, tier ASC opus<sonnet<haiku, last_used DESC)`. Group by agent for readability.
61
+
62
+ Emit:
63
+
64
+ ```
65
+ ## Bandit Posterior Snapshot
66
+
67
+ Per-(agent, bin, delegate, tier) posterior state. Read-only — to reset use `{{command_prefix}}bandit-reset` (Phase 23.5).
68
+
69
+ Posterior file: `.design/telemetry/posterior.json` (last updated: <generated_at>)
70
+ Total arms: <count>
71
+
72
+ | Agent | Bin | Delegate | Tier | Alpha | Beta | Mean | Stddev | Count | Last Used |
73
+ |-------|-----|----------|------|-------|------|------|--------|-------|-----------|
74
+ | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
75
+
76
+ > Mean = alpha / (alpha + beta). Stddev = sqrt(alpha*beta / ((alpha+beta)^2 * (alpha+beta+1))).
77
+ > Delegate '-' = Phase 23.5 legacy slice (equivalent to 'none').
78
+ > See `reference/bandit-integration.md` for interpretation.
79
+ > Read-only — use `{{command_prefix}}bandit-reset` to clear posterior state.
80
+ ```
81
+
82
+ Precision: alpha/beta 2 decimals; mean/stddev 3 decimals; count integer; `last_used` truncated to minute (`YYYY-MM-DDTHH:MM`); null `last_used` renders `-`.
83
+
84
+ After the table, surface a per-`(agent, bin)` best-arm summary: for each unique pair, identify highest-mean arm (tie-broken by `count` DESC) - answers "why did the bandit pick tier X?" at a glance.
85
+
86
+ ### 4. Record
87
+
88
+ Append one JSONL line to `.design/skill-records.jsonl`: `{"skill":"gdd-bandit-status","ts":"<ISO>","arms_seen":<count>,"posterior_present":<bool>}`. Skill writes ONLY to skill-records.jsonl (telemetry); never touches the posterior.
89
+
90
+ ## Cross-references
91
+
92
+ - `./reference/bandit-integration.md` - operator guide; interpretation patterns.
93
+ - `scripts/lib/bandit-router.cjs` (Phase 23.5) - posterior shape, `DEFAULT_POSTERIOR_PATH`, `loadPosterior()`.
94
+ - `scripts/lib/bandit-router/integration.cjs` (27.5-01), `hooks/budget-enforcer.ts` (27.5-02), `scripts/lib/session-runner/index.ts` (27.5-03), `scripts/lib/bandit-arbitrage.cjs` (27.5-04), `{{command_prefix}}bandit-reset` (Phase 23.5) - only surface that mutates the posterior.
@@ -0,0 +1,65 @@
1
+ ---
2
+ name: gdd-benchmark
3
+ description: "Harvest and synthesize per-component design benchmarks from 18 design systems and produce canonical component specs at `reference/components/<name>.md`. Use when adding a new component spec, running a benchmark wave, listing corpus coverage, or refreshing a spec after a design-system version bump."
4
+ argument-hint: "<component> | --wave <N> | --list | --refresh <component>"
5
+ tools: Read, Write, Bash, Grep, Glob, Task, WebFetch
6
+ ---
7
+
8
+ # {{command_prefix}}benchmark
9
+
10
+ Harvest per-component design knowledge from 18 design systems and synthesize canonical
11
+ specs at `reference/components/<name>.md`. The 18-source corpus + fallback chain lives in
12
+ `../../connections/design-corpora.md`. Per-skill output discipline + completion-marker
13
+ conventions are at `../../reference/shared-preamble.md#output-contract-reminders`.
14
+
15
+ ## Invocation Modes
16
+
17
+ | Invocation | Action |
18
+ |------------|--------|
19
+ | `{{command_prefix}}benchmark <component>` | Harvest + synthesize a single component |
20
+ | `{{command_prefix}}benchmark --wave <N>` | Run a full wave (1 = Inputs, 2 = Containers, etc.) |
21
+ | `{{command_prefix}}benchmark --list` | Show corpus coverage - which specs exist, which are pending |
22
+ | `{{command_prefix}}benchmark --refresh <component>` | Re-harvest a spec (for design-system version bumps) |
23
+
24
+ ## Single-Component Flow (`{{command_prefix}}benchmark <component>`)
25
+
26
+ 1. **Check if spec exists** - `Glob("reference/components/<component>.md")`. If found and `--refresh` was not passed, confirm before overwriting.
27
+
28
+ 2. **Harvest** - spawn `component-benchmark-harvester` with required-reading `@connections/design-corpora.md`, target component, raw-output path `.planning/benchmarks/raw/<component>.md`, and a salvage hint to `.planning/research/impeccable-salvage/`. Acceptance: raw harvest exists with ≥4 source sections.
29
+
30
+ 3. **Synthesize** - spawn `component-benchmark-synthesizer` with required-reading `@.planning/benchmarks/raw/<component>.md`, `@reference/components/TEMPLATE.md`, `@reference/anti-patterns.md`. Output: `reference/components/<component>.md`. Also update `reference/components/README.md` (add entry in correct category). Acceptance: spec ≤350 lines, cites ≥4 systems, follows `TEMPLATE.md` sections, has a WAI-ARIA keyboard contract + a failing-example block.
31
+
32
+ 4. **Report** - print spec path, line count, systems cited.
33
+
34
+ ## Wave Mode (`{{command_prefix}}benchmark --wave <N>`)
35
+
36
+ Read the wave definition from `reference/components/README.md` and run each component sequentially (not parallel - each harvest is network-bound and the raw files are large).
37
+
38
+ | Wave | Components |
39
+ |------|-----------|
40
+ | 1 | button, input, select-combobox, checkbox, radio, switch, link, label |
41
+ | 2 | card, modal-dialog, drawer, popover, tooltip, accordion, tabs |
42
+
43
+ Print progress per component: `[N/total] harvesting <component>…`
44
+
45
+ ## List Mode (`{{command_prefix}}benchmark --list`)
46
+
47
+ Read `reference/components/README.md` and diff against `reference/components/*.md` files. Print a table with columns: Component, Status, Wave, Lines.
48
+
49
+ ## Refresh Mode (`{{command_prefix}}benchmark --refresh <component>`)
50
+
51
+ Same as single-component flow but skips the "already exists" guard. Use when a design system ships a breaking update to a component's spec.
52
+
53
+ ## Source List
54
+
55
+ `../../connections/design-corpora.md` - 18 design systems with canonical URLs, licensing, and fallback chain (canonical → archive.org → Refero MCP → Pinterest MCP).
56
+
57
+ ## Output Artifacts
58
+
59
+ | Artifact | Purpose |
60
+ |----------|---------|
61
+ | `.planning/benchmarks/raw/<component>.md` | Raw multi-source harvest (input only) |
62
+ | `reference/components/<component>.md` | Canonical spec (distributed with plugin) |
63
+ | `reference/components/README.md` | Corpus index (updated by synthesizer) |
64
+
65
+ ## BENCHMARK COMPLETE
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: gdd-bootstrap-ds
3
+ description: "Bootstraps a design system for a GREENFIELD project that has none - no Figma, no tokens, no component library. Takes a brand input (primary color + optional secondary + tone tags + target framework) and emits a coherent OKLCH token system (color tints, modular type scale, 4pt/8pt spacing, radius + motion defaults) in 3 variants to pick from, then scaffolds proof components (button/input/card). Use at the start of a brand-new project, or when {{command_prefix}}explore finds no existing design system. Never invents a brand; never overwrites an existing DS."
4
+ argument-hint: "[--primary <color>] [--secondary <color>] [--tone <tags>] [--framework web|native-ios|native-android|flutter]"
5
+ user-invocable: true
6
+ tools: Read, Write, Bash, Glob, Grep, AskUserQuestion, Task
7
+ ---
8
+
9
+ # {{command_prefix}}bootstrap-ds
10
+
11
+ Greenfield design-system bootstrap. Closes the gap that GDD's `design-context-builder` assumes a design system already exists (in code or Figma) - a brand-new project has none. This skill is the **front door**: it collects a brand input and hands it to `agents/ds-generator.md`, which emits the token system + proof components per `reference/ds-bootstrap-rubric.md` (deterministic math in `scripts/lib/ds/token-scale.cjs`).
12
+
13
+ ## When to use
14
+
15
+ - At the start of a brand-new project (no `tailwind.config`, no token file, no DS).
16
+ - When `{{command_prefix}}discover` / `design-context-builder` reports **no existing design system** and the user opts to bootstrap one.
17
+
18
+ If a design system **already exists**, do NOT run this - defer to `design-context-builder` (it maps the existing one). State that and stop.
19
+
20
+ ## Steps
21
+
22
+ 1. **Collect the brand input.** From flags, or via `AskUserQuestion` for anything missing:
23
+ - **primary** (required) - the brand color (hex / rgb / `oklch()`).
24
+ - **secondary** (optional) - a second brand color (emitted only if supplied - the rubric's ≤2-brand-colors rule).
25
+ - **tone tags** (optional) - `calm` / `corporate` / `editorial` / `playful` / `bold` (maps to the type ratio + chroma treatment).
26
+ - **target framework** (optional) - `web` (default) / `native-ios` / `native-android` / `flutter`. Detect from the project if absent (Phase 34 routing).
27
+ 2. **Delegate to `ds-generator`** (via `Task`): it resolves the primary to OKLCH, runs `token-scale.cjs` for **3 variants** (conservative / balanced / bold), and presents them.
28
+ 3. **Pick a variant.** Surface the 3 variants (primary `500`, type ratio, spacing baseline, radius, feel); the user picks ONE.
29
+ 4. **Emit + scaffold (proposal → confirm).** `ds-generator` emits the chosen token set (role-named CSS custom properties + the framework mapping) and scaffolds **button / input / card** as a coherence proof. Nothing is written to `src/` without confirmation.
30
+
31
+ ## Do Not
32
+
33
+ - Do not invent a brand (no logomark, no typeface choice, no third brand color) - emit a token *system*, not an identity.
34
+ - Do not overwrite an existing design system - defer to `design-context-builder`.
35
+ - Do not add a color-conversion dependency - `token-scale.cjs` emits native CSS `oklch()`.
36
+
37
+ ## Output
38
+
39
+ End with:
40
+
41
+ ```
42
+ ## BOOTSTRAP-DS COMPLETE
43
+ ```