@hegemonart/get-design-done 1.58.1 → 1.59.2

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.
@@ -223,12 +223,12 @@ on them fail with a clear connection-refused class of error.
223
223
  id: KFM-008
224
224
  pattern: '(MCP.*(unreachable|ECONNREFUSED|not connected)|mcp.*server.*not.*running|connection refused.*ws://)'
225
225
  diagnosis: 'An MCP server (Figma, GDD-state, or GDD-tools) is not reachable; the plugin cannot route tool calls through it.'
226
- remedy: 'Start the relevant MCP server (see scripts/mcp-servers/) and confirm `claude mcp list` shows it as connected.'
226
+ remedy: 'Start the relevant MCP server (see sdk/mcp/) and confirm `claude mcp list` shows it as connected.'
227
227
  severity: medium
228
228
  propose_report: true
229
229
  symptom: 'A command depending on an MCP server fails with `MCP unreachable`, `ECONNREFUSED`, `mcp server not running`, or `connection refused ws://...`. Tool calls routed through MCP never reach their target.'
230
230
  root_cause: 'The local MCP transport (WebSocket or stdio bridge) is not bound. The MCP server process is either not started, crashed silently, or is listening on a different port than the client expects.'
231
- fix: '1) Run `claude mcp list` and check the status column for the failing server. 2) If it shows `disconnected`, start it: `scripts/mcp-servers/<name>.cjs` or the launcher script for that server. 3) Confirm the port matches the value in `mcp.json` or `.mcp.json`. 4) Re-run the failing command. If the server crashes on start, this is a maintainer report path (propose_report:true).'
231
+ fix: '1) Run `claude mcp list` and check the status column for the failing server. 2) If it shows `disconnected`, start it: `sdk/mcp/<name>/server.ts` or the launcher script for that server. 3) Confirm the port matches the value in `mcp.json` or `.mcp.json`. 4) Re-run the failing command. If the server crashes on start, this is a maintainer report path (propose_report:true).'
232
232
  related_phases: [27.7, 33.6]
233
233
  first_observed_cycle: 'pre-30.5'
234
234
  ```
@@ -502,7 +502,7 @@
502
502
  "path": "reference/schemas/mcp-gdd-tools.schema.json",
503
503
  "type": "schema",
504
504
  "phase": 27.7,
505
- "description": "Draft-07 input/output schemas for the 12 read-only tools in scripts/mcp-servers/gdd-mcp/ (gdd-mcp MCP server)"
505
+ "description": "Draft-07 input/output schemas for the 12 read-only tools in sdk/mcp/gdd-mcp/ (gdd-mcp MCP server)"
506
506
  },
507
507
  {
508
508
  "name": "meta-rules",
@@ -160,6 +160,108 @@ export interface DesignConfigJson {
160
160
 
161
161
  export type ConfigSchema = DesignConfigJson;
162
162
 
163
+ // ---- design-context.schema.json ----
164
+ /**
165
+ * The canonical typed knowledge graph of a design system, persisted at .design/context-graph.json. Nodes are design entities (tokens, components, screens, patterns); edges are typed relationships between them (uses-token, composes, transitions-to). Built by a two-phase mapper: a deterministic extract pass emits node/edge skeletons, then an LLM summary pass fills each node summary. Validated structurally by scripts/validate-design-context.cjs and queried by scripts/lib/design-context-query.cjs.
166
+ */
167
+ export interface DesignContextGraph {
168
+ /**
169
+ * Schema version of this graph document (e.g. "52.0").
170
+ */
171
+ schema_version: string;
172
+ /**
173
+ * ISO-8601 timestamp the graph was last assembled (optional).
174
+ */
175
+ generated_at?: string;
176
+ /**
177
+ * All design entities in the graph. Node ids must be unique.
178
+ */
179
+ nodes: Node[];
180
+ /**
181
+ * All typed relationships. Every source/target must resolve to a node id.
182
+ */
183
+ edges: Edge[];
184
+ [k: string]: unknown;
185
+ }
186
+ export interface Node {
187
+ /**
188
+ * Stable unique identifier for the node (referenced by edge source/target).
189
+ */
190
+ id: string;
191
+ /**
192
+ * The kind of design entity this node represents.
193
+ */
194
+ type:
195
+ | 'token'
196
+ | 'component'
197
+ | 'variant'
198
+ | 'state'
199
+ | 'motion-fragment'
200
+ | 'a11y-pattern'
201
+ | 'screen'
202
+ | 'layer'
203
+ | 'pattern'
204
+ | 'anti-pattern';
205
+ /**
206
+ * Human-readable name of the entity.
207
+ */
208
+ name: string;
209
+ /**
210
+ * One-line LLM-authored description of what the entity is and does. A stub summary (empty or identical to name) is flagged by the validator as a soft warning.
211
+ */
212
+ summary: string;
213
+ /**
214
+ * Controlled-vocabulary tags grouping the node by concern (see reference/design-context-tag-vocab.md). Unknown tags are a soft warning, not a hard error.
215
+ */
216
+ tags?: string[];
217
+ /**
218
+ * Coarse complexity bucket for the entity.
219
+ */
220
+ complexity: 'simple' | 'moderate' | 'complex';
221
+ /**
222
+ * Optional finer classification. For token nodes one of color/spacing/typography/radius/shadow; for layer nodes one of Atomic/Molecular/Organism/Template. Free-form for other node types.
223
+ */
224
+ subtype?: string;
225
+ [k: string]: unknown;
226
+ }
227
+ export interface Edge {
228
+ /**
229
+ * Node id the edge originates from.
230
+ */
231
+ source: string;
232
+ /**
233
+ * Node id the edge points to.
234
+ */
235
+ target: string;
236
+ /**
237
+ * The kind of relationship between source and target.
238
+ */
239
+ type:
240
+ | 'uses-token'
241
+ | 'composes'
242
+ | 'extends'
243
+ | 'transitions-to'
244
+ | 'depends-on'
245
+ | 'mirrors'
246
+ | 'conflicts-with'
247
+ | 'referenced-by'
248
+ | 'tested-by'
249
+ | 'documented-by'
250
+ | 'consumes-context'
251
+ | 'provides-context';
252
+ /**
253
+ * Whether the relationship reads source-to-target (forward), target-to-source (backward), or both ways (bidirectional).
254
+ */
255
+ direction: 'forward' | 'backward' | 'bidirectional';
256
+ /**
257
+ * Relationship strength in the inclusive range 0..1.
258
+ */
259
+ weight: number;
260
+ [k: string]: unknown;
261
+ }
262
+
263
+ export type DesignContextSchema = DesignContextGraph;
264
+
163
265
  // ---- events.schema.json ----
164
266
  /**
165
267
  * One line of .design/telemetry/events.jsonl — the append-only telemetry stream produced by Plan 20-06. Each event is a single JSON object followed by a newline. See .planning/phases/20-gdd-sdk-foundation/20-06-PLAN.md.
@@ -168,7 +270,7 @@ export type Event = {
168
270
  [k: string]: unknown;
169
271
  } & {
170
272
  /**
171
- * Free-form event type identifier. Pre-registered seeds: state.mutation, state.transition, stage.entered, stage.exited, hook.fired, error, capability_gap, kfm-candidate, router_pick, verify_outcome, rollout_started, rollout_advanced, rollout_stuck, budget_forecast, project_cap_warning, project_cap_halt.
273
+ * Free-form event type identifier. Pre-registered seeds: state.mutation, state.transition, stage.entered, stage.exited, hook.fired, error, capability_gap, kfm-candidate, router_pick, verify_outcome, rollout_started, rollout_advanced, rollout_stuck, budget_forecast, project_cap_warning, project_cap_halt, live_session_start, live_pick, live_generate, live_accept, live_discard, live_session_end, instinct_emitted, instinct_promoted, instinct_decayed, risk_assessment.
172
274
  */
173
275
  type: string;
174
276
  /**
@@ -266,6 +368,73 @@ export interface AgentInsightLine {
266
368
 
267
369
  export type InsightLineSchema = AgentInsightLine;
268
370
 
371
+ // ---- instinct.schema.json ----
372
+ /**
373
+ * An atomic, confidence-weighted design instinct learned across cycles. Validates the YAML frontmatter object of an instinct unit (see reference/instinct-format.md). Project-scoped units live at <root>/instincts/instincts.json; promoted global units live at ~/.claude/gdd/global-instincts.json. Persisted + queried by scripts/lib/instinct-store.cjs.
374
+ */
375
+ export type InstinctUnit = {
376
+ [k: string]: unknown;
377
+ } & {
378
+ /**
379
+ * Kebab-case stable identifier, e.g. "prefer-token-over-hex". Lowercase letters, digits, single hyphens.
380
+ */
381
+ id: string;
382
+ /**
383
+ * One sentence naming the situation that fires the instinct, e.g. "When a color literal appears in a component, reach for a design token first."
384
+ */
385
+ trigger: string;
386
+ /**
387
+ * Posterior trust in the instinct. Floor 0.3 (a fresh instinct is advisory, never directive); ceiling 0.9 (no instinct is ever certain). TTL decay multiplies this by 0.9 when the instinct goes unsurfaced.
388
+ */
389
+ confidence: number;
390
+ /**
391
+ * Lifecycle stage the instinct applies to, aligned to the Phase 50 lifecycle stages.
392
+ */
393
+ domain: 'intake' | 'explore' | 'decide' | 'build' | 'verify' | 'operate' | 'utility';
394
+ /**
395
+ * project = learned from one repository; global = promoted after the K/M gate across distinct projects.
396
+ */
397
+ scope: 'project' | 'global';
398
+ /**
399
+ * 8-char hex sha of the normalized git origin the instinct was first learned from. Required for project scope; optional for global (a promoted instinct is no longer tied to one origin).
400
+ */
401
+ project_id?: string;
402
+ /**
403
+ * Which producer minted the instinct: a reflection pass, the extract-learnings step, or a direct user assertion.
404
+ */
405
+ source: 'reflection' | 'extract-learnings' | 'user';
406
+ /**
407
+ * How many distinct design cycles have surfaced this instinct. Feeds the K=2 half of the promotion gate.
408
+ */
409
+ cycles_seen?: number;
410
+ /**
411
+ * Set of distinct project ids that have surfaced this instinct. Its length feeds the M=2 half of the promotion gate.
412
+ */
413
+ project_ids?: string[];
414
+ /**
415
+ * ISO date (YYYY-MM-DD) the instinct was first recorded.
416
+ */
417
+ first_seen?: string;
418
+ /**
419
+ * ISO date (YYYY-MM-DD) the instinct was last surfaced. Resets the TTL decay window.
420
+ */
421
+ last_seen?: string;
422
+ /**
423
+ * Beta posterior success weight. Seeded from the Beta(2,8) prior on promotion.
424
+ */
425
+ alpha?: number;
426
+ /**
427
+ * Beta posterior failure weight. Seeded from the Beta(2,8) prior on promotion.
428
+ */
429
+ beta?: number;
430
+ /**
431
+ * Tag recording which prior class seeded the posterior, e.g. "instinct".
432
+ */
433
+ prior_class?: string;
434
+ };
435
+
436
+ export type InstinctSchema = InstinctUnit;
437
+
269
438
  // ---- intel.schema.json ----
270
439
  /**
271
440
  * Shape of intel-store slice files per reference/intel-schema.md. Each slice has a generated timestamp and one array-valued payload key matching the slice name.
@@ -394,6 +563,57 @@ export interface IterationBudget {
394
563
 
395
564
  export type IterationBudgetSchema = IterationBudget;
396
565
 
566
+ // ---- live-session.schema.json ----
567
+ /**
568
+ * A single `/gdd:live` session record persisted at .design/live-sessions/<session-id>.json. Captures the pick -> generate -> accept/discard loop as an append-only event log so a session survives a crash or --resume. Written atomically by scripts/lib/live/session-store.cjs.
569
+ */
570
+ export interface LiveSession {
571
+ /**
572
+ * Schema version of this session record (e.g. "47.0").
573
+ */
574
+ schema_version: string;
575
+ /**
576
+ * Stable id; also the basename of the on-disk file (no path separators).
577
+ */
578
+ session_id: string;
579
+ /**
580
+ * Lifecycle status. Only in_progress sessions are resumable.
581
+ */
582
+ status: 'in_progress' | 'completed' | 'abandoned';
583
+ /**
584
+ * ISO-8601 timestamp the session was created.
585
+ */
586
+ started_at: string;
587
+ /**
588
+ * ISO-8601 timestamp the session was closed; null while in_progress.
589
+ */
590
+ ended_at: string | null;
591
+ /**
592
+ * The page the element was picked from (optional).
593
+ */
594
+ url?: string;
595
+ /**
596
+ * Dev-server descriptor (url/port/command, or a plain string). Free-form by design.
597
+ */
598
+ dev_server?: string | {} | null;
599
+ /**
600
+ * Append-only log of session events, oldest first.
601
+ */
602
+ events: {
603
+ /**
604
+ * Event kind.
605
+ */
606
+ kind: 'pick' | 'generate' | 'accept' | 'discard';
607
+ /**
608
+ * ISO-8601 timestamp the event was recorded.
609
+ */
610
+ at: string;
611
+ [k: string]: unknown;
612
+ }[];
613
+ }
614
+
615
+ export type LiveSessionSchema = LiveSession;
616
+
397
617
  // ---- marketplace.schema.json ----
398
618
  /**
399
619
  * Shape of .claude-plugin/marketplace.json — the plugin marketplace descriptor.
@@ -448,7 +668,7 @@ export type McpBudgetSchema = MCPBudget;
448
668
 
449
669
  // ---- mcp-gdd-state-tools.schema.json ----
450
670
  /**
451
- * Combined manifest of all 11 gdd-state MCP tool input+output schemas (Plan 20-05). Individual tool schemas live under scripts/mcp-servers/gdd-state/schemas/ and the tool handlers reference them; this combined schema exists so downstream validators and codegen can compile a single surface.
671
+ * Combined manifest of all 11 gdd-state MCP tool input+output schemas (Plan 20-05). Individual tool schemas live under sdk/mcp/gdd-state/schemas/ and the tool handlers reference them; this combined schema exists so downstream validators and codegen can compile a single surface.
452
672
  */
453
673
  export interface McpGddStateTools {
454
674
  tools: {
@@ -482,11 +702,11 @@ export type McpGddStateToolsSchema = McpGddStateTools;
482
702
 
483
703
  // ---- mcp-gdd-tools.schema.json ----
484
704
  /**
485
- * Combined manifest of all gdd-mcp tool input+output schemas (Plan 27.7-02). Individual tool schemas live under scripts/mcp-servers/gdd-mcp/schemas/ and the tool handlers reference them; this combined schema exists so downstream validators and codegen can compile a single surface (D-11).
705
+ * Combined manifest of all gdd-mcp tool input+output schemas (Plan 27.7-02). Individual tool schemas live under sdk/mcp/gdd-mcp/schemas/ and the tool handlers reference them; this combined schema exists so downstream validators and codegen can compile a single surface (D-11).
486
706
  */
487
707
  export interface McpGddTools {
488
708
  /**
489
- * Per-tool input/output schemas keyed by tool name. Exactly 12 entries (D-03 hard cap).
709
+ * Per-tool input/output schemas keyed by tool name. Exactly 13 entries (D-03 cap, raised 12 -> 13 in Phase 52 for gdd_context_query).
490
710
  */
491
711
  tools?: {
492
712
  gdd_status?: {
@@ -499,6 +719,22 @@ export interface McpGddTools {
499
719
  blocker_count: number;
500
720
  };
501
721
  };
722
+ gdd_context_query?: {
723
+ input: {
724
+ op: 'nodes' | 'edges' | 'path' | 'consumers-of' | 'unreachable' | 'cycles' | 'coverage';
725
+ type?: string;
726
+ tag?: string;
727
+ from?: string;
728
+ to?: string;
729
+ id?: string;
730
+ };
731
+ output: {
732
+ op: string;
733
+ graph_present: boolean;
734
+ path?: string;
735
+ result: unknown[] | {} | null;
736
+ };
737
+ };
502
738
  gdd_phase_current?: {
503
739
  input: {};
504
740
  output: {
@@ -2,7 +2,7 @@
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "$id": "https://raw.githubusercontent.com/hegemonart/get-design-done/main/reference/schemas/mcp-gdd-state-tools.schema.json",
4
4
  "title": "McpGddStateTools",
5
- "description": "Combined manifest of all 11 gdd-state MCP tool input+output schemas (Plan 20-05). Individual tool schemas live under scripts/mcp-servers/gdd-state/schemas/ and the tool handlers reference them; this combined schema exists so downstream validators and codegen can compile a single surface.",
5
+ "description": "Combined manifest of all 11 gdd-state MCP tool input+output schemas (Plan 20-05). Individual tool schemas live under sdk/mcp/gdd-state/schemas/ and the tool handlers reference them; this combined schema exists so downstream validators and codegen can compile a single surface.",
6
6
  "type": "object",
7
7
  "additionalProperties": false,
8
8
  "required": ["tools"],
@@ -2,7 +2,7 @@
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "$id": "https://raw.githubusercontent.com/hegemonart/get-design-done/main/reference/schemas/mcp-gdd-tools.schema.json",
4
4
  "title": "McpGddTools",
5
- "description": "Combined manifest of all gdd-mcp tool input+output schemas (Plan 27.7-02). Individual tool schemas live under scripts/mcp-servers/gdd-mcp/schemas/ and the tool handlers reference them; this combined schema exists so downstream validators and codegen can compile a single surface (D-11).",
5
+ "description": "Combined manifest of all gdd-mcp tool input+output schemas (Plan 27.7-02). Individual tool schemas live under sdk/mcp/gdd-mcp/schemas/ and the tool handlers reference them; this combined schema exists so downstream validators and codegen can compile a single surface (D-11).",
6
6
  "type": "object",
7
7
  "properties": {
8
8
  "tools": {
@@ -9,7 +9,7 @@ is a `composes_with` edge (the source calls the target as sub-orchestration); a
9
9
  a `next_skills` edge (a pipeline hint for what runs next). Stage grouping is best-effort and
10
10
  inferred from the skill name; skills with no stage keyword fall under Utility.
11
11
 
12
- Skills: 94. Composition edges: 19 composes_with, 6 next_skills.
12
+ Skills: 95. Composition edges: 19 composes_with, 6 next_skills.
13
13
 
14
14
  ```mermaid
15
15
  flowchart TD
@@ -65,6 +65,7 @@ flowchart TD
65
65
  n_add_backlog["add-backlog"]
66
66
  n_analyze_dependencies["analyze-dependencies"]
67
67
  n_apply_reflections["apply-reflections"]
68
+ n_bandit_reset["bandit-reset"]
68
69
  n_bandit_status["bandit-status"]
69
70
  n_budget["budget"]
70
71
  n_cache_manager["cache-manager"]
@@ -74,7 +74,7 @@ function helpText() {
74
74
  ' --dry-run Print the diff without writing',
75
75
  ' --config-dir D Override the config directory',
76
76
  ' --no-peer-prompt Suppress the post-install peer-CLI detection nudge',
77
- ' --register-mcp Register gdd-mcp with detected harnesses (Claude Code, Codex). Opt-in.',
77
+ ' --register-mcp Register gdd-mcp + gdd-state with detected harnesses (Claude Code, Codex). Opt-in.',
78
78
  ' --no-register-mcp Skip MCP registration (default behavior; included for symmetry).',
79
79
  ' --doctor Print Tier-2 distribution-channel status (read-only; no install)',
80
80
  ' --help, -h Show this message',
@@ -287,6 +287,7 @@ async function main() {
287
287
  }
288
288
 
289
289
  // Phase 27.7 / Plan 27.7-04 — opt-in MCP registration (D-07).
290
+ // Phase 59.1 — registers BOTH gdd MCP servers (gdd-mcp + gdd-state).
290
291
  // Fires only on real install (not uninstall, not dry-run) when the user
291
292
  // passes --register-mcp explicitly. Default OFF; --no-register-mcp is a
292
293
  // no-op today (reserved for symmetry / when default flips). Idempotent
@@ -298,23 +299,29 @@ async function main() {
298
299
  try {
299
300
  const result = registerMcp({ harness });
300
301
  if (!result.detected) {
302
+ // CLI absent — single notice covers all servers for this harness.
301
303
  process.stderr.write('[install] ' + result.notice + '\n');
302
- } else if (result.idempotent_skip) {
303
- process.stdout.write(
304
- '[install] gdd-mcp already registered with ' + harness + ' — skipping.\n',
305
- );
306
- } else if (result.applied) {
307
- process.stdout.write(
308
- '[install] gdd-mcp registered with ' + harness + '.\n',
309
- );
310
- } else {
311
- process.stderr.write(
312
- '[install] gdd-mcp registration with ' + harness + ' failed: exit ' + result.exit_code + '\n',
313
- );
304
+ continue;
305
+ }
306
+ // Report each registered server individually.
307
+ for (const s of result.servers || []) {
308
+ if (s.idempotent_skip) {
309
+ process.stdout.write(
310
+ '[install] ' + s.server + ' already registered with ' + harness + ' — skipping.\n',
311
+ );
312
+ } else if (s.applied) {
313
+ process.stdout.write(
314
+ '[install] ' + s.server + ' registered with ' + harness + '.\n',
315
+ );
316
+ } else {
317
+ process.stderr.write(
318
+ '[install] ' + s.server + ' registration with ' + harness + ' failed: exit ' + s.exit_code + '\n',
319
+ );
320
+ }
314
321
  }
315
322
  } catch (err) {
316
323
  process.stderr.write(
317
- '[install] gdd-mcp registration error (' + harness + '): ' + (err && err.message ? err.message : err) + '\n',
324
+ '[install] MCP registration error (' + harness + '): ' + (err && err.message ? err.message : err) + '\n',
318
325
  );
319
326
  }
320
327
  }