@hegemonart/get-design-done 1.51.0 → 1.53.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 (58) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +96 -0
  4. package/README.md +4 -0
  5. package/SKILL.md +2 -0
  6. package/agents/a11y-mapper.md +30 -1
  7. package/agents/component-taxonomy-mapper.md +30 -1
  8. package/agents/design-context-reviewer-gate.md +102 -0
  9. package/agents/design-context-reviewer.md +186 -0
  10. package/agents/design-debt-crawler.md +60 -60
  11. package/agents/design-research-synthesizer.md +27 -1
  12. package/agents/motion-mapper.md +35 -13
  13. package/agents/token-mapper.md +30 -1
  14. package/agents/visual-hierarchy-mapper.md +30 -1
  15. package/dist/claude-code/.claude/skills/context/SKILL.md +137 -0
  16. package/dist/claude-code/.claude/skills/discover/SKILL.md +7 -1
  17. package/dist/claude-code/.claude/skills/explore/SKILL.md +3 -1
  18. package/dist/claude-code/.claude/skills/migrate-context/SKILL.md +123 -0
  19. package/dist/claude-code/.claude/skills/progress/SKILL.md +4 -0
  20. package/package.json +3 -2
  21. package/reference/design-context-schema.md +159 -0
  22. package/reference/design-context-tag-vocab.md +82 -0
  23. package/reference/registry.json +14 -0
  24. package/reference/schemas/design-context.schema.json +130 -0
  25. package/reference/schemas/mcp-gdd-tools.schema.json +34 -1
  26. package/reference/skill-graph.md +3 -1
  27. package/scripts/lib/design-context/extract-a11y.mjs +188 -0
  28. package/scripts/lib/design-context/extract-components.mjs +243 -0
  29. package/scripts/lib/design-context/extract-motion.mjs +248 -0
  30. package/scripts/lib/design-context/extract-tokens.mjs +234 -0
  31. package/scripts/lib/design-context/extract-visual-hierarchy.mjs +178 -0
  32. package/scripts/lib/design-context/integration-map.mjs +251 -0
  33. package/scripts/lib/design-context/merge-fragments.mjs +227 -0
  34. package/scripts/lib/design-context-query.cjs +0 -0
  35. package/scripts/lib/explore-parallel-runner/index.ts +58 -0
  36. package/scripts/lib/explore-parallel-runner/types.ts +58 -0
  37. package/scripts/lib/manifest/skills.json +18 -2
  38. package/scripts/lib/mappers/compute-batches.mjs +625 -0
  39. package/scripts/lib/mappers/graph-adjacency.mjs +129 -0
  40. package/scripts/lib/mappers/incremental-discover.cjs +617 -0
  41. package/scripts/lib/mappers/incremental-discover.d.cts +133 -0
  42. package/scripts/lib/mappers/neighbor-map.mjs +0 -0
  43. package/scripts/lib/mcp-tools-lint/index.cjs +3 -1
  44. package/sdk/cli/index.js +369 -2
  45. package/sdk/fingerprint/classify.cjs +406 -0
  46. package/sdk/fingerprint/index.ts +405 -0
  47. package/sdk/fingerprint/store.cjs +523 -0
  48. package/sdk/index.ts +1 -0
  49. package/sdk/mcp/gdd-mcp/schemas/gdd_context_query.schema.json +60 -0
  50. package/sdk/mcp/gdd-mcp/server.js +474 -158
  51. package/sdk/mcp/gdd-mcp/server.ts +9 -5
  52. package/sdk/mcp/gdd-mcp/tools/gdd_context_query.ts +35 -0
  53. package/sdk/mcp/gdd-mcp/tools/index.ts +18 -13
  54. package/skills/context/SKILL.md +137 -0
  55. package/skills/discover/SKILL.md +7 -1
  56. package/skills/explore/SKILL.md +3 -1
  57. package/skills/migrate-context/SKILL.md +123 -0
  58. package/skills/progress/SKILL.md +4 -0
