@hegemonart/get-design-done 1.57.2 → 1.58.0

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 (159) hide show
  1. package/.claude-plugin/marketplace.json +4 -4
  2. package/.claude-plugin/plugin.json +2 -2
  3. package/CHANGELOG.md +87 -0
  4. package/README.md +1 -1
  5. package/SKILL.md +2 -6
  6. package/connections/cursor.md +0 -1
  7. package/hooks/gdd-intel-trigger.js +2 -2
  8. package/package.json +3 -3
  9. package/reference/DEPRECATIONS.md +18 -11
  10. package/reference/live-mode-integration.md +1 -1
  11. package/reference/registry.json +1 -1
  12. package/reference/skill-graph.md +1 -5
  13. package/reference/skill-metadata.md +4 -4
  14. package/reference/skill-placeholders.md +2 -2
  15. package/scripts/lib/manifest/scaffolder.cjs +1 -1
  16. package/scripts/lib/manifest/schemas/skills.schema.json +1 -1
  17. package/scripts/lib/manifest/skills.json +4 -24
  18. package/scripts/lib/new-addendum.cjs +1 -1
  19. package/scripts/lib/worktree-resolve.cjs +4 -16
  20. package/sdk/cli/commands/build.ts +2 -2
  21. package/sdk/cli/index.js +2 -2
  22. package/sdk/cli/index.ts +1 -1
  23. package/skills/README.md +82 -0
  24. package/skills/bootstrap-ds/SKILL.md +1 -1
  25. package/skills/compare/SKILL.md +1 -1
  26. package/skills/new-cycle/SKILL.md +1 -1
  27. package/skills/new-skill/SKILL.md +5 -5
  28. package/skills/peer-cli-customize/SKILL.md +0 -1
  29. package/skills/peers/SKILL.md +1 -1
  30. package/skills/reflect/procedures/capability-gap-scan.md +0 -1
  31. package/skills/report-issue/report-issue-procedure.md +0 -1
  32. package/skills/synthesize/SKILL.md +1 -1
  33. package/skills/turn-closeout/SKILL.md +1 -1
  34. package/dist/claude-code/.claude/skills/add-backlog/SKILL.md +0 -48
  35. package/dist/claude-code/.claude/skills/analyze-dependencies/SKILL.md +0 -95
  36. package/dist/claude-code/.claude/skills/apply-reflections/SKILL.md +0 -109
  37. package/dist/claude-code/.claude/skills/apply-reflections/apply-reflections-procedure.md +0 -170
  38. package/dist/claude-code/.claude/skills/audit/SKILL.md +0 -79
  39. package/dist/claude-code/.claude/skills/bandit-status/SKILL.md +0 -94
  40. package/dist/claude-code/.claude/skills/benchmark/SKILL.md +0 -65
  41. package/dist/claude-code/.claude/skills/bootstrap-ds/SKILL.md +0 -43
  42. package/dist/claude-code/.claude/skills/brief/SKILL.md +0 -145
  43. package/dist/claude-code/.claude/skills/budget/SKILL.md +0 -45
  44. package/dist/claude-code/.claude/skills/cache-manager/SKILL.md +0 -66
  45. package/dist/claude-code/.claude/skills/cache-manager/cache-policy.md +0 -126
  46. package/dist/claude-code/.claude/skills/check-update/SKILL.md +0 -98
  47. package/dist/claude-code/.claude/skills/compare/SKILL.md +0 -82
  48. package/dist/claude-code/.claude/skills/compare/compare-rubric.md +0 -171
  49. package/dist/claude-code/.claude/skills/complete-cycle/SKILL.md +0 -81
  50. package/dist/claude-code/.claude/skills/connections/SKILL.md +0 -71
  51. package/dist/claude-code/.claude/skills/connections/connections-onboarding.md +0 -608
  52. package/dist/claude-code/.claude/skills/context/SKILL.md +0 -137
  53. package/dist/claude-code/.claude/skills/continue/SKILL.md +0 -24
  54. package/dist/claude-code/.claude/skills/darkmode/SKILL.md +0 -76
  55. package/dist/claude-code/.claude/skills/darkmode/darkmode-audit-procedure.md +0 -258
  56. package/dist/claude-code/.claude/skills/debug/SKILL.md +0 -41
  57. package/dist/claude-code/.claude/skills/debug/debug-feedback-loops.md +0 -119
  58. package/dist/claude-code/.claude/skills/design/SKILL.md +0 -118
  59. package/dist/claude-code/.claude/skills/design/design-procedure.md +0 -304
  60. package/dist/claude-code/.claude/skills/discover/SKILL.md +0 -78
  61. package/dist/claude-code/.claude/skills/discover/discover-procedure.md +0 -222
  62. package/dist/claude-code/.claude/skills/discuss/SKILL.md +0 -96
  63. package/dist/claude-code/.claude/skills/do/SKILL.md +0 -45
  64. package/dist/claude-code/.claude/skills/explore/SKILL.md +0 -118
  65. package/dist/claude-code/.claude/skills/explore/explore-procedure.md +0 -267
  66. package/dist/claude-code/.claude/skills/export/SKILL.md +0 -30
  67. package/dist/claude-code/.claude/skills/extract-learnings/SKILL.md +0 -114
  68. package/dist/claude-code/.claude/skills/fast/SKILL.md +0 -91
  69. package/dist/claude-code/.claude/skills/figma-extract/SKILL.md +0 -64
  70. package/dist/claude-code/.claude/skills/figma-write/SKILL.md +0 -50
  71. package/dist/claude-code/.claude/skills/graphify/SKILL.md +0 -49
  72. package/dist/claude-code/.claude/skills/health/SKILL.md +0 -99
  73. package/dist/claude-code/.claude/skills/health/health-mcp-detection.md +0 -44
  74. package/dist/claude-code/.claude/skills/health/health-skill-length-report.md +0 -69
  75. package/dist/claude-code/.claude/skills/help/SKILL.md +0 -87
  76. package/dist/claude-code/.claude/skills/instinct/SKILL.md +0 -111
  77. package/dist/claude-code/.claude/skills/list-assumptions/SKILL.md +0 -61
  78. package/dist/claude-code/.claude/skills/list-pins/SKILL.md +0 -27
  79. package/dist/claude-code/.claude/skills/live/SKILL.md +0 -98
  80. package/dist/claude-code/.claude/skills/locale/SKILL.md +0 -51
  81. package/dist/claude-code/.claude/skills/map/SKILL.md +0 -89
  82. package/dist/claude-code/.claude/skills/migrate/SKILL.md +0 -70
  83. package/dist/claude-code/.claude/skills/migrate-context/SKILL.md +0 -123
  84. package/dist/claude-code/.claude/skills/new-addendum/SKILL.md +0 -81
  85. package/dist/claude-code/.claude/skills/new-cycle/SKILL.md +0 -37
  86. package/dist/claude-code/.claude/skills/new-cycle/milestone-completeness-rubric.md +0 -87
  87. package/dist/claude-code/.claude/skills/new-project/SKILL.md +0 -53
  88. package/dist/claude-code/.claude/skills/new-skill/SKILL.md +0 -90
  89. package/dist/claude-code/.claude/skills/next/SKILL.md +0 -68
  90. package/dist/claude-code/.claude/skills/note/SKILL.md +0 -48
  91. package/dist/claude-code/.claude/skills/openrouter-status/SKILL.md +0 -86
  92. package/dist/claude-code/.claude/skills/optimize/SKILL.md +0 -97
  93. package/dist/claude-code/.claude/skills/override/SKILL.md +0 -86
  94. package/dist/claude-code/.claude/skills/paper-write/SKILL.md +0 -54
  95. package/dist/claude-code/.claude/skills/pause/SKILL.md +0 -77
  96. package/dist/claude-code/.claude/skills/peer-cli-add/SKILL.md +0 -88
  97. package/dist/claude-code/.claude/skills/peer-cli-add/peer-cli-protocol.md +0 -161
  98. package/dist/claude-code/.claude/skills/peer-cli-customize/SKILL.md +0 -90
  99. package/dist/claude-code/.claude/skills/peers/SKILL.md +0 -96
  100. package/dist/claude-code/.claude/skills/pencil-write/SKILL.md +0 -54
  101. package/dist/claude-code/.claude/skills/pin/SKILL.md +0 -37
  102. package/dist/claude-code/.claude/skills/plan/SKILL.md +0 -105
  103. package/dist/claude-code/.claude/skills/plan/plan-procedure.md +0 -278
  104. package/dist/claude-code/.claude/skills/plant-seed/SKILL.md +0 -48
  105. package/dist/claude-code/.claude/skills/pr-branch/SKILL.md +0 -32
  106. package/dist/claude-code/.claude/skills/progress/SKILL.md +0 -107
  107. package/dist/claude-code/.claude/skills/quality-gate/SKILL.md +0 -90
  108. package/dist/claude-code/.claude/skills/quality-gate/threat-modeling.md +0 -101
  109. package/dist/claude-code/.claude/skills/quick/SKILL.md +0 -44
  110. package/dist/claude-code/.claude/skills/reapply-patches/SKILL.md +0 -32
  111. package/dist/claude-code/.claude/skills/recall/SKILL.md +0 -75
  112. package/dist/claude-code/.claude/skills/reflect/SKILL.md +0 -85
  113. package/dist/claude-code/.claude/skills/reflect/procedures/capability-gap-scan.md +0 -120
  114. package/dist/claude-code/.claude/skills/report-issue/SKILL.md +0 -53
  115. package/dist/claude-code/.claude/skills/report-issue/report-issue-procedure.md +0 -120
  116. package/dist/claude-code/.claude/skills/resume/SKILL.md +0 -93
  117. package/dist/claude-code/.claude/skills/review-backlog/SKILL.md +0 -46
  118. package/dist/claude-code/.claude/skills/review-decisions/SKILL.md +0 -42
  119. package/dist/claude-code/.claude/skills/roi/SKILL.md +0 -54
  120. package/dist/claude-code/.claude/skills/rollout-status/SKILL.md +0 -35
  121. package/dist/claude-code/.claude/skills/router/SKILL.md +0 -89
  122. package/dist/claude-code/.claude/skills/router/capability-gap-emitter.md +0 -65
  123. package/dist/claude-code/.claude/skills/router/router-pick-emitter.md +0 -78
  124. package/dist/claude-code/.claude/skills/router/router-rules.md +0 -84
  125. package/dist/claude-code/.claude/skills/scan/SKILL.md +0 -92
  126. package/dist/claude-code/.claude/skills/scan/scan-procedure.md +0 -732
  127. package/dist/claude-code/.claude/skills/settings/SKILL.md +0 -87
  128. package/dist/claude-code/.claude/skills/ship/SKILL.md +0 -48
  129. package/dist/claude-code/.claude/skills/sketch/SKILL.md +0 -78
  130. package/dist/claude-code/.claude/skills/sketch-wrap-up/SKILL.md +0 -92
  131. package/dist/claude-code/.claude/skills/skill-manifest/SKILL.md +0 -79
  132. package/dist/claude-code/.claude/skills/spike/SKILL.md +0 -67
  133. package/dist/claude-code/.claude/skills/spike-wrap-up/SKILL.md +0 -86
  134. package/dist/claude-code/.claude/skills/start/SKILL.md +0 -67
  135. package/dist/claude-code/.claude/skills/start/start-procedure.md +0 -115
  136. package/dist/claude-code/.claude/skills/state/SKILL.md +0 -106
  137. package/dist/claude-code/.claude/skills/stats/SKILL.md +0 -51
  138. package/dist/claude-code/.claude/skills/style/SKILL.md +0 -71
  139. package/dist/claude-code/.claude/skills/style/style-doc-procedure.md +0 -150
  140. package/dist/claude-code/.claude/skills/synthesize/SKILL.md +0 -94
  141. package/dist/claude-code/.claude/skills/timeline/SKILL.md +0 -66
  142. package/dist/claude-code/.claude/skills/todo/SKILL.md +0 -64
  143. package/dist/claude-code/.claude/skills/turn-closeout/SKILL.md +0 -95
  144. package/dist/claude-code/.claude/skills/undo/SKILL.md +0 -31
  145. package/dist/claude-code/.claude/skills/unlock-decision/SKILL.md +0 -54
  146. package/dist/claude-code/.claude/skills/unpin/SKILL.md +0 -31
  147. package/dist/claude-code/.claude/skills/update/SKILL.md +0 -56
  148. package/dist/claude-code/.claude/skills/using-gdd/SKILL.md +0 -78
  149. package/dist/claude-code/.claude/skills/verify/SKILL.md +0 -113
  150. package/dist/claude-code/.claude/skills/verify/verify-procedure.md +0 -511
  151. package/dist/claude-code/.claude/skills/warm-cache/SKILL.md +0 -81
  152. package/dist/claude-code/.claude/skills/watch-authorities/SKILL.md +0 -82
  153. package/dist/claude-code/.claude/skills/zoom-out/SKILL.md +0 -26
  154. package/hooks/run-hook.cmd +0 -35
  155. package/skills/discover/SKILL.md +0 -78
  156. package/skills/discover/discover-procedure.md +0 -222
  157. package/skills/new-cycle/milestone-completeness-rubric.md +0 -87
  158. package/skills/scan/SKILL.md +0 -92
  159. package/skills/scan/scan-procedure.md +0 -732
