@hegemonart/get-design-done 1.56.0 → 1.57.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 +45 -0
- package/README.md +2 -0
- package/SKILL.md +1 -0
- package/dist/claude-code/.claude/skills/state/SKILL.md +106 -0
- package/hooks/gdd-fact-force.js +92 -3
- package/package.json +1 -1
- package/reference/skill-graph.md +2 -1
- package/scripts/lib/manifest/skills.json +8 -0
- package/scripts/lib/state/migrate-to-sqlite.cjs +664 -0
- package/scripts/lib/state/query-surface.cjs +391 -0
- package/scripts/lib/state/render-markdown.cjs +717 -0
- package/scripts/lib/state/state-backend.cjs +345 -0
- package/scripts/lib/state/state-store.cjs +735 -0
- package/sdk/cli/index.js +193 -96
- package/sdk/dashboard/data/source.cjs +44 -5
- package/sdk/mcp/gdd-state/server.js +127 -30
- package/sdk/mcp/gdd-state/tools/get.ts +8 -0
- package/sdk/state/index.ts +267 -13
- package/sdk/state/lockfile.ts +48 -0
- package/sdk/state/schema.sql +218 -0
- package/skills/state/SKILL.md +106 -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.57.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.57.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.57.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,51 @@ All notable changes to get-design-done are documented here. Versions follow [sem
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
## [1.57.0] - 2026-06-03
|
|
8
|
+
|
|
9
|
+
### Phase 57 - SQLite State Backbone (Cross-Session Query Layer)
|
|
10
|
+
|
|
11
|
+
GDD project state lives in per-file markdown (STATE.md blocks, recall, instincts). Cross-cycle queries ("every decision
|
|
12
|
+
tagged accessibility across the last five cycles") require fan-out greps and are effectively infeasible. Phase 57 adds an
|
|
13
|
+
opt-in `.design/state.sqlite` as an indexed query layer over that state, while markdown stays the human-editable source of
|
|
14
|
+
truth. It is **built with zero new dependency**: SQLite is reached through the existing opportunistic
|
|
15
|
+
`probeOptional('better-sqlite3')` runtime probe (the same pattern Phase 51 uses for the instinct store), with a guaranteed
|
|
16
|
+
markdown / JS-scan fallback whenever the module is absent. Migration is opt-in (`--migrate-state`) in v1.57.0, dual-writes
|
|
17
|
+
for one minor version, and is fully reversible (`/gdd:state demigrate`). When better-sqlite3 is not installed, GDD behaves
|
|
18
|
+
exactly as before. Planned and executed via the GSD pipeline (3 + 1 + 2 parallel executors with one reconciliation pass).
|
|
19
|
+
|
|
20
|
+
### Breaking changes
|
|
21
|
+
|
|
22
|
+
- **Opt-in SQLite state backbone.** Running `node scripts/lib/state/migrate-to-sqlite.cjs --migrate-state` builds
|
|
23
|
+
`.design/state.sqlite` (14 tables plus FTS5) from your STATE.md. After migration, state mutations dual-write: SQLite is
|
|
24
|
+
the authoritative store and STATE.md is rendered from it byte-for-byte (the existing `gdd-state` `read`/`mutate`/`transition`
|
|
25
|
+
API is unchanged). Without migration, or when better-sqlite3 is absent, nothing changes - markdown stays authoritative.
|
|
26
|
+
Markdown is always human-editable; a hand-edit is detected on the next write and folded back into SQLite.
|
|
27
|
+
- **New `/gdd:state` skill** with three subcommands: `query "<sql>"` (engine-level read-only SELECT over the
|
|
28
|
+
decisions/blockers/plans tables), `recover` (rebuild a corrupt `state.sqlite` from markdown), and `demigrate` (drop
|
|
29
|
+
`state.sqlite` and fall back to the markdown-only source of truth).
|
|
30
|
+
|
|
31
|
+
### Added
|
|
32
|
+
|
|
33
|
+
- **`scripts/lib/state/`** - `state-backend.cjs` (`probeOptional('better-sqlite3')` + FTS5 probe -> `{Database, BACKEND}`;
|
|
34
|
+
WAL / busy_timeout / foreign_keys pragmas; engine-level readonly opens), `state-store.cjs` (dual-backend dispatch; the
|
|
35
|
+
SQLite-authoritative -> render-markdown -> write-STATE.md transaction; hand-edit freshness guard), `migrate-to-sqlite.cjs`
|
|
36
|
+
(idempotent UPSERT migration, `--migrate-state` opt-in, `--dry-run`), `render-markdown.cjs` (byte-equal STATE.md
|
|
37
|
+
reconstruction from SQLite via the proven serializer), `query-surface.cjs` (readonly SQL + first-token denylist, recover,
|
|
38
|
+
demigrate, cap-10 `.bak` rotation).
|
|
39
|
+
- **`sdk/state/schema.sql`** - 14 tables (state_position, decisions, blockers, must_haves, plans, findings, design_debt,
|
|
40
|
+
recall_records, instincts, sessions, worktree_state, conflict_incidents, plus `_meta`/`_block_meta`) with FTS5 virtual
|
|
41
|
+
tables on decisions/findings/recall/instincts.
|
|
42
|
+
- **Consumers read SQLite when migrated** - `gdd_state__get` and the dashboard data plane read SQLite-direct (markdown
|
|
43
|
+
scrape fallback; the MCP tool schema is unchanged), and the Phase 56 fact-force gate gains an FTS5 tier-0 lookup with the
|
|
44
|
+
grep fallback intact.
|
|
45
|
+
|
|
46
|
+
### Changed
|
|
47
|
+
|
|
48
|
+
- **`sdk/state/index.ts`** routes `read`/`mutate`/`transition` through the SQLite dual-write path only when migration is
|
|
49
|
+
active for the resolved state file (a sibling `state.sqlite` exists); otherwise the markdown path runs byte-identically.
|
|
50
|
+
The new SQLite sibling lock (`state.sqlite.lock`) is always acquired before `STATE.md.lock`.
|
|
51
|
+
|
|
7
52
|
## [1.56.0] - 2026-06-03
|
|
8
53
|
|
|
9
54
|
### Phase 56 - Risk-Scoring + Fact-Forcing Gate (Quantified Action Confidence)
|
package/README.md
CHANGED
|
@@ -273,6 +273,8 @@ All 14 runtimes receive their native artifact layout (`skills/`, `command/`, `ag
|
|
|
273
273
|
|
|
274
274
|
**Risk-scoring and fact-forcing gate (v1.56.0).** Writer actions now carry a quantified risk score instead of a binary allow/deny. A pure, deterministic scorer (`scripts/lib/risk/compute-risk.cjs`, frozen tables, no I/O) grades each Write / Edit / MultiEdit / Bash by tool, file sensitivity, and input shape, then two PreToolUse hooks act on it: `gdd-risk-gate.js` emits a `risk_assessment` event and blocks only the genuinely dangerous actions (destructive bash, high-sensitivity-file rewrites at or above 0.85), while `gdd-fact-force.js` holds the first write to a file until its DesignContext consumers and recorded decisions have actually been read this session. The fact-force hold is soft and softens to a warning when the Phase 52 graph is absent, so greenfield projects are never over-blocked. `/gdd:override` clears a block or a fact-force hold with an approver and reason (audit-trailed as a `D-XX` override decision), and `design-fixer` routes findings by confidence times risk. **Built dep-free** (a maintainer decision: a pure scorer plus static tables, no ML). **No new runtime dependency.**
|
|
275
275
|
|
|
276
|
+
**SQLite state backbone (v1.57.0).** Project state (decisions, blockers, plans, findings, recall, instincts) lives in per-file markdown, which makes cross-cycle queries ("every accessibility decision across the last five cycles") infeasible. Phase 57 adds an opt-in `.design/state.sqlite` as an indexed query layer while markdown stays the human-editable source of truth. It is **built with zero new dependency**: SQLite is reached through the existing opportunistic `probeOptional('better-sqlite3')` runtime probe (the Phase 51 pattern), with a guaranteed markdown / JS-scan fallback whenever the module is absent. Run `migrate-to-sqlite.cjs --migrate-state` to build the database (14 tables plus FTS5); afterwards state mutations dual-write (SQLite authoritative, STATE.md rendered from it byte-for-byte) while the `gdd-state` read/mutate/transition API is unchanged. `/gdd:state query "<sql>"` runs read-only SELECTs (engine-level readonly), `/gdd:state recover` rebuilds a corrupt database from markdown, and `/gdd:state demigrate` reverts to markdown-only. When better-sqlite3 is not installed, GDD behaves exactly as before. **No new runtime dependency.**
|
|
277
|
+
|
|
276
278
|
Verify with:
|
|
277
279
|
|
|
278
280
|
```
|
package/SKILL.md
CHANGED
|
@@ -117,6 +117,7 @@ Each stage produces artifacts in `.design/` inside the current project.
|
|
|
117
117
|
| `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 |
|
|
118
118
|
| `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 |
|
|
119
119
|
| `override <finding-id \| factforce <path>> [--approver <who>] [--reason <text>]` | `get-design-done:gdd-override` | Phase 56 - escalation surface for a risk-gate block or a first-write fact-force hold; with an approver and reason, writes a `D-XX` override-tagged decision (audit trail) for a blocked finding, or clears the fact-force `checked[path]` lock for a path you have legitimately reviewed. Mirrors unlock-decision; never overrides silently |
|
|
120
|
+
| `state <query "<sql>" \| recover \| demigrate>` | `get-design-done:gdd-state` | Phase 57 - operate the opt-in SQLite state backbone: `query` runs a read-only SELECT over the decisions/blockers/plans tables (engine-level readonly), `recover` rebuilds a corrupt `state.sqlite` from the markdown STATE.md, `demigrate` removes `state.sqlite` to fall back to the markdown-only source of truth. Markdown stays the human-editable SoT; SQLite is opportunistic and reversible |
|
|
120
121
|
|
|
121
122
|
## Handoff Routing
|
|
122
123
|
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gdd-state
|
|
3
|
+
description: "Query, recover, or roll back the Phase 57 SQLite state backbone. Use when you need to inspect the decisions/blockers/plans tables with a raw SELECT, rebuild a corrupt state.sqlite from the markdown STATE.md, or revert to the markdown-only source of truth by removing state.sqlite. Activates for requests involving querying the SQLite state database, recovering from SQLite corruption, or reverting the migration (demigrate)."
|
|
4
|
+
argument-hint: "<query \"<sql>\" | recover | demigrate>"
|
|
5
|
+
user-invocable: true
|
|
6
|
+
tools: Read, Bash, Grep, Glob
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# /gdd:state
|
|
10
|
+
|
|
11
|
+
The Phase 57 SQLite state backbone is opt-in (`--migrate-state`) and fully reversible.
|
|
12
|
+
Markdown `.design/STATE.md` is always the human-editable SoT; SQLite is a faster query
|
|
13
|
+
layer derived from it. This skill exposes three subcommands for operating on that layer.
|
|
14
|
+
|
|
15
|
+
## Subcommands
|
|
16
|
+
|
|
17
|
+
| Subcommand | What it does |
|
|
18
|
+
|---|---|
|
|
19
|
+
| `/gdd:state query "<sql>"` | Run a read-only SELECT against `.design/state.sqlite`. |
|
|
20
|
+
| `/gdd:state recover` | Rotate the current sqlite to a `.bak` and rebuild from markdown. |
|
|
21
|
+
| `/gdd:state demigrate` | Remove `.design/state.sqlite`; markdown becomes the SoT again. |
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## query
|
|
26
|
+
|
|
27
|
+
Execute a read-only SELECT against the state database.
|
|
28
|
+
|
|
29
|
+
The engine opens the file with `readonly:true` so all writes are rejected at the
|
|
30
|
+
engine level. A first-token denylist (Set membership, no regex) additionally blocks
|
|
31
|
+
DROP, DELETE, UPDATE, INSERT, ALTER, ATTACH, CREATE, PRAGMA, VACUUM, ANALYZE,
|
|
32
|
+
REINDEX, and REPLACE before the connection is opened.
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
node -e '
|
|
36
|
+
const qs = require("./scripts/lib/state/query-surface.cjs");
|
|
37
|
+
const result = qs.query(process.argv[1], { projectRoot: process.cwd() });
|
|
38
|
+
console.log(JSON.stringify(result, null, 2));
|
|
39
|
+
' "<sql>"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Outputs `{ rows: [...], backend: "sqlite" }` on success, or
|
|
43
|
+
`{ degraded: true, message: "..." }` when SQLite is not active.
|
|
44
|
+
|
|
45
|
+
Degrades gracefully (no throw) when `BACKEND==='markdown'` or when
|
|
46
|
+
`.design/state.sqlite` has not been created yet (run `--migrate-state` first).
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## recover
|
|
51
|
+
|
|
52
|
+
Rotate the current (possibly corrupt) `.design/state.sqlite` to `.bak.0`, then
|
|
53
|
+
rebuild a fresh database from the markdown `.design/STATE.md` using
|
|
54
|
+
`migrate-to-sqlite.cjs` in force mode. Runs `PRAGMA integrity_check` on the
|
|
55
|
+
result and reports the outcome.
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
node -e '
|
|
59
|
+
const qs = require("./scripts/lib/state/query-surface.cjs");
|
|
60
|
+
const result = qs.recover({ projectRoot: process.cwd() });
|
|
61
|
+
console.log(JSON.stringify(result, null, 2));
|
|
62
|
+
'
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Outputs `{ recovered: true, integrity: true, message: "..." }` on success.
|
|
66
|
+
|
|
67
|
+
Backup rotation keeps at most 10 files (`.bak.0` through `.bak.9`). The oldest
|
|
68
|
+
backup is overwritten when the cap is reached.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## demigrate
|
|
73
|
+
|
|
74
|
+
Remove `.design/state.sqlite` so the markdown `STATE.md` becomes the SoT again.
|
|
75
|
+
Idempotent: if the file does not exist, returns a clear no-op message without error.
|
|
76
|
+
A backup is taken in `.bak.0` before removal.
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
node -e '
|
|
80
|
+
const qs = require("./scripts/lib/state/query-surface.cjs");
|
|
81
|
+
const result = qs.demigrate({ projectRoot: process.cwd() });
|
|
82
|
+
console.log(JSON.stringify(result, null, 2));
|
|
83
|
+
'
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Outputs `{ demigrated: true, message: "..." }` when the file was removed, or
|
|
87
|
+
`{ demigrated: false, message: "..." }` when it was already absent (no-op).
|
|
88
|
+
|
|
89
|
+
To re-enable SQLite after a demigrate, run `--migrate-state` again.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Key design decisions
|
|
94
|
+
|
|
95
|
+
- **Markdown is always the SoT.** SQLite is opt-in via `--migrate-state` and
|
|
96
|
+
reversible via `demigrate`. The markdown file is never silently overwritten.
|
|
97
|
+
- **Read-only queries only.** The `query` subcommand enforces SELECT-only via both
|
|
98
|
+
the engine (`readonly:true`) and a defense-in-depth denylist. No writes
|
|
99
|
+
are possible through this skill.
|
|
100
|
+
- **Backup rotation cap.** `rotateBak` shifts `.bak.0..8` up by one index and caps
|
|
101
|
+
at `.bak.9` (10 files total). The oldest backup is overwritten automatically.
|
|
102
|
+
- **Graceful degradation.** All subcommands return a clear `{ degraded, message }`
|
|
103
|
+
object (no throw) when `better-sqlite3` is not installed or when
|
|
104
|
+
`GDD_STATE_BACKEND=markdown` is set.
|
|
105
|
+
|
|
106
|
+
## STATE COMPLETE
|
package/hooks/gdd-fact-force.js
CHANGED
|
@@ -148,13 +148,102 @@ function decisionSources(cwd) {
|
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
/**
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
|
|
151
|
+
* Lazy-require state-store.cjs (Phase 57 dual-backend layer).
|
|
152
|
+
* Returns null if not yet available (degrade to grep).
|
|
153
|
+
*/
|
|
154
|
+
function _requireStateStore() {
|
|
155
|
+
try {
|
|
156
|
+
const candidates = [
|
|
157
|
+
path.join(__dirname, '..', 'scripts', 'lib', 'state', 'state-store.cjs'),
|
|
158
|
+
];
|
|
159
|
+
const root = findPackageRoot(__dirname);
|
|
160
|
+
if (root) candidates.push(path.join(root, 'scripts', 'lib', 'state', 'state-store.cjs'));
|
|
161
|
+
for (const c of candidates) {
|
|
162
|
+
try {
|
|
163
|
+
const m = require(c);
|
|
164
|
+
if (m && typeof m.queryDecisions === 'function') return m;
|
|
165
|
+
} catch { /* try next */ }
|
|
166
|
+
}
|
|
167
|
+
} catch { /* never throw */ }
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Lazy-require state-backend.cjs to check if migration is active.
|
|
173
|
+
* Migration is active when BACKEND==='sqlite' AND the sibling .design/state.sqlite exists.
|
|
174
|
+
*/
|
|
175
|
+
function _isMigrationActive(cwd) {
|
|
176
|
+
try {
|
|
177
|
+
const candidates = [
|
|
178
|
+
path.join(__dirname, '..', 'scripts', 'lib', 'state', 'state-backend.cjs'),
|
|
179
|
+
];
|
|
180
|
+
const root = findPackageRoot(__dirname);
|
|
181
|
+
if (root) candidates.push(path.join(root, 'scripts', 'lib', 'state', 'state-backend.cjs'));
|
|
182
|
+
let backend = null;
|
|
183
|
+
for (const c of candidates) {
|
|
184
|
+
try {
|
|
185
|
+
const m = require(c);
|
|
186
|
+
if (m && typeof m.BACKEND === 'string' && typeof m.sqlitePath === 'function') {
|
|
187
|
+
backend = m;
|
|
188
|
+
break;
|
|
189
|
+
}
|
|
190
|
+
} catch { /* try next */ }
|
|
191
|
+
}
|
|
192
|
+
if (!backend || backend.BACKEND !== 'sqlite') return false;
|
|
193
|
+
// Verify that the sibling .design/state.sqlite actually exists (migration-active gate).
|
|
194
|
+
const dbPath = backend.sqlitePath(cwd);
|
|
195
|
+
return fs.existsSync(dbPath);
|
|
196
|
+
} catch {
|
|
197
|
+
return false;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Does any decision/blocker line mention this file?
|
|
203
|
+
*
|
|
204
|
+
* When migration is active (BACKEND==='sqlite' AND .design/state.sqlite exists):
|
|
205
|
+
* - Tier-0: query state-store.cjs queryDecisions(term) for each search term.
|
|
206
|
+
* Falls back to grep if the store query throws.
|
|
207
|
+
* When migration is NOT active (default, un-migrated):
|
|
208
|
+
* - Substring grep over STATE.md/CYCLES.md/LEARNINGS.md (UNCHANGED).
|
|
209
|
+
*
|
|
210
|
+
* Returns { found:boolean, where:string|null }.
|
|
211
|
+
* The return shape and the soften-if-absent behavior are UNCHANGED.
|
|
154
212
|
*/
|
|
155
213
|
function decisionMentions(cwd, relPath) {
|
|
156
214
|
const basename = path.basename(relPath);
|
|
157
215
|
const terms = Array.from(new Set([basename, relPath].filter(Boolean)));
|
|
216
|
+
|
|
217
|
+
// Tier-0: FTS5 path (migration-active only).
|
|
218
|
+
if (_isMigrationActive(cwd)) {
|
|
219
|
+
const store = _requireStateStore();
|
|
220
|
+
if (store) {
|
|
221
|
+
try {
|
|
222
|
+
for (const t of terms) {
|
|
223
|
+
if (!t) continue;
|
|
224
|
+
const rows = store.queryDecisions(t, { projectRoot: cwd, limit: 1 });
|
|
225
|
+
if (Array.isArray(rows) && rows.length > 0) {
|
|
226
|
+
return { found: true, where: 'state.sqlite' };
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
// FTS5 returned no matches; check blockers via getBlockers substring.
|
|
230
|
+
const blockers = store.getBlockers ? store.getBlockers({ projectRoot: cwd }) : [];
|
|
231
|
+
if (Array.isArray(blockers) && blockers.length > 0) {
|
|
232
|
+
for (const b of blockers) {
|
|
233
|
+
const body = (b.body_md || b.raw_line || '');
|
|
234
|
+
for (const t of terms) {
|
|
235
|
+
if (t && body.includes(t)) return { found: true, where: 'state.sqlite' };
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
return { found: false, where: null };
|
|
240
|
+
} catch {
|
|
241
|
+
// FTS5 query failed: fall through to grep.
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// Tier-1 (always-on fallback): substring grep over canonical docs.
|
|
158
247
|
for (const src of decisionSources(cwd)) {
|
|
159
248
|
let content;
|
|
160
249
|
try { content = fs.readFileSync(src, 'utf8'); } catch { continue; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hegemonart/get-design-done",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.57.0",
|
|
4
4
|
"description": "A design-quality pipeline for AI coding agents: brief, plan, implement, and verify UI work against your design system.",
|
|
5
5
|
"author": "Hegemon",
|
|
6
6
|
"homepage": "https://github.com/hegemonart/get-design-done",
|
package/reference/skill-graph.md
CHANGED
|
@@ -9,7 +9,7 @@ is a `composes_with` edge (the source calls the target as sub-orchestration); a
|
|
|
9
9
|
a `next_skills` edge (a pipeline hint for what runs next). Stage grouping is best-effort and
|
|
10
10
|
inferred from the skill name; skills with no stage keyword fall under Utility.
|
|
11
11
|
|
|
12
|
-
Skills:
|
|
12
|
+
Skills: 94. Composition edges: 0 composes_with, 6 next_skills.
|
|
13
13
|
|
|
14
14
|
```mermaid
|
|
15
15
|
flowchart TD
|
|
@@ -108,6 +108,7 @@ flowchart TD
|
|
|
108
108
|
n_settings["settings"]
|
|
109
109
|
n_ship["ship"]
|
|
110
110
|
n_skill_manifest["skill-manifest"]
|
|
111
|
+
n_state["state"]
|
|
111
112
|
n_stats["stats"]
|
|
112
113
|
n_style["style"]
|
|
113
114
|
n_synthesize["synthesize"]
|
|
@@ -542,6 +542,14 @@
|
|
|
542
542
|
"tools": "Read, Grep, Glob, Bash, Write, Task",
|
|
543
543
|
"disable_model_invocation": true
|
|
544
544
|
},
|
|
545
|
+
{
|
|
546
|
+
"name": "state",
|
|
547
|
+
"description": "Query, recover, or roll back the Phase 57 SQLite state backbone. Use when you need to inspect the decisions/blockers/plans tables with a raw SELECT, rebuild a corrupt state.sqlite from the markdown STATE.md, or revert to the markdown-only source of truth by removing state.sqlite. Activates for requests involving querying the SQLite state database, recovering from SQLite corruption, or reverting the migration (demigrate).",
|
|
548
|
+
"argument_hint": "<query \"<sql>\" | recover | demigrate>",
|
|
549
|
+
"user_invocable": true,
|
|
550
|
+
"tools": "Read, Bash, Grep, Glob",
|
|
551
|
+
"registered_in_phase": "57"
|
|
552
|
+
},
|
|
545
553
|
{
|
|
546
554
|
"name": "stats",
|
|
547
555
|
"description": "Cycle stats - decisions made, tasks completed, commits, timeline, git metrics.",
|