@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
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
},
|
|
6
6
|
"metadata": {
|
|
7
7
|
"description": "Get Design Done — 5-stage agent-orchestrated design pipeline with 9 connections, handoff-first workflow, bidirectional Figma write-back, 22+ specialized agents, queryable knowledge layer (intel store, dependency analysis, learnings extraction), and a self-improvement loop (reflector, frontmatter + budget feedback, global-skills layer). v1.20.0 ships the SDK foundation: gdd-state MCP server (11 typed tools), lockfile-safe STATE.md mutations, event stream, and resilience primitives (jittered-backoff, rate-guard, error-classifier, iteration-budget) for rate-limit + 429 + context-overflow recovery. Full CI/CD pipeline (Node 22/24 × Linux/macOS/Windows) and release automation (auto-tag + GitHub Release + release-time smoke test).",
|
|
8
|
-
"version": "1.
|
|
8
|
+
"version": "1.52.0"
|
|
9
9
|
},
|
|
10
10
|
"plugins": [
|
|
11
11
|
{
|
|
12
12
|
"name": "get-design-done",
|
|
13
13
|
"source": "./",
|
|
14
14
|
"description": "Agent-orchestrated 5-stage design pipeline: Brief → Explore → Plan → Design → Verify. 22+ specialized agents, 9 connections (Figma, Refero, Preview, Storybook, Chromatic, Figma Writer, Graphify, Pinterest, Claude Design), Claude Design handoff, bidirectional Figma write-back, and a queryable intel store (.design/intel/) for dependency and learnings queries. Standalone commands: style, darkmode, compare, figma-write, graphify, handoff, analyze-dependencies, skill-manifest, extract-learnings. Embeds NNG heuristics, WCAG thresholds, typographic systems, motion framework, and anti-pattern catalog. Ships with a full CI/CD pipeline (Node 22/24 × Linux/macOS/Windows) and release automation. Optimization layer (v1.0.4.1, retroactive): gdd-router + gdd-cache-manager skills, PreToolUse budget-enforcer hook, tier-aware agent frontmatter, lazy checker gates, streaming synthesizer, /gdd:warm-cache + /gdd:optimize commands, and cost telemetry at .design/telemetry/costs.jsonl — targeting 50-70% per-task token-cost reduction with no quality-floor regression. v1.20.0 SDK foundation: gdd-state MCP server (11 typed tools), lockfile-safe STATE.md mutations, event stream at .design/telemetry/events.jsonl, resilience primitives (jittered-backoff, rate-guard, error-classifier, iteration-budget) with rate-limit + 429 + context-overflow recovery, and TypeScript toolchain.",
|
|
15
|
-
"version": "1.
|
|
15
|
+
"version": "1.52.0",
|
|
16
16
|
"author": {
|
|
17
17
|
"name": "hegemonart"
|
|
18
18
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "get-design-done",
|
|
3
3
|
"short_name": "gdd",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.52.0",
|
|
5
5
|
"description": "Agent-orchestrated 5-stage design pipeline: Brief → Explore → Plan → Design → Verify. 59 specialized agents, 88 skills, 41 connection integrations (Figma, Refero, Preview, Storybook, Chromatic, Graphify, Slack, Linear, Jira, Notion, and more), handoff-first workflow via Claude Design bundles, bidirectional Figma write-back (annotations, Code Connect), queryable intel store (`.design/intel/`) for O(1) design surface lookups, and self-improvement loop (reflector agent, frontmatter + budget feedback, global-skills layer at `~/.claude/gdd/global-skills/`). Standalone commands: style, darkmode, compare, figma-write, graphify, handoff, analyze-dependencies, skill-manifest, extract-learnings, reflect, apply-reflections. Embeds NNG heuristics, WCAG thresholds, typographic systems, motion framework, and anti-pattern catalog. Ships with a full CI/CD pipeline (Node 22/24 × Linux/macOS/Windows, lint + schema + frontmatter + stale-ref + shellcheck + gitleaks + injection-scan + blocking size-budget) and release automation (auto-tag + GitHub Release + release-time smoke test). Optimization layer (v1.0.4.1, retroactive): gdd-router + gdd-cache-manager skills, PreToolUse budget-enforcer hook, tier-aware agent frontmatter, lazy checker gates, streaming synthesizer, /gdd:warm-cache + /gdd:optimize commands, and cost telemetry at .design/telemetry/costs.jsonl — targeting 50-70% per-task token-cost reduction with no quality-floor regression. v1.20.0 SDK foundation: gdd-state MCP server (11 typed tools), lockfile-safe STATE.md mutations, event stream at .design/telemetry/events.jsonl, resilience primitives (jittered-backoff, rate-guard, error-classifier, iteration-budget) with rate-limit + 429 + context-overflow recovery, and TypeScript toolchain. v1.27.7 ships gdd-mcp (Phase 27.7): 12 read-only MCP tools for sub-3s priming. v1.28.0 (Phase 28): Foundational References Tier 2 — 5 new reference files (color-theory, composition, proportion-systems, i18n, contrast-advanced), 2 verifier i18n probes + 1 explore i18n-readiness probe, 12 additive cross-link insertions across 10 existing references, 2 orthogonal audit-scoring lens-tags (composition_alignment + i18n_readiness).",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "hegemonart",
|
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,53 @@ All notable changes to get-design-done are documented here. Versions follow [sem
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
## [1.52.0] - 2026-06-03
|
|
8
|
+
|
|
9
|
+
### Phase 52 - Typed DesignContext Graph Schema (KEYSTONE)
|
|
10
|
+
|
|
11
|
+
GDD's design knowledge lived in flat `.design/map/*.md` mapper notes that nothing downstream could query. Phase 52
|
|
12
|
+
introduces a typed DesignContext graph: a design-semantic map of tokens, components, variants, states, motion fragments,
|
|
13
|
+
a11y patterns, screens, layers, and design patterns, plus the typed edges between them. It is the keystone for phases
|
|
14
|
+
53-57 (semantic mapper engine, graph-aware verification, dashboard, SQLite mirror). Regex extraction (not tree-sitter),
|
|
15
|
+
JSON storage (not SQLite), zero new dependency. Planned and executed via the GSD pipeline (5 parallel executor subagents).
|
|
16
|
+
|
|
17
|
+
### Breaking changes
|
|
18
|
+
|
|
19
|
+
- **New graph contract at `.design/context-graph.json`.** Nodes are `{ id, type, name, summary, tags[], complexity }`
|
|
20
|
+
over 10 node types; edges are `{ source, target, type, direction, weight }` over 12 edge types
|
|
21
|
+
(`reference/schemas/design-context.schema.json`). The 5 mapper agents and the synthesizer now DUAL-EMIT: they keep
|
|
22
|
+
writing `.design/map/*.md` AND emit graph fragments to `.design/fragments/<mapper>.json` (backward-compatible for one
|
|
23
|
+
minor version), so consumers gain the graph without losing the markdown maps.
|
|
24
|
+
- **gdd-mcp tool cap raised 12 -> 13.** A 13th read-only tool, `gdd_context_query`, joins the registry
|
|
25
|
+
(`sdk/mcp/gdd-mcp/tools/index.ts`). The hard cap in the tool index, the MCP-tools lint, and the Phase 27.7 baselines
|
|
26
|
+
all move to 13. No write tools were added.
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
|
|
30
|
+
- **Schema, validator, query lib**: `reference/schemas/design-context.schema.json` (plus `reference/design-context-schema.md`
|
|
31
|
+
and `reference/design-context-tag-vocab.md`); `scripts/validate-design-context.cjs` (referential integrity, id
|
|
32
|
+
uniqueness, completeness, controlled tag vocabulary; dep-free with an optional Ajv overlay; wired as the
|
|
33
|
+
`validate:design-context` CI gate, a clean no-op when no graph is present); and `scripts/lib/design-context-query.cjs`
|
|
34
|
+
(`load`/`nodes`/`edges`/`path`/`consumersOf`/`unreachable`/`cycles`/`coverage`; pure, dep-free).
|
|
35
|
+
- **Extract and merge engine**: `scripts/lib/design-context/{extract-tokens,extract-components,extract-motion,extract-a11y,extract-visual-hierarchy,merge-fragments,integration-map}.mjs`,
|
|
36
|
+
regex over source roots, dep-free, emitting schema-valid fragments; merge dedupes nodes by id and recovers or drops dangling edges.
|
|
37
|
+
- **MCP and skills**: `gdd_context_query` (read-only graph query over the seven operations), `/gdd:context` (its front
|
|
38
|
+
end), and `/gdd:migrate-context` (migrate a pre-Phase-52 project from `.design/map/*.md` to the graph, flagging
|
|
39
|
+
low-confidence transforms; preview-first with `--dry-run`).
|
|
40
|
+
- **Debt-crawler dual-mode**: `design-debt-crawler` queries the graph when `.design/context-graph.json` is present and
|
|
41
|
+
falls back to grep otherwise; `/gdd:progress` surfaces graph coverage; `integration-map.mjs` renders a mermaid map per Atomic-Design layer.
|
|
42
|
+
|
|
43
|
+
### Notes
|
|
44
|
+
|
|
45
|
+
- 6-manifest lockstep at **v1.52.0** + `OFF_CADENCE_VERSIONS.add('1.52.0')` + 37 `manifests-version.txt` baselines.
|
|
46
|
+
Re-locked: skill-list (89 -> 91; +context +migrate-context), root SKILL.md rows, the phase-42 compile count
|
|
47
|
+
(113 -> 115), the phase-28.5 distribution + warn count (8 -> 10; context at 137 and migrate-context at 123 lines, both
|
|
48
|
+
in the advisory WARN band), the progress post-migration baseline, the gdd-mcp 27.7 tool-count + registry baselines
|
|
49
|
+
(12 -> 13), and skills.json (+2). Tarball golden 917 -> 934 (+17). The `lint:md` ignore was widened to nested
|
|
50
|
+
`node_modules`.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
7
54
|
## [1.51.0] - 2026-06-03
|
|
8
55
|
|
|
9
56
|
### Phase 51 - Instinct-Based Learnings
|
package/README.md
CHANGED
|
@@ -263,6 +263,8 @@ All 14 runtimes receive their native artifact layout (`skills/`, `command/`, `ag
|
|
|
263
263
|
|
|
264
264
|
**Instinct-based learnings (v1.51.0).** The reflection loop now produces atomic, confidence-weighted instinct units instead of prose nobody reads. Each unit (`reference/instinct-format.md`: trigger, confidence 0.3-0.9, domain, scope, project id) is stored via `scripts/lib/instinct-store.cjs` (a JSON store with optional `better-sqlite3` FTS5 acceleration, the same probe-and-fall-back pattern as cross-cycle recall, so no dependency is added). `design-reflector` dual-emits instincts plus a narrative; `/gdd:apply-reflections` accepts them; the decision-injector surfaces the top-3 relevant instincts into agent context on every design-file read; and `/gdd:instinct list|query|promote` inspects the project and global stores. A project instinct promotes to the global layer only after it recurs across at least two projects (a conservative `Beta(2,8)` prior keeps it advisory), and stale instincts decay and archive. **No new runtime dependency.**
|
|
265
265
|
|
|
266
|
+
**Typed DesignContext graph (v1.52.0, keystone).** Design knowledge moves from flat `.design/map/*.md` notes to a typed graph at `.design/context-graph.json`: nodes are tokens, components, variants, states, motion fragments, a11y patterns, screens, layers, and design patterns; typed edges connect them (uses-token, composes, depends-on, consumes-context, and eight more). A Draft-07 schema (`reference/schemas/design-context.schema.json`) plus a dep-free validator (`scripts/validate-design-context.cjs`) and a pure query lib (`scripts/lib/design-context-query.cjs`: nodes / edges / path / consumers / unreachable / cycles / coverage) back it; regex extract passes build fragments that merge into the graph. The five mapper agents and the synthesizer dual-emit, so the markdown maps stay while fragments are added. A 13th read-only MCP tool (`gdd_context_query`) and two skills (`/gdd:context`, `/gdd:migrate-context`) expose it. Regex not tree-sitter, JSON not SQLite; this is the keystone for the phases that follow. **No new runtime dependency.**
|
|
267
|
+
|
|
266
268
|
Verify with:
|
|
267
269
|
|
|
268
270
|
```
|
package/SKILL.md
CHANGED
|
@@ -113,6 +113,8 @@ Each stage produces artifacts in `.design/` inside the current project.
|
|
|
113
113
|
| `review-decisions [<id>] [--pending]` | `get-design-done:gdd-review-decisions` | Phase 40 - surface the async decision-review queue (`proposed → reviewing → approved → locked`); `--pending` shows decisions still awaiting action. Read-only |
|
|
114
114
|
| `unlock-decision <id> --approver <who> [--reason <text>] [--dry-run]` | `get-design-done:gdd-unlock-decision` | Phase 40 - reopen a LOCKED decision (the only escape hatch); requires an approver + writes an audit entry; previews before writing |
|
|
115
115
|
| `locale [<code>]` | `get-design-done:gdd-locale` | Phase 40.5 - inspect or set the GDD CLI locale (en/ru/uk/de/fr/zh/ja) for `--help`, errors, and skill prompt headers; missing keys fall back to English. No arg reports the resolved locale + coverage |
|
|
116
|
+
| `context [nodes --type X \| edges --type Z \| path <a> <b> \| consumers-of <id> \| unreachable \| cycles \| coverage]` | `get-design-done:gdd-context` | Phase 52 - read-only query front end for the typed DesignContext graph at `.design/context-graph.json`; lists/filters nodes and edges, traces a path between two nodes, finds a node's consumers, and reports unreachable nodes, dependency cycles, and coverage. Never writes |
|
|
117
|
+
| `migrate-context [--dry-run]` | `get-design-done:gdd-migrate-context` | Phase 52 - migrate a pre-Phase-52 project from flat `.design/map/*.md` mapper notes to the typed DesignContext graph; runs the extract-*.mjs passes, merges fragments, validates with `validate-design-context.cjs`, and flags low-confidence transforms for review. Preview-first; `--dry-run` previews without writing |
|
|
116
118
|
|
|
117
119
|
## Handoff Routing
|
|
118
120
|
|
package/agents/a11y-mapper.md
CHANGED
|
@@ -11,6 +11,7 @@ typical-duration-seconds: 45
|
|
|
11
11
|
reads-only: false
|
|
12
12
|
writes:
|
|
13
13
|
- ".design/map/a11y.md"
|
|
14
|
+
- ".design/fragments/a11y-mapper.json"
|
|
14
15
|
---
|
|
15
16
|
|
|
16
17
|
@reference/shared-preamble.md
|
|
@@ -136,9 +137,37 @@ Total: N findings. (0 = clean)
|
|
|
136
137
|
```
|
|
137
138
|
```
|
|
138
139
|
|
|
140
|
+
## Graph fragment emission
|
|
141
|
+
|
|
142
|
+
Dual-emit: keep writing `.design/map/a11y.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.
|
|
143
|
+
|
|
144
|
+
### 1. Deterministic phase (structural nodes/edges)
|
|
145
|
+
|
|
146
|
+
Run the matching extractor over the same source roots you scanned above:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
node scripts/lib/design-context/extract-a11y.mjs <source_root> [<source_root>...] > .design/fragments/a11y-mapper.json
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
`extract-a11y.mjs` walks the source roots with regex (zero-dep) and returns a Fragment whose `nodes[]` have `id`, `type` (`a11y-pattern`), and `name` filled, with stub `summary` you must replace. Patterns map to the ARIA, keyboard, focus, landmark, and skip-link signals you inventoried above. This is a static scan only; runtime behavior stays out (Phase 8).
|
|
153
|
+
|
|
154
|
+
### 2. LLM phase (fill summary, tags, complexity)
|
|
155
|
+
|
|
156
|
+
For every node the extractor produced, set:
|
|
157
|
+
|
|
158
|
+
- `summary`: one sentence describing the pattern and the WCAG concern it touches, distinct from `name`. Example: "Focus-visible ring on interactive controls, supports 2.4.7".
|
|
159
|
+
- `tags[]`: pick from `reference/design-context-tag-vocab.md` only (a11y terms such as `aria`, `keyboard`, `focus`, `landmark`, `contrast`). Where a node maps to a WCAG criterion you tracked, use the vocab tag for it. Drop any tag not in the vocab.
|
|
160
|
+
- `complexity`: `simple` for a single attribute or landmark, `moderate` for a keyboard-handler pattern across a widget, `complex` for a composite pattern such as a focus-managed dialog.
|
|
161
|
+
|
|
162
|
+
Add edges the extractor cannot infer: a pattern whose coverage a test asserts is `tested-by`; a pattern explained in a reference is `documented-by`. Set `direction` and `weight` per the schema.
|
|
163
|
+
|
|
164
|
+
### 3. Write the fragment
|
|
165
|
+
|
|
166
|
+
Write the completed Fragment to `.design/fragments/a11y-mapper.json` with `schema_version`, `mapper: "a11y-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.
|
|
167
|
+
|
|
139
168
|
## Constraints
|
|
140
169
|
|
|
141
|
-
No modifications outside `.design/map/`. No live browser. No git. No agent spawning.
|
|
170
|
+
No modifications outside `.design/map/` and `.design/fragments/`. No live browser. No git. No agent spawning.
|
|
142
171
|
|
|
143
172
|
## A11Y MAP COMPLETE
|
|
144
173
|
|
|
@@ -11,6 +11,7 @@ typical-duration-seconds: 45
|
|
|
11
11
|
reads-only: false
|
|
12
12
|
writes:
|
|
13
13
|
- ".design/map/components.md"
|
|
14
|
+
- ".design/fragments/component-taxonomy-mapper.json"
|
|
14
15
|
---
|
|
15
16
|
|
|
16
17
|
@reference/shared-preamble.md
|
|
@@ -81,9 +82,37 @@ dominant_styling: [CSS Modules | Tailwind | styled-components | mixed]
|
|
|
81
82
|
|-----------|--------|
|
|
82
83
|
```
|
|
83
84
|
|
|
85
|
+
## Graph fragment emission
|
|
86
|
+
|
|
87
|
+
Dual-emit: keep writing `.design/map/components.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.
|
|
88
|
+
|
|
89
|
+
### 1. Deterministic phase (structural nodes/edges)
|
|
90
|
+
|
|
91
|
+
Run the matching extractor over the same source roots you scanned above:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
node scripts/lib/design-context/extract-components.mjs <source_root> [<source_root>...] > .design/fragments/component-taxonomy-mapper.json
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
`extract-components.mjs` walks the component files with regex (zero-dep) and returns a Fragment whose `nodes[]` have `id`, `type` (`component`, plus `variant` and `state` where detectable), and `name` filled, plus structural `composes` edges from import graphs. Each node `summary` arrives as a STUB you must replace.
|
|
98
|
+
|
|
99
|
+
### 2. LLM phase (fill summary, tags, complexity)
|
|
100
|
+
|
|
101
|
+
For every node the extractor produced, set:
|
|
102
|
+
|
|
103
|
+
- `summary`: one sentence describing the component's responsibility, distinct from `name`. Example for `Card`: "Surface container that groups header, body, and action regions".
|
|
104
|
+
- `tags[]`: pick from `reference/design-context-tag-vocab.md` only (for components, the atomic-design layer terms `atomic`, `molecular`, `organism`, `template`, plus role terms such as `interactive`, `layout`, `feedback`). Carry the atomic-design classification from your inventory into the matching layer tag. Drop any tag not in the vocab.
|
|
105
|
+
- `complexity`: `simple` for an atom with no children, `moderate` for a molecule composing 2 to 5 children, `complex` for an organism with 6+ children or routable surface.
|
|
106
|
+
|
|
107
|
+
Add cross-component edges the extractor cannot infer: a compound child specializing a base is `extends`; a near-duplicate sibling you flagged for reuse is `mirrors`. Set `direction` and `weight` per the schema.
|
|
108
|
+
|
|
109
|
+
### 3. Write the fragment
|
|
110
|
+
|
|
111
|
+
Write the completed Fragment to `.design/fragments/component-taxonomy-mapper.json` with `schema_version`, `mapper: "component-taxonomy-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.
|
|
112
|
+
|
|
84
113
|
## Constraints
|
|
85
114
|
|
|
86
|
-
Do not modify anything outside `.design/map/`. No git. No agent spawning.
|
|
115
|
+
Do not modify anything outside `.design/map/` and `.design/fragments/`. No git. No agent spawning.
|
|
87
116
|
|
|
88
117
|
## Record
|
|
89
118
|
|
|
@@ -26,32 +26,23 @@ tree of an existing or legacy codebase, find design debt, group it by category,
|
|
|
26
26
|
each finding by priority, and write a single project-scoped report at
|
|
27
27
|
`.design/debt/DEBT-CATALOG.md`.
|
|
28
28
|
|
|
29
|
-
You run once against the whole project, not
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
You are a pure catalog. You do NOT modify source code, you do NOT apply fixes, and you
|
|
35
|
-
do NOT spawn other agents. For every finding you suggest a remediation command the user
|
|
36
|
-
can run later; you never run it yourself.
|
|
29
|
+
You run once against the whole project, not one cycle of work (the defining difference
|
|
30
|
+
from cycle-scoped `design-auditor`). You are a pure catalog: you do NOT modify source code,
|
|
31
|
+
apply fixes, or spawn other agents. For every finding you suggest a remediation command the
|
|
32
|
+
user can run later; you never run it yourself.
|
|
37
33
|
|
|
38
34
|
## CRITICAL: Project-Wide Scope, Not Cycle Scope
|
|
39
35
|
|
|
40
|
-
**You do NOT read `.design/STATE.md` `<completed_tasks>`.** You do not scope to the
|
|
41
|
-
|
|
42
|
-
whole source tree.
|
|
36
|
+
**You do NOT read `.design/STATE.md` `<completed_tasks>`.** You do not scope to the current
|
|
37
|
+
cycle, wave, or any recently touched file list. Your scope is the whole source tree.
|
|
43
38
|
|
|
44
39
|
- You **walk the entire codebase**, every source file under the configured source roots
|
|
45
|
-
(default `src/`), regardless of when it
|
|
46
|
-
|
|
47
|
-
- You
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
is absent, default the source root to `src/` and proceed.
|
|
52
|
-
|
|
53
|
-
If you ever find yourself filtering files by a completed-task list, stop: that is the
|
|
54
|
-
cycle-scoped behavior this agent exists to avoid.
|
|
40
|
+
(default `src/`), regardless of when it last changed or whether a GDD cycle touched it.
|
|
41
|
+
- You write to one **project-scoped** path, `.design/debt/DEBT-CATALOG.md`, never under a cycle.
|
|
42
|
+
- You may read `.design/STATE.md` solely for `source_roots`; ignore its `<completed_tasks>`,
|
|
43
|
+
`<position>`, `wave`, and `cycle` fields. If STATE.md is absent, default to `src/`.
|
|
44
|
+
- If you ever find yourself filtering files by a completed-task list, stop: that is the
|
|
45
|
+
cycle-scoped behavior this agent exists to avoid.
|
|
55
46
|
|
|
56
47
|
## Required Reading
|
|
57
48
|
|
|
@@ -63,14 +54,36 @@ listed file before acting. Minimum expected files:
|
|
|
63
54
|
- @reference/anti-slop-rubric.md
|
|
64
55
|
- @reference/reviewer-confidence-gate.md
|
|
65
56
|
|
|
66
|
-
`reference/debt-categories.md` is the taxonomy
|
|
67
|
-
|
|
68
|
-
catalog that the anti-pattern class cross-references.
|
|
57
|
+
`reference/debt-categories.md` is the taxonomy and the source of the priority-scoring model.
|
|
58
|
+
`reference/anti-patterns.md` is the BAN-NN and SLOP-NN catalog the anti-pattern class cites.
|
|
69
59
|
|
|
70
60
|
---
|
|
71
61
|
|
|
72
62
|
## Work
|
|
73
63
|
|
|
64
|
+
### Step 0: Mode selection (graph-aware dual-mode)
|
|
65
|
+
|
|
66
|
+
Check for the typed DesignContext graph at `.design/context-graph.json`. When it exists,
|
|
67
|
+
PREFER graph queries via `scripts/lib/design-context-query.cjs` for the three classes that
|
|
68
|
+
map cleanly, and grep for the rest. When it is absent, run the full grep scan (Step 2) as
|
|
69
|
+
before. Queries (`Q="node ${CLAUDE_PLUGIN_ROOT:-.}/scripts/lib/design-context-query.cjs"`,
|
|
70
|
+
all with `--file .design/context-graph.json --json`):
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
$Q nodes --type component # untokenized: a component id NOT in any uses-token source
|
|
74
|
+
$Q edges --type uses-token # ...the tokenized component ids
|
|
75
|
+
$Q nodes --type anti-pattern # anti-pattern: each node is a direct finding
|
|
76
|
+
$Q edges --type conflicts-with # ...names the sanctioned pattern it collides with
|
|
77
|
+
$Q nodes # complexity outliers: keep complexity === "complex"
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
A graph hit cites the node `id` as the location and the query as the evidence. The other six
|
|
81
|
+
classes (color-literal, contrast, density-spacing, typography-drift, a11y-text,
|
|
82
|
+
aesthetic-slop) always grep, since the graph lacks their raw `file:line` literal evidence.
|
|
83
|
+
The output contract, the confidence gate (Step 2.5), and the priority scoring (Step 3) are
|
|
84
|
+
identical in both modes: a graph-sourced finding still clears the Pre-Report Gate and carries
|
|
85
|
+
a `confidence` value and a `priority` score.
|
|
86
|
+
|
|
74
87
|
### Step 1: Determine source roots
|
|
75
88
|
|
|
76
89
|
Read `source_roots` from `.design/STATE.md` if present; otherwise default to `src/`.
|
|
@@ -83,8 +96,9 @@ find src/ -type f \( -name "*.tsx" -o -name "*.jsx" -o -name "*.ts" -o -name "*.
|
|
|
83
96
|
|
|
84
97
|
### Step 2: Scan each debt class
|
|
85
98
|
|
|
86
|
-
Run one pass per class from `reference/debt-categories.md
|
|
87
|
-
matched text for
|
|
99
|
+
Run one pass per class from `reference/debt-categories.md`, recording `file:line` plus the
|
|
100
|
+
matched text for traceability. When a graph exists (Step 0), the anti-pattern,
|
|
101
|
+
untokenized-component, and complexity-outlier passes below are the no-graph fallback.
|
|
88
102
|
|
|
89
103
|
**color-literal** (raw color values, not token references):
|
|
90
104
|
|
|
@@ -93,38 +107,31 @@ grep -rEn "#[0-9a-fA-F]{3,8}|rgb\(|rgba\(|hsl\(|hsla\(" src/ \
|
|
|
93
107
|
--include="*.tsx" --include="*.jsx" --include="*.css" --include="*.scss" 2>/dev/null
|
|
94
108
|
```
|
|
95
109
|
|
|
96
|
-
Exclude the
|
|
97
|
-
|
|
110
|
+
Exclude the token-definition file (a literal inside a `var(--x: #hex)` definition IS the
|
|
111
|
+
token). Count distinct literals and total occurrences.
|
|
98
112
|
|
|
99
|
-
**anti-pattern** (BAN-NN and SLOP-NN): run the deterministic detector once over the
|
|
100
|
-
|
|
101
|
-
|
|
113
|
+
**anti-pattern** (BAN-NN and SLOP-NN): run the deterministic detector once over the tree.
|
|
114
|
+
It returns every statically matchable rule with `file`, `line`, `ruleId`, and a reference
|
|
115
|
+
link, offline.
|
|
102
116
|
|
|
103
117
|
```bash
|
|
104
118
|
node "${CLAUDE_PLUGIN_ROOT:-.}/bin/gdd-detect" src/ --json 2>/dev/null || true
|
|
105
119
|
```
|
|
106
120
|
|
|
107
|
-
Parse the JSON `findings` array. The detector cannot match the two subjective rules
|
|
108
|
-
|
|
109
|
-
manual-review note rather than counting them.
|
|
121
|
+
Parse the JSON `findings` array. The detector cannot match the two subjective rules (BAN-04
|
|
122
|
+
keyboard-action animation, BAN-10 nested equal radius); list those as a manual-review note.
|
|
110
123
|
|
|
111
124
|
**untokenized-component** (component renders surface without token references):
|
|
112
125
|
|
|
113
126
|
```bash
|
|
114
|
-
# arbitrary bracket values + inline hex inside component files
|
|
115
127
|
grep -rEn "\[[0-9]+px\]|\[#[0-9a-fA-F]{3,8}\]" src/ \
|
|
116
128
|
--include="*.tsx" --include="*.jsx" --include="*.vue" --include="*.svelte" 2>/dev/null
|
|
117
|
-
|
|
118
|
-
grep -rEln "var\(--|theme\(" src/ --include="*.tsx" --include="*.jsx" 2>/dev/null
|
|
129
|
+
grep -rEln "var\(--|theme\(" src/ --include="*.tsx" --include="*.jsx" 2>/dev/null # tokenized files
|
|
119
130
|
```
|
|
120
131
|
|
|
121
|
-
A component file with literal or bracket hits and no `var(--` reference is untokenized.
|
|
122
|
-
The literal-to-token ratio per file is the strength signal.
|
|
132
|
+
A component file with literal or bracket hits and no `var(--` reference is untokenized; the per-file literal-to-token ratio is the strength signal.
|
|
123
133
|
|
|
124
|
-
**contrast** (foreground and background pairs below WCAG AA): resolve color pairs
|
|
125
|
-
share an element or selector, compute the ratio, and flag pairs under 4.5:1 for body
|
|
126
|
-
text or 3:1 for large text and non-text indicators. Pairs built from unresolvable
|
|
127
|
-
runtime values become a manual-review note.
|
|
134
|
+
**contrast** (foreground and background pairs below WCAG AA): resolve color pairs sharing an element or selector, compute the ratio, and flag pairs under 4.5:1 for body text or 3:1 for large text and non-text indicators. Unresolvable runtime pairs become a manual-review note.
|
|
128
135
|
|
|
129
136
|
**density-spacing** (off-scale spacing and inconsistent rhythm):
|
|
130
137
|
|
|
@@ -133,8 +140,7 @@ grep -rEon "(p|px|py|pt|pb|pl|pr|m|mx|my|mt|mb|ml|mr|gap|space-[xy])-[0-9.]+" sr
|
|
|
133
140
|
--include="*.tsx" --include="*.jsx" 2>/dev/null | sort | uniq -c | sort -rn
|
|
134
141
|
```
|
|
135
142
|
|
|
136
|
-
Flag values
|
|
137
|
-
32) and clusters where sibling components use different step counts for one role.
|
|
143
|
+
Flag values off the modular scale (default 4 / 8 / 12 / 16 / 24 / 32) and sibling clusters with mismatched step counts.
|
|
138
144
|
|
|
139
145
|
**typography-drift** (off-scale sizes, too many families, weak weight hierarchy):
|
|
140
146
|
|
|
@@ -145,8 +151,7 @@ grep -rEon "text-[a-z0-9]+|font-(bold|semibold|medium|normal|light)|font-size:[^
|
|
|
145
151
|
grep -rEn "font-family:|fontFamily" src/ --include="*.css" --include="*.ts" 2>/dev/null
|
|
146
152
|
```
|
|
147
153
|
|
|
148
|
-
Flag a long tail of one-off sizes, more than two families, and `font-weight` under 400
|
|
149
|
-
on small text.
|
|
154
|
+
Flag a long tail of one-off sizes, more than two families, and `font-weight` under 400 on small text.
|
|
150
155
|
|
|
151
156
|
**a11y-text** (text-content accessibility debt):
|
|
152
157
|
|
|
@@ -156,14 +161,13 @@ grep -rEn "No data|No results|Nothing here|went wrong|error occurred" src/ \
|
|
|
156
161
|
--include="*.tsx" --include="*.jsx" 2>/dev/null
|
|
157
162
|
```
|
|
158
163
|
|
|
159
|
-
Flag meaningful images without `alt`, icon-only controls without an accessible name,
|
|
160
|
-
placeholder used as the only label, and generic empty or error copy.
|
|
164
|
+
Flag meaningful images without `alt`, icon-only controls without an accessible name, placeholder-as-only-label, and generic empty or error copy.
|
|
161
165
|
|
|
162
|
-
**aesthetic-slop** (generically AI-default even when pillars pass): the orthogonal
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
166
|
+
**aesthetic-slop** (generically AI-default even when pillars pass): the orthogonal verb-axis
|
|
167
|
+
class from `reference/anti-slop-rubric.md`. `agents/design-auditor.md` scores five axes
|
|
168
|
+
(Directness, Distinctness, Hierarchy, Authenticity, Density, 1-10 each) and routes any finding
|
|
169
|
+
summing below 35 of 50 here as `category: aesthetic-slop`, carrying its `verb_axes_scored`
|
|
170
|
+
values plus matched `reference/visual-tells.md` categories as evidence.
|
|
167
171
|
|
|
168
172
|
### Step 2.5: Pre-Report Gate + confidence
|
|
169
173
|
|
|
@@ -192,12 +196,8 @@ Sort the catalog by `priority` descending. Break ties by visible-delta, then pre
|
|
|
192
196
|
|
|
193
197
|
### Step 4: Write the catalog
|
|
194
198
|
|
|
195
|
-
Create the directory and write the report. Each row suggests a
|
|
196
|
-
the ROADMAP open-question default: pure catalog, no auto-fix.
|
|
197
|
-
|
|
198
|
-
```bash
|
|
199
|
-
mkdir -p .design/debt
|
|
200
|
-
```
|
|
199
|
+
Create the directory (`mkdir -p .design/debt`) and write the report. Each row suggests a
|
|
200
|
+
remediation command per the ROADMAP open-question default: pure catalog, no auto-fix.
|
|
201
201
|
|
|
202
202
|
---
|
|
203
203
|
|
|
@@ -11,6 +11,7 @@ typical-duration-seconds: 60
|
|
|
11
11
|
reads-only: false
|
|
12
12
|
writes:
|
|
13
13
|
- ".design/DESIGN-CONTEXT.md"
|
|
14
|
+
- ".design/context-graph.json"
|
|
14
15
|
---
|
|
15
16
|
|
|
16
17
|
@reference/shared-preamble.md
|
|
@@ -26,6 +27,7 @@ Aggregates outputs from the 5 mappers, discussant decisions, phase-researcher fi
|
|
|
26
27
|
- `.design/map/visual-hierarchy.md` - visual-hierarchy-mapper output
|
|
27
28
|
- `.design/map/a11y.md` - a11y-mapper output
|
|
28
29
|
- `.design/map/motion.md` - motion-mapper output
|
|
30
|
+
- `.design/fragments/*.json` - the typed graph fragments the 5 mappers dual-emit (one per mapper); these feed the graph merge below
|
|
29
31
|
- `.design/STATE.md` - `<decisions>` block (D-XX entries) and `<connections>` block
|
|
30
32
|
- Any phase-researcher output provided in the spawn prompt `<research>` block
|
|
31
33
|
- Pinterest MCP (if `pinterest: available` in STATE.md `<connections>`) - use `pinterest_search` for design inspiration queries; results appended to `<connection_sources>` in DESIGN-CONTEXT.md
|
|
@@ -85,6 +87,30 @@ Use Glob to confirm presence; skip absent files gracefully and mark section as `
|
|
|
85
87
|
---
|
|
86
88
|
```
|
|
87
89
|
|
|
90
|
+
## Graph merge and validation
|
|
91
|
+
|
|
92
|
+
The 5 mappers now dual-emit typed graph fragments to `.design/fragments/<mapper>.json` alongside their `.design/map/*.md`. After they finish, merge those fragments into the typed DesignContext graph, validate it, and derive the human view from it. This runs in addition to the markdown synthesis above (dual-emit, kept for one minor for backward-compat).
|
|
93
|
+
|
|
94
|
+
1. **Merge fragments into the graph.** Invoke the merge engine over every fragment present:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
node scripts/lib/design-context/merge-fragments.mjs .design/fragments/*.json > .design/context-graph.json 2> .design/fragments/merge.stderr
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
`merge-fragments.mjs` dedupes nodes by `id`, recovers or drops dangling edges, and emits the merged Graph (`schema_version`, `generated_at`, `nodes[]`, `edges[]`) per `reference/design-context-schema.md`. Items it could not auto-fix (dropped edges, id collisions it could not reconcile) are written to stderr; keep that stderr for the review pass below.
|
|
101
|
+
|
|
102
|
+
2. **Validate the graph (hard block).** Run the validator and gate on its exit code:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
node scripts/validate-design-context.cjs .design/context-graph.json
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Exit 0 is clean. A non-zero exit is a hard block: do NOT write a `status: complete` DESIGN-CONTEXT.md over a graph that failed validation. Report the validator output and stop, leaving the prior artifact in place. Soft warnings (for example a `summary` equal to its `name`, or a tag near the vocab boundary) are surfaced but do not block.
|
|
109
|
+
|
|
110
|
+
3. **Derive the human view FROM the graph.** Treat `.design/context-graph.json` as the source of truth and render `.design/DESIGN-CONTEXT.md` as an auto-derived view of it. Keep the existing section structure so downstream consumers do not break: `<token_system>` from `token` nodes, `<component_inventory>` from `component`/`variant`/`state` nodes grouped by atomic-design layer tag, `<visual_hierarchy>` from `screen`/`pattern`/`anti-pattern` nodes, `<a11y_baseline>` from `a11y-pattern` nodes, `<motion_system>` from `motion-fragment` nodes, and `<decisions>` from STATE.md as before. Each node's `summary` and `tags[]` populate the rows; edges populate the cross-reference notes (for example which components consume which tokens via `uses-token`).
|
|
111
|
+
|
|
112
|
+
4. **Review pass for could-not-fix items.** Hand the contents of `.design/fragments/merge.stderr` (plus any validator soft-warnings) to an assemble-review pass that cites the offending pattern and proposes a fix back to the owning mapper. Follow the assemble-reviewer pattern used elsewhere in the pipeline for "could not fix" hand-off. A dedicated `assemble-reviewer` agent is a likely future addition for this; do not create or spawn it here. For now, list these items under a `<graph_review>` section in DESIGN-CONTEXT.md so the next cycle can act on them.
|
|
113
|
+
|
|
88
114
|
## Handoff mode
|
|
89
115
|
|
|
90
116
|
Handoff mode activates when `handoff_source` is present in `.design/STATE.md <position>`. In this mode, the synthesizer's primary input is the Claude Design handoff bundle rather than the 5 mapper outputs.
|
|
@@ -163,7 +189,7 @@ Read .design/STATE.md
|
|
|
163
189
|
|
|
164
190
|
Before writing any `.design/` artifact, resolve the main repo root via `scripts/lib/worktree-resolve.cjs` (`resolveDesignRoot`) so a worktree run writes to the main checkout and does not leak.
|
|
165
191
|
|
|
166
|
-
|
|
192
|
+
Two artifacts (dual-emit): `.design/context-graph.json` (the merged, validated typed graph, source of truth) and `.design/DESIGN-CONTEXT.md` (the auto-derived human view of that graph).
|
|
167
193
|
|
|
168
194
|
## Record
|
|
169
195
|
|
package/agents/motion-mapper.md
CHANGED
|
@@ -11,6 +11,7 @@ typical-duration-seconds: 30
|
|
|
11
11
|
reads-only: false
|
|
12
12
|
writes:
|
|
13
13
|
- ".design/map/motion.md"
|
|
14
|
+
- ".design/fragments/motion-mapper.json"
|
|
14
15
|
---
|
|
15
16
|
|
|
16
17
|
@reference/shared-preamble.md
|
|
@@ -25,9 +26,7 @@ You inventory motion and animation patterns. Zero session memory. You do not mod
|
|
|
25
26
|
|
|
26
27
|
- `.design/STATE.md`
|
|
27
28
|
- `reference/motion.md` (if present) - **the motion domain-index (Phase 45): start here.** It indexes the
|
|
28
|
-
motion fragments below with a "use this when" pointer for each. Load a specific fragment ONLY when you
|
|
29
|
-
reach the classification step that needs it (drill-in), not all of them up front - this is the bulk of
|
|
30
|
-
the token saving (the index is ~1.7k tokens vs ~15k for all four fragments).
|
|
29
|
+
motion fragments below with a "use this when" pointer for each. Load a specific fragment ONLY when you reach the classification step that needs it (drill-in), not all of them up front.
|
|
31
30
|
- Drill-in fragments (load on demand, per the index in `motion.md`):
|
|
32
31
|
- `reference/motion-advanced.md` - advanced patterns: spring physics, scroll-driven, FLIP, View Transitions API, gesture/drag mechanics, clip-path patterns, blur crossfades, Framer Motion hardware-accel gotcha
|
|
33
32
|
- `reference/motion-easings.md` - 12 canonical easing presets; classify each detected easing against this catalog
|
|
@@ -91,10 +90,7 @@ grep -rEn "animation-timeline|ScrollTimeline|useScroll\b" src/ | head -30
|
|
|
91
90
|
grep -rEn "\.animate\(\[|WebAnimation|getAnimations" src/ | head -20
|
|
92
91
|
```
|
|
93
92
|
|
|
94
|
-
Classify gesture patterns against `reference/motion-advanced.md` (velocity formula, pointer capture, multi-touch protection).
|
|
95
|
-
Classify easing values against the 12 canonical presets in `reference/motion-easings.md`; output `"custom"` with justification for anything that doesn't match.
|
|
96
|
-
Classify page/route transitions against the 8 families in `reference/motion-transition-taxonomy.md`.
|
|
97
|
-
Classify spring configs against the 4 presets in `reference/motion-spring.md`.
|
|
93
|
+
Classify gesture patterns against `reference/motion-advanced.md` (velocity formula, pointer capture, multi-touch protection), easing values against the 12 presets in `reference/motion-easings.md` (output `"custom"` with justification for anything unmatched), page/route transitions against the 8 families in `reference/motion-transition-taxonomy.md`, and spring configs against the 4 presets in `reference/motion-spring.md`.
|
|
98
94
|
|
|
99
95
|
## Output Format - `.design/map/motion.md`
|
|
100
96
|
|
|
@@ -134,10 +130,12 @@ generated: [ISO 8601]
|
|
|
134
130
|
```
|
|
135
131
|
|
|
136
132
|
## CSS transitions
|
|
133
|
+
|
|
137
134
|
| File | Property | Duration | Easing | Canonical Easing |
|
|
138
135
|
|------|----------|----------|--------|-----------------|
|
|
139
136
|
|
|
140
137
|
## Library usage
|
|
138
|
+
|
|
141
139
|
| Library | Files | Notes |
|
|
142
140
|
|---------|-------|-------|
|
|
143
141
|
|
|
@@ -149,20 +147,20 @@ generated: [ISO 8601]
|
|
|
149
147
|
- Narrative (>800ms): [N]
|
|
150
148
|
|
|
151
149
|
## Easing classification
|
|
150
|
+
|
|
152
151
|
| Detected Easing | Canonical Name | Count | Notes |
|
|
153
152
|
|----------------|---------------|-------|-------|
|
|
154
153
|
|
|
155
154
|
## Advanced patterns detected
|
|
155
|
+
|
|
156
156
|
| Pattern | Files | Notes |
|
|
157
157
|
|---------|-------|-------|
|
|
158
158
|
|
|
159
159
|
## Reduced-motion compliance
|
|
160
|
-
- `prefers-reduced-motion` queries present: [N]
|
|
161
|
-
- Animated components lacking a reduced-motion branch: [list]
|
|
160
|
+
- `prefers-reduced-motion` queries present: [N]; animated components lacking a reduced-motion branch: [list]
|
|
162
161
|
|
|
163
162
|
## Score
|
|
164
|
-
Reduced-motion compliance: [Full | Partial | None]
|
|
165
|
-
Motion consistency: [Consistent | Mixed | Chaotic]
|
|
163
|
+
Reduced-motion compliance: [Full | Partial | None]. Motion consistency: [Consistent | Mixed | Chaotic]
|
|
166
164
|
|
|
167
165
|
## Micro-motion findings
|
|
168
166
|
|
|
@@ -207,12 +205,36 @@ After the standard motion inventory, emit a "Micro-motion findings" section with
|
|
|
207
205
|
Total: N violations found. (0 = clean)
|
|
208
206
|
```
|
|
209
207
|
|
|
210
|
-
If no violations found, emit: `## Micro-motion findings
|
|
208
|
+
If no violations found, emit: `## Micro-motion findings (CLEAN, 0 violations)`
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## Graph fragment emission
|
|
212
|
+
|
|
213
|
+
Dual-emit: keep writing `.design/map/motion.md` above, and ALSO emit a typed graph fragment for the synthesizer to merge into `.design/context-graph.json`. Fragment shape comes from `reference/design-context-schema.md`; allowed `tags[]` come from `reference/design-context-tag-vocab.md`. Do not invent fields or tags outside those references.
|
|
214
|
+
|
|
215
|
+
### 1. Deterministic phase
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
node scripts/lib/design-context/extract-motion.mjs <source_root> [<source_root>...] > .design/fragments/motion-mapper.json
|
|
211
219
|
```
|
|
212
220
|
|
|
221
|
+
`extract-motion.mjs` walks the source roots with regex (zero-dep) and returns a Fragment whose `nodes[]` (`type: motion-fragment`) have `id`, `name`, and a stub `summary` you replace. It maps to the `animations[]` you already inventoried, so reuse that data.
|
|
222
|
+
|
|
223
|
+
### 2. LLM phase (fill summary, tags, complexity)
|
|
224
|
+
|
|
225
|
+
- `summary`: one sentence per node, distinct from `name`. Example: "Toast enter, opacity plus translateY over 180ms".
|
|
226
|
+
- `tags[]`: from the tag-vocab only (motion terms such as `enter`, `exit`, `gesture`, `scroll-driven`, `reduced-motion`). Drop tags not in the vocab.
|
|
227
|
+
- `complexity`: `simple` for a single CSS transition, `moderate` for a library spring or multi-property tween, `complex` for FLIP, scroll-driven, or gesture-physics patterns.
|
|
228
|
+
|
|
229
|
+
Add `transitions-to` edges between fragments that form an enter/exit pair or a route sequence. Set `direction` and `weight` per the schema.
|
|
230
|
+
|
|
231
|
+
### 3. Write the fragment
|
|
232
|
+
|
|
233
|
+
Write the Fragment to `.design/fragments/motion-mapper.json` (`schema_version`, `mapper: "motion-mapper"`, `generated_at` ISO 8601, enriched `nodes[]`, `edges[]`), resolving the main repo root so a worktree run does not leak the file.
|
|
234
|
+
|
|
213
235
|
## Constraints
|
|
214
236
|
|
|
215
|
-
No modifications outside `.design/map/`. No git. No agent spawning.
|
|
237
|
+
No modifications outside `.design/map/` and `.design/fragments/`. No git. No agent spawning.
|
|
216
238
|
|
|
217
239
|
## Record
|
|
218
240
|
|
package/agents/token-mapper.md
CHANGED
|
@@ -11,6 +11,7 @@ typical-duration-seconds: 45
|
|
|
11
11
|
reads-only: false
|
|
12
12
|
writes:
|
|
13
13
|
- ".design/map/tokens.md"
|
|
14
|
+
- ".design/fragments/token-mapper.json"
|
|
14
15
|
---
|
|
15
16
|
|
|
16
17
|
@reference/shared-preamble.md
|
|
@@ -140,9 +141,37 @@ Total: N findings. (0 = clean)
|
|
|
140
141
|
```
|
|
141
142
|
```
|
|
142
143
|
|
|
144
|
+
## Graph fragment emission
|
|
145
|
+
|
|
146
|
+
Dual-emit: keep writing `.design/map/tokens.md` above, and ALSO emit a typed graph fragment so the synthesizer can merge it into `.design/context-graph.json`. Fragment shape and field rules come from `reference/design-context-schema.md`; the allowed `tags[]` come from `reference/design-context-tag-vocab.md`. Do not invent fields or tags outside those two references.
|
|
147
|
+
|
|
148
|
+
### 1. Deterministic phase (structural nodes/edges)
|
|
149
|
+
|
|
150
|
+
Run the matching extractor over the same `<source_roots>` you scanned above:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
node scripts/lib/design-context/extract-tokens.mjs <source_root> [<source_root>...] > .design/fragments/token-mapper.json
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
`extract-tokens.mjs` walks the source roots with regex (zero-dep) and returns a Fragment whose `nodes[]` have `id`, `type` (`token`, subtype color/spacing/typography/radius/shadow), and `name` filled, plus structural `uses-token` edges from consuming files. Each node `summary` arrives as a STUB you must replace.
|
|
157
|
+
|
|
158
|
+
### 2. LLM phase (fill summary, tags, complexity)
|
|
159
|
+
|
|
160
|
+
For every node the extractor produced, set:
|
|
161
|
+
|
|
162
|
+
- `summary`: one sentence describing the token's role, distinct from `name` (a summary equal to the name is a soft-warn in the validator). Example for `--color-primary`: "Brand accent used for primary CTAs and active states".
|
|
163
|
+
- `tags[]`: pick from `reference/design-context-tag-vocab.md` only (for tokens, terms such as `color`, `spacing`, `typography`, `semantic`, `brand`). Drop any tag not in the vocab.
|
|
164
|
+
- `complexity`: `simple` for a single literal value, `moderate` for a token that aliases or composes others (for example a shadow built from a 3-layer formula), `complex` for a token whose value depends on mode/theme resolution.
|
|
165
|
+
|
|
166
|
+
Add cross-token edges you can see that the extractor cannot infer: a semantic token aliasing a primitive is `extends`; a shadow token referencing spacing or color primitives is `uses-token`. Set `direction` and `weight` per the schema.
|
|
167
|
+
|
|
168
|
+
### 3. Write the fragment
|
|
169
|
+
|
|
170
|
+
Write the completed Fragment to `.design/fragments/token-mapper.json` with `schema_version`, `mapper: "token-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.
|
|
171
|
+
|
|
143
172
|
## Constraints
|
|
144
173
|
|
|
145
|
-
You MUST NOT modify anything outside `.design/map/`. Do not run git commands or spawn agents.
|
|
174
|
+
You MUST NOT modify anything outside `.design/map/` and `.design/fragments/`. Do not run git commands or spawn agents.
|
|
146
175
|
|
|
147
176
|
## Record
|
|
148
177
|
|