@@ -0,0 +1,82 @@
1
+ # `skill-templates/` - Editable Skill Source (Single Source of Truth)
2
+
3
+ This directory is the **only** place to edit skill content. Every `SKILL.md` and sibling
4
+ doc here is the editable truth - the per-skill prose, examples, procedure files
5
+ (`*-procedure.md`, `*-rules.md`, emitters, etc.) all live here.
6
+
7
+ The user-facing `skills/` directory at the repo root is a **build artifact**, not source.
8
+ It's gitignored and regenerated automatically:
9
+
10
+ - on `npm install` (via the `prepare` lifecycle script) - so developer clones work immediately
11
+ - on `npm pack` / `npm publish` (via `prepack`) - so the published tarball ships pre-built skills
12
+
13
+ End users installing `@hegemonart/get-design-done` from the npm registry receive a tarball
14
+ with `skills/` already built; no build step runs on their machine.
15
+
16
+ ## Why two directories, not one
17
+
18
+ Claude Code reads `./skills/<slug>/SKILL.md` raw. If we kept `/gdd:` placeholders
19
+ in the file Claude reads, the literal text `/gdd:` would show up in the prompt.
20
+ So the editable templates need to live separately from the rendered output.
21
+
22
+ The previous layout (Phase 42) put templates under `source/skills/` AND committed the
23
+ rendered `skills/` alongside. That meant 232 tracked files for 116 distinct skills with
24
+ identical content modulo a single placeholder substitution. Pure git churn.
25
+
26
+ v1.58.0 fixes this: templates are tracked once at `skill-templates/`, the rendered output
27
+ is generated on demand.
28
+
29
+ ## Source-of-truth split (what lives where)
30
+
31
+ | Concern | Source of truth | How it reaches `skills/` |
32
+ |---|---|---|
33
+ | **Body content** (everything below the frontmatter) | `skill-templates/<slug>/SKILL.md` | `scripts/build-skills.cjs` walks `skill-templates/`, applies per-harness placeholder substitution, writes to `skills/` |
34
+ | **Universal frontmatter** (`name`, `description`, `argument-hint`, `tools`, `user-invocable`, `disable-model-invocation`) | `scripts/lib/manifest/skills.json` | `scripts/generate-skill-frontmatter.cjs` writes the managed block into `skill-templates/<slug>/SKILL.md`, then `build:skills` copies it onward |
35
+ | **Non-managed frontmatter** (e.g. `color`, `model`, custom keys) | `skill-templates/<slug>/SKILL.md` itself (preserved verbatim) | carried through both generators unchanged |
36
+
37
+ The forward direction is **`skills.json` -> `skill-templates/` -> `skills/`**.
38
+ Treat that direction as canonical; the `--extract` mode of `generate-skill-frontmatter.cjs` exists
39
+ only to seed the manifest from current sources when reconciling drift.
40
+
41
+ ## Editing protocol
42
+
43
+ 1. **Edit body** -> modify `skill-templates/<slug>/SKILL.md` (anything below the frontmatter delimiter).
44
+ 2. **Edit universal frontmatter** -> modify `scripts/lib/manifest/skills.json`, then run
45
+ `npm run generate:skill-frontmatter`.
46
+ 3. **Edit non-managed frontmatter** -> modify `skill-templates/<slug>/SKILL.md` directly; the generator
47
+ preserves it.
48
+ 4. **Regenerate the built surface** -> `npm run build:skills`. This rewrites the gitignored
49
+ `skills/<slug>/SKILL.md` byte-for-byte from the templates.
50
+ 5. **Verify the build** -> `npm run build:skills:check` (CI gate) confirms compile determinism
51
+ and that the on-disk `skills/` matches what `skill-templates/` would generate.
52
+
53
+ ## Placeholders
54
+
55
+ Four substitution slots are supported by `scripts/lib/build/factory.cjs`:
56
+
57
+ - `/gdd:` - slash-command prefix (`/gdd:` for Claude, `/gdd-` for Codex, etc.)
58
+ - `your configured Claude model` - human-readable model phrase ("your configured Claude model", etc.)
59
+ - `.claude/settings.json` - per-harness config path (`.claude/settings.json`, `.codex/config.toml`, ...)
60
+ - `ask Claude Code` - "ask Claude Code", "ask Codex", etc.
61
+
62
+ Plus conditional blocks: `BODY` keeps
63
+ `BODY` only when the active harness id is in the listed set.
64
+
65
+ Escape with `{{ ... }}` to emit a literal `{{...}}` in the output (never substituted).
66
+
67
+ Full grammar + the per-harness substitution table: `reference/skill-placeholders.md`.
68
+
69
+ ## What npm ships
70
+
71
+ `package.json` `files` lists `skills/` (the built surface); `skill-templates/` is repo-only and
72
+ is **not** distributed via npm. The `prepack` lifecycle runs `npm run build:skills` so the tarball
73
+ always contains a freshly-built `skills/`.
74
+
75
+ ## Cross-references
76
+
77
+ - `scripts/build-skills.cjs` - the multi-harness orchestrator that compiles this directory.
78
+ - `scripts/lib/build/factory.cjs` - the pure transformer applied per-harness.
79
+ - `scripts/lib/manifest/README.md` - explains why `skills.json` is the universal-frontmatter SoT.
80
+ - `scripts/generate-skill-frontmatter.cjs` - manifest -> source-frontmatter generator (with
81
+ `--check` drift gate and `--extract` reverse mode).
82
+ - `reference/skill-placeholders.md` - placeholder grammar + per-harness substitution table.
@@ -1,6 +1,6 @@
1
1
  ---
2
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 /gdd:discover finds no existing design system. Never invents a brand; never overwrites an existing 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 /gdd:explore finds no existing design system. Never invents a brand; never overwrites an existing DS."
4
4
  argument-hint: "[--primary <color>] [--secondary <color>] [--tone <tags>] [--framework web|native-ios|native-android|flutter]"
5
5
  user-invocable: true
6
6
  tools: Read, Write, Bash, Glob, Grep, AskUserQuestion, Task
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: gdd-compare
3
- description: "Compute the delta between the `DESIGN.md` baseline (from scan) and the `DESIGN-VERIFICATION.md` result (from verify), reporting per-category score delta, anti-pattern delta (resolved vs new), must-have pass/fail change, and design drift (regressions without covering tasks in `DESIGN-PLAN.md`). Use after `verify` to measure whether a design pipeline cycle actually improved the design. Writes `.design/COMPARE-REPORT.md`. Activates for requests involving diffing a design baseline against verification output, or a before-after design delta."
3
+ description: "Compute the delta between the `DESIGN.md` baseline (from explore) and the `DESIGN-VERIFICATION.md` result (from verify), reporting per-category score delta, anti-pattern delta (resolved vs new), must-have pass/fail change, and design drift (regressions without covering tasks in `DESIGN-PLAN.md`). Use after `verify` to measure whether a design pipeline cycle actually improved the design. Writes `.design/COMPARE-REPORT.md`. Activates for requests involving diffing a design baseline against verification output, or a before-after design delta."
4
4
  argument-hint: ""
5
5
  user-invocable: true
6
6
  ---
@@ -7,7 +7,7 @@ tools: Read, Write, AskUserQuestion
7
7
 
8
8
  # /gdd:new-cycle
9
9
 
10
- The cycle is the hierarchical unit above individual pipeline runs: **Cycle > Pipeline run > Wave > Task**. Each cycle has a goal, tracks its own decisions, and can span many pipeline runs. See `./milestone-completeness-rubric.md` §"Cycle level" for what counts as cycle completion (used by `/gdd:complete-cycle` to close the cycle).
10
+ The cycle is the hierarchical unit above individual pipeline runs: **Cycle > Pipeline run > Wave > Task**. Each cycle has a goal, tracks its own decisions, and can span many pipeline runs. `/gdd:complete-cycle` closes the cycle once goals are met and a retrospective is captured.
11
11
 
12
12
  ## Steps
13
13
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: gdd-new-skill
3
- description: "Scaffolds a new Phase-28.5 + Phase-50-compliant skill: gathers a name, a multi-paragraph v3 description, a lifecycle stage, an allowed-tools list, and optional composes_with neighbours, then writes source/skills/<name>/SKILL.md from the pure generator. Use when adding a brand-new gdd skill and you want the frontmatter, length cap, and v3 description form correct from the first commit. Activates for requests involving authoring a skill, scaffolding a command, creating a new SKILL.md, or adding a slash command."
3
+ description: "Scaffolds a new Phase-28.5 + Phase-50-compliant skill: gathers a name, a multi-paragraph v3 description, a lifecycle stage, an allowed-tools list, and optional composes_with neighbours, then writes skill-templates/<name>/SKILL.md from the pure generator. Use when adding a brand-new gdd skill and you want the frontmatter, length cap, and v3 description form correct from the first commit. Activates for requests involving authoring a skill, scaffolding a command, creating a new SKILL.md, or adding a slash command."
4
4
  argument-hint: "<skill-name>"
5
5
  tools: Read, Write, Bash, AskUserQuestion
6
6
  user-invocable: true
@@ -8,7 +8,7 @@ user-invocable: true
8
8
 
9
9
  # /gdd:new-skill
10
10
 
11
- **Role:** Interactively scaffold a contract-compliant skill. Gather the fields, then write `source/skills/<name>/SKILL.md` from the pure generator at `scripts/lib/manifest/scaffolder.cjs`. This skill writes ONE source file. It does NOT touch `scripts/lib/manifest/skills.json` and does NOT run the build; it prints the exact follow-up commands instead.
11
+ **Role:** Interactively scaffold a contract-compliant skill. Gather the fields, then write `skill-templates/<name>/SKILL.md` from the pure generator at `scripts/lib/manifest/scaffolder.cjs`. This skill writes ONE source file. It does NOT touch `scripts/lib/manifest/skills.json` and does NOT run the build; it prints the exact follow-up commands instead.
12
12
 
13
13
  Read `reference/skill-authoring-contract.md` first for the length cap, the frontmatter required fields, and the v3 description form.
14
14
 
@@ -27,7 +27,7 @@ Either way the answers feed the same record builder. Never block waiting on a TT
27
27
 
28
28
  ## Step 1 - Gather the fields
29
29
 
30
- 1. **name**: the slug from `$ARGUMENTS` if present, else ask. Must match `^[a-z0-9][a-z0-9-._]*$`. Reject `source/skills/<name>/` collisions.
30
+ 1. **name**: the slug from `$ARGUMENTS` if present, else ask. Must match `^[a-z0-9][a-z0-9-._]*$`. Reject `skill-templates/<name>/` collisions.
31
31
  2. **description**: a multi-paragraph v3 form. Sentence one is what the skill does. Sentence two is `Use when <triggers>`. Sentence three is `Activates for requests involving <kw1>, <kw2>, <kw3>.` Keep it 20 to 1024 chars.
32
32
  3. **lifecycle stage**: pick one of brief / explore / plan / verify / ship / figma / token / report (free text allowed). This seeds the composition suggestions.
33
33
  4. **tools**: a comma list (for example `Read, Write, Bash`). Empty means inherit-all.
@@ -45,7 +45,7 @@ Present the suggestions; let the user accept, edit, or clear them.
45
45
 
46
46
  ## Step 2 - Length pre-check
47
47
 
48
- Before writing, estimate the body length. If the planned body would exceed about 100 lines, warn the user (the authoring contract warns at 100 and blocks at 250) and suggest extracting domain content into a co-located `source/skills/<name>/<topic>.md` reference. The generated skeleton is small; the warning is for the prose the user will add next.
48
+ Before writing, estimate the body length. If the planned body would exceed about 100 lines, warn the user (the authoring contract warns at 100 and blocks at 250) and suggest extracting domain content into a co-located `skill-templates/<name>/<topic>.md` reference. The generated skeleton is small; the warning is for the prose the user will add next.
49
49
 
50
50
  ## Step 3 - Write the file
51
51
 
@@ -66,7 +66,7 @@ process.stdout.write(s.renderSkillMd(rec));
66
66
  "
67
67
  ```
68
68
 
69
- `buildSkillRecord` throws on an invalid name, an out-of-budget description, or a malformed tools list. Surface the thrown message to the user and re-prompt the offending field. Capture stdout and write it verbatim to `source/skills/<name>/SKILL.md` via the Write tool.
69
+ `buildSkillRecord` throws on an invalid name, an out-of-budget description, or a malformed tools list. Surface the thrown message to the user and re-prompt the offending field. Capture stdout and write it verbatim to `skill-templates/<name>/SKILL.md` via the Write tool.
70
70
 
71
71
  ## Step 4 - Tell the user the follow-up
72
72
 
@@ -79,7 +79,6 @@ See `./../peer-cli-add/peer-cli-protocol.md` §"Edge cases" for: rewire-to-unmat
79
79
  - `scripts/validate-frontmatter.ts` (Plan 27-06) - `delegate_to` validation.
80
80
  - `scripts/lib/peer-cli/registry.cjs` (Plan 27-05) - capability matrix.
81
81
  - `skills/peer-cli-add/SKILL.md` - for adding a NEW peer (this skill rewires among existing peers).
82
- - `.planning/phases/27-peer-cli-delegation/CONTEXT.md` D-06 - decision lineage.
83
82
 
84
83
  ## Record
85
84
 
@@ -85,7 +85,7 @@ The table IS the output. No follow-up prose. Users act on it: `(opt-in disabled)
85
85
 
86
86
  - `./../peer-cli-add/peer-cli-protocol.md` - ACP/ASP handshake + adapter scaffold (procedure ref shared with peer-cli-add/customize).
87
87
  - `./reference/peer-cli-capabilities.md` (Plan 27-05) - full capability matrix doc.
88
- - `scripts/lib/peer-cli/registry.cjs` (Plan 27-05), `scripts/lib/install/runtimes.cjs` (Plan 27-11), `skills/peer-cli-customize/SKILL.md`, `skills/peer-cli-add/SKILL.md`, `.planning/phases/27-peer-cli-delegation/CONTEXT.md` D-10.
88
+ - `scripts/lib/peer-cli/registry.cjs` (Plan 27-05), `scripts/lib/install/runtimes.cjs` (Plan 27-11), `skills/peer-cli-customize/SKILL.md`, `skills/peer-cli-add/SKILL.md`.
89
89
 
90
90
  ## Record
91
91
 
@@ -117,4 +117,3 @@ npm test
117
117
  - `reference/schemas/events.schema.json` - the `capability_gap` event class shipped by Plan 29-01 (the 7-field shape + `TrajectoryRef` definition).
118
118
  - `scripts/lib/event-chain.cjs` - `appendChainEvent` (the real emitter API; 29-01 did NOT ship a separate helper file).
119
119
  - `scripts/lib/bandit-router.cjs` - Phase 23.5 posterior file producer (the source for scan #2).
120
- - `.planning/phases/29-capability-gap-self-authoring/CONTEXT.md` - phase decisions (D-02 7-field shape, D-07 hash-pinning, D-08 MCP carve-out, D-11 tmpdir tests).
@@ -117,4 +117,3 @@ Body is written to a tmp file to avoid arg-length and shell-escaping. URL parsed
117
117
  - [SKILL.md](./SKILL.md) - entry contract.
118
118
  - `reference/pseudonymization-rules.md` - full R1..R8 rule catalog (Plan 30-01).
119
119
  - `reference/known-failure-modes.md` - triage catalogue (Plan 30-03).
120
- - `.planning/phases/30-issue-reporter/CONTEXT.md` - phase decisions D-01..D-15.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: synthesize
3
- description: "Streaming synthesizer - collapses N parallel-agent markdown outputs into one compact merged summary via a single Haiku 4.5 call. Invoked inline by orchestrators (skills/map/, skills/discover/, skills/plan/) after parallel spawns return. Not user-invocable."
3
+ description: "Streaming synthesizer - collapses N parallel-agent markdown outputs into one compact merged summary via a single Haiku 4.5 call. Invoked inline by orchestrators (skills/map/, skills/explore/, skills/plan/) after parallel spawns return. Not user-invocable."
4
4
  tools: Read, Task
5
5
  user-invocable: false
6
6
  disable-model-invocation: true
@@ -9,7 +9,7 @@ tools: Read, Bash
9
9
 
10
10
  ## Role
11
11
 
12
- You are a deterministic **closeout** skill. You close the per-turn telemetry gap on runtimes that don't expose a Stop event (codex, gemini, and 11 others). You are a code-level mirror of `hooks/gdd-turn-closeout.js` (D-10): same conditions, same idempotence, same emitted event shape. The only difference: the JS hook emits the nudge as `additionalContext` via the harness; this skill prints the nudge directly to the user. See `./../new-cycle/milestone-completeness-rubric.md` §"Task level" for the broader closeout discipline (what "turn complete" means within a stage).
12
+ You are a deterministic **closeout** skill. You close the per-turn telemetry gap on runtimes that don't expose a Stop event (codex, gemini, and 11 others). You are a code-level mirror of `hooks/gdd-turn-closeout.js` (D-10): same conditions, same idempotence, same emitted event shape. The only difference: the JS hook emits the nudge as `additionalContext` via the harness; this skill prints the nudge directly to the user. A turn is "complete" when the verify command exits 0, the `<done>` criterion is observable, and the diff stays within the declared scope - any deviation is logged for the run summary.
13
13
 
14
14
  **When to invoke:** orchestrator skills (`/gdd:next`, `/gdd:design`, `/gdd:verify`) tail-call this skill as their final step before returning. Adoption is incremental - each orchestrator can wire the tail-call independently; the skill exists as a stable, callable surface today.
15
15
 
@@ -1,48 +0,0 @@
1
- ---
2
- name: gdd-add-backlog
3
- description: "Park a design idea for a future cycle. Writes to .design/backlog/BACKLOG.md."
4
- argument-hint: "[text]"
5
- tools: Read, Write, AskUserQuestion
6
- disable-model-invocation: true
7
- ---
8
-
9
- # /gdd:add-backlog
10
-
11
- **Role:** Long-term parking lot for design ideas. Backing store: `.design/backlog/BACKLOG.md`.
12
-
13
- ## Step 1 - Get text
14
-
15
- If `$ARGUMENTS` is empty, ask the user: "What should be added to the backlog?"
16
-
17
- ## Step 2 - Append
18
-
19
- Create `.design/backlog/` directory and `BACKLOG.md` with `# Design Backlog` header if missing.
20
-
21
- Derive `<title>` = first 60 characters of the text (strip newlines). Append:
22
-
23
- ```markdown
24
- ## <title>
25
- **Added**: YYYY-MM-DD
26
- **Status**: parked
27
-
28
- <full text>
29
-
30
- ---
31
- ```
32
-
33
- ## Output
34
-
35
- ```
36
- ━━━ Backlog entry parked ━━━
37
- Title: <title>
38
- Status: parked
39
- Promote later via: /gdd:review-backlog
40
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
41
- ```
42
-
43
- ## Constraints
44
-
45
- - Do not modify files outside `.design/backlog/`.
46
- - Do not set status to anything other than `parked` here - `/gdd:review-backlog` owns status transitions.
47
-
48
- ## ADD-BACKLOG COMPLETE
@@ -1,95 +0,0 @@
1
- ---
2
- name: gdd-analyze-dependencies
3
- description: "Queries the intel store to surface token fan-out, component call-graphs, decision traceability, and circular dependency detection. Requires .design/intel/ to exist (run build-intel.cjs first)."
4
- tools: Bash, Read, Glob, Grep
5
- ---
6
-
7
- # /gdd:analyze-dependencies
8
-
9
- **Role:** Surface dependency relationships, token usage spread, component graphs, and decision traceability using `.design/intel/`. All queries are O(1) reads against pre-built JSON slices - no file greps. See `./reference/heuristics.md` for the underlying dependency-analysis heuristics (fan-out thresholds, orphan-token criteria, cycle-detection bias).
10
-
11
- ## Pre-flight
12
-
13
- Verify the intel store exists:
14
-
15
- ```bash
16
- ls .design/intel/files.json 2>/dev/null && echo "ready" || echo "missing"
17
- ```
18
-
19
- If missing, print:
20
-
21
- ```
22
- Intel store not found. Build it first:
23
- node scripts/build-intel.cjs --force
24
- Then re-run /gdd:analyze-dependencies.
25
- ```
26
-
27
- ## Usage modes
28
-
29
- - `/gdd:analyze-dependencies` - run all four analyses and print a combined report
30
- - `/gdd:analyze-dependencies tokens` - token fan-out only
31
- - `/gdd:analyze-dependencies components` - component call-graph only
32
- - `/gdd:analyze-dependencies decisions` - decision traceability only
33
- - `/gdd:analyze-dependencies circular` - circular dependency detection only
34
-
35
- ## Analysis 1 - Token fan-out
36
-
37
- Surfaces tokens referenced in many files + orphans (referenced exactly once).
38
-
39
- 1. Read `.design/intel/tokens.json`; group by `token` value; count distinct `file` values.
40
- 2. Sort descending; print top-20 with token / file count / category columns.
41
- 3. Append orphans list (token + file:line of the single reference).
42
-
43
- Header: `━━━ Token fan-out ━━━` … `(top 20 shown)` … `Orphaned tokens (referenced in exactly 1 file):` … footer rule.
44
-
45
- ## Analysis 2 - Component call-graph
46
-
47
- Surfaces widely-referenced components and the files referencing each.
48
-
49
- 1. Read `.design/intel/components.json`; group by `component` name; count distinct `file` values.
50
- 2. Sort descending; print top-20 with component / references / files columns.
51
- 3. If `components <Name>` is passed, print only that component's referencing files (one per line).
52
-
53
- Header: `━━━ Component call-graph ━━━` … footer rule.
54
-
55
- ## Analysis 3 - Decision traceability
56
-
57
- Maps decisions to skill/agent files that cite them.
58
-
59
- 1. Read `.design/intel/decisions.json` (decision IDs D-01, D-02, …).
60
- 2. Read `.design/intel/symbols.json` for heading anchors; `.design/intel/dependencies.json` for @-reference chains.
61
- 3. For each decision, cross-reference which files cite the ID.
62
- 4. Print per-decision block: `D-NN <description>` then a 6-space-indented `Referenced by: <file:line>, …` line (or `(no explicit references found)`).
63
- 5. Footer: `Total: N decisions tracked, M with file references`.
64
-
65
- Empty-state: `No decisions indexed. Run node scripts/build-intel.cjs after creating .design/DESIGN-CONTEXT.md.`
66
-
67
- ## Analysis 4 - Circular dependency detection
68
-
69
- Detects cycles in the `@`-reference graph (File A → File B → File A). DFS with path-tracking detects back-edges; algorithm + adjacency-map shape detailed in `./reference/heuristics.md` §"Dependency-cycle detection".
70
-
71
- 1. Read `.design/intel/graph.json`; build adjacency map from `edges`.
72
- 2. Run DFS with path-tracking; collect back-edges as cycles.
73
- 3. Print each cycle with the node sequence + `<- CYCLE` marker on the closing node.
74
- 4. Footer: `Total cycles: N` (or `All clear — no circular dependencies detected.`).
75
-
76
- ## Combined report
77
-
78
- When run without a mode argument, print all four analyses in sequence separated by blank lines, prefixed with:
79
-
80
- ```
81
- ━━━ Dependency Analysis ━━━
82
- Intel store: .design/intel/
83
- Generated: <timestamp from files.json>
84
- Files indexed: <count>
85
- ```
86
-
87
- ## Required reading (conditional)
88
-
89
- @.design/intel/tokens.json (if present)
90
- @.design/intel/components.json (if present)
91
- @.design/intel/dependencies.json (if present)
92
- @.design/intel/decisions.json (if present)
93
- @.design/intel/graph.json (if present)
94
-
95
- ## ANALYZE-DEPENDENCIES COMPLETE
@@ -1,109 +0,0 @@
1
- ---
2
- name: gdd-apply-reflections
3
- description: "Review and selectively apply proposals from .design/reflections/<cycle-slug>.md. Diffs each proposal, prompts user to accept/skip/edit, then writes changes."
4
- argument-hint: "[--cycle <slug>] [--filter <FRONTMATTER|REFERENCE|BUDGET|QUESTION|GLOBAL-SKILL>] [--dry-run]"
5
- tools: Read, Write, Edit, Bash, Glob
6
- ---
7
-
8
- # /gdd:apply-reflections
9
-
10
- Interactive proposal review loop. Reads `.design/reflections/<cycle-slug>.md`, walks each numbered proposal, and applies accepted ones to the appropriate target file. Nothing is applied without explicit user confirmation.
11
-
12
- ## Steps
13
-
14
- ### 1. Resolve reflections file
15
-
16
- - If `--cycle <slug>` given: load `.design/reflections/<slug>.md`
17
- - Else: glob `.design/reflections/*.md`, sort by modified time descending, load the most recent
18
- - If no file found: error "No reflections found. Run `/gdd:reflect` first."
19
- - Print: "Reviewing reflections: <filename>"
20
-
21
- ### 2. Parse proposals
22
-
23
- Scan file for lines matching `### Proposal N — [TYPE] ...`. Extract each proposal block (Why / Change / Risk).
24
-
25
- If `--filter <TYPE>` given: skip proposals whose type tag doesn't match.
26
-
27
- Print: "Found N proposals (N after filter)."
28
-
29
- ### 3. Review loop
30
-
31
- For each proposal (in order):
32
-
33
- Print the full proposal block:
34
- ```
35
- ─────────────────────────────────────────
36
- Proposal N/TOTAL — [TYPE] Title
37
- Risk: low|medium
38
-
39
- Why: ...
40
- Change: ...
41
- ─────────────────────────────────────────
42
- (a) apply (s) skip (e) edit (q) quit
43
- ```
44
-
45
- If `--dry-run`: print `[dry-run — would prompt here]` and continue to next proposal without prompting.
46
-
47
- Based on user choice:
48
- - **a** - apply (see Apply Logic below)
49
- - **s** - mark proposal as `**Reviewed: skipped**` in the reflections file; continue
50
- - **e** - show the Change text, ask user to provide edited version, then apply the edited version
51
- - **q** - stop processing; print "Stopped at proposal N. Resume with `/gdd:apply-reflections --cycle <slug>`."
52
-
53
- ### 4. Apply Logic by Proposal Type
54
-
55
- After the user chooses `a` (apply) or `e` (edit-then-apply), branch on the proposal's bracketed type tag and follow the per-type apply procedure in `./apply-reflections-procedure.md` - one numbered procedure each for `[FRONTMATTER]`, `[REFERENCE]`, `[BUDGET]`, `[QUESTION]`, `[GLOBAL-SKILL]`. All branches end with `**Applied**: <date>` appended to the proposal block in the reflections file.
56
-
57
- ### 5. Summary
58
-
59
- After all proposals processed (or `q`):
60
- ```
61
- ─────────────────────────────────────────
62
- Apply-reflections complete
63
- Applied: N
64
- Skipped: N
65
- Remaining: N (run again to continue)
66
- ─────────────────────────────────────────
67
- ```
68
-
69
- ## [INCUBATOR]
70
-
71
- Incubator drafts authored by `scripts/lib/incubator-author.cjs` (Phase 29-04) appear as a distinct proposal class. For each draft under `.design/reflections/incubator/<slug>/`, use `scripts/lib/apply-reflections/incubator-proposals.cjs`:
72
-
73
- 1. `discoverIncubatorDrafts()` → list pending drafts.
74
- 2. `renderProposal(draft)` → show full body + diff + origin signals.
75
- 3. User chooses **accept** | **reject** | **defer** | **edit**.
76
- 4. **accept** - scope-guard runs FIRST (`validateScope` from `scripts/validate-incubator-scope.cjs`); `applyAccept` then promotes draft → `agents/<slug>.md` or `skills/<slug>/SKILL.md` and appends a registry entry. Single-step per D-04.
77
- 5. **reject** - `applyReject` removes the incubator subdir.
78
- 6. **defer** - no-op; draft re-surfaces next run.
79
- 7. **edit** - `applyEdit` opens `$EDITOR`; re-prompt user on close.
80
-
81
- **Stage-1 gate.** At session start, call `checkStage1Gate()`. If `thresholdMet && !optInRecorded`, display the opt-in prompt once. NEVER auto-flip per D-01 - recording opt-in requires explicit user confirmation via `recordOptIn()`. Full procedure: `./apply-reflections-procedure.md` §[INCUBATOR].
82
-
83
- ## [KFM-CANDIDATE]
84
-
85
- KFM-catalogue proposals authored by `scripts/lib/reflector-kfm-proposer.cjs` (Phase 30.5-03 D-05) appear as a 6th proposal class. Drafts at `.design/reflections/incubator/kfm-<slug>/CATALOGUE-ENTRY.md`; pre-filled 11-field schema with `TODO:` placeholders for `pattern` + `fix`. Two upstream signals share the surface (D-06): `capability_gap` clusters (≥3, no existing match) + `kfm-candidate` events (whitelist-matched articles, 1-shot). User chooses **accept** | **reject** | **defer** | **edit**. `applyAccept` appends to `reference/known-failure-modes.md` + `reference/registry.json` (`origin: incubator-kfm`); `applyReject` removes the incubator subdir; `applyDefer` stamps `deferred_until`; `applyEdit` returns the draft path for `$EDITOR`. Full procedure: `./apply-reflections-procedure.md` §[KFM-CANDIDATE].
86
-
87
- ## [INSTINCT]
88
-
89
- Atomic instinct units emitted by `design-reflector` (and surfaced from `/gdd:extract-learnings`) appear as a distinct proposal class, alongside `[INCUBATOR]` and `[KFM-CANDIDATE]`. Each unit is a fenced `yaml` block under the reflector's `## Atomic instincts` section, shaped per `reference/instinct-format.md` (`id`, `trigger`, `confidence`, `domain`, `scope`, `project_id`, `source`, `cycles_seen`, `first_seen`, `last_seen`, plus a short body). A unit is a proposal, never a stored fact - nothing lands until the user accepts it.
90
-
91
- Mirror the `[INCUBATOR]` flow:
92
-
93
- 1. Discover the units: parse every `yaml` block under `## Atomic instincts` in the reflections file. Skip malformed blocks (warn on stderr, keep going).
94
- 2. For each unit: show the parsed `trigger`, `domain`, `confidence`, and body so the user sees what would be stored.
95
- 3. Prompt: `(a) accept (r) reject (d) defer (e) edit (q) quit`.
96
-
97
- **Per-action behavior:**
98
-
99
- 1. **accept** - call `scripts/lib/instinct-store.cjs` `add(unit, { scope, baseDir })` with the unit at its emitted `confidence`. The store owns de-duplication and `cycles_seen` bookkeeping. On success print `Stored instinct <id> (<domain>, confidence <n>).` and append `**Applied**: <date>` to the proposal block.
100
- 2. **reject** - do not store the unit. Append `**Reviewed: rejected**` to the reflections file.
101
- 3. **defer** - no-op; the unit re-surfaces next run. Append `**Reviewed: deferred**`.
102
- 4. **edit** - let the user adjust `trigger`, `confidence`, or `domain`, then accept the edited unit through the same `add(...)` call. Default `scope: 'project'` (write `global` only when the unit's frontmatter says so); never edit `.design/instincts/instincts.json` directly, and promote to global via the separate gated `/gdd:instinct promote`.
103
-
104
- ## Do Not
105
-
106
- - Do not apply any proposal without the user explicitly choosing `a` or `e`.
107
- - Do not modify source code files (`.ts`, `.tsx`, `.css`, `.js`) - only agent files, reference files, budget.json, discussant questions, global skills, and incubator drafts.
108
- - Do not re-run the reflector - this skill only applies existing proposals.
109
- - Do not bypass the scope guard or auto-flip Stage-1 - both are non-negotiable per D-05 / D-01.
@@ -1,170 +0,0 @@
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.