@hegemonart/get-design-done 1.51.0 → 1.52.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.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +47 -0
- package/README.md +2 -0
- package/SKILL.md +2 -0
- package/agents/a11y-mapper.md +30 -1
- package/agents/component-taxonomy-mapper.md +30 -1
- package/agents/design-debt-crawler.md +60 -60
- package/agents/design-research-synthesizer.md +27 -1
- package/agents/motion-mapper.md +35 -13
- package/agents/token-mapper.md +30 -1
- package/agents/visual-hierarchy-mapper.md +30 -1
- package/dist/claude-code/.claude/skills/context/SKILL.md +137 -0
- package/dist/claude-code/.claude/skills/migrate-context/SKILL.md +123 -0
- package/dist/claude-code/.claude/skills/progress/SKILL.md +4 -0
- package/package.json +3 -2
- package/reference/design-context-schema.md +159 -0
- package/reference/design-context-tag-vocab.md +82 -0
- package/reference/registry.json +14 -0
- package/reference/schemas/design-context.schema.json +130 -0
- package/reference/schemas/mcp-gdd-tools.schema.json +34 -1
- package/reference/skill-graph.md +3 -1
- package/scripts/lib/design-context/extract-a11y.mjs +188 -0
- package/scripts/lib/design-context/extract-components.mjs +243 -0
- package/scripts/lib/design-context/extract-motion.mjs +248 -0
- package/scripts/lib/design-context/extract-tokens.mjs +234 -0
- package/scripts/lib/design-context/extract-visual-hierarchy.mjs +178 -0
- package/scripts/lib/design-context/integration-map.mjs +251 -0
- package/scripts/lib/design-context/merge-fragments.mjs +227 -0
- package/scripts/lib/design-context-query.cjs +0 -0
- package/scripts/lib/manifest/skills.json +16 -0
- package/scripts/lib/mcp-tools-lint/index.cjs +3 -1
- package/sdk/mcp/gdd-mcp/schemas/gdd_context_query.schema.json +60 -0
- package/sdk/mcp/gdd-mcp/server.js +474 -158
- package/sdk/mcp/gdd-mcp/server.ts +9 -5
- package/sdk/mcp/gdd-mcp/tools/gdd_context_query.ts +35 -0
- package/sdk/mcp/gdd-mcp/tools/index.ts +18 -13
- package/skills/context/SKILL.md +137 -0
- package/skills/migrate-context/SKILL.md +123 -0
- package/skills/progress/SKILL.md +4 -0
|
@@ -11,6 +11,7 @@ typical-duration-seconds: 45
|
|
|
11
11
|
reads-only: false
|
|
12
12
|
writes:
|
|
13
13
|
- ".design/map/visual-hierarchy.md"
|
|
14
|
+
- ".design/fragments/visual-hierarchy-mapper.json"
|
|
14
15
|
---
|
|
15
16
|
|
|
16
17
|
@reference/shared-preamble.md
|
|
@@ -117,9 +118,37 @@ Total: N findings.
|
|
|
117
118
|
```
|
|
118
119
|
```
|
|
119
120
|
|
|
121
|
+
## Graph fragment emission
|
|
122
|
+
|
|
123
|
+
Dual-emit: keep writing `.design/map/visual-hierarchy.md` above, and ALSO emit a typed graph fragment for the synthesizer to merge into `.design/context-graph.json`. Fragment shape and field rules come from `reference/design-context-schema.md`; allowed `tags[]` come from `reference/design-context-tag-vocab.md`. Do not invent fields or tags outside those two references.
|
|
124
|
+
|
|
125
|
+
### 1. Deterministic phase (structural nodes/edges)
|
|
126
|
+
|
|
127
|
+
Run the matching extractor over the same source roots you scanned above:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
node scripts/lib/design-context/extract-visual-hierarchy.mjs <source_root> [<source_root>...] > .design/fragments/visual-hierarchy-mapper.json
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
`extract-visual-hierarchy.mjs` walks the source roots with regex (zero-dep) and returns a Fragment whose `nodes[]` have `id`, `type` (`screen` for pages or routes, `pattern` for layout patterns, `anti-pattern` for hierarchy violations you flagged), and `name` filled, with stub `summary` you must replace.
|
|
134
|
+
|
|
135
|
+
### 2. LLM phase (fill summary, tags, complexity)
|
|
136
|
+
|
|
137
|
+
For every node the extractor produced, set:
|
|
138
|
+
|
|
139
|
+
- `summary`: one sentence describing the screen or pattern and its hierarchy signal, distinct from `name`. Example for an F-pattern node: "Left-aligned scan path with stacked content blocks".
|
|
140
|
+
- `tags[]`: pick from `reference/design-context-tag-vocab.md` only (hierarchy terms such as `f-pattern`, `z-pattern`, `centered`, `type-scale`, `focal-weight`). Drop any tag not in the vocab.
|
|
141
|
+
- `complexity`: `simple` for a single layout pattern, `moderate` for a screen combining two patterns, `complex` for a screen with nested or competing focal regions.
|
|
142
|
+
|
|
143
|
+
Add edges the extractor cannot infer: two screens sharing a layout pattern are `mirrors`; a flagged anti-pattern that contradicts a sibling screen's pattern is `conflicts-with`. Set `direction` and `weight` per the schema.
|
|
144
|
+
|
|
145
|
+
### 3. Write the fragment
|
|
146
|
+
|
|
147
|
+
Write the completed Fragment to `.design/fragments/visual-hierarchy-mapper.json` with `schema_version`, `mapper: "visual-hierarchy-mapper"`, `generated_at` (ISO 8601), the enriched `nodes[]`, and `edges[]`. Resolve the main repo root the same way the rest of the pipeline does so a worktree run does not leak the file.
|
|
148
|
+
|
|
120
149
|
## Constraints
|
|
121
150
|
|
|
122
|
-
No modifications outside `.design/map/`. No git. No agent spawning.
|
|
151
|
+
No modifications outside `.design/map/` and `.design/fragments/`. No git. No agent spawning.
|
|
123
152
|
|
|
124
153
|
## Record
|
|
125
154
|
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gdd-context
|
|
3
|
+
description: "Queries the typed DesignContext graph at .design/context-graph.json - the design-semantic map of tokens, components, variants, states, motion, a11y patterns, screens, layers, and design patterns plus the edges between them. Lists and filters nodes and edges, traces a path between two nodes, finds the consumers of a node, and reports unreachable nodes, dependency cycles, and coverage. Use when the user wants to inspect the design graph, find what depends on a token or component, trace how one node reaches another, or check graph health. Activates for requests involving the design context graph, design dependencies, token consumers, component composition, unreachable design nodes, design cycles, or design coverage."
|
|
4
|
+
argument-hint: "[nodes --type X | edges --type Z | path <a> <b> | consumers-of <id> | unreachable | cycles | coverage]"
|
|
5
|
+
tools: Read, Bash
|
|
6
|
+
user-invocable: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# /gdd:context
|
|
10
|
+
|
|
11
|
+
**Role:** Read-only front end for the typed DesignContext graph. The graph is a design-semantic map: nodes are tokens, components, variants, states, motion fragments, a11y patterns, screens, layers, and design patterns; edges connect them (uses-token, composes, extends, transitions-to, depends-on, mirrors, conflicts-with, referenced-by, tested-by, documented-by, consumes-context, provides-context). This skill queries that graph. It never writes to it. The graph is authored by the mapper agents plus the design-research-synthesizer; this skill only reads.
|
|
12
|
+
|
|
13
|
+
The query engine ships at `scripts/lib/design-context-query.cjs` (authored elsewhere; this skill only calls it). It is pure and dep-free, exposing `load`, `nodes`, `edges`, `path`, `consumersOf`, `unreachable`, `cycles`, and `coverage`. The merged graph lives at `.design/context-graph.json` with the shape `{ schema_version, generated_at, nodes[], edges[] }`.
|
|
14
|
+
|
|
15
|
+
If `.design/context-graph.json` is absent, print: `No DesignContext graph yet. Run the design research pipeline (mappers plus /gdd:synthesize) to generate .design/context-graph.json.` Then STOP. Do not invent a graph.
|
|
16
|
+
|
|
17
|
+
The engine exposes a module API rather than a CLI, so drive it from a short `node -e` script, the same way other skills call a `scripts/lib` helper:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
node -e "const q=require('${CLAUDE_PLUGIN_ROOT}/scripts/lib/design-context-query.cjs'); \
|
|
21
|
+
const g=q.load('.design/context-graph.json'); \
|
|
22
|
+
console.log(JSON.stringify(q.nodes(g, { type: process.env.NODE_TYPE || undefined, tag: process.env.TAG || undefined })));"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Invocation Modes
|
|
26
|
+
|
|
27
|
+
| Command | Behavior |
|
|
28
|
+
|---|---|
|
|
29
|
+
| `/gdd:context nodes` | List graph nodes, optionally filtered by `--type` and `--tag` (default mode). |
|
|
30
|
+
| `/gdd:context edges` | List graph edges, optionally filtered by `--type`. |
|
|
31
|
+
| `/gdd:context path <a> <b>` | Trace a path from node `<a>` to node `<b>`. |
|
|
32
|
+
| `/gdd:context consumers-of <id>` | List the nodes that consume node `<id>`. |
|
|
33
|
+
| `/gdd:context unreachable` | List nodes no edge reaches. |
|
|
34
|
+
| `/gdd:context cycles` | List dependency cycles in the graph. |
|
|
35
|
+
| `/gdd:context coverage` | Report graph coverage (typed and tagged ratios). |
|
|
36
|
+
|
|
37
|
+
Output discipline: emit JSON when a tool or another skill is the caller; render a compact table when a person is at the terminal.
|
|
38
|
+
|
|
39
|
+
## nodes
|
|
40
|
+
|
|
41
|
+
List nodes. `--type <t>` filters by node type (token, component, variant, state, motion-fragment, a11y-pattern, screen, layer, pattern, anti-pattern). `--tag <tag>` filters by a controlled tag. Call `nodes(graph, { type, tag })`:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
node -e "const q=require('${CLAUDE_PLUGIN_ROOT}/scripts/lib/design-context-query.cjs'); \
|
|
45
|
+
const g=q.load('.design/context-graph.json'); \
|
|
46
|
+
console.log(JSON.stringify(q.nodes(g, { type: process.env.NODE_TYPE || undefined, tag: process.env.TAG || undefined })));"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Render one row per node. Keep it scannable:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
ID TYPE COMPLEXITY NAME
|
|
53
|
+
token:color/brand token simple Brand primary
|
|
54
|
+
component:Button component moderate Button
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
If no nodes match, say so plainly and suggest a broader filter.
|
|
58
|
+
|
|
59
|
+
## edges
|
|
60
|
+
|
|
61
|
+
List edges. `--type <t>` filters by edge type (uses-token, composes, extends, transitions-to, depends-on, mirrors, conflicts-with, referenced-by, tested-by, documented-by, consumes-context, provides-context). Call `edges(graph, { type })`:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
node -e "const q=require('${CLAUDE_PLUGIN_ROOT}/scripts/lib/design-context-query.cjs'); \
|
|
65
|
+
const g=q.load('.design/context-graph.json'); \
|
|
66
|
+
console.log(JSON.stringify(q.edges(g, { type: process.env.EDGE_TYPE || undefined })));"
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Render `source -> target (type, weight)` per row. If none match, report it and suggest dropping the filter.
|
|
70
|
+
|
|
71
|
+
## path
|
|
72
|
+
|
|
73
|
+
Trace a path between two node ids. Call `path(graph, from, to)`:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
node -e "const q=require('${CLAUDE_PLUGIN_ROOT}/scripts/lib/design-context-query.cjs'); \
|
|
77
|
+
const g=q.load('.design/context-graph.json'); \
|
|
78
|
+
console.log(JSON.stringify(q.path(g, process.env.FROM, process.env.TO)));"
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Print the ordered node ids joined by arrows. If no path exists, print `No path from <a> to <b>.` Do not fabricate intermediate nodes.
|
|
82
|
+
|
|
83
|
+
## consumers-of
|
|
84
|
+
|
|
85
|
+
List the nodes that consume a given node (the inbound side). Call `consumersOf(graph, id)`:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
node -e "const q=require('${CLAUDE_PLUGIN_ROOT}/scripts/lib/design-context-query.cjs'); \
|
|
89
|
+
const g=q.load('.design/context-graph.json'); \
|
|
90
|
+
console.log(JSON.stringify(q.consumersOf(g, process.env.ID)));"
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Render the consumer ids one per row. If the id is unknown, print `No node <id> in the graph.` and suggest `/gdd:context nodes`.
|
|
94
|
+
|
|
95
|
+
## unreachable
|
|
96
|
+
|
|
97
|
+
List nodes that no edge reaches (orphans). Call `unreachable(graph)`:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
node -e "const q=require('${CLAUDE_PLUGIN_ROOT}/scripts/lib/design-context-query.cjs'); \
|
|
101
|
+
const g=q.load('.design/context-graph.json'); \
|
|
102
|
+
console.log(JSON.stringify(q.unreachable(g)));"
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
If the list is empty, print `Every node is reachable.`
|
|
106
|
+
|
|
107
|
+
## cycles
|
|
108
|
+
|
|
109
|
+
List dependency cycles. Call `cycles(graph)`:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
node -e "const q=require('${CLAUDE_PLUGIN_ROOT}/scripts/lib/design-context-query.cjs'); \
|
|
113
|
+
const g=q.load('.design/context-graph.json'); \
|
|
114
|
+
console.log(JSON.stringify(q.cycles(g)));"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Print each cycle as its ordered node ids. If there are none, print `No cycles detected.`
|
|
118
|
+
|
|
119
|
+
## coverage
|
|
120
|
+
|
|
121
|
+
Report graph coverage. Call `coverage(graph)`:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
node -e "const q=require('${CLAUDE_PLUGIN_ROOT}/scripts/lib/design-context-query.cjs'); \
|
|
125
|
+
const g=q.load('.design/context-graph.json'); \
|
|
126
|
+
console.log(JSON.stringify(q.coverage(g)));"
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Surface the returned ratios (for example typed and tagged coverage and node and edge counts) as a short summary.
|
|
130
|
+
|
|
131
|
+
## Do Not
|
|
132
|
+
|
|
133
|
+
- Do not edit `.design/context-graph.json` or the fragments under `.design/fragments/`. All writes go through the mapper agents and the synthesizer.
|
|
134
|
+
- Do not invent nodes, edges, or paths. If a query returns nothing, report it plainly.
|
|
135
|
+
- Do not modify `scripts/lib/design-context-query.cjs` or the DesignContext schema.
|
|
136
|
+
|
|
137
|
+
## CONTEXT COMPLETE
|
|
@@ -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.
|
|
3
|
+
"version": "1.52.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\" \"
|
|
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`.
|
package/reference/registry.json
CHANGED
|
@@ -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
|
}
|