@hegemonart/get-design-done 1.57.1 → 1.57.3

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 (237) hide show
  1. package/.claude-plugin/marketplace.json +26 -41
  2. package/.claude-plugin/plugin.json +23 -48
  3. package/CHANGELOG.md +139 -0
  4. package/README.md +166 -511
  5. package/SKILL.md +4 -6
  6. package/agents/README.md +33 -36
  7. package/agents/a11y-mapper.md +3 -3
  8. package/agents/component-benchmark-harvester.md +6 -6
  9. package/agents/component-benchmark-synthesizer.md +3 -3
  10. package/agents/compose-executor.md +3 -3
  11. package/agents/cost-forecaster.md +2 -2
  12. package/agents/design-auditor.md +7 -7
  13. package/agents/design-authority-watcher.md +15 -15
  14. package/agents/design-context-builder.md +4 -4
  15. package/agents/design-context-checker-gate.md +1 -1
  16. package/agents/design-discussant.md +2 -2
  17. package/agents/design-doc-writer.md +1 -1
  18. package/agents/design-executor.md +2 -2
  19. package/agents/design-figma-writer.md +2 -2
  20. package/agents/design-fixer.md +7 -7
  21. package/agents/design-integration-checker-gate.md +1 -1
  22. package/agents/design-integration-checker.md +1 -1
  23. package/agents/design-paper-writer.md +3 -3
  24. package/agents/design-pencil-writer.md +1 -1
  25. package/agents/design-planner.md +21 -0
  26. package/agents/design-reflector.md +39 -39
  27. package/agents/design-research-synthesizer.md +1 -0
  28. package/agents/design-start-writer.md +1 -1
  29. package/agents/design-update-checker.md +5 -5
  30. package/agents/design-verifier-gate.md +1 -1
  31. package/agents/design-verifier.md +52 -48
  32. package/agents/ds-generator.md +2 -2
  33. package/agents/ds-migration-planner.md +4 -4
  34. package/agents/email-executor.md +9 -9
  35. package/agents/experiment-result-ingester.md +3 -3
  36. package/agents/flutter-executor.md +5 -5
  37. package/agents/gdd-graph-refresh.md +3 -3
  38. package/agents/gdd-intel-updater.md +2 -2
  39. package/agents/motion-mapper.md +2 -2
  40. package/agents/motion-verifier.md +4 -4
  41. package/agents/pdf-executor.md +8 -8
  42. package/agents/perf-analyzer.md +17 -17
  43. package/agents/pr-commenter.md +9 -9
  44. package/agents/prototype-gate.md +2 -2
  45. package/agents/quality-gate-runner.md +1 -1
  46. package/agents/rollout-coordinator.md +3 -3
  47. package/agents/swift-executor.md +4 -4
  48. package/agents/ticket-sync-agent.md +6 -6
  49. package/agents/user-research-synthesizer.md +2 -2
  50. package/connections/connections.md +44 -45
  51. package/connections/cursor.md +72 -0
  52. package/connections/preview.md +3 -3
  53. package/hooks/first-run-nudge.cjs +171 -0
  54. package/hooks/gdd-intel-trigger.js +243 -0
  55. package/hooks/gdd-mcp-circuit-breaker.js +62 -7
  56. package/hooks/gdd-precompact-snapshot.js +50 -29
  57. package/hooks/gdd-protected-paths.js +150 -18
  58. package/hooks/gdd-risk-gate.js +93 -1
  59. package/hooks/gdd-sessionstart-recap.js +59 -24
  60. package/hooks/hooks.json +13 -4
  61. package/hooks/inject-using-gdd.cjs +188 -0
  62. package/hooks/update-check.cjs +511 -0
  63. package/package.json +9 -3
  64. package/reference/STATE-TEMPLATE.md +10 -13
  65. package/reference/audit-scoring.md +1 -1
  66. package/reference/cache-tier-doctrine.md +46 -0
  67. package/reference/config-schema.md +9 -9
  68. package/reference/i18n.md +1 -1
  69. package/reference/intel-schema.md +37 -2
  70. package/reference/meta-rules.md +4 -4
  71. package/reference/model-tiers.md +2 -2
  72. package/reference/registry.json +101 -94
  73. package/reference/runtime-models.md +11 -1
  74. package/reference/shared-preamble.md +13 -14
  75. package/reference/skill-graph.md +22 -3
  76. package/scripts/bootstrap.cjs +373 -0
  77. package/scripts/injection-patterns.cjs +58 -0
  78. package/scripts/lib/apply-reflections/incubator-proposals.cjs +57 -26
  79. package/scripts/lib/install/converters/codex-plugin.cjs +5 -2
  80. package/scripts/lib/install/converters/cursor.cjs +20 -0
  81. package/scripts/lib/issue-reporter/report-flow.cjs +1 -1
  82. package/scripts/lib/manifest/skills.json +75 -28
  83. package/scripts/lib/state/query-surface.cjs +67 -9
  84. package/scripts/lib/state/state-store.cjs +68 -26
  85. package/scripts/lib/worktree-resolve.cjs +4 -16
  86. package/sdk/cli/commands/stage.ts +17 -0
  87. package/sdk/cli/index.js +14 -0
  88. package/skills/README.md +46 -0
  89. package/skills/bootstrap-ds/SKILL.md +1 -1
  90. package/skills/cache-manager/SKILL.md +3 -3
  91. package/skills/cache-manager/cache-policy.md +1 -1
  92. package/skills/compare/SKILL.md +1 -1
  93. package/skills/design/SKILL.md +19 -0
  94. package/skills/explore/SKILL.md +11 -0
  95. package/skills/figma-write/SKILL.md +13 -2
  96. package/skills/new-cycle/SKILL.md +1 -1
  97. package/skills/paper-write/SKILL.md +54 -0
  98. package/skills/peer-cli-customize/SKILL.md +0 -1
  99. package/skills/peers/SKILL.md +1 -1
  100. package/skills/pencil-write/SKILL.md +54 -0
  101. package/skills/reflect/procedures/capability-gap-scan.md +0 -1
  102. package/skills/report-issue/SKILL.md +2 -2
  103. package/skills/report-issue/report-issue-procedure.md +0 -1
  104. package/skills/router/SKILL.md +2 -2
  105. package/skills/synthesize/SKILL.md +1 -1
  106. package/skills/turn-closeout/SKILL.md +1 -1
  107. package/skills/verify/verify-procedure.md +10 -11
  108. package/skills/warm-cache/SKILL.md +1 -1
  109. package/dist/claude-code/.claude/skills/add-backlog/SKILL.md +0 -48
  110. package/dist/claude-code/.claude/skills/analyze-dependencies/SKILL.md +0 -95
  111. package/dist/claude-code/.claude/skills/apply-reflections/SKILL.md +0 -109
  112. package/dist/claude-code/.claude/skills/apply-reflections/apply-reflections-procedure.md +0 -170
  113. package/dist/claude-code/.claude/skills/audit/SKILL.md +0 -79
  114. package/dist/claude-code/.claude/skills/bandit-status/SKILL.md +0 -94
  115. package/dist/claude-code/.claude/skills/benchmark/SKILL.md +0 -65
  116. package/dist/claude-code/.claude/skills/bootstrap-ds/SKILL.md +0 -43
  117. package/dist/claude-code/.claude/skills/brief/SKILL.md +0 -145
  118. package/dist/claude-code/.claude/skills/budget/SKILL.md +0 -45
  119. package/dist/claude-code/.claude/skills/cache-manager/SKILL.md +0 -66
  120. package/dist/claude-code/.claude/skills/cache-manager/cache-policy.md +0 -126
  121. package/dist/claude-code/.claude/skills/check-update/SKILL.md +0 -98
  122. package/dist/claude-code/.claude/skills/compare/SKILL.md +0 -82
  123. package/dist/claude-code/.claude/skills/compare/compare-rubric.md +0 -171
  124. package/dist/claude-code/.claude/skills/complete-cycle/SKILL.md +0 -81
  125. package/dist/claude-code/.claude/skills/connections/SKILL.md +0 -71
  126. package/dist/claude-code/.claude/skills/connections/connections-onboarding.md +0 -608
  127. package/dist/claude-code/.claude/skills/context/SKILL.md +0 -137
  128. package/dist/claude-code/.claude/skills/continue/SKILL.md +0 -24
  129. package/dist/claude-code/.claude/skills/darkmode/SKILL.md +0 -76
  130. package/dist/claude-code/.claude/skills/darkmode/darkmode-audit-procedure.md +0 -258
  131. package/dist/claude-code/.claude/skills/debug/SKILL.md +0 -41
  132. package/dist/claude-code/.claude/skills/debug/debug-feedback-loops.md +0 -119
  133. package/dist/claude-code/.claude/skills/design/SKILL.md +0 -99
  134. package/dist/claude-code/.claude/skills/design/design-procedure.md +0 -304
  135. package/dist/claude-code/.claude/skills/discover/SKILL.md +0 -78
  136. package/dist/claude-code/.claude/skills/discover/discover-procedure.md +0 -222
  137. package/dist/claude-code/.claude/skills/discuss/SKILL.md +0 -96
  138. package/dist/claude-code/.claude/skills/do/SKILL.md +0 -45
  139. package/dist/claude-code/.claude/skills/explore/SKILL.md +0 -107
  140. package/dist/claude-code/.claude/skills/explore/explore-procedure.md +0 -267
  141. package/dist/claude-code/.claude/skills/export/SKILL.md +0 -30
  142. package/dist/claude-code/.claude/skills/extract-learnings/SKILL.md +0 -114
  143. package/dist/claude-code/.claude/skills/fast/SKILL.md +0 -91
  144. package/dist/claude-code/.claude/skills/figma-extract/SKILL.md +0 -64
  145. package/dist/claude-code/.claude/skills/figma-write/SKILL.md +0 -39
  146. package/dist/claude-code/.claude/skills/graphify/SKILL.md +0 -49
  147. package/dist/claude-code/.claude/skills/health/SKILL.md +0 -99
  148. package/dist/claude-code/.claude/skills/health/health-mcp-detection.md +0 -44
  149. package/dist/claude-code/.claude/skills/health/health-skill-length-report.md +0 -69
  150. package/dist/claude-code/.claude/skills/help/SKILL.md +0 -87
  151. package/dist/claude-code/.claude/skills/instinct/SKILL.md +0 -111
  152. package/dist/claude-code/.claude/skills/list-assumptions/SKILL.md +0 -61
  153. package/dist/claude-code/.claude/skills/list-pins/SKILL.md +0 -27
  154. package/dist/claude-code/.claude/skills/live/SKILL.md +0 -98
  155. package/dist/claude-code/.claude/skills/locale/SKILL.md +0 -51
  156. package/dist/claude-code/.claude/skills/map/SKILL.md +0 -89
  157. package/dist/claude-code/.claude/skills/migrate/SKILL.md +0 -70
  158. package/dist/claude-code/.claude/skills/migrate-context/SKILL.md +0 -123
  159. package/dist/claude-code/.claude/skills/new-addendum/SKILL.md +0 -81
  160. package/dist/claude-code/.claude/skills/new-cycle/SKILL.md +0 -37
  161. package/dist/claude-code/.claude/skills/new-cycle/milestone-completeness-rubric.md +0 -87
  162. package/dist/claude-code/.claude/skills/new-project/SKILL.md +0 -53
  163. package/dist/claude-code/.claude/skills/new-skill/SKILL.md +0 -90
  164. package/dist/claude-code/.claude/skills/next/SKILL.md +0 -68
  165. package/dist/claude-code/.claude/skills/note/SKILL.md +0 -48
  166. package/dist/claude-code/.claude/skills/openrouter-status/SKILL.md +0 -86
  167. package/dist/claude-code/.claude/skills/optimize/SKILL.md +0 -97
  168. package/dist/claude-code/.claude/skills/override/SKILL.md +0 -86
  169. package/dist/claude-code/.claude/skills/pause/SKILL.md +0 -77
  170. package/dist/claude-code/.claude/skills/peer-cli-add/SKILL.md +0 -88
  171. package/dist/claude-code/.claude/skills/peer-cli-add/peer-cli-protocol.md +0 -161
  172. package/dist/claude-code/.claude/skills/peer-cli-customize/SKILL.md +0 -90
  173. package/dist/claude-code/.claude/skills/peers/SKILL.md +0 -96
  174. package/dist/claude-code/.claude/skills/pin/SKILL.md +0 -37
  175. package/dist/claude-code/.claude/skills/plan/SKILL.md +0 -105
  176. package/dist/claude-code/.claude/skills/plan/plan-procedure.md +0 -278
  177. package/dist/claude-code/.claude/skills/plant-seed/SKILL.md +0 -48
  178. package/dist/claude-code/.claude/skills/pr-branch/SKILL.md +0 -32
  179. package/dist/claude-code/.claude/skills/progress/SKILL.md +0 -107
  180. package/dist/claude-code/.claude/skills/quality-gate/SKILL.md +0 -90
  181. package/dist/claude-code/.claude/skills/quality-gate/threat-modeling.md +0 -101
  182. package/dist/claude-code/.claude/skills/quick/SKILL.md +0 -44
  183. package/dist/claude-code/.claude/skills/reapply-patches/SKILL.md +0 -32
  184. package/dist/claude-code/.claude/skills/recall/SKILL.md +0 -75
  185. package/dist/claude-code/.claude/skills/reflect/SKILL.md +0 -85
  186. package/dist/claude-code/.claude/skills/reflect/procedures/capability-gap-scan.md +0 -120
  187. package/dist/claude-code/.claude/skills/report-issue/SKILL.md +0 -53
  188. package/dist/claude-code/.claude/skills/report-issue/report-issue-procedure.md +0 -120
  189. package/dist/claude-code/.claude/skills/resume/SKILL.md +0 -93
  190. package/dist/claude-code/.claude/skills/review-backlog/SKILL.md +0 -46
  191. package/dist/claude-code/.claude/skills/review-decisions/SKILL.md +0 -42
  192. package/dist/claude-code/.claude/skills/roi/SKILL.md +0 -54
  193. package/dist/claude-code/.claude/skills/rollout-status/SKILL.md +0 -35
  194. package/dist/claude-code/.claude/skills/router/SKILL.md +0 -89
  195. package/dist/claude-code/.claude/skills/router/capability-gap-emitter.md +0 -65
  196. package/dist/claude-code/.claude/skills/router/router-pick-emitter.md +0 -78
  197. package/dist/claude-code/.claude/skills/router/router-rules.md +0 -84
  198. package/dist/claude-code/.claude/skills/scan/SKILL.md +0 -92
  199. package/dist/claude-code/.claude/skills/scan/scan-procedure.md +0 -732
  200. package/dist/claude-code/.claude/skills/settings/SKILL.md +0 -87
  201. package/dist/claude-code/.claude/skills/ship/SKILL.md +0 -48
  202. package/dist/claude-code/.claude/skills/sketch/SKILL.md +0 -78
  203. package/dist/claude-code/.claude/skills/sketch-wrap-up/SKILL.md +0 -92
  204. package/dist/claude-code/.claude/skills/skill-manifest/SKILL.md +0 -79
  205. package/dist/claude-code/.claude/skills/spike/SKILL.md +0 -67
  206. package/dist/claude-code/.claude/skills/spike-wrap-up/SKILL.md +0 -86
  207. package/dist/claude-code/.claude/skills/start/SKILL.md +0 -67
  208. package/dist/claude-code/.claude/skills/start/start-procedure.md +0 -115
  209. package/dist/claude-code/.claude/skills/state/SKILL.md +0 -106
  210. package/dist/claude-code/.claude/skills/stats/SKILL.md +0 -51
  211. package/dist/claude-code/.claude/skills/style/SKILL.md +0 -71
  212. package/dist/claude-code/.claude/skills/style/style-doc-procedure.md +0 -150
  213. package/dist/claude-code/.claude/skills/synthesize/SKILL.md +0 -94
  214. package/dist/claude-code/.claude/skills/timeline/SKILL.md +0 -66
  215. package/dist/claude-code/.claude/skills/todo/SKILL.md +0 -64
  216. package/dist/claude-code/.claude/skills/turn-closeout/SKILL.md +0 -95
  217. package/dist/claude-code/.claude/skills/undo/SKILL.md +0 -31
  218. package/dist/claude-code/.claude/skills/unlock-decision/SKILL.md +0 -54
  219. package/dist/claude-code/.claude/skills/unpin/SKILL.md +0 -31
  220. package/dist/claude-code/.claude/skills/update/SKILL.md +0 -56
  221. package/dist/claude-code/.claude/skills/using-gdd/SKILL.md +0 -78
  222. package/dist/claude-code/.claude/skills/verify/SKILL.md +0 -113
  223. package/dist/claude-code/.claude/skills/verify/verify-procedure.md +0 -512
  224. package/dist/claude-code/.claude/skills/warm-cache/SKILL.md +0 -81
  225. package/dist/claude-code/.claude/skills/watch-authorities/SKILL.md +0 -82
  226. package/dist/claude-code/.claude/skills/zoom-out/SKILL.md +0 -26
  227. package/hooks/first-run-nudge.sh +0 -82
  228. package/hooks/inject-using-gdd.sh +0 -72
  229. package/hooks/run-hook.cmd +0 -35
  230. package/hooks/update-check.sh +0 -251
  231. package/scripts/lib/audit-aggregator/index.cjs +0 -219
  232. package/scripts/lib/hedge-ensemble.cjs +0 -217
  233. package/skills/discover/SKILL.md +0 -78
  234. package/skills/discover/discover-procedure.md +0 -222
  235. package/skills/new-cycle/milestone-completeness-rubric.md +0 -87
  236. package/skills/scan/SKILL.md +0 -92
  237. package/skills/scan/scan-procedure.md +0 -732
@@ -15,8 +15,8 @@
15
15
  * setPosition(position, opts) - upsert state_position
16
16
  * getPosition(opts) - return current position
17
17
  * queryDecisions(ftsQuery, opts) - FTS5 search over decisions (or JS fallback)
18
- * migrate(migrateOpts) - lazy-require migrate-to-sqlite.cjs (Executor B)
19
- * render(projectRoot) - lazy-require render-markdown.cjs (Executor C)
18
+ * migrate(migrateOpts) - lazy-require migrate-to-sqlite.cjs
19
+ * render(projectRoot) - lazy-require render-markdown.cjs
20
20
  * backendName() - return BACKEND string
21
21
  *
22
22
  * R7 dual-write: every SQLite MUTATION wraps writeStructured() + renderMarkdown()
@@ -103,18 +103,18 @@ async function loadSdk() {
103
103
  }
104
104
 
105
105
  // ---------------------------------------------------------------------------
106
- // Lazy-require helpers for Executor B and C modules (PINNED names).
107
- // Do NOT call require() on these at module load - they may not exist yet.
106
+ // Lazy-require helpers for the migrate and render sibling modules (PINNED names).
107
+ // Loaded on first call so a missing better-sqlite3 binding does not crash module load.
108
108
  // ---------------------------------------------------------------------------
109
109
 
110
- /** @type {any|null} Cached migrate-to-sqlite module (Executor B). */
110
+ /** @type {any|null} Cached migrate-to-sqlite module. */
111
111
  let _migrateModule = null;
112
- /** @type {any|null} Cached render-markdown module (Executor C). */
112
+ /** @type {any|null} Cached render-markdown module. */
113
113
  let _renderModule = null;
114
114
 
115
115
  /**
116
- * Lazy-require ./migrate-to-sqlite.cjs (Executor B's module).
117
- * Returns null if not yet available.
116
+ * Lazy-require ./migrate-to-sqlite.cjs.
117
+ * Returns null if the require fails (e.g. better-sqlite3 missing).
118
118
  * @returns {any|null}
119
119
  */
120
120
  function _requireMigrate() {
@@ -128,8 +128,8 @@ function _requireMigrate() {
128
128
  }
129
129
 
130
130
  /**
131
- * Lazy-require ./render-markdown.cjs (Executor C's module).
132
- * Returns null if not yet available.
131
+ * Lazy-require ./render-markdown.cjs.
132
+ * Returns null if the require fails.
133
133
  * @returns {any|null}
134
134
  */
135
135
  function _requireRender() {
@@ -280,7 +280,7 @@ function _dualWrite(db, statePath, cycleId, writeStructured, sdk) {
280
280
  db.prepare('INSERT OR REPLACE INTO _meta(key, value) VALUES (?, ?)').run('last_render_sha256', newSha);
281
281
  }
282
282
  // If render module not available or sdk not loaded, still write the structured data.
283
- // STATE.md will be stale until Executor C's render module is present.
283
+ // STATE.md will be stale until the render module loads successfully.
284
284
  });
285
285
  txn();
286
286
  }
@@ -654,19 +654,60 @@ function _currentCycleId(db) {
654
654
  }
655
655
 
656
656
  // ---------------------------------------------------------------------------
657
- // migrate - lazy delegate to migrate-to-sqlite.cjs (Executor B).
657
+ // migrate - async lazy delegate to migrate-to-sqlite.cjs.
658
658
  // ---------------------------------------------------------------------------
659
659
 
660
660
  /**
661
- * Run migration from markdown STATE.md to SQLite.
662
- * Delegates to ./migrate-to-sqlite.cjs (created by Executor B).
663
- * If that module is not yet present, logs a clear message and returns.
661
+ * Run migration from markdown `.design/STATE.md` to the SQLite state database.
664
662
  *
665
- * @param {{ statePath?: string, dbPath?: string, projectRoot?: string,
666
- * dryRun?: boolean, upsertOnly?: boolean }} [migrateOpts]
667
- * @returns {{ migrated: boolean, backend: string, message?: string }}
663
+ * This function is the public store-level entry point for the
664
+ * `--migrate-state` flow. It lazy-loads `./migrate-to-sqlite.cjs` on first call
665
+ * and delegates to whichever export it exposes (`migrateToSqlite`,
666
+ * `migrate`, or `migrateState`), in priority order. The underlying
667
+ * `migrateToSqlite` is itself async (it dynamically imports
668
+ * `sdk/state/parser.ts` and uses node:fs/promises for IO), so this wrapper
669
+ * is async and always returns a Promise.
670
+ *
671
+ * The function NEVER throws on infrastructure failures:
672
+ * - `BACKEND === 'markdown'` (no better-sqlite3) → resolves with
673
+ * `{ migrated: false, backend: 'markdown', message: ... }`.
674
+ * - `require('./migrate-to-sqlite.cjs')` failed → resolves with
675
+ * `{ migrated: false, backend: 'sqlite', message: ... }`.
676
+ * - The delegate module loaded but exposes no recognized export → resolves
677
+ * with `{ migrated: false, backend: 'sqlite', message: ... }`.
678
+ *
679
+ * Errors thrown by the delegate (parser failure, schema mismatch, etc.) are
680
+ * propagated as a rejected Promise - callers should `await` and handle.
681
+ *
682
+ * Idempotent: calling `migrate()` repeatedly on a clean database is safe
683
+ * (the underlying migration uses `INSERT ... ON CONFLICT ... DO UPDATE`).
684
+ * Migration is opt-in: the delegate refuses to write unless `force:true` or
685
+ * the CLI `--migrate-state` flag is set (a notice is returned instead).
686
+ *
687
+ * Dual-channel result shapes:
688
+ * - markdown floor: { migrated: false, backend: 'markdown', message }
689
+ * - sqlite path: { migrated: boolean, tables: {...counts}, dryRun,
690
+ * skipped, reason }
691
+ * The caller MUST inspect `migrated` (the boolean) — never `backend` alone —
692
+ * to decide whether the operation actually performed writes.
693
+ *
694
+ * @async
695
+ * @param {object} [migrateOpts] options forwarded to the delegate
696
+ * @param {string} [migrateOpts.statePath] explicit path to STATE.md
697
+ * @param {string} [migrateOpts.dbPath] explicit path to state.sqlite
698
+ * @param {string} [migrateOpts.projectRoot] project root for path lookup
699
+ * @param {boolean} [migrateOpts.dryRun] wrap writes in BEGIN/ROLLBACK
700
+ * @param {boolean} [migrateOpts.force] same as `--migrate-state` flag
701
+ * @param {boolean} [migrateOpts.upsertOnly] re-parse + UPSERT without wiping
702
+ * unrelated rows (used by the R8
703
+ * freshness guard)
704
+ * @returns {Promise<{ migrated: boolean, backend?: string, message?: string,
705
+ * tables?: object, dryRun?: boolean, skipped?: boolean, reason?: string }>}
706
+ * Resolves with the migration result; rejects only on delegate exceptions.
707
+ * @see migrate-to-sqlite.cjs for the underlying transactional implementation
708
+ * @see render for the reverse direction (SQLite → STATE.md)
668
709
  */
669
- function migrate(migrateOpts = {}) {
710
+ async function migrate(migrateOpts = {}) {
670
711
  if (BACKEND !== 'sqlite') {
671
712
  return {
672
713
  migrated: false,
@@ -679,17 +720,18 @@ function migrate(migrateOpts = {}) {
679
720
  return {
680
721
  migrated: false,
681
722
  backend: 'sqlite',
682
- message: 'migrate-to-sqlite.cjs not yet available (Executor B pending)',
723
+ message: 'migrate-to-sqlite.cjs could not be loaded (require failed)',
683
724
  };
684
725
  }
726
+ // Delegate is async; await so callers see the resolved result, not a Promise.
685
727
  if (typeof mod.migrateToSqlite === 'function') {
686
- return mod.migrateToSqlite(migrateOpts);
728
+ return await mod.migrateToSqlite(migrateOpts);
687
729
  }
688
730
  if (typeof mod.migrate === 'function') {
689
- return mod.migrate(migrateOpts);
731
+ return await mod.migrate(migrateOpts);
690
732
  }
691
733
  if (typeof mod.migrateState === 'function') {
692
- return mod.migrateState(migrateOpts);
734
+ return await mod.migrateState(migrateOpts);
693
735
  }
694
736
  return {
695
737
  migrated: false,
@@ -699,13 +741,13 @@ function migrate(migrateOpts = {}) {
699
741
  }
700
742
 
701
743
  // ---------------------------------------------------------------------------
702
- // render - lazy delegate to render-markdown.cjs (Executor C).
744
+ // render - lazy delegate to render-markdown.cjs.
703
745
  // ---------------------------------------------------------------------------
704
746
 
705
747
  /**
706
748
  * Re-render STATE.md from SQLite state (reverse of migration).
707
- * Delegates to ./render-markdown.cjs (created by Executor C).
708
- * If that module is not yet present, logs a clear message and returns null.
749
+ * Delegates to ./render-markdown.cjs.
750
+ * If that module cannot be loaded, returns null silently.
709
751
  *
710
752
  * @param {string} [projectRoot]
711
753
  * @returns {Promise<string|null>} rendered markdown string, or null if unavailable
@@ -2,9 +2,9 @@
2
2
  /**
3
3
  * scripts/lib/worktree-resolve.cjs — Phase 49 (Quick Anti-Slop Floor).
4
4
  *
5
- * Redirect `.design/` and `.planning/` writes to the MAIN repo root when GDD
6
- * runs inside a git WORKTREE. A worktree has its own ephemeral checkout dir; a
7
- * naive `process.cwd()`-relative `.design/STATE.md` write would land inside the
5
+ * Redirect `.design/` writes to the MAIN repo root when GDD runs inside a git
6
+ * WORKTREE. A worktree has its own ephemeral checkout dir; a naive
7
+ * `process.cwd()`-relative `.design/STATE.md` write would land inside the
8
8
  * throwaway worktree and get lost (or leak) when the worktree is removed. We
9
9
  * detect the worktree, resolve the main repo root, and point artifact writes
10
10
  * there so state survives across worktree lifecycles.
@@ -167,17 +167,6 @@ function resolveDesignRoot(cwd = process.cwd(), exec) {
167
167
  return path.join(resolveRepoRoot(cwd, exec), '.design');
168
168
  }
169
169
 
170
- /**
171
- * Absolute `.planning` root in the MAIN repo (worktree-safe).
172
- *
173
- * @param {string} [cwd=process.cwd()]
174
- * @param {(cmd: string, args: string[]) => string} [exec]
175
- * @returns {string}
176
- */
177
- function resolvePlanningRoot(cwd = process.cwd(), exec) {
178
- return path.join(resolveRepoRoot(cwd, exec), '.planning');
179
- }
180
-
181
170
  /** One-shot guard so the redirect notice prints at most once per process. */
182
171
  let NOTICE_EMITTED = false;
183
172
 
@@ -193,7 +182,7 @@ let NOTICE_EMITTED = false;
193
182
  function noticeOnce(targetRoot, write) {
194
183
  if (NOTICE_EMITTED) return false;
195
184
  NOTICE_EMITTED = true;
196
- const line = `worktree detected -> .design/.planning redirected to ${targetRoot}\n`;
185
+ const line = `worktree detected -> .design redirected to ${targetRoot}\n`;
197
186
  try {
198
187
  if (typeof write === 'function') {
199
188
  write(line);
@@ -215,7 +204,6 @@ module.exports = {
215
204
  isWorktree,
216
205
  resolveRepoRoot,
217
206
  resolveDesignRoot,
218
- resolvePlanningRoot,
219
207
  noticeOnce,
220
208
  _resetNoticeForTests,
221
209
  };
@@ -110,6 +110,18 @@ const VALID_STAGE_NAMES = new Set<string>([
110
110
  'discuss',
111
111
  ]);
112
112
 
113
+ // Names of top-level `gdd-sdk` subcommands that users sometimes try to invoke
114
+ // as stages (e.g. `gdd-sdk stage audit`). When a stage name collides with one,
115
+ // surface a "did you mean" hint pointing at the real invocation.
116
+ const TOP_LEVEL_COMMANDS_OFTEN_CONFUSED_FOR_STAGES = new Set<string>([
117
+ 'audit',
118
+ 'build',
119
+ 'dashboard',
120
+ 'init',
121
+ 'query',
122
+ 'run',
123
+ ]);
124
+
113
125
  export async function stageCommand(
114
126
  args: ParsedArgs,
115
127
  deps: StageCommandDeps = {},
@@ -134,6 +146,11 @@ export async function stageCommand(
134
146
  stderr.write(
135
147
  `gdd-sdk stage: "${stageName}" is not one of brief|explore|plan|design|verify|discuss\n`,
136
148
  );
149
+ if (TOP_LEVEL_COMMANDS_OFTEN_CONFUSED_FOR_STAGES.has(stageName)) {
150
+ stderr.write(
151
+ `gdd-sdk stage: did you mean \`gdd-sdk ${stageName}\`? "${stageName}" is a top-level subcommand, not a pipeline stage.\n`,
152
+ );
153
+ }
137
154
  return 3;
138
155
  }
139
156
 
package/sdk/cli/index.js CHANGED
@@ -8253,6 +8253,14 @@ var VALID_STAGE_NAMES = /* @__PURE__ */ new Set([
8253
8253
  "verify",
8254
8254
  "discuss"
8255
8255
  ]);
8256
+ var TOP_LEVEL_COMMANDS_OFTEN_CONFUSED_FOR_STAGES = /* @__PURE__ */ new Set([
8257
+ "audit",
8258
+ "build",
8259
+ "dashboard",
8260
+ "init",
8261
+ "query",
8262
+ "run"
8263
+ ]);
8256
8264
  async function stageCommand(args, deps = {}) {
8257
8265
  const stdout = deps.stdout ?? process.stdout;
8258
8266
  const stderr = deps.stderr ?? process.stderr;
@@ -8271,6 +8279,12 @@ async function stageCommand(args, deps = {}) {
8271
8279
  `gdd-sdk stage: "${stageName}" is not one of brief|explore|plan|design|verify|discuss
8272
8280
  `
8273
8281
  );
8282
+ if (TOP_LEVEL_COMMANDS_OFTEN_CONFUSED_FOR_STAGES.has(stageName)) {
8283
+ stderr.write(
8284
+ `gdd-sdk stage: did you mean \`gdd-sdk ${stageName}\`? "${stageName}" is a top-level subcommand, not a pipeline stage.
8285
+ `
8286
+ );
8287
+ }
8274
8288
  return 3;
8275
8289
  }
8276
8290
  let flags;
@@ -0,0 +1,46 @@
1
+ # `source/skills/` - Canonical Skill BODY Source
2
+
3
+ This directory is the **canonical home for skill body content**. Every `SKILL.md` under
4
+ `source/skills/<slug>/` is the editable truth: the per-skill prose, examples, procedure files,
5
+ and any sibling docs (`*-procedure.md`, `*-rules.md`, emitters, etc.) live here.
6
+
7
+ `skills/` (the sibling at the repo root) is a **built artifact**, regenerated from this directory
8
+ by `npm run build:skills`. Do not hand-edit `skills/<slug>/SKILL.md` - your edit will be wiped on
9
+ the next build and the CI drift gate (`build:skills:check`) will fail.
10
+
11
+ ## Source-of-truth split (what lives where)
12
+
13
+ | Concern | Source of truth | How it reaches `skills/` |
14
+ |---|---|---|
15
+ | **Body content** (everything below the frontmatter) | `source/skills/<slug>/SKILL.md` | `scripts/build-skills.cjs` walks `source/skills/`, applies per-harness placeholder substitution, writes to `skills/` |
16
+ | **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 `source/skills/<slug>/SKILL.md`, then `build:skills` copies it onward |
17
+ | **Non-managed frontmatter** (e.g. `color`, `model`, custom keys) | `source/skills/<slug>/SKILL.md` itself (preserved verbatim) | carried through both generators unchanged |
18
+
19
+ The forward direction is **`skills.json` -> `source/skills/` -> `skills/`**.
20
+ Treat that direction as canonical; the `--extract` mode of `generate-skill-frontmatter.cjs` exists
21
+ only to seed the manifest from current sources when reconciling drift.
22
+
23
+ ## Editing protocol
24
+
25
+ 1. **Edit body** -> modify `source/skills/<slug>/SKILL.md` (anything below the frontmatter delimiter).
26
+ 2. **Edit universal frontmatter** -> modify `scripts/lib/manifest/skills.json`, then run
27
+ `npm run generate:skill-frontmatter`.
28
+ 3. **Edit non-managed frontmatter** -> modify `source/skills/<slug>/SKILL.md` directly; the generator
29
+ preserves it.
30
+ 4. **Regenerate the built surface** -> `npm run build:skills`. This rewrites `skills/<slug>/SKILL.md`
31
+ byte-for-byte.
32
+ 5. **Verify no drift** -> `npm run build:skills:check` (CI gate) and `npm run generate:skill-frontmatter:check`.
33
+
34
+ ## What npm ships
35
+
36
+ `package.json` `files` lists `skills/` (the built surface); `source/skills/` is repo-only and is
37
+ **not** distributed via npm. Users running `npm install @hegemonart/get-design-done` get the
38
+ compiled skills; only contributors editing this repo touch `source/skills/`.
39
+
40
+ ## Cross-references
41
+
42
+ - `scripts/build-skills.cjs` - the multi-harness orchestrator that compiles this directory.
43
+ - `scripts/lib/build/factory.cjs` - the pure transformer applied per-harness.
44
+ - `scripts/lib/manifest/README.md` - explains why `skills.json` is the universal-frontmatter SoT.
45
+ - `scripts/generate-skill-frontmatter.cjs` - manifest -> source-frontmatter generator (with
46
+ `--check` drift gate and `--extract` reverse mode).
@@ -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-cache-manager
3
- description: "Maintains .design/cache-manifest.json for Layer B explicit cache per D-08. Computes deterministic SHA-256 input-hash from (agent-path + sorted-input-file-paths + input-content-hashes). On spawn: lookup key → return cached blob if within TTL, else miss. On completion: write result + TTL. Consulted by hooks/budget-enforcer.js before every Agent spawn."
3
+ description: "Maintains .design/cache-manifest.json for Layer B explicit cache per D-08. Computes deterministic SHA-256 input-hash from (agent-path + sorted-input-file-paths + input-content-hashes). On spawn: lookup key → return cached blob if within TTL, else miss. On completion: write result + TTL. Consulted by hooks/budget-enforcer.ts before every Agent spawn."
4
4
  user-invocable: false
5
5
  tools: Read, Bash, Write
6
6
  disable-model-invocation: true
@@ -38,11 +38,11 @@ You are the deterministic cache-key computer and cache-manifest writer for the o
38
38
 
39
39
  ## Deterministic Input-Hash Algorithm
40
40
 
41
- The canonical reference implementation (single source of truth; `hooks/budget-enforcer.js` imports the same primitive via a shared helper) lives in `./cache-policy.md#deterministic-input-hash-algorithm-layer-b` - it documents the JS implementation, the maintainer notes (sorted-unique paths, MISSING-file sentinel, agent-path bust behavior), the manifest shape, and TTL semantics in one place. Conform to the algorithm exactly so the hook and any orchestrator agree byte-for-byte.
41
+ The canonical reference implementation (single source of truth; `hooks/budget-enforcer.ts` imports the same primitive via a shared helper) lives in `./cache-policy.md#deterministic-input-hash-algorithm-layer-b` - it documents the JS implementation, the maintainer notes (sorted-unique paths, MISSING-file sentinel, agent-path bust behavior), the manifest shape, and TTL semantics in one place. Conform to the algorithm exactly so the hook and any orchestrator agree byte-for-byte.
42
42
 
43
43
  ## Integration Points
44
44
 
45
- - **`hooks/budget-enforcer.js`** (Plan 10.1-01) reads the manifest on every Agent spawn. The hook already calls `cacheLookup(agent, inputHash)` against `.design/cache-manifest.json`. This skill is the authority on how `inputHash` is computed so the hook and any orchestrator agree byte-for-byte.
45
+ - **`hooks/budget-enforcer.ts`** (Plan 10.1-01) reads the manifest on every Agent spawn. The hook already calls `cacheLookup(agent, inputHash)` against `.design/cache-manifest.json`. This skill is the authority on how `inputHash` is computed so the hook and any orchestrator agree byte-for-byte.
46
46
  - **Orchestrators** (e.g., `skills/map/`, `skills/discover/`, `skills/plan/`) invoke Phase 1 (compute-key) + Phase 4 (write-result-on-completion) around each Agent spawn they launch. Phase 2 + Phase 3 are executed by the hook.
47
47
  - **Warm-cache command** (`skills/warm-cache/SKILL.md`, Task 02) does not touch Layer B - it only primes Anthropic's 5-min prompt cache (Layer A). Do not confuse the two.
48
48
 
@@ -21,7 +21,7 @@ The two layers (D-08):
21
21
 
22
22
  ## Deterministic Input-Hash Algorithm (Layer B)
23
23
 
24
- The canonical reference implementation (the single source of truth; `hooks/budget-enforcer.js` imports the same primitive via a shared helper):
24
+ The canonical reference implementation (the single source of truth; `hooks/budget-enforcer.ts` imports the same primitive via a shared helper):
25
25
 
26
26
  ```js
27
27
  // Deterministic cache-key primitive (reference implementation)
@@ -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
  ---
@@ -79,6 +79,25 @@ Print the `=== Design stage complete ===` summary (tasks complete/total, deviati
79
79
 
80
80
  After all tasks finish, if STATE.md `<connections>` has `figma: available`, offer the user the figma-write opt-in prompt (modes: annotate / tokenize / mappings, with optional `--dry-run`). Spawn `design-figma-writer` with the selected mode on "yes"; skip silently on "no". NEVER auto-run without confirmation. Full prompt + dispatch logic: `./design-procedure.md` §Figma Write Dispatch.
81
81
 
82
+ ## Component Generator Dispatch
83
+
84
+ If the DESIGN-PLAN has a `task_type: component` task without a matching `src/components/*.tsx`, OR the brief / DESIGN-CONTEXT.md explicitly asks for a new component, AND STATE.md `<connections>` shows a generator connection (`21st-dev: available`, `magic-patterns: available`, `plasmic: available`, `builder-io: available`, or `v0-dev: available`); offer the component-generator opt-in.
85
+
86
+ ```
87
+ Task("design-component-generator", """
88
+ mode: <21st|magic-patterns|plasmic|builder-io|v0-dev>
89
+ component_spec: <DESIGN-PLAN task summary + DESIGN-CONTEXT acceptance criteria>
90
+ required_reading:
91
+ - .design/STATE.md
92
+ - .design/DESIGN-PLAN.md
93
+ - .design/DESIGN-CONTEXT.md
94
+ """)
95
+ ```
96
+
97
+ Sequential (the agent is `parallel-safe: never`). Wait for the agent's `## design-component-generator complete.` marker. Skip silently when no generator connection is available OR no component task is pending. Auto-mode bypasses the prompt; otherwise prompt "Generate component via [tool]? (y/n)" and only spawn on "y".
98
+
99
+ The dispatch fires AFTER `design-executor` completes the hand-coded plan tasks. The agent's output (component file path + tokens used + provenance) is appended to `.design/DESIGN-SUMMARY.md` as a single `## Generated Components` section so verify can audit it.
100
+
82
101
  <HARD-GATE>
83
102
  Do NOT transition to verify (or invoke `/gdd:verify`) until `.design/DESIGN-SUMMARY.md` is committed. If this project uses a custom `.design` location, read the artifact path from `.design/STATE.md` rather than assuming the default.
84
103
  </HARD-GATE>
@@ -61,6 +61,16 @@ Run the canonical scan grep/glob inventory (POSIX ERE, preserving PLAT-01/02): c
61
61
  - **Project-local skills**: read `./.claude/skills/design-*-conventions.md` -> include in DESIGN-CONTEXT.md `<project_conventions>` (these override defaults).
62
62
  - **Global skills**: `~/.claude/gdd/global-skills/*.md` (other than README) -> prepend to `<project_conventions>` under `<global_conventions>` sub-block. Project-local D-XX wins on conflict.
63
63
 
64
+ ## Step 2.6 - Graph review (gate then reviewer)
65
+
66
+ Runs only when Step 2's mapper batch + synthesizer produced `.design/context-graph.json`. Skip the whole step if the file is absent (pre-Phase-52 project, or `--skip-scan`).
67
+
68
+ 1. **Gate first (cheap Haiku check).** Spawn `design-context-reviewer-gate` via `Task()` with the classifier signal from Step 2's incremental batching pass: `change_pct` (fingerprint classifier `pct`), `classifier_action` (`SKIP` / `PARTIAL_UPDATE` / `ARCHITECTURE_UPDATE` / `FULL_UPDATE`), and `graph_path: ".design/context-graph.json"`. Gate emits a single-line `{spawn, rationale}` JSON decision then `## GATE COMPLETE`.
69
+ 2. **If `spawn: false`**: record `mcp__gdd_state__set_status: "explore_graph_review_skipped"`, log the gate `rationale` (e.g., "project change 3% < 5% threshold"), set telemetry `lazy_skipped: true`. Done - proceed to Step 3.
70
+ 3. **If `spawn: true`**: spawn `design-context-reviewer` via `Task()` with `<required_reading>` pointing at `.design/STATE.md`, `.design/context-graph.json`, `reference/design-context-schema.md`, `reference/design-context-tag-vocab.md`. The reviewer runs `scripts/validate-design-context.cjs --json` as the deterministic floor (checks 1/2/3/5) then layers the semantic checks (4/6/7/8/9) and returns the 9-check verdict inline (`APPROVED` or `REJECT`).
71
+ 4. **Capture verdict (read-only contract).** The reviewer does NOT write `.design/DESIGN-CONTEXT-REVIEW.md` - it is `reads-only: true, writes: []`. WARN findings surface through `scripts/lib/health-mirror#getHealthChecks` as `status: 'warn'`; a hard-reject maps to `status: 'fail'`. Record the overall verdict via `mcp__gdd_state__set_status: "explore_graph_review_approved"` (or `"_rejected"`).
72
+ 5. **On REJECT**: record `mcp__gdd_state__add_blocker` with the reviewer's blocking-issues list verbatim. Do not advance to Step 3 until the synthesizer or the implicated mapper is re-run. On `APPROVED` (with or without WARNs): proceed.
73
+
64
74
  ---
65
75
 
66
76
  ## Step 3 - Design interview (unless `--skip-interview`)
@@ -80,6 +90,7 @@ Full interview protocol + JSON line schema: `./explore-procedure.md` §Step 3.
80
90
  ## Step 4 - Close out explore
81
91
 
82
92
  - If the synthesizer / mapper batch ran in Step 2: `mcp__gdd_state__update_progress` with `task_progress: "<done>/<total>"`, `status: "explore_mappers_done"`.
93
+ - If Step 2.6 ran the graph review: ensure the verdict status is recorded (`explore_graph_review_approved` / `_rejected` / `_skipped`); on `_rejected` do NOT checkpoint until re-run.
83
94
  - `mcp__gdd_state__checkpoint` - bumps `last_checkpoint`.
84
95
  - Stage advance to `plan` happens at the next stage's entry (plan owns its own `transition_stage`); do not edit frontmatter directly.
85
96
 
@@ -34,6 +34,17 @@ Read `.design/STATE.md` and `.design/DESIGN-CONTEXT.md` before dispatching the a
34
34
 
35
35
  ## Dispatch
36
36
 
37
- <agent>design-figma-writer</agent>
37
+ ```
38
+ Task("design-figma-writer", """
39
+ mode: <annotate|tokenize|mappings>
40
+ dry_run: <true|false>
41
+ confirm_shared: <true|false>
42
+ required_reading:
43
+ - .design/STATE.md
44
+ - .design/DESIGN-CONTEXT.md
45
+ """)
46
+ ```
38
47
 
39
- Pass through all flags and arguments from the invocation to the agent.
48
+ Pass `mode` from the first positional argument; `dry_run` from `--dry-run`;
49
+ `confirm_shared` from `--confirm-shared`. Wait for the agent's completion
50
+ marker before returning.
@@ -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
 
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: gdd-paper-write
3
+ description: "Push design decisions from `.design/DESIGN-CONTEXT.md` into the active paper.design canvas by dispatching the `design-paper-writer` agent in one of three modes (annotate / tokenize / roundtrip). Use when the user has completed a design pipeline cycle and wants the decisions reflected in their paper.design canvas. Operates proposal->confirm with `--dry-run`."
4
+ argument-hint: "<annotate|tokenize|roundtrip> [--dry-run]"
5
+ user-invocable: true
6
+ tools: Read, Write, Bash, Grep, Glob
7
+ ---
8
+
9
+ # gdd-paper-write
10
+
11
+ Dispatches the `design-paper-writer` agent to write design decisions back to the active paper.design canvas. The shared probe pattern (ToolSearch → live call → STATE.md write) and connection handshake are documented at `../../reference/shared-preamble.md#connection-handshake-summary` and `../../connections/paper-design.md`.
12
+
13
+ ## Usage
14
+
15
+ ```
16
+ /get-design-done paper-write <mode> [--dry-run]
17
+ ```
18
+
19
+ Modes:
20
+ - `annotate` - add design decision comments to canvas nodes
21
+ - `tokenize` - sync CSS token values to paper.design node styles
22
+ - `roundtrip` - write implementation status back as text/HTML layers
23
+
24
+ Flags:
25
+ - `--dry-run` - emit the proposal without executing any paper.design writes
26
+
27
+ paper.design has no team-library concept, so there is no `--confirm-shared` flag. Every write still requires an explicit `yes` confirmation (unless `--dry-run` is set).
28
+
29
+ ## Prerequisites
30
+
31
+ 1. paper.design MCP registered. Install: `claude mcp add paper-design --transport http https://mcp.paper.design/sse` then restart the session. See `../../connections/paper-design.md` for the full probe pattern and budget rules.
32
+ 2. `.design/DESIGN-CONTEXT.md` exists (run `discover` first)
33
+ 3. `.design/STATE.md` `<connections>` shows `paper-design: available`. If `not_configured` or `unavailable`, the agent will STOP with a diagnostic.
34
+
35
+ Budget: the agent tracks `budget_used` in STATE.md `<connections>` and warns when usage reaches 90/100 on the free tier.
36
+
37
+ ## Required Reading
38
+
39
+ Read `.design/STATE.md` and `.design/DESIGN-CONTEXT.md` before dispatching the agent.
40
+
41
+ ## Dispatch
42
+
43
+ ```
44
+ Task("design-paper-writer", """
45
+ mode: <annotate|tokenize|roundtrip>
46
+ dry_run: <true|false>
47
+ required_reading:
48
+ - .design/STATE.md
49
+ - .design/DESIGN-CONTEXT.md
50
+ """)
51
+ ```
52
+
53
+ Pass `mode` from the first positional argument; `dry_run` from `--dry-run`.
54
+ Wait for the agent's completion marker before returning.
@@ -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
 
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: gdd-pencil-write
3
+ description: "Update local `.pen` source files with design decisions from `.design/DESIGN-CONTEXT.md` by dispatching the `design-pencil-writer` agent in one of two modes (annotate / roundtrip). Use when the user has completed a design pipeline cycle and wants the decisions reflected in their `.pen` files. Operates proposal->confirm with `--dry-run`."
4
+ argument-hint: "<annotate|roundtrip> [--dry-run]"
5
+ user-invocable: true
6
+ tools: Read, Write, Bash, Grep, Glob
7
+ ---
8
+
9
+ # gdd-pencil-write
10
+
11
+ Dispatches the `design-pencil-writer` agent to write design decisions back to `.pen` spec files. Unlike Figma/paper.design, pencil.dev keeps `.pen` YAML specs as the project's git-tracked source of truth; no MCP is required and every write is committed atomically. The probe pattern (file-based, no ToolSearch) and integration contract are documented at `../../connections/pencil-dev.md`.
12
+
13
+ ## Usage
14
+
15
+ ```
16
+ /get-design-done pencil-write <mode> [--dry-run]
17
+ ```
18
+
19
+ Modes:
20
+ - `annotate` - append DESIGN-DEBT findings as comments to the relevant `.pen` files
21
+ - `roundtrip` - update `.pen` spec frontmatter (design-tokens, state) from verified implementation
22
+
23
+ There is no `tokenize` mode; `.pen` files are source-of-truth specs, not derived artifacts.
24
+
25
+ Flags:
26
+ - `--dry-run` - emit the proposal without writing or committing any `.pen` changes
27
+
28
+ ## Prerequisites
29
+
30
+ 1. pencil.dev workspace detected; one or more `.pen` files in `cwd` (no MCP install required):
31
+ ```bash
32
+ find . -name "*.pen" -not -path "*/node_modules/*" | head -5
33
+ ```
34
+ 2. `.design/DESIGN-CONTEXT.md` exists (run `discover` first). For `annotate` mode, `.design/DESIGN-DEBT.md` is also required. For `roundtrip` mode, `.design/DESIGN-VERIFICATION.md` is also required.
35
+ 3. `.design/STATE.md` `<connections>` shows `pencil-dev: available`. If `not_configured`, no `.pen` files were found at probe time; re-run `discover` or `connections` after adding `.pen` specs.
36
+
37
+ ## Required Reading
38
+
39
+ Read `.design/STATE.md` and `.design/DESIGN-CONTEXT.md` before dispatching the agent.
40
+
41
+ ## Dispatch
42
+
43
+ ```
44
+ Task("design-pencil-writer", """
45
+ mode: <annotate|roundtrip>
46
+ dry_run: <true|false>
47
+ required_reading:
48
+ - .design/STATE.md
49
+ - .design/DESIGN-CONTEXT.md
50
+ """)
51
+ ```
52
+
53
+ Pass `mode` from the first positional argument; `dry_run` from `--dry-run`.
54
+ Wait for the agent's completion marker before returning.
@@ -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).
@@ -15,7 +15,7 @@ If invoked without an error context (the user just typed `/gdd:report-issue` col
15
15
 
16
16
  ## Steps
17
17
 
18
- 0. **Kill-switch** (D-08). Call `isDisabled()` from `scripts/lib/issue-reporter/kill-switch.cjs` FIRST. Either env (`GDD_DISABLE_ISSUE_REPORTER=1`) OR config (`.design/config.json` with `{ "issue_reporter": false }`) makes the command unavailable. Surface the disable line via `getDisableReason()` ('env' wins when both set) and stop. No draft, no triage, no payload. `gsd-health` mirrors the same line for at-a-glance verification.
18
+ 0. **Kill-switch** (D-08). Call `isDisabled()` from `scripts/lib/issue-reporter/kill-switch.cjs` FIRST. Either env (`GDD_DISABLE_ISSUE_REPORTER=1`) OR config (`.design/config.json` with `{ "issue_reporter": false }`) makes the command unavailable. Surface the disable line via `getDisableReason()` ('env' wins when both set) and stop. No draft, no triage, no payload. `/gdd:health` mirrors the same line for at-a-glance verification.
19
19
  1. **Triage**. Call `matchKnownFailure(errorContext)` from `scripts/lib/issue-reporter/triage-matcher.cjs` (Plan 30-03). If `matched === true` and `--force-report` is NOT set: print the suggested diagnosis + remedy, stop. Do NOT write a draft. (D-07)
20
20
  2. **Assemble**. Call `assemble(commandName, errorContext, trajectoryRef?, capabilityGapEvent?)` from `scripts/lib/issue-reporter/payload-assembly.cjs` (Plan 30-02). This layers Phase 22 redact → Phase 30 pseudonymize, computes the fingerprint, and renders bilingual disclaimer + sections.
21
21
  3. **Draft**. Call `writeDraft({title, body, fingerprint})` from `scripts/lib/issue-reporter/draft-writer.cjs`. Print the absolute path: `Draft written to .design/issue-drafts/<timestamp>-<fp8>.md`. The file persists across decline - the user keeps their work either way. (D-04)
@@ -48,6 +48,6 @@ Available on `/gdd:report-issue`. Overrides the triage gate (Step 1) but does NO
48
48
  - **No `EDITOR` set.** The path is printed; open it in whatever editor you prefer, save, then return to the consent prompt.
49
49
  - **Triage matched something irrelevant.** Pass `--force-report` to bypass the gate. Consent is still required.
50
50
  - **`gh` not installed (D-10).** After consent, the payload is copied to your clipboard and an issue-template URL is printed. Paste into the URL to file manually. Install `gh` later and the existing draft can be re-submitted.
51
- - **Command unavailable / disabled (D-08).** Run `gsd-health`. The `issue reporter:` line shows the active disable surface - either `disabled by env (GDD_DISABLE_ISSUE_REPORTER=1)` or `disabled by config (.design/config.json: issue_reporter=false)`. Unset the env var or flip the config key to re-enable.
51
+ - **Command unavailable / disabled (D-08).** Run `/gdd:health`. The `issue reporter:` line shows the active disable surface - either `disabled by env (GDD_DISABLE_ISSUE_REPORTER=1)` or `disabled by config (.design/config.json: issue_reporter=false)`. Unset the env var or flip the config key to re-enable.
52
52
 
53
53
  See [report-issue-procedure.md](./report-issue-procedure.md) for the full procedure with rationale per decision (D-02, D-03, D-04, D-05, D-07, D-11).
@@ -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.