@hegemonart/get-design-done 1.50.1 → 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 +93 -0
- package/README.md +4 -0
- package/SKILL.md +4 -1
- 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-reflector.md +33 -0
- 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/apply-reflections/SKILL.md +17 -0
- package/dist/claude-code/.claude/skills/context/SKILL.md +137 -0
- package/dist/claude-code/.claude/skills/extract-learnings/SKILL.md +16 -0
- package/dist/claude-code/.claude/skills/instinct/SKILL.md +111 -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/hooks/gdd-decision-injector.js +115 -6
- package/package.json +3 -2
- package/reference/design-context-schema.md +159 -0
- package/reference/design-context-tag-vocab.md +82 -0
- package/reference/instinct-format.md +120 -0
- package/reference/registry.json +21 -0
- package/reference/schemas/design-context.schema.json +130 -0
- package/reference/schemas/events.schema.json +1 -1
- package/reference/schemas/instinct.schema.json +91 -0
- package/reference/schemas/mcp-gdd-tools.schema.json +34 -1
- package/reference/skill-graph.md +4 -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/instinct-store.cjs +677 -0
- package/scripts/lib/manifest/skills.json +24 -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/apply-reflections/SKILL.md +17 -0
- package/skills/context/SKILL.md +137 -0
- package/skills/extract-learnings/SKILL.md +16 -0
- package/skills/instinct/SKILL.md +111 -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,99 @@ 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
|
+
|
|
54
|
+
## [1.51.0] - 2026-06-03
|
|
55
|
+
|
|
56
|
+
### Phase 51 - Instinct-Based Learnings
|
|
57
|
+
|
|
58
|
+
GDD's reflection loop was extractive, not predictive: `/gdd:extract-learnings` wrote a prose `LEARNINGS.md` that no
|
|
59
|
+
downstream agent read. Phase 51 restructures learnings into atomic, confidence-weighted instinct units that are
|
|
60
|
+
queryable, deduplicable, promotable, and surfaced back into agent context. Adapted from ecc's continuous-learning v2
|
|
61
|
+
(project-vs-global scope). Planned and executed via the GSD pipeline (3 parallel executor subagents). No new runtime
|
|
62
|
+
dependency, no new egress.
|
|
63
|
+
|
|
64
|
+
### Breaking changes
|
|
65
|
+
|
|
66
|
+
- **Reflection output gains atomic instinct units.** `design-reflector` now emits a `## Atomic instincts` section
|
|
67
|
+
(YAML units per `reference/instinct-format.md`) alongside a `## Narrative reflection` (dual-emit for one minor
|
|
68
|
+
version), and `/gdd:apply-reflections` gains an `[INSTINCT]` proposal class (accept/reject/defer/edit). Consumers of
|
|
69
|
+
the reflection format should read both sections.
|
|
70
|
+
- **A new instinct store + schema.** `scripts/lib/instinct-store.cjs` is the source of truth (`.design/instincts/instincts.json`
|
|
71
|
+
project + `~/.claude/gdd/global-instincts.json` global); `reference/schemas/instinct.schema.json` is wired into
|
|
72
|
+
`validate:schemas` and enforces the unit shape (confidence 0.3-0.9, domain enum, scope, sha8 project_id).
|
|
73
|
+
|
|
74
|
+
### Added
|
|
75
|
+
|
|
76
|
+
- **`reference/instinct-format.md`** + **`reference/schemas/instinct.schema.json`**: the atomic instinct unit (YAML
|
|
77
|
+
frontmatter `id`/`trigger`/`confidence`/`domain`/`scope`/`project_id`/`source`/`cycles_seen`/`first_seen`/`last_seen`
|
|
78
|
+
with a prose body), the K=2/M=2 promotion gate, the Beta(2,8) prior, and TTL decay.
|
|
79
|
+
- **`scripts/lib/instinct-store.cjs`**: JSON-canonical store with OPTIONAL FTS5 acceleration via
|
|
80
|
+
`probeOptional('better-sqlite3')` (the Phase 19.5 design-search pattern, so no dependency is added). Exports
|
|
81
|
+
`add`/`list`/`query`/`get`/`promote`/`touch`/`decay`/`deriveProjectId`; atomic writes; worktree-safe.
|
|
82
|
+
- **`/gdd:instinct`** skill: `list` / `query "<keyword>"` (FTS5 or in-memory scan) / `promote <id>` (project to global,
|
|
83
|
+
gated on `cycles_seen >= 2` across `>= 2` distinct project ids; user-confirmed).
|
|
84
|
+
- **Decision-injector integration**: `gdd-decision-injector.js` surfaces a top-3 `## Relevant instincts` block in
|
|
85
|
+
agent context (non-fatal; skipped when no store is present).
|
|
86
|
+
- **TTL decay**: instincts not surfaced in 6 cycles decay (`confidence *= 0.9`); below 0.2 they archive. Wired into the
|
|
87
|
+
cleanup sweep. Three `instinct_*` event types seeded into `events.schema.json`. `extract-learnings` dual-emits.
|
|
88
|
+
|
|
89
|
+
### Notes
|
|
90
|
+
|
|
91
|
+
- 6-manifest lockstep at **v1.51.0** + `OFF_CADENCE_VERSIONS.add('1.51.0')` + 37 `manifests-version.txt` baselines.
|
|
92
|
+
Re-locked: skill-list (89), registry (176), phase-42 count (113), the events-schema sha256 snapshot,
|
|
93
|
+
resilience-primitives (40, +instinct-store.cjs), the phase-28.5 distribution + warn count (5 -> 8; apply-reflections
|
|
94
|
+
was trimmed back to <=110), skill-graph regenerated. Tarball golden 912 -> 917 (+5; the cleanup/injector/schema edits
|
|
95
|
+
are same-path).
|
|
96
|
+
- Out of scope: cross-project federation, auto-skill-generation from instincts, embedding-based clustering, cross-runtime sync.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
7
100
|
## [1.50.1] - 2026-06-03
|
|
8
101
|
|
|
9
102
|
### Fixed
|
package/README.md
CHANGED
|
@@ -261,6 +261,10 @@ All 14 runtimes receive their native artifact layout (`skills/`, `command/`, `ag
|
|
|
261
261
|
|
|
262
262
|
**Authoring contract v3 (v1.50.0).** Two additions. A verb-based anti-slop rubric (`reference/anti-slop-rubric.md`) scores five orthogonal axes (Directness, Distinctness, Hierarchy, Authenticity, Density); a sum below 35/50 routes a finding to the debt crawler as `aesthetic-slop`. It rides as a lens-tag on the existing 7-pillar audit, so it catches "generically AI-default" where the pillars catch "wrong". And a machine-parseable skill-composition manifest: optional `composes_with` / `next_skills` frontmatter, a DAG validator (`validate:composition-graph` fails on cycles or dangling refs), and an auto-generated `reference/skill-graph.md`. Skill descriptions move to a multi-paragraph v3 form (`<what>. Use when <triggers>. Activates for requests involving <kw>.`) with both forms accepted during a transition window, a boilerplate-cohort lint, and a `/gdd:new-skill` scaffolder. **No new runtime dependency.**
|
|
263
263
|
|
|
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
|
+
|
|
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
|
+
|
|
264
268
|
Verify with:
|
|
265
269
|
|
|
266
270
|
```
|
package/SKILL.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: get-design-done
|
|
3
3
|
short_name: gdd
|
|
4
4
|
description: "Master design pipeline for Claude Code. 5-stage workflow: Brief → Explore → Plan → Design → Verify. Run 'brief' first in any new project to capture the design problem, then 'explore' to inventory the codebase and interview for context. Invoke without arguments for status and auto-routing."
|
|
5
|
-
argument-hint: "[brief|explore|plan|design|verify|handoff|map|next|help|status|style|darkmode|live|compare|figma-write|graphify|discuss|list-assumptions|progress|health|todo|stats|note|plant-seed|add-backlog|review-backlog|scan|discover|settings|update|reapply-patches|audit|pause|resume|new-cycle|debug|quick|new-project|complete-cycle|fast|do|ship|undo|pr-branch|sketch|sketch-wrap-up|spike|spike-wrap-up|reflect|apply-reflections|analyze-dependencies|extract-learnings|skill-manifest|pin|unpin|list-pins|new-skill|warm-cache|optimize|cache-manager|watch-authorities|check-update|benchmark|recall|timeline|continue|zoom-out]"
|
|
5
|
+
argument-hint: "[brief|explore|plan|design|verify|handoff|map|next|help|status|style|darkmode|live|compare|figma-write|graphify|discuss|list-assumptions|progress|health|todo|stats|note|plant-seed|add-backlog|review-backlog|scan|discover|settings|update|reapply-patches|audit|pause|resume|new-cycle|debug|quick|new-project|complete-cycle|fast|do|ship|undo|pr-branch|sketch|sketch-wrap-up|spike|spike-wrap-up|reflect|apply-reflections|analyze-dependencies|extract-learnings|skill-manifest|pin|unpin|list-pins|new-skill|instinct|warm-cache|optimize|cache-manager|watch-authorities|check-update|benchmark|recall|timeline|continue|zoom-out]"
|
|
6
6
|
user-invocable: true
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -94,6 +94,7 @@ Each stage produces artifacts in `.design/` inside the current project.
|
|
|
94
94
|
| `unpin <skill>` | `get-design-done:gdd-unpin` | Phase 46 - remove pinned aliases for a skill (only files carrying the gdd-pinned-skill marker) |
|
|
95
95
|
| `list-pins` | `get-design-done:gdd-list-pins` | Phase 46 - show pinned aliases per harness with their source skill and last-pinned timestamp |
|
|
96
96
|
| `new-skill <name>` | `get-design-done:gdd-new-skill` | Phase 50 - interactive scaffolder for a new Phase 28.5 + v3-compliant skill (multi-paragraph description, lifecycle stage, optional composes_with); writes source/skills/<name>/SKILL.md |
|
|
97
|
+
| `instinct [list\|query <kw>\|promote <id>]` | `get-design-done:gdd-instinct` | Phase 51 - inspect and manage atomic instinct learning units (project + global stores); list, search by keyword, or promote a vetted project instinct to global once it clears the cross-project gate |
|
|
97
98
|
| `quality-gate` | `get-design-done:quality-gate` | Phase 25 - parallel lint/type/test/visual command runner; classifies failures via quality-gate-runner agent |
|
|
98
99
|
| `turn-closeout` | `get-design-done:turn-closeout` | Phase 25 - Stop-hook mirror skill; finalizes per-turn STATE blocks and emits closeout events |
|
|
99
100
|
| `bandit-status` | `get-design-done:bandit-status` | Phase 27.5 - read-only diagnostic surface for the bandit posterior; per-(agent, bin, delegate, tier) snapshots (alpha, beta, mean, stddev, count, last-used). Use `/gdd:bandit-reset` to mutate. |
|
|
@@ -112,6 +113,8 @@ Each stage produces artifacts in `.design/` inside the current project.
|
|
|
112
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 |
|
|
113
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 |
|
|
114
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 |
|
|
115
118
|
|
|
116
119
|
## Handoff Routing
|
|
117
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
|
|
|
@@ -257,6 +257,39 @@ Append stdout to the cycle markdown body (after Section 8 / before the Proposals
|
|
|
257
257
|
|
|
258
258
|
---
|
|
259
259
|
|
|
260
|
+
## Atomic instincts
|
|
261
|
+
|
|
262
|
+
Phase 51 adds atomic instinct units alongside the prose reflection. For each pattern you observed this cycle that is small enough to state as a single trigger plus a one-line response, emit a structured instinct unit. The narrative below stays for human reading; this section is the machine-readable twin. Both are emitted for one minor version so readers and tooling migrate together.
|
|
263
|
+
|
|
264
|
+
Emit 0 to N units. Each unit follows `reference/instinct-format.md` exactly: YAML frontmatter (`id`, `trigger`, `confidence` from 0.3 to 0.9, `domain` from the format's enum, `scope`, `project_id`, `source`, `cycles_seen`, `first_seen`, `last_seen`) plus a short body. Set `source: design-reflector`. Set `confidence` from the strength of the evidence - a pattern seen once this cycle stays near 0.3 to 0.5; a pattern that recurs across prior learnings earns more. Do not exceed 0.9.
|
|
265
|
+
|
|
266
|
+
A unit is a proposal, not a stored fact. You write the units here; the user accepts them via `{{command_prefix}}apply-reflections` (the `[INSTINCT]` class). Accepted units land in the store through `scripts/lib/instinct-store.cjs` `add(unit, { scope, baseDir })` at the emitted confidence. You never call `add()` yourself and you never write to `.design/instincts/instincts.json` directly.
|
|
267
|
+
|
|
268
|
+
Emit each unit in a fenced `yaml` block so the apply step can parse it:
|
|
269
|
+
|
|
270
|
+
```yaml
|
|
271
|
+
id: in-<short-hash>
|
|
272
|
+
trigger: <one-line condition that should fire this instinct>
|
|
273
|
+
confidence: 0.45
|
|
274
|
+
domain: <enum value from reference/instinct-format.md>
|
|
275
|
+
scope: project
|
|
276
|
+
project_id: <project id from STATE.md or deriveProjectId>
|
|
277
|
+
source: design-reflector
|
|
278
|
+
cycles_seen: 1
|
|
279
|
+
first_seen: <ISO-8601>
|
|
280
|
+
last_seen: <ISO-8601>
|
|
281
|
+
---
|
|
282
|
+
<one or two sentences: the response this instinct recommends and why>
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
If no pattern this cycle is atomic enough to state as a single trigger, write one line: "No atomic instincts this cycle." and move on. Do not pad.
|
|
286
|
+
|
|
287
|
+
### Narrative reflection
|
|
288
|
+
|
|
289
|
+
Keep the prose reflection for human readers. Summarize, in two to four sentences, the through-line of this cycle: what kept recurring, what shifted, and which instinct units above you have the most confidence in. This subsection is what a person skims; the units above are what tooling consumes.
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
260
293
|
## Proposals
|
|
261
294
|
|
|
262
295
|
After all sections, write a **Proposals** section. Number proposals sequentially. Every proposal must include evidence - no vague observations.
|
|
@@ -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
|
|