@hegemonart/get-design-done 1.28.8 → 1.30.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 (58) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +116 -0
  4. package/README.de.md +25 -0
  5. package/README.fr.md +25 -0
  6. package/README.it.md +25 -0
  7. package/README.ja.md +25 -0
  8. package/README.ko.md +25 -0
  9. package/README.md +30 -0
  10. package/README.zh-CN.md +25 -0
  11. package/SKILL.md +2 -0
  12. package/agents/design-authority-watcher.md +42 -1
  13. package/agents/design-reflector.md +50 -0
  14. package/package.json +1 -1
  15. package/reference/capability-gap-stage-gate.md +261 -0
  16. package/reference/known-failure-modes.md +521 -0
  17. package/reference/pseudonymization-rules.md +189 -0
  18. package/reference/registry.json +22 -1
  19. package/reference/schemas/events.schema.json +158 -3
  20. package/reference/schemas/generated.d.ts +319 -4
  21. package/scripts/cli/gdd-events.mjs +35 -2
  22. package/scripts/gsd-cleanup-incubator.cjs +367 -0
  23. package/scripts/lib/apply-reflections/incubator-proposals.cjs +455 -0
  24. package/scripts/lib/authority-watcher/index.cjs +201 -0
  25. package/scripts/lib/bandit-router.cjs +92 -9
  26. package/scripts/lib/failure-mode-matcher.cjs +460 -0
  27. package/scripts/lib/gsd-health-mirror/index.cjs +37 -1
  28. package/scripts/lib/incubator-author.cjs +845 -0
  29. package/scripts/lib/install/interactive.cjs +27 -2
  30. package/scripts/lib/issue-reporter/cli-flag-report.cjs +153 -0
  31. package/scripts/lib/issue-reporter/consent-prompt.cjs +231 -0
  32. package/scripts/lib/issue-reporter/dedup.cjs +458 -0
  33. package/scripts/lib/issue-reporter/destination.cjs +37 -0
  34. package/scripts/lib/issue-reporter/draft-writer.cjs +157 -0
  35. package/scripts/lib/issue-reporter/gh-absent-fallback.cjs +220 -0
  36. package/scripts/lib/issue-reporter/gh-submit.cjs +114 -0
  37. package/scripts/lib/issue-reporter/kill-switch.cjs +122 -0
  38. package/scripts/lib/issue-reporter/payload-assembly.cjs +367 -0
  39. package/scripts/lib/issue-reporter/privacy-diff.cjs +385 -0
  40. package/scripts/lib/issue-reporter/report-flow.cjs +269 -0
  41. package/scripts/lib/issue-reporter/triage-matcher.cjs +270 -0
  42. package/scripts/lib/pseudonymize.cjs +444 -0
  43. package/scripts/lib/reflections-cycle-writer.cjs +172 -0
  44. package/scripts/lib/reflector/capability-gap-scan.cjs +751 -0
  45. package/scripts/lib/reflector-capability-gap-aggregator.cjs +352 -0
  46. package/scripts/lib/reflector-kfm-proposer.cjs +468 -0
  47. package/scripts/release-smoke-test.cjs +33 -2
  48. package/scripts/validate-incubator-scope.cjs +133 -0
  49. package/skills/apply-reflections/SKILL.md +20 -1
  50. package/skills/apply-reflections/apply-reflections-procedure.md +106 -4
  51. package/skills/fast/SKILL.md +46 -0
  52. package/skills/reflect/SKILL.md +9 -0
  53. package/skills/reflect/procedures/capability-gap-scan.md +120 -0
  54. package/skills/report-issue/SKILL.md +53 -0
  55. package/skills/report-issue/report-issue-procedure.md +120 -0
  56. package/skills/router/SKILL.md +5 -0
  57. package/skills/router/capability-gap-emitter.md +65 -0
  58. package/skills/update/SKILL.md +3 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hegemonart/get-design-done",
3
- "version": "1.28.8",
3
+ "version": "1.30.5",
4
4
  "description": "A design-quality pipeline for AI coding agents: brief, plan, implement, and verify UI work against your design system.",
5
5
  "author": "Hegemon",
6
6
  "homepage": "https://github.com/hegemonart/get-design-done",
@@ -0,0 +1,261 @@
1
+ # Capability-Gap Stage-0 → Stage-1 Gate Specification
2
+
3
+ > Phase 29 reference doc. Specifies the deterministic gate that decides when
4
+ > the reflector has gathered enough `capability_gap` signal to surface a
5
+ > one-time opt-in prompt for Stage-1 (incubator authoring of new agents /
6
+ > skills). **No code path in this repository auto-flips the stage** —
7
+ > D-01 is the discipline.
8
+
9
+ ---
10
+
11
+ ## 1. Overview
12
+
13
+ Phase 29 ships in two stages:
14
+
15
+ - **Stage 0** (Wave A, v1.29.0) emits `capability_gap` events from
16
+ `/gdd:fast` no-skill-match (Plan 29-01), `gdd-router` unmatched-intent
17
+ (Plan 29-01), and the reflector pattern-detection pass (Plan 29-02).
18
+ - **Stage 1** (Wave B) layers incubator authoring of agents and skills on
19
+ top of the Stage-0 signal (Plans 29-04 / 29-05 / 29-06).
20
+
21
+ The transition Stage 0 → Stage 1 is **gated on data**, not on a calendar
22
+ date or a release. The reflector aggregates events into per-cycle
23
+ clusters (`scripts/lib/reflector-capability-gap-aggregator.cjs`) and
24
+ evaluates a deterministic stability function against the project's
25
+ cycle history. When the gate is crossed, `/gdd:apply-reflections`
26
+ emits a **one-time user-facing prompt** in the cycle markdown — never
27
+ an auto-stage-flip. The user opting in is a separate explicit action,
28
+ out of scope for this gate spec.
29
+
30
+ Reference: **Phase 29 CONTEXT.md decision D-01** (two-stage approach;
31
+ user opts in per a one-time prompt; if data is thin, Stage 1 never
32
+ auto-enables).
33
+
34
+ ---
35
+
36
+ ## 2. Default thresholds
37
+
38
+ The gate has three knobs, all set in `.design/config.json`
39
+ under the `capability_gap_gate` key. Defaults:
40
+
41
+ | Knob | Default | Meaning |
42
+ |------|---------|---------|
43
+ | `K` | `3` | Minimum number of **stable clusters** required to cross the gate. |
44
+ | `M` | `10` | Minimum number of **consecutive cycles** a cluster must appear in to be considered for stability. |
45
+ | `stddev_threshold` | `0.05` | Maximum allowed posterior `stddev(Beta(α, β))` for a cluster to be considered stable. |
46
+
47
+ All three are overridable via `.design/config.json`:
48
+
49
+ ```jsonc
50
+ {
51
+ "capability_gap_gate": {
52
+ "K": 3,
53
+ "M": 10,
54
+ "stddev_threshold": 0.05
55
+ }
56
+ }
57
+ ```
58
+
59
+ Reference: **Phase 29 CONTEXT.md decision D-03** (defaults are starting
60
+ points; first-N-users data should refine).
61
+
62
+ Validation: `K` must be a positive integer, `M` a positive integer,
63
+ `stddev_threshold` a number in `(0, 1]`. The evaluator silently falls
64
+ back to defaults if any value is invalid (T-29.03-02 mitigation in the
65
+ plan's threat model).
66
+
67
+ ---
68
+
69
+ ## 3. Stability formula
70
+
71
+ A cluster `c` is **stable** iff both conditions hold:
72
+
73
+ 1. **Consecutive presence.** `c` appears in `≥ M` consecutive cycles
74
+ somewhere within the observed history. (The most recent unbroken
75
+ run is what matters — if a cluster missed a cycle, the run resets
76
+ and only the longest streak counts.)
77
+ 2. **Narrow posterior.** The closed-form posterior standard deviation
78
+ of the Beta distribution satisfies:
79
+
80
+ ```
81
+ stddev(Beta(α, β)) = sqrt( (α · β) / ((α + β)² · (α + β + 1)) )
82
+ ```
83
+
84
+ with the Laplace prior (matches Phase 23.5's bandit-router posterior
85
+ store):
86
+
87
+ ```
88
+ α = appearances + 1
89
+ β = (cycles_observed − appearances) + 1
90
+ ```
91
+
92
+ where `appearances` is the total number of cycles in which `c` was
93
+ present (across the full history, not just the M-window) and
94
+ `cycles_observed = history.length`.
95
+
96
+ **Worked example.** A cluster present in 25 of the 30 observed cycles
97
+ with a longest consecutive run of 18 has `α = 26`, `β = 6`, so
98
+ `stddev ≈ sqrt((26·6)/(32²·33)) ≈ sqrt(0.0154) ≈ 0.124`. That fails
99
+ the default `stddev_threshold = 0.05`. To clear `0.05`, that same
100
+ cluster would need closer to 30/30 presence or a longer history.
101
+
102
+ **Cross-link.** The closed-form Beta-stddev is shared with Phase 23.5
103
+ (see `scripts/lib/bandit-arbitrage.cjs` and the
104
+ "Bandit-arbitrage analysis" section in `agents/design-reflector.md`).
105
+ The same posterior is what gates frontmatter-tier corrections; here it
106
+ gates stage transition.
107
+
108
+ ---
109
+
110
+ ## 4. Evaluation cadence
111
+
112
+ Gate evaluation runs every time `/gdd:apply-reflections` is invoked.
113
+ Inputs:
114
+
115
+ 1. The reflector pass collects all cycle markdown files in
116
+ `.design/reflections/` and parses the `## Capability gaps observed`
117
+ sections (emitted by `renderGapsSection` in
118
+ `scripts/lib/reflector-capability-gap-aggregator.cjs`).
119
+ 2. The per-cycle cluster lists are folded into a history array of
120
+ `{ cycle_slug, clusters }` entries.
121
+ 3. `evaluateStageGate(history, config)` is called once and returns:
122
+
123
+ ```ts
124
+ { crossed: boolean, stable_cluster_ids: string[], cycles_observed: number }
125
+ ```
126
+
127
+ 4. If `crossed === true` and the project has not previously opted in
128
+ (see § 6), the prompt in § 5 is emitted into the cycle markdown.
129
+
130
+ The evaluation is **deterministic** (no randomness), **idempotent**
131
+ (no side-effects in the evaluator), and **read-only** with respect to
132
+ `.design/config.json` — that file is only updated by the user's
133
+ explicit opt-in action, never by the reflector.
134
+
135
+ ---
136
+
137
+ ## 5. Gate-crossed prompt
138
+
139
+ When the gate crosses for the first time, `/gdd:apply-reflections`
140
+ appends the following verbatim block to the cycle markdown:
141
+
142
+ > ```markdown
143
+ > ## Stage-0 → Stage-1 gate crossed — opt-in required
144
+ >
145
+ > Capability-gap detection has accumulated enough signal across recent
146
+ > cycles to consider enabling Stage-1 (incubator authoring of new
147
+ > agents / skills). The gate is informational only — **nothing has
148
+ > changed in the runtime**, and Stage-1 will NOT auto-enable. Per
149
+ > Phase 29 CONTEXT.md decision D-01, the user opts in explicitly.
150
+ >
151
+ > - Stable clusters observed: **<N>** (≥K = <K>)
152
+ > - Cycles observed: **<cycles_observed>** (≥M = <M>)
153
+ > - Stable cluster IDs (truncated):
154
+ > - `<cluster_id_1>`
155
+ > - `<cluster_id_2>`
156
+ > - `<cluster_id_3>`
157
+ >
158
+ > If you want to enable Stage-1 incubator authoring (Plans 29-04 / 29-05),
159
+ > opt in with the project-local command below. You can always opt out
160
+ > later by deleting the timestamps from `.design/config.json` (§ 7).
161
+ >
162
+ > <!-- TODO: confirm opt-in command — likely
163
+ > `node "$HOME/.claude/get-shit-done/bin/gsd-tools.cjs" config set capability_gap_gate.opted_in_at "$(date -Iseconds)"`
164
+ > or a project-local equivalent. Plan 29-05 (apply-reflections
165
+ > extension) will land the canonical command. -->
166
+ >
167
+ > This prompt is emitted at most once per project. If you ignore it,
168
+ > the gate continues to evaluate every cycle but does not re-prompt
169
+ > (the `user_prompted_at` timestamp in `.design/config.json` suppresses
170
+ > it). To re-trigger the prompt for a fresh round of evaluation, delete
171
+ > `capability_gap_gate.user_prompted_at` from `.design/config.json`.
172
+ > ```
173
+
174
+ The wiring side of this — actually writing the `user_prompted_at`
175
+ timestamp and routing the opt-in confirmation — is deferred to
176
+ **Plan 29-05** (`/gdd:apply-reflections` extension). This document
177
+ specifies the prompt text and behavior; 29-05 implements the
178
+ state-machine that consumes it.
179
+
180
+ ---
181
+
182
+ ## 6. Opt-in semantics
183
+
184
+ Two timestamps in `.design/config.json` track the project's gate state:
185
+
186
+ ```jsonc
187
+ {
188
+ "capability_gap_gate": {
189
+ "K": 3,
190
+ "M": 10,
191
+ "stddev_threshold": 0.05,
192
+ "user_prompted_at": "2026-05-19T22:00:00.000Z", // set when § 5 emitted
193
+ "opted_in_at": "2026-05-19T22:05:00.000Z" // set when user opts in
194
+ }
195
+ }
196
+ ```
197
+
198
+ - **`user_prompted_at`** is set the first time the gate crosses and the
199
+ prompt block is rendered. The prompt is not re-emitted while this
200
+ timestamp is present.
201
+ - **`opted_in_at`** is set when the user explicitly opts into Stage-1.
202
+ Stage-1 incubator authoring (Plans 29-04+) becomes active once this
203
+ timestamp is present. **Stage 1 is NEVER enabled by the reflector
204
+ setting this timestamp itself** — D-01 lock.
205
+
206
+ Once `opted_in_at` is set, the gate stops emitting prompts entirely
207
+ (it's a one-shot mechanism, not a continuous nudge).
208
+
209
+ ---
210
+
211
+ ## 7. Reset / override
212
+
213
+ Operators can manually reset the gate by editing `.design/config.json`:
214
+
215
+ | Effect desired | Action |
216
+ |----------------|--------|
217
+ | Re-prompt on next gate cross | Delete `capability_gap_gate.user_prompted_at`. |
218
+ | Revert from Stage-1 to Stage-0 | Delete `capability_gap_gate.opted_in_at`. (Stage-1 artifacts in `.design/reflections/incubator/` are NOT removed by this; deletion is the user's call.) |
219
+ | Tighten / loosen thresholds | Edit `K` / `M` / `stddev_threshold` directly. Out-of-range values silently fall back to defaults (§ 2). |
220
+
221
+ Reset is **explicit** and **idempotent**. The reflector never writes
222
+ to these fields on its own — the only writers are (a) the
223
+ `/gdd:apply-reflections` opt-in path (Plan 29-05) and (b) the human
224
+ operator editing the file by hand.
225
+
226
+ ---
227
+
228
+ ## 8. Test fixtures
229
+
230
+ Executable examples that exercise the gate live in
231
+ `tests/reflector-capability-gap-aggregation.test.cjs`:
232
+
233
+ - **T3** — 30 cycles × 3 always-present clusters → gate crosses with
234
+ default K=3 / M=10 / stddev_threshold=0.05.
235
+ - **T3b** — 10 cycles × 1 always-present cluster → gate does NOT
236
+ cross (posterior stddev ≈ 0.077 with α=11, β=1 is above the 0.05
237
+ threshold; M=10 is the lower bound on observations, not a
238
+ sufficient condition for stability).
239
+ - **T4** — 30 cycles, 2 always-present clusters + 1 "noisy" cluster
240
+ present in only the first 4 cycles → gate does NOT cross
241
+ (`stable_cluster_ids.length === 2 < K=3`).
242
+ - **T4b** — 5 cycles total → gate does NOT cross (`cycles_observed < M`).
243
+ - **T7** — Confirms `K` and `stddev_threshold` overrides flow through
244
+ `normalizeConfig` and reach the evaluation.
245
+
246
+ These fixtures are synthetic and inline (D-11). The gate evaluator
247
+ never reads `.design/gep/events.jsonl` directly in CI — fixtures
248
+ seed the cluster lists by hand.
249
+
250
+ ---
251
+
252
+ ## Decisions referenced
253
+
254
+ - **D-01** — Two-stage approach: Stage 0 telemetry-only ships first;
255
+ Stage 1 authoring gated on data; user opts in per a one-time prompt;
256
+ no auto-flip.
257
+ - **D-03** — Default `K=3` / `M=10` / `stddev_threshold=0.05`,
258
+ overridable via `.design/config.json`.
259
+ - **D-11** — Tests use synthetic fixtures (no live event chain reads).
260
+ - **Phase 23.5** — Posterior `stddev(Beta(α, β))` closed form and
261
+ Laplace prior convention reused here.