@@ -0,0 +1,123 @@
1
+ ---
2
+ name: gdd-migrate-context
3
+ description: "Migrates a pre-Phase-52 project from the flat .design/map/*.md mapper notes to the typed DesignContext graph at .design/context-graph.json. Reads the old map notes, runs the deterministic extract-*.mjs passes to build mapper fragments, merges them with merge-fragments.mjs, validates the result with validate-design-context.cjs, and flags every low-confidence transform for human review before anything is trusted. Read-first and reversible; --dry-run previews the plan without writing. Use when upgrading a project to the DesignContext graph and .design/map/*.md still holds the only structured design notes. Activates for requests involving migrating design maps, building the context graph from old notes, or DesignContext graph migration."
4
+ argument-hint: "[--dry-run]"
5
+ tools: Read, Write, Bash
6
+ user-invocable: true
7
+ ---
8
+
9
+ # /gdd:migrate-context
10
+
11
+ Closes the pre-graph gap: before Phase 52 a project recorded its structured design knowledge as flat
12
+ `.design/map/*.md` mapper notes (token map, component taxonomy, motion map, a11y map, visual-hierarchy
13
+ map). Phase 52 introduced the typed DesignContext graph at `.design/context-graph.json`. This skill
14
+ carries a project across that boundary: it reads the old map notes, rebuilds the graph deterministically
15
+ from source, validates it, and surfaces anything it could not transform with confidence so a human can
16
+ confirm it. It never trusts a low-confidence guess silently.
17
+
18
+ Contracts: `../../reference/design-context-schema.md` (the Node / Edge / Fragment / Graph shapes) and
19
+ `../../reference/design-context-tag-vocab.md` (the controlled `tags[]` vocabulary).
20
+
21
+ ## Invocation
22
+
23
+ | Command | Behavior |
24
+ |---|---|
25
+ | `/gdd:migrate-context` | Run the full migration: read old maps, extract fragments, merge, validate, then report the low-confidence items for review. |
26
+ | `/gdd:migrate-context --dry-run` | Preview only. Print the migration plan and what each step would write, change nothing on disk. |
27
+
28
+ ## Step 1 - Detect the pre-52 state
29
+
30
+ Read the project layout before touching anything.
31
+
32
+ 1. List `.design/map/*.md`. These are the pre-52 mapper notes (for example `token-map.md`,
33
+ `component-taxonomy.md`, `motion-map.md`, `a11y-map.md`, `visual-hierarchy.md`). If the directory is
34
+ absent or empty, there is nothing to migrate: print `No .design/map/*.md notes found; nothing to
35
+ migrate.` and stop.
36
+ 2. Check whether `.design/context-graph.json` already exists. If it does, this is a re-run: keep the
37
+ existing graph as a backup reference and report that the migration will rebuild it. Do not delete it.
38
+ 3. In `--dry-run`, print the file list and the planned outputs (`.design/fragments/<mapper>.json` per
39
+ mapper, then `.design/context-graph.json`) and stop before Step 2.
40
+
41
+ ## Step 2 - Rebuild fragments deterministically
42
+
43
+ The graph topology comes from the source tree, not from prose. Run each deterministic extractor over the
44
+ configured source roots (default `src/`; read `source_roots` from `.design/STATE.md` if present). Each
45
+ extractor is pure, dependency-free, and prints a schema-valid Fragment to stdout.
46
+
47
+ ```bash
48
+ mkdir -p .design/fragments
49
+ for mapper in tokens components motion a11y visual-hierarchy; do
50
+ node "${CLAUDE_PLUGIN_ROOT:-.}/scripts/lib/design-context/extract-${mapper}.mjs" src/ \
51
+ > ".design/fragments/extract-${mapper}.json"
52
+ done
53
+ ```
54
+
55
+ The extractors fill `id / type / name / subtype / tags / complexity` and every edge they can prove; they
56
+ leave each node `summary` empty for the summary pass. Use the old `.design/map/*.md` notes as the source
57
+ of the human-authored `summary` text and any tags the extractor could not infer: for each node whose name
58
+ matches a map entry, copy that note's one-line description into the node `summary` and add any vocabulary
59
+ tags it implies. This is the only place prose feeds the graph.
60
+
61
+ ## Step 3 - Merge into the canonical graph
62
+
63
+ Merge the fragments into the single graph. The merger dedupes nodes by `id`, unions tags, prefers a
64
+ non-stub summary over the empty stub, and keeps an edge only when both endpoints resolve to a node in some
65
+ fragment. Dropped dangling edges are reported on stderr as `could-not-fix:` lines.
66
+
67
+ ```bash
68
+ node "${CLAUDE_PLUGIN_ROOT:-.}/scripts/lib/design-context/merge-fragments.mjs" \
69
+ .design/fragments --out .design/context-graph.json
70
+ ```
71
+
72
+ Capture the stderr `could-not-fix:` lines. Each one is a transform the merge could not complete (a map
73
+ note referenced an entity the extractor never found in source). These are low-confidence items for Step 5,
74
+ not silent drops.
75
+
76
+ ## Step 4 - Validate
77
+
78
+ Validate the merged graph. The validator checks structure, referential integrity (no dangling edges),
79
+ unique ids, non-stub summaries (soft warning), and the controlled tag vocabulary (soft warning).
80
+
81
+ ```bash
82
+ node "${CLAUDE_PLUGIN_ROOT:-.}/scripts/validate-design-context.cjs" .design/context-graph.json
83
+ ```
84
+
85
+ Exit `0` is clean, `1` is warnings only (stub summaries or unknown tags to tidy later), `2` is a hard
86
+ error (a dangling edge or duplicate id) that must be fixed before the graph is trusted. On exit `2`, do
87
+ not present the graph as migrated: report the errors and stop so a human can resolve them.
88
+
89
+ ## Step 5 - Flag low-confidence transforms
90
+
91
+ Collect everything that needs human eyes and present it as one review list rather than applying it:
92
+
93
+ - every `could-not-fix:` line from the merge (an unresolved or dropped edge);
94
+ - every node still carrying an empty `summary` after Step 2 (a map note had no matching entity, or no
95
+ note existed);
96
+ - every validator `WARN` (stub summary, tag outside the controlled vocabulary).
97
+
98
+ Print the list with a clear heading and ask the user to confirm or correct each item. Do not auto-resolve
99
+ a low-confidence transform: a wrong edge or a mislabeled node poisons every later graph query.
100
+
101
+ ## Step 6 - Deprecate the old map notes
102
+
103
+ The flat `.design/map/*.md` notes stay readable for one minor version so nothing breaks mid-upgrade. Add a
104
+ one-line deprecation banner to the top of each migrated map note (do not delete the file):
105
+
106
+ ```text
107
+ > Deprecated: superseded by the DesignContext graph (.design/context-graph.json) as of Phase 52.
108
+ > Read-only for one minor version; regenerate the graph with /gdd:migrate-context.
109
+ ```
110
+
111
+ In `--dry-run`, describe this banner instead of writing it. Announce that the next minor version may remove
112
+ the `.design/map/*.md` notes, and that the graph is now the source of truth.
113
+
114
+ ## Do Not
115
+
116
+ - Do not trust a low-confidence transform silently. Every `could-not-fix:` line and every stub goes on the
117
+ Step 5 review list.
118
+ - Do not delete `.design/map/*.md`. Add the deprecation banner and keep the notes for one minor version.
119
+ - Do not hand-edit `.design/context-graph.json` to force validation green. Fix the fragment or the source,
120
+ then re-merge.
121
+ - Do not edit the extractors, the merger, or the validator. This skill only calls them.
122
+
123
+ ## MIGRATE-CONTEXT COMPLETE
@@ -86,6 +86,10 @@ After the pipeline state (and forensic audit if run), surface a one-line composi
86
86
 
87
87
  Run `scripts/validate-composition-graph.cjs` for the authoritative cycle and dangling-edge counts when that validator is present; until then report `0` and note the graph is not yet wired. This is a readiness hint, not a gate.
88
88
 
89
+ ## Step 3.6 - DesignContext graph coverage
90
+
91
+ When `.design/context-graph.json` exists, surface one line for the typed DesignContext graph using the `coverage` helper in `scripts/lib/design-context-query.cjs` (`node scripts/lib/design-context-query.cjs coverage`), then point at the Atomic-Design map: `DesignContext graph: <pct>% node-type coverage | map: .design/INTEGRATION-MAP.md`. Skip this line entirely when the graph is absent (a pre-Phase-52 project); offer `/gdd:migrate-context` as the next step instead. Readiness hint, not a gate.
92
+
89
93
  ## Step 4 - Update notice (safe-window surface)
90
94
 
91
95
  After printing the pipeline state, emit the plugin-update banner if one is present. This file is written by `hooks/update-check.sh` subject to the state-machine guard (mid-pipeline stages suppress it) and per-version dismissal.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hegemonart/get-design-done",
3
- "version": "1.51.0",
3
+ "version": "1.53.0",
4
4
  "description": "A design-quality pipeline for AI coding agents: brief, plan, implement, and verify UI work against your design system.",
5
5
  "author": "Hegemon",
6
6
  "homepage": "https://github.com/hegemonart/get-design-done",
@@ -59,7 +59,7 @@
59
59
  "test:behavior": "node scripts/run-behavior-tests.cjs",
60
60
  "typecheck": "tsc --noEmit",
61
61
  "codegen:schemas": "node --experimental-strip-types scripts/codegen-schema-types.ts",
62
- "lint:md": "npx --yes markdownlint-cli2 \"**/*.md\" \"#node_modules\" \"#.planning\" \"#.claude\" \"#test/fixtures/baselines\"",
62
+ "lint:md": "npx --yes markdownlint-cli2 \"**/*.md\" \"#**/node_modules\" \"#.planning\" \"#.claude\" \"#test/fixtures/baselines\"",
63
63
  "lint:links": "npx --yes lychee --no-progress --accept 200,206,403,429 \"**/*.md\" || true",
64
64
  "lint:agentskills": "node scripts/lint-agentskills-spec.cjs",
65
65
  "lint:changelog": "node scripts/lint-changelog.cjs",
@@ -74,6 +74,7 @@
74
74
  "check:domain-links": "node scripts/check-domain-cross-links.cjs",
75
75
  "check:no-duplication": "node scripts/check-no-duplication.cjs",
76
76
  "validate:composition-graph": "node scripts/validate-composition-graph.cjs",
77
+ "validate:design-context": "node scripts/validate-design-context.cjs",
77
78
  "validate:skill-frontmatter": "node scripts/validate-skill-frontmatter.cjs",
78
79
  "build:skill-graph": "node scripts/generate-skill-graph.cjs",
79
80
  "build:skill-graph:check": "node scripts/generate-skill-graph.cjs --check",
@@ -0,0 +1,159 @@
1
+ ---
2
+ name: design-context-schema
3
+ type: reference
4
+ version: 1.0.0
5
+ phase: 52
6
+ tags: [design-context, knowledge-graph, schema, nodes, edges, mapper, two-phase]
7
+ last_updated: 2026-06-03
8
+ ---
9
+
10
+ # DesignContext Graph Schema
11
+
12
+ The DesignContext graph is the typed knowledge graph of a design system. It records design
13
+ entities as `nodes` and the relationships between them as `edges`, so an agent can reason about
14
+ a system the way an engineer reads a dependency graph: which token a component consumes, which
15
+ screen a flow transitions to, which pattern an anti-pattern conflicts with. The canonical graph
16
+ lives at `.design/context-graph.json`. It is validated by `scripts/validate-design-context.cjs`
17
+ and queried by `scripts/lib/design-context-query.cjs`.
18
+
19
+ This file documents the four shapes (Node, Edge, Fragment, Graph), the ten node types, the twelve
20
+ edge types, and the two-phase mapper pattern that builds the graph. The controlled `tags[]`
21
+ vocabulary lives in `./design-context-tag-vocab.md`; the JSON Schema lives at
22
+ `./schemas/design-context.schema.json`.
23
+
24
+ ## Shapes
25
+
26
+ Four shapes make up the contract. A Graph is the assembled whole; a Fragment is one mapper's
27
+ contribution before merge; Nodes and Edges are the parts.
28
+
29
+ ### Node
30
+
31
+ ```
32
+ { id, type, name, summary, tags[], complexity }
33
+ ```
34
+
35
+ - `id`: stable unique string; edges reference it. A duplicate id is a hard error.
36
+ - `type`: one of the ten node types below.
37
+ - `name`: human-readable name of the entity.
38
+ - `summary`: a one-line description of what the entity is and does. The deterministic pass may
39
+ leave this empty; the summary pass fills it. An empty summary, or one identical to `name`, is a
40
+ soft warning (a stub).
41
+ - `tags[]`: strings from the controlled vocabulary. An unknown tag is a soft warning.
42
+ - `complexity`: one of `simple`, `moderate`, `complex`.
43
+ - `subtype` *(optional)*: a finer class. For a `token` node one of
44
+ `color / spacing / typography / radius / shadow`; for a `layer` node one of
45
+ `Atomic / Molecular / Organism / Template`.
46
+
47
+ ### Edge
48
+
49
+ ```
50
+ { source, target, type, direction, weight }
51
+ ```
52
+
53
+ - `source`, `target`: node ids. Both must resolve to an existing node; a dangling endpoint is a
54
+ hard error.
55
+ - `type`: one of the twelve edge types below.
56
+ - `direction`: one of `forward`, `backward`, `bidirectional`. A forward edge reads
57
+ source-to-target; a backward edge reads target-to-source; a bidirectional edge reads both ways.
58
+ Traversal in the query library honors direction.
59
+ - `weight`: a number in the inclusive range 0 to 1. It expresses relationship strength, not
60
+ distance, so a stronger tie has a higher weight.
61
+
62
+ ### Fragment
63
+
64
+ ```
65
+ { schema_version, mapper, generated_at, nodes[], edges[] }
66
+ ```
67
+
68
+ A Fragment is the output of a single mapper (the Figma mapper, the codebase mapper, the docs
69
+ mapper). It carries a `mapper` field naming its origin and is merged into the Graph by union on
70
+ node `id`. Fragments let mappers run independently and write narrow outputs that later combine.
71
+
72
+ ### Graph
73
+
74
+ ```
75
+ { schema_version, generated_at, nodes[], edges[] }
76
+ ```
77
+
78
+ The Graph is the merged, canonical document at `.design/context-graph.json`. `schema_version` is
79
+ required; `generated_at` is an optional ISO-8601 timestamp recording when the graph was assembled.
80
+
81
+ ## Node types
82
+
83
+ Ten node types cover the entities a design system holds. Each entry states what the type is and
84
+ when a mapper emits it.
85
+
86
+ - **token**: a design-token leaf such as a color, a spacing step, or a type ramp value. Emitted
87
+ for every resolvable token; carries a `subtype` naming the token family.
88
+ - **component**: a reusable UI unit (a button, a card, an input). Emitted once per component
89
+ regardless of how many variants it has.
90
+ - **variant**: a named configuration of a component (a button's `primary` or `ghost`). Emitted
91
+ when a component exposes distinct variants worth addressing on their own.
92
+ - **state**: an interaction or lifecycle state of a component (`hover`, `disabled`, `loading`).
93
+ Emitted when state changes carry their own styling or behavior.
94
+ - **motion-fragment**: a reusable motion unit (an enter transition, an easing curve, a loop).
95
+ Emitted when motion is named and reused rather than ad hoc.
96
+ - **a11y-pattern**: an accessibility pattern (a focus-trap, a skip-link, an aria-live region).
97
+ Emitted when a component participates in a named accessibility contract.
98
+ - **screen**: a full page or view in a product flow. Emitted once per distinct screen.
99
+ - **layer**: a composition layer in the atomic taxonomy. Carries a `subtype` of `Atomic`,
100
+ `Molecular`, `Organism`, or `Template`. Emitted to record where an entity sits in the hierarchy.
101
+ - **pattern**: a recurring solution that spans components (a master-detail layout, a wizard).
102
+ Emitted when a shape repeats across the system and earns a name.
103
+ - **anti-pattern**: a recurring shape the system wants to retire (a one-off color, a duplicated
104
+ control). Emitted so the graph can point at debt and the edges can mark conflicts.
105
+
106
+ ## Edge types
107
+
108
+ Twelve edge types cover how entities relate. Each entry states the relationship and when it
109
+ applies.
110
+
111
+ - **uses-token**: a component or variant consumes a token. Source is the consumer, target is the
112
+ token.
113
+ - **composes**: a larger entity is built from a smaller one (a card composes a button). Source is
114
+ the whole, target is the part.
115
+ - **extends**: a variant or component specializes another (a `primary` button extends the base
116
+ button). Source is the specialization.
117
+ - **transitions-to**: a screen or state moves to another in a flow. Used for navigation graphs
118
+ and state machines.
119
+ - **depends-on**: a generic dependency where the more specific edge types do not fit. Source
120
+ needs target to function.
121
+ - **mirrors**: two entities are intentional reflections of each other (a light-mode and dark-mode
122
+ pair). Usually bidirectional.
123
+ - **conflicts-with**: two entities collide or duplicate intent (an anti-pattern conflicts with a
124
+ sanctioned pattern). Used to surface debt.
125
+ - **referenced-by**: an inbound citation: the target points at the source from outside the graph
126
+ core (a doc or a ticket references this entity). Often backward.
127
+ - **tested-by**: an entity is covered by a test. Source is the entity, target is the test node.
128
+ - **documented-by**: an entity is described by a doc. Source is the entity, target is the doc.
129
+ - **consumes-context**: an entity reads shared context provided elsewhere (a component reads a
130
+ theme provider). Source is the reader.
131
+ - **provides-context**: an entity supplies shared context to others (a theme provider supplies a
132
+ palette). Source is the provider; the matching reader uses `consumes-context`.
133
+
134
+ ## The two-phase mapper pattern
135
+
136
+ A mapper builds the graph in two passes so the cheap, deterministic work is separate from the
137
+ costly, judgment-bearing work.
138
+
139
+ 1. **Deterministic extract.** A pure pass walks the source (a Figma file, a component tree, a docs
140
+ set) and emits node and edge skeletons: ids, types, names, tags, complexity, and every edge it
141
+ can prove. Summaries are left empty. This pass is reproducible and dependency-free, so a graph
142
+ can be rebuilt the same way every run.
143
+ 2. **LLM summary.** A second pass fills each node `summary` with a one-line description an agent
144
+ can read. Only the `summary` field changes; ids, types, and edges stay fixed from the extract
145
+ pass. This keeps the expensive pass narrow and lets the validator flag any node the summary
146
+ pass missed as a stub.
147
+
148
+ Splitting the work this way means the structure of the graph is deterministic and auditable, while
149
+ the prose layer can be regenerated on its own without disturbing the topology. A mapper writes a
150
+ Fragment; the assembler merges fragments into the canonical Graph.
151
+
152
+ ## Cross-references
153
+
154
+ - Controlled `tags[]` vocabulary the validator enforces: see `./design-context-tag-vocab.md`.
155
+ - The JSON Schema (Draft-07) for the Graph: see `./schemas/design-context.schema.json`.
156
+ - The validator (structural, referential, completeness, tag checks):
157
+ `scripts/validate-design-context.cjs`.
158
+ - The query library (filters, BFS path, consumers, orphans, cycles, coverage):
159
+ `scripts/lib/design-context-query.cjs`.
@@ -0,0 +1,82 @@
1
+ ---
2
+ name: design-context-tag-vocab
3
+ type: reference
4
+ version: 1.0.0
5
+ phase: 52
6
+ tags: [design-context, knowledge-graph, tags, vocabulary, controlled-vocab]
7
+ last_updated: 2026-06-03
8
+ ---
9
+
10
+ # DesignContext Tag Vocabulary
11
+
12
+ This is the controlled vocabulary the DesignContext validator checks node `tags[]` against. A tag
13
+ outside this list is a soft warning, not a hard error, so a mapper can ship a new tag and the
14
+ graph still loads; the warning prompts a reviewer to either fix the tag or add it here.
15
+
16
+ ## Source of truth
17
+
18
+ The canonical list lives in code, in the `TAG_VOCAB` set inside
19
+ `scripts/validate-design-context.cjs`. That set is what the validator enforces. This document
20
+ mirrors it for human readers and groups the tags by concern. When the set changes, update this
21
+ file by hand to match. If the two ever disagree, the code wins.
22
+
23
+ ## Why a controlled vocabulary
24
+
25
+ Free-form tags drift: one node says `darkmode`, another `dark-mode`, a third `dark`. A query for
26
+ `dark-mode` then misses two of three. A controlled list keeps tags queryable and keeps the
27
+ `nodes(graph, { tag })` filter reliable. The list is deliberately broad rather than minimal, so
28
+ most real tags land inside it; the soft-warning behavior absorbs the rest without blocking a build.
29
+
30
+ ## Tags by concern
31
+
32
+ The groupings below are for reading only. The validator treats the vocabulary as one flat set, so
33
+ a tag is valid regardless of which group it sits in.
34
+
35
+ - **Color**: `color`, `palette`, `theme`, `dark-mode`, `light-mode`, `contrast`, `gradient`,
36
+ `surface`, `brand`.
37
+ - **Spacing and sizing**: `spacing`, `sizing`, `density`, `gap`, `inset`, `stack`.
38
+ - **Typography**: `typography`, `font`, `type-scale`, `heading`, `body-text`, `label`, `numeric`.
39
+ - **Radius, shape, elevation**: `radius`, `shape`, `border`, `shadow`, `elevation`, `depth`.
40
+ - **Motion**: `motion`, `transition`, `animation`, `easing`, `duration`, `enter`, `exit`, `loop`,
41
+ `gesture`.
42
+ - **Accessibility**: `a11y`, `aria`, `focus`, `keyboard`, `screen-reader`, `reduced-motion`,
43
+ `contrast-safe`, `touch-target`.
44
+ - **Layout and structure**: `layout`, `grid`, `flex`, `responsive`, `breakpoint`, `container`,
45
+ `overflow`, `position`, `z-index`.
46
+ - **Interaction state**: `state`, `hover`, `active`, `disabled`, `loading`, `error`, `success`,
47
+ `selected`, `pressed`, `dragging`.
48
+ - **Component taxonomy**: `atom`, `molecule`, `organism`, `template`, `primitive`, `composite`,
49
+ `layout-primitive`.
50
+ - **Forms and inputs**: `form`, `input`, `control`, `validation`, `field`.
51
+ - **Navigation and structure**: `navigation`, `overlay`, `modal`, `menu`, `tabs`, `data-display`,
52
+ `feedback`, `media`.
53
+ - **Semantic role**: `interactive`, `static`, `decorative`, `destructive`, `utility`.
54
+ - **Quality flags**: `deprecated`, `experimental`, `stable`, `anti-pattern`, `review-needed`.
55
+
56
+ ## Machine-readable list
57
+
58
+ The fenced block below is the same vocabulary as a flat list for any tool that wants to read the
59
+ doc instead of the code. Tokens are separated by commas or newlines (split on `/[\s,]+/`), so the
60
+ grouping into lines is cosmetic. It must stay equal to the `TAG_VOCAB` set in
61
+ `scripts/validate-design-context.cjs`.
62
+
63
+ ```text
64
+ color, palette, theme, dark-mode, light-mode, contrast, gradient, surface, brand,
65
+ spacing, sizing, density, gap, inset, stack,
66
+ typography, font, type-scale, heading, body-text, label, numeric,
67
+ radius, shape, border, shadow, elevation, depth,
68
+ motion, transition, animation, easing, duration, enter, exit, loop, gesture,
69
+ a11y, aria, focus, keyboard, screen-reader, reduced-motion, contrast-safe, touch-target,
70
+ layout, grid, flex, responsive, breakpoint, container, overflow, position, z-index,
71
+ state, hover, active, disabled, loading, error, success, selected, pressed, dragging,
72
+ atom, molecule, organism, template, primitive, composite, layout-primitive,
73
+ form, input, control, validation, field,
74
+ navigation, overlay, modal, menu, tabs, data-display, feedback, media,
75
+ interactive, static, decorative, destructive, utility,
76
+ deprecated, experimental, stable, anti-pattern, review-needed
77
+ ```
78
+
79
+ ## Cross-references
80
+
81
+ - The node and edge type catalogue and the four shapes: see `./design-context-schema.md`.
82
+ - The validator that enforces this vocabulary: `scripts/validate-design-context.cjs`.
@@ -1156,6 +1156,20 @@
1156
1156
  "type": "meta-rules",
1157
1157
  "phase": 51,
1158
1158
  "description": "Phase 51 instinct unit format: YAML frontmatter (id, trigger, confidence 0.3-0.9, domain, scope, project_id, source, cycles_seen, first/last_seen) + body; promotion gate K=2/M=2; Beta(2,8) prior; TTL decay. Stored via scripts/lib/instinct-store.cjs."
1159
+ },
1160
+ {
1161
+ "name": "design-context-schema",
1162
+ "path": "reference/design-context-schema.md",
1163
+ "type": "schema",
1164
+ "phase": 52,
1165
+ "description": "Phase 52 (KEYSTONE) typed DesignContext graph: 10 node types + 12 edge types, Node/Edge/Fragment/Graph shapes, two-phase mapper pattern. Schema at reference/schemas/design-context.schema.json."
1166
+ },
1167
+ {
1168
+ "name": "design-context-tag-vocab",
1169
+ "path": "reference/design-context-tag-vocab.md",
1170
+ "type": "meta-rules",
1171
+ "phase": 52,
1172
+ "description": "Phase 52 controlled tag vocabulary for DesignContext nodes; validate-design-context.cjs soft-warns on unknown tags."
1159
1173
  }
1160
1174
  ]
1161
1175
  }
@@ -0,0 +1,130 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://github.com/hegemonart/get-design-done/reference/schemas/design-context.schema.json",
4
+ "title": "Design Context Graph",
5
+ "description": "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.",
6
+ "type": "object",
7
+ "required": ["schema_version", "nodes", "edges"],
8
+ "properties": {
9
+ "schema_version": {
10
+ "type": "string",
11
+ "minLength": 1,
12
+ "description": "Schema version of this graph document (e.g. \"52.0\")."
13
+ },
14
+ "generated_at": {
15
+ "type": "string",
16
+ "format": "date-time",
17
+ "description": "ISO-8601 timestamp the graph was last assembled (optional)."
18
+ },
19
+ "nodes": {
20
+ "type": "array",
21
+ "description": "All design entities in the graph. Node ids must be unique.",
22
+ "items": { "$ref": "#/definitions/node" }
23
+ },
24
+ "edges": {
25
+ "type": "array",
26
+ "description": "All typed relationships. Every source/target must resolve to a node id.",
27
+ "items": { "$ref": "#/definitions/edge" }
28
+ }
29
+ },
30
+ "additionalProperties": true,
31
+ "definitions": {
32
+ "node": {
33
+ "type": "object",
34
+ "required": ["id", "type", "name", "summary", "complexity"],
35
+ "properties": {
36
+ "id": {
37
+ "type": "string",
38
+ "minLength": 1,
39
+ "description": "Stable unique identifier for the node (referenced by edge source/target)."
40
+ },
41
+ "type": {
42
+ "type": "string",
43
+ "description": "The kind of design entity this node represents.",
44
+ "enum": [
45
+ "token",
46
+ "component",
47
+ "variant",
48
+ "state",
49
+ "motion-fragment",
50
+ "a11y-pattern",
51
+ "screen",
52
+ "layer",
53
+ "pattern",
54
+ "anti-pattern"
55
+ ]
56
+ },
57
+ "name": {
58
+ "type": "string",
59
+ "minLength": 1,
60
+ "description": "Human-readable name of the entity."
61
+ },
62
+ "summary": {
63
+ "type": "string",
64
+ "description": "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."
65
+ },
66
+ "tags": {
67
+ "type": "array",
68
+ "description": "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.",
69
+ "items": { "type": "string" }
70
+ },
71
+ "complexity": {
72
+ "type": "string",
73
+ "description": "Coarse complexity bucket for the entity.",
74
+ "enum": ["simple", "moderate", "complex"]
75
+ },
76
+ "subtype": {
77
+ "type": "string",
78
+ "description": "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."
79
+ }
80
+ },
81
+ "additionalProperties": true
82
+ },
83
+ "edge": {
84
+ "type": "object",
85
+ "required": ["source", "target", "type", "direction", "weight"],
86
+ "properties": {
87
+ "source": {
88
+ "type": "string",
89
+ "minLength": 1,
90
+ "description": "Node id the edge originates from."
91
+ },
92
+ "target": {
93
+ "type": "string",
94
+ "minLength": 1,
95
+ "description": "Node id the edge points to."
96
+ },
97
+ "type": {
98
+ "type": "string",
99
+ "description": "The kind of relationship between source and target.",
100
+ "enum": [
101
+ "uses-token",
102
+ "composes",
103
+ "extends",
104
+ "transitions-to",
105
+ "depends-on",
106
+ "mirrors",
107
+ "conflicts-with",
108
+ "referenced-by",
109
+ "tested-by",
110
+ "documented-by",
111
+ "consumes-context",
112
+ "provides-context"
113
+ ]
114
+ },
115
+ "direction": {
116
+ "type": "string",
117
+ "description": "Whether the relationship reads source-to-target (forward), target-to-source (backward), or both ways (bidirectional).",
118
+ "enum": ["forward", "backward", "bidirectional"]
119
+ },
120
+ "weight": {
121
+ "type": "number",
122
+ "minimum": 0,
123
+ "maximum": 1,
124
+ "description": "Relationship strength in the inclusive range 0..1."
125
+ }
126
+ },
127
+ "additionalProperties": true
128
+ }
129
+ }
130
+ }
@@ -7,7 +7,7 @@
7
7
  "properties": {
8
8
  "tools": {
9
9
  "type": "object",
10
- "description": "Per-tool input/output schemas keyed by tool name. Exactly 12 entries (D-03 hard cap).",
10
+ "description": "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).",
11
11
  "additionalProperties": false,
12
12
  "properties": {
13
13
  "gdd_status": {
@@ -33,6 +33,39 @@
33
33
  }
34
34
  }
35
35
  },
36
+ "gdd_context_query": {
37
+ "type": "object",
38
+ "additionalProperties": false,
39
+ "required": ["input", "output"],
40
+ "properties": {
41
+ "input": {
42
+ "type": "object",
43
+ "additionalProperties": false,
44
+ "required": ["op"],
45
+ "properties": {
46
+ "op": {
47
+ "type": "string",
48
+ "enum": ["nodes", "edges", "path", "consumers-of", "unreachable", "cycles", "coverage"]
49
+ },
50
+ "type": { "type": "string" },
51
+ "tag": { "type": "string" },
52
+ "from": { "type": "string" },
53
+ "to": { "type": "string" },
54
+ "id": { "type": "string" }
55
+ }
56
+ },
57
+ "output": {
58
+ "type": "object",
59
+ "required": ["op", "graph_present", "result"],
60
+ "properties": {
61
+ "op": { "type": "string" },
62
+ "graph_present": { "type": "boolean" },
63
+ "path": { "type": "string" },
64
+ "result": { "type": ["array", "object", "null"] }
65
+ }
66
+ }
67
+ }
68
+ },
36
69
  "gdd_phase_current": {
37
70
  "type": "object",
38
71
  "additionalProperties": false,
@@ -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: 89. Composition edges: 0 composes_with, 6 next_skills.
12
+ Skills: 91. Composition edges: 0 composes_with, 6 next_skills.
13
13
 
14
14
  ```mermaid
15
15
  flowchart TD
@@ -72,6 +72,7 @@ flowchart TD
72
72
  n_cache_manager["cache-manager"]
73
73
  n_check_update["check-update"]
74
74
  n_connections["connections"]
75
+ n_context["context"]
75
76
  n_continue["continue"]
76
77
  n_debug["debug"]
77
78
  n_extract_learnings["extract-learnings"]
@@ -83,6 +84,7 @@ flowchart TD
83
84
  n_instinct["instinct"]
84
85
  n_list_pins["list-pins"]
85
86
  n_locale["locale"]
87
+ n_migrate_context["migrate-context"]
86
88
  n_new_skill["new-skill"]
87
89
  n_next["next"]
88
90
  n_note["note"]