@hegemonart/get-design-done 1.19.6 → 1.21.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 +11 -14
- package/.claude-plugin/plugin.json +9 -32
- package/CHANGELOG.md +138 -0
- package/README.md +54 -1
- package/agents/design-reflector.md +13 -0
- package/bin/gdd-sdk +55 -0
- package/connections/connections.md +3 -0
- package/connections/figma.md +2 -0
- package/connections/gdd-state.md +186 -0
- package/hooks/budget-enforcer.ts +716 -0
- package/hooks/context-exhaustion.ts +251 -0
- package/hooks/gdd-read-injection-scanner.ts +172 -0
- package/hooks/hooks.json +3 -3
- package/package.json +32 -51
- package/reference/codex-tools.md +53 -0
- package/reference/config-schema.md +2 -2
- package/reference/error-recovery.md +58 -0
- package/reference/gemini-tools.md +53 -0
- package/reference/registry.json +21 -0
- package/reference/schemas/budget.schema.json +42 -0
- package/reference/schemas/events.schema.json +55 -0
- package/reference/schemas/generated.d.ts +419 -0
- package/reference/schemas/iteration-budget.schema.json +36 -0
- package/reference/schemas/mcp-gdd-state-tools.schema.json +89 -0
- package/reference/schemas/rate-limits.schema.json +31 -0
- package/scripts/aggregate-agent-metrics.ts +282 -0
- package/scripts/codegen-schema-types.ts +149 -0
- package/scripts/e2e/run-headless.ts +514 -0
- package/scripts/lib/cli/commands/audit.ts +382 -0
- package/scripts/lib/cli/commands/init.ts +217 -0
- package/scripts/lib/cli/commands/query.ts +329 -0
- package/scripts/lib/cli/commands/run.ts +656 -0
- package/scripts/lib/cli/commands/stage.ts +468 -0
- package/scripts/lib/cli/index.ts +167 -0
- package/scripts/lib/cli/parse-args.ts +336 -0
- package/scripts/lib/context-engine/index.ts +116 -0
- package/scripts/lib/context-engine/manifest.ts +69 -0
- package/scripts/lib/context-engine/truncate.ts +282 -0
- package/scripts/lib/context-engine/types.ts +59 -0
- package/scripts/lib/discuss-parallel-runner/aggregator.ts +448 -0
- package/scripts/lib/discuss-parallel-runner/discussants.ts +430 -0
- package/scripts/lib/discuss-parallel-runner/index.ts +223 -0
- package/scripts/lib/discuss-parallel-runner/types.ts +184 -0
- package/scripts/lib/error-classifier.cjs +232 -0
- package/scripts/lib/error-classifier.d.cts +44 -0
- package/scripts/lib/event-stream/emitter.ts +88 -0
- package/scripts/lib/event-stream/index.ts +164 -0
- package/scripts/lib/event-stream/types.ts +127 -0
- package/scripts/lib/event-stream/writer.ts +154 -0
- package/scripts/lib/explore-parallel-runner/index.ts +294 -0
- package/scripts/lib/explore-parallel-runner/mappers.ts +290 -0
- package/scripts/lib/explore-parallel-runner/synthesizer.ts +295 -0
- package/scripts/lib/explore-parallel-runner/types.ts +139 -0
- package/scripts/lib/gdd-errors/classification.ts +124 -0
- package/scripts/lib/gdd-errors/index.ts +218 -0
- package/scripts/lib/gdd-state/gates.ts +216 -0
- package/scripts/lib/gdd-state/index.ts +167 -0
- package/scripts/lib/gdd-state/lockfile.ts +232 -0
- package/scripts/lib/gdd-state/mutator.ts +574 -0
- package/scripts/lib/gdd-state/parser.ts +523 -0
- package/scripts/lib/gdd-state/types.ts +179 -0
- package/scripts/lib/harness/detect.ts +90 -0
- package/scripts/lib/harness/index.ts +64 -0
- package/scripts/lib/harness/tool-map.ts +142 -0
- package/scripts/lib/init-runner/index.ts +396 -0
- package/scripts/lib/init-runner/researchers.ts +245 -0
- package/scripts/lib/init-runner/scaffold.ts +224 -0
- package/scripts/lib/init-runner/synthesizer.ts +224 -0
- package/scripts/lib/init-runner/types.ts +143 -0
- package/scripts/lib/iteration-budget.cjs +205 -0
- package/scripts/lib/iteration-budget.d.cts +32 -0
- package/scripts/lib/jittered-backoff.cjs +112 -0
- package/scripts/lib/jittered-backoff.d.cts +38 -0
- package/scripts/lib/lockfile.cjs +177 -0
- package/scripts/lib/lockfile.d.cts +21 -0
- package/scripts/lib/logger/index.ts +251 -0
- package/scripts/lib/logger/sinks.ts +269 -0
- package/scripts/lib/logger/types.ts +110 -0
- package/scripts/lib/pipeline-runner/human-gate.ts +134 -0
- package/scripts/lib/pipeline-runner/index.ts +527 -0
- package/scripts/lib/pipeline-runner/stage-handlers.ts +339 -0
- package/scripts/lib/pipeline-runner/state-machine.ts +144 -0
- package/scripts/lib/pipeline-runner/types.ts +183 -0
- package/scripts/lib/prompt-sanitizer/index.ts +435 -0
- package/scripts/lib/prompt-sanitizer/patterns.ts +173 -0
- package/scripts/lib/rate-guard.cjs +365 -0
- package/scripts/lib/rate-guard.d.cts +38 -0
- package/scripts/lib/session-runner/errors.ts +406 -0
- package/scripts/lib/session-runner/index.ts +715 -0
- package/scripts/lib/session-runner/transcript.ts +189 -0
- package/scripts/lib/session-runner/types.ts +144 -0
- package/scripts/lib/tool-scoping/index.ts +219 -0
- package/scripts/lib/tool-scoping/parse-agent-tools.ts +207 -0
- package/scripts/lib/tool-scoping/stage-scopes.ts +139 -0
- package/scripts/lib/tool-scoping/types.ts +77 -0
- package/scripts/mcp-servers/gdd-state/schemas/add_blocker.schema.json +67 -0
- package/scripts/mcp-servers/gdd-state/schemas/add_decision.schema.json +68 -0
- package/scripts/mcp-servers/gdd-state/schemas/add_must_have.schema.json +68 -0
- package/scripts/mcp-servers/gdd-state/schemas/checkpoint.schema.json +51 -0
- package/scripts/mcp-servers/gdd-state/schemas/frontmatter_update.schema.json +62 -0
- package/scripts/mcp-servers/gdd-state/schemas/get.schema.json +51 -0
- package/scripts/mcp-servers/gdd-state/schemas/probe_connections.schema.json +75 -0
- package/scripts/mcp-servers/gdd-state/schemas/resolve_blocker.schema.json +66 -0
- package/scripts/mcp-servers/gdd-state/schemas/set_status.schema.json +47 -0
- package/scripts/mcp-servers/gdd-state/schemas/transition_stage.schema.json +70 -0
- package/scripts/mcp-servers/gdd-state/schemas/update_progress.schema.json +58 -0
- package/scripts/mcp-servers/gdd-state/server.ts +288 -0
- package/scripts/mcp-servers/gdd-state/tools/add_blocker.ts +72 -0
- package/scripts/mcp-servers/gdd-state/tools/add_decision.ts +89 -0
- package/scripts/mcp-servers/gdd-state/tools/add_must_have.ts +113 -0
- package/scripts/mcp-servers/gdd-state/tools/checkpoint.ts +60 -0
- package/scripts/mcp-servers/gdd-state/tools/frontmatter_update.ts +91 -0
- package/scripts/mcp-servers/gdd-state/tools/get.ts +51 -0
- package/scripts/mcp-servers/gdd-state/tools/index.ts +51 -0
- package/scripts/mcp-servers/gdd-state/tools/probe_connections.ts +73 -0
- package/scripts/mcp-servers/gdd-state/tools/resolve_blocker.ts +84 -0
- package/scripts/mcp-servers/gdd-state/tools/set_status.ts +54 -0
- package/scripts/mcp-servers/gdd-state/tools/shared.ts +194 -0
- package/scripts/mcp-servers/gdd-state/tools/transition_stage.ts +80 -0
- package/scripts/mcp-servers/gdd-state/tools/update_progress.ts +81 -0
- package/scripts/validate-frontmatter.ts +114 -0
- package/scripts/validate-schemas.ts +401 -0
- package/skills/brief/SKILL.md +15 -6
- package/skills/design/SKILL.md +31 -13
- package/skills/explore/SKILL.md +41 -17
- package/skills/health/SKILL.md +15 -4
- package/skills/optimize/SKILL.md +3 -3
- package/skills/pause/SKILL.md +16 -10
- package/skills/plan/SKILL.md +33 -17
- package/skills/progress/SKILL.md +15 -11
- package/skills/resume/SKILL.md +19 -10
- package/skills/settings/SKILL.md +11 -3
- package/skills/todo/SKILL.md +12 -3
- package/skills/verify/SKILL.md +65 -29
- package/hooks/budget-enforcer.js +0 -329
- package/hooks/context-exhaustion.js +0 -127
- package/hooks/gdd-read-injection-scanner.js +0 -39
- package/scripts/aggregate-agent-metrics.js +0 -173
- package/scripts/validate-frontmatter.cjs +0 -68
- package/scripts/validate-schemas.cjs +0 -242
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Error recovery
|
|
2
|
+
|
|
3
|
+
This is the recovery-action protocol for low-level errors inside the GDD pipeline. It sits on top of `scripts/lib/error-classifier.cjs` (Plan 20-14) and references the rate-guard, jittered-backoff, and iteration-budget primitives.
|
|
4
|
+
|
|
5
|
+
## Recovery protocol
|
|
6
|
+
|
|
7
|
+
On `status=413` or `context_overflow`, re-emit with compressed context (drop oldest non-system turns, target 50% reduction, retry once).
|
|
8
|
+
|
|
9
|
+
On `status=429`, consult `scripts/lib/rate-guard.cjs` → `blockUntilReady(provider)` before retry.
|
|
10
|
+
|
|
11
|
+
On network-transient (5xx, ECONNRESET), use jittered backoff (`scripts/lib/jittered-backoff.cjs`); max 3 retries.
|
|
12
|
+
|
|
13
|
+
On auth-error, surface to user — do not retry.
|
|
14
|
+
|
|
15
|
+
## Recovery-action table
|
|
16
|
+
|
|
17
|
+
The `FailoverReason` enum in `scripts/lib/error-classifier.cjs` has eight values. Each row below is the canonical recovery action for one of those values. The classifier's `suggestedAction` field returns a one-liner drawn from this table; this doc is the authoritative long form.
|
|
18
|
+
|
|
19
|
+
| FailoverReason | Retryable | Action |
|
|
20
|
+
| ------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
21
|
+
| `rate_limited` | yes | Call `rate-guard.ingestHeaders(provider, response.headers)` to record the rate-limit signal, then `rate-guard.blockUntilReady(provider)` before retrying. The blocker waits until `resetAt` on disk — synchronized siblings (watch-authorities + update-check) therefore share the backoff boundary. After the block returns, retry with jittered backoff at attempt 0. |
|
|
22
|
+
| `context_overflow` | yes | Compress context — drop the oldest non-system turns (or the oldest attachments) targeting roughly 50 % token reduction. Retry **once** with the compressed payload. If the retry also raises `context_overflow`, escalate to the user as an unrecoverable block — further compression destroys information. |
|
|
23
|
+
| `auth_error` | no | Surface the error to the user with actionable text: which credential, which provider, and the renewal path (OAuth re-auth URL, API-key environment variable, etc.). Do not retry automatically — a loop would just multiply the failure. |
|
|
24
|
+
| `network_transient` | yes | Retry with `scripts/lib/jittered-backoff.cjs` — `await sleep(attempt)` inside a bounded loop. Cap at 3 attempts before giving up. When retries exhaust, reclassify as `network_permanent` and surface to the user. |
|
|
25
|
+
| `network_permanent` | no | Surface to user. The endpoint is wrong, DNS is broken, or the resource was removed. A retry without operator action will just re-fail. |
|
|
26
|
+
| `tool_not_found` | no | Surface to user. Either the tool name drifted (common for MCP servers whose prefixes change across sessions) or the MCP is not registered. Reprobe via the connection's probe sequence before retrying anything. |
|
|
27
|
+
| `validation` | no | Surface the validation detail to the caller. Do not retry the same input — 4xx is the server saying "your payload is wrong". Fixing the payload is caller work. |
|
|
28
|
+
| `unknown` | no | Surface the raw error to the user. Do not retry — we can't tell whether it's safe. Add a telemetry row so we can tighten the classifier over time. |
|
|
29
|
+
|
|
30
|
+
## Integration points
|
|
31
|
+
|
|
32
|
+
| Caller | When to classify | What to do with `reason` |
|
|
33
|
+
| ------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
|
|
34
|
+
| `hooks/budget-enforcer.ts` | pre-spawn rate-guard check (Plan 20-14) | If upstream state already shows `rate_limited`, emit `decision: 'rate-limited'` and short-circuit before any spawn. |
|
|
35
|
+
| Figma MCP probe | live `get_metadata` call errors | `network_transient` → jittered-backoff retry. `auth_error` → STOP with a reauth note. `rate_limited` → block then retry. |
|
|
36
|
+
| Watch-authorities fetcher | per-feed HTTP fetch | Same policy as Figma probe; `validation` also possible on ETag stalemate (304). |
|
|
37
|
+
| Update-check HTTP curl | GitHub `releases/latest` fetch | Silent failure by D-04 of Plan 13.3 — classify but don't surface; log and exit 0. |
|
|
38
|
+
| MCP transport | tool-call errors (gdd-state, figma, 21st-dev)| Map `tool_not_found` to a probe-reissue; map `auth_error` to STOP; retry transient classes via the caller's own loop. |
|
|
39
|
+
|
|
40
|
+
## Fix-loop iteration interaction
|
|
41
|
+
|
|
42
|
+
Retries consume iteration budget when paired with the Layer-B cache:
|
|
43
|
+
|
|
44
|
+
1. On cache hit, `iteration-budget.refund(1)` preserves the iteration that would otherwise have been spent.
|
|
45
|
+
2. On each actual retry that does real work (no cache hit), the caller `iteration-budget.consume(1)` before the spawn.
|
|
46
|
+
3. When the budget's `remaining === 0`, further retries throw `IterationBudgetExhaustedError` and the caller must surface to user — a retry cycle has become pathological.
|
|
47
|
+
|
|
48
|
+
This protects the "infinite fix loop" case — a blocker that regenerates after every fix — from burning unbounded context.
|
|
49
|
+
|
|
50
|
+
## Telemetry
|
|
51
|
+
|
|
52
|
+
Every classification result that leads to a retry or a surfaced error should append an event to `.design/telemetry/events.jsonl`:
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{ "type": "error.classified", "timestamp": "…", "sessionId": "…", "payload": { "reason": "rate_limited", "retryable": true, "caller": "figma-probe" } }
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The event subtype is defined in `scripts/lib/event-stream/types.ts`. Consumers (`gdd-reflector`, dashboard) aggregate by `reason` to detect classifier drift — if `unknown` spikes, the classifier needs tightening.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Gemini CLI Tool Map
|
|
2
|
+
|
|
3
|
+
Last verified: 2026-04-24
|
|
4
|
+
|
|
5
|
+
When a GDD skill references a Claude Code tool name, the Gemini runtime
|
|
6
|
+
translates to the equivalent below. Skills do NOT need to branch — the tool
|
|
7
|
+
name in prose is authoritative; Gemini resolves via this map.
|
|
8
|
+
|
|
9
|
+
## Tool-name mapping
|
|
10
|
+
|
|
11
|
+
| CC name | Gemini name | Notes |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| `Read` | `read_file` | Takes `absolute_path`. |
|
|
14
|
+
| `Write` | `write_file` | Takes `path`, `content`; overwrites. |
|
|
15
|
+
| `Edit` | `replace` | Takes `file_path`, `old_string`, `new_string`. Semantics match CC. |
|
|
16
|
+
| `Bash` | `run_shell_command` | Takes `{command: string, directory?}`. |
|
|
17
|
+
| `Grep` | `search_file_content` | Native grep wrapper. |
|
|
18
|
+
| `Glob` | `glob` | Native glob wrapper. |
|
|
19
|
+
| `Task` | Sub-invocation via nested gemini CLI | Same gap as Codex. |
|
|
20
|
+
| `WebSearch` | `google_web_search` | Built-in. |
|
|
21
|
+
| `WebFetch` | `web_fetch` | Built-in. |
|
|
22
|
+
|
|
23
|
+
## MCP server `gdd-state`
|
|
24
|
+
|
|
25
|
+
The gdd-state MCP server works unchanged on Gemini. Configure Gemini to load
|
|
26
|
+
it by adding to `~/.gemini/settings.json`:
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"mcpServers": {
|
|
31
|
+
"gdd-state": {
|
|
32
|
+
"command": "node",
|
|
33
|
+
"args": ["--experimental-strip-types", "<pkg-root>/scripts/mcp-servers/gdd-state/server.ts"]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
All 11 tools exposed by the server appear as `mcp__gdd_state__*` in Gemini.
|
|
40
|
+
|
|
41
|
+
## Known gaps
|
|
42
|
+
|
|
43
|
+
- `Task` spawning: same as Codex — prefer `run_shell_command("npx gdd-sdk stage ...")`.
|
|
44
|
+
See GEMINI.md for invocation details.
|
|
45
|
+
- Gemini's `replace` has stricter uniqueness requirements than CC's Edit;
|
|
46
|
+
when `old_string` appears more than once, Gemini requires context lines.
|
|
47
|
+
Skill prose that calls Edit should include surrounding context in
|
|
48
|
+
`old_string` to satisfy both harnesses.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
Last verified: 2026-04-24 — tool surface re-checked against Gemini CLI docs
|
|
53
|
+
current to this date. Revisit whenever Gemini ships a tool-vocabulary change.
|
package/reference/registry.json
CHANGED
|
@@ -3,6 +3,27 @@
|
|
|
3
3
|
"version": 1,
|
|
4
4
|
"generated_at": "2026-04-24T00:00:00.000Z",
|
|
5
5
|
"entries": [
|
|
6
|
+
{
|
|
7
|
+
"name": "codex-tools",
|
|
8
|
+
"path": "reference/codex-tools.md",
|
|
9
|
+
"type": "meta-rules",
|
|
10
|
+
"phase": 21,
|
|
11
|
+
"description": "Phase 21 cross-harness tool map — Claude Code → OpenAI Codex CLI tool-name equivalents for the gdd-sdk runner (Read→read_file, Write/Edit→apply_patch, Bash→shell, etc.)"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "gemini-tools",
|
|
15
|
+
"path": "reference/gemini-tools.md",
|
|
16
|
+
"type": "meta-rules",
|
|
17
|
+
"phase": 21,
|
|
18
|
+
"description": "Phase 21 cross-harness tool map — Claude Code → Gemini CLI tool-name equivalents for the gdd-sdk runner"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "error-recovery",
|
|
22
|
+
"path": "reference/error-recovery.md",
|
|
23
|
+
"type": "meta-rules",
|
|
24
|
+
"phase": 20,
|
|
25
|
+
"description": "Phase 20 resilience recovery protocol — rate-limit + 429 + context-overflow retry guidance for the SDK runner (jittered-backoff / rate-guard / error-classifier / iteration-budget integration)"
|
|
26
|
+
},
|
|
6
27
|
{
|
|
7
28
|
"name": "component-authoring",
|
|
8
29
|
"path": "reference/component-authoring.md",
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://get-design-done.example/schemas/budget.schema.json",
|
|
4
|
+
"title": ".design/budget.json",
|
|
5
|
+
"description": "Shape of .design/budget.json — the Phase 10.1 optimization-layer budget governance file. Consumed by hooks/budget-enforcer.ts on every PreToolUse:Agent spawn. Bootstrap writes the Default Config from reference/config-schema.md if the file is missing.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": true,
|
|
8
|
+
"properties": {
|
|
9
|
+
"per_task_cap_usd": {
|
|
10
|
+
"type": "number",
|
|
11
|
+
"minimum": 0,
|
|
12
|
+
"description": "Hard ceiling per agent spawn (USD). Breach under enforcement_mode=enforce triggers D-02 block."
|
|
13
|
+
},
|
|
14
|
+
"per_phase_cap_usd": {
|
|
15
|
+
"type": "number",
|
|
16
|
+
"minimum": 0,
|
|
17
|
+
"description": "Cumulative ceiling across all spawns within the current phase (USD). Read from .design/STATE.md frontmatter `phase:` field."
|
|
18
|
+
},
|
|
19
|
+
"tier_overrides": {
|
|
20
|
+
"type": "object",
|
|
21
|
+
"additionalProperties": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"enum": ["haiku", "sonnet", "opus"]
|
|
24
|
+
},
|
|
25
|
+
"description": "Per-agent tier override map (agent-name -> tier). Wins over agent frontmatter default-tier per D-04."
|
|
26
|
+
},
|
|
27
|
+
"auto_downgrade_on_cap": {
|
|
28
|
+
"type": "boolean",
|
|
29
|
+
"description": "When true, hook silently rewrites tier -> haiku at 80% of per_task_cap_usd per D-03; logged as tier_downgraded: true in telemetry."
|
|
30
|
+
},
|
|
31
|
+
"cache_ttl_seconds": {
|
|
32
|
+
"type": "integer",
|
|
33
|
+
"minimum": 0,
|
|
34
|
+
"description": "TTL (seconds) driving .design/cache-manifest.json entry expiry per D-08 Layer B. Default 3600."
|
|
35
|
+
},
|
|
36
|
+
"enforcement_mode": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"enum": ["enforce", "warn", "log"],
|
|
39
|
+
"description": "D-11 enforcement policy. enforce = block + auto-downgrade; warn = print warnings but allow spawn; log = advisory-only telemetry without gating."
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/hegemonart/get-design-done/main/reference/schemas/events.schema.json",
|
|
4
|
+
"title": "Event",
|
|
5
|
+
"description": "One line of .design/telemetry/events.jsonl — the append-only telemetry stream produced by Plan 20-06. Each event is a single JSON object followed by a newline. See .planning/phases/20-gdd-sdk-foundation/20-06-PLAN.md.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["type", "timestamp", "sessionId", "payload"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"type": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"minLength": 1,
|
|
13
|
+
"description": "Free-form event type identifier. Pre-registered seeds: state.mutation, state.transition, stage.entered, stage.exited, hook.fired, error."
|
|
14
|
+
},
|
|
15
|
+
"timestamp": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"format": "date-time",
|
|
18
|
+
"description": "ISO-8601 timestamp of event emission."
|
|
19
|
+
},
|
|
20
|
+
"sessionId": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"minLength": 1,
|
|
23
|
+
"description": "Stable identifier per GDD pipeline run; correlates events across stages."
|
|
24
|
+
},
|
|
25
|
+
"stage": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"enum": ["brief", "explore", "plan", "design", "verify"],
|
|
28
|
+
"description": "Optional — present when the event is scoped to a pipeline stage."
|
|
29
|
+
},
|
|
30
|
+
"cycle": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"minLength": 1,
|
|
33
|
+
"description": "Optional — present when the event is scoped to a cycle identifier."
|
|
34
|
+
},
|
|
35
|
+
"payload": {
|
|
36
|
+
"type": "object",
|
|
37
|
+
"description": "Event-type-specific payload. Opaque at the envelope level."
|
|
38
|
+
},
|
|
39
|
+
"_meta": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"additionalProperties": false,
|
|
42
|
+
"required": ["pid", "host", "source"],
|
|
43
|
+
"properties": {
|
|
44
|
+
"pid": { "type": "integer", "minimum": 0 },
|
|
45
|
+
"host": { "type": "string" },
|
|
46
|
+
"source": { "type": "string" }
|
|
47
|
+
},
|
|
48
|
+
"description": "Writer-injected provenance. Never set by callers."
|
|
49
|
+
},
|
|
50
|
+
"_truncated": {
|
|
51
|
+
"type": "boolean",
|
|
52
|
+
"description": "Writer-set flag indicating the payload exceeded maxLineBytes and has been replaced by a placeholder."
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
// AUTO-GENERATED from reference/schemas/*.schema.json — DO NOT EDIT.
|
|
2
|
+
// Regenerate: npm run codegen:schemas
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
// ---- authority-snapshot.schema.json ----
|
|
5
|
+
/**
|
|
6
|
+
* Structure of .design/authority-snapshot.json produced by agents/design-authority-watcher.md. See .planning/phases/13.2-external-authority-watcher/13.2-CONTEXT.md §D-12.
|
|
7
|
+
*/
|
|
8
|
+
export interface AuthoritySnapshot {
|
|
9
|
+
version: 1;
|
|
10
|
+
generated_at: string;
|
|
11
|
+
feeds: {
|
|
12
|
+
[k: string]: FeedState;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface FeedState {
|
|
16
|
+
last_fetched_at: string;
|
|
17
|
+
etag?: string;
|
|
18
|
+
/**
|
|
19
|
+
* @maxItems 200
|
|
20
|
+
*/
|
|
21
|
+
entries: Entry[];
|
|
22
|
+
}
|
|
23
|
+
export interface Entry {
|
|
24
|
+
id: string;
|
|
25
|
+
hash: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type AuthoritySnapshotSchema = AuthoritySnapshot;
|
|
29
|
+
|
|
30
|
+
// ---- budget.schema.json ----
|
|
31
|
+
/**
|
|
32
|
+
* Shape of .design/budget.json — the Phase 10.1 optimization-layer budget governance file. Consumed by hooks/budget-enforcer.ts on every PreToolUse:Agent spawn. Bootstrap writes the Default Config from reference/config-schema.md if the file is missing.
|
|
33
|
+
*/
|
|
34
|
+
export interface DesignBudgetJson {
|
|
35
|
+
/**
|
|
36
|
+
* Hard ceiling per agent spawn (USD). Breach under enforcement_mode=enforce triggers D-02 block.
|
|
37
|
+
*/
|
|
38
|
+
per_task_cap_usd?: number;
|
|
39
|
+
/**
|
|
40
|
+
* Cumulative ceiling across all spawns within the current phase (USD). Read from .design/STATE.md frontmatter `phase:` field.
|
|
41
|
+
*/
|
|
42
|
+
per_phase_cap_usd?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Per-agent tier override map (agent-name -> tier). Wins over agent frontmatter default-tier per D-04.
|
|
45
|
+
*/
|
|
46
|
+
tier_overrides?: {
|
|
47
|
+
[k: string]: 'haiku' | 'sonnet' | 'opus';
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* When true, hook silently rewrites tier -> haiku at 80% of per_task_cap_usd per D-03; logged as tier_downgraded: true in telemetry.
|
|
51
|
+
*/
|
|
52
|
+
auto_downgrade_on_cap?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* TTL (seconds) driving .design/cache-manifest.json entry expiry per D-08 Layer B. Default 3600.
|
|
55
|
+
*/
|
|
56
|
+
cache_ttl_seconds?: number;
|
|
57
|
+
/**
|
|
58
|
+
* D-11 enforcement policy. enforce = block + auto-downgrade; warn = print warnings but allow spawn; log = advisory-only telemetry without gating.
|
|
59
|
+
*/
|
|
60
|
+
enforcement_mode?: 'enforce' | 'warn' | 'log';
|
|
61
|
+
[k: string]: unknown;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export type BudgetSchema = DesignBudgetJson;
|
|
65
|
+
|
|
66
|
+
// ---- config.schema.json ----
|
|
67
|
+
/**
|
|
68
|
+
* Shape of .design/config.json — model profile and parallelism settings per reference/config-schema.md.
|
|
69
|
+
*/
|
|
70
|
+
export interface DesignConfigJson {
|
|
71
|
+
model_profile?: 'quality' | 'balanced' | 'budget';
|
|
72
|
+
parallelism?: {
|
|
73
|
+
enabled?: boolean;
|
|
74
|
+
max_parallel_agents?: number;
|
|
75
|
+
min_tasks_to_parallelize?: number;
|
|
76
|
+
min_estimated_savings_seconds?: number;
|
|
77
|
+
require_disjoint_touches?: boolean;
|
|
78
|
+
worktree_isolation?: boolean;
|
|
79
|
+
per_stage_override?: {
|
|
80
|
+
[k: string]: {
|
|
81
|
+
enabled?: boolean;
|
|
82
|
+
max_parallel_agents?: number;
|
|
83
|
+
min_tasks_to_parallelize?: number;
|
|
84
|
+
min_estimated_savings_seconds?: number;
|
|
85
|
+
require_disjoint_touches?: boolean;
|
|
86
|
+
worktree_isolation?: boolean;
|
|
87
|
+
[k: string]: unknown;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
[k: string]: unknown;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Latest plugin tag (e.g. "v1.0.7.3") whose update nudge the user has dismissed. Set by /gdd:check-update --dismiss and by hooks/update-check.sh on the --dismiss code path. When a newer tag ships, the nudge reappears.
|
|
94
|
+
*/
|
|
95
|
+
update_dismissed?: string;
|
|
96
|
+
[k: string]: unknown;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export type ConfigSchema = DesignConfigJson;
|
|
100
|
+
|
|
101
|
+
// ---- events.schema.json ----
|
|
102
|
+
/**
|
|
103
|
+
* One line of .design/telemetry/events.jsonl — the append-only telemetry stream produced by Plan 20-06. Each event is a single JSON object followed by a newline. See .planning/phases/20-gdd-sdk-foundation/20-06-PLAN.md.
|
|
104
|
+
*/
|
|
105
|
+
export interface Event {
|
|
106
|
+
/**
|
|
107
|
+
* Free-form event type identifier. Pre-registered seeds: state.mutation, state.transition, stage.entered, stage.exited, hook.fired, error.
|
|
108
|
+
*/
|
|
109
|
+
type: string;
|
|
110
|
+
/**
|
|
111
|
+
* ISO-8601 timestamp of event emission.
|
|
112
|
+
*/
|
|
113
|
+
timestamp: string;
|
|
114
|
+
/**
|
|
115
|
+
* Stable identifier per GDD pipeline run; correlates events across stages.
|
|
116
|
+
*/
|
|
117
|
+
sessionId: string;
|
|
118
|
+
/**
|
|
119
|
+
* Optional — present when the event is scoped to a pipeline stage.
|
|
120
|
+
*/
|
|
121
|
+
stage?: 'brief' | 'explore' | 'plan' | 'design' | 'verify';
|
|
122
|
+
/**
|
|
123
|
+
* Optional — present when the event is scoped to a cycle identifier.
|
|
124
|
+
*/
|
|
125
|
+
cycle?: string;
|
|
126
|
+
/**
|
|
127
|
+
* Event-type-specific payload. Opaque at the envelope level.
|
|
128
|
+
*/
|
|
129
|
+
payload: {};
|
|
130
|
+
/**
|
|
131
|
+
* Writer-injected provenance. Never set by callers.
|
|
132
|
+
*/
|
|
133
|
+
_meta?: {
|
|
134
|
+
pid: number;
|
|
135
|
+
host: string;
|
|
136
|
+
source: string;
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* Writer-set flag indicating the payload exceeded maxLineBytes and has been replaced by a placeholder.
|
|
140
|
+
*/
|
|
141
|
+
_truncated?: boolean;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export type EventsSchema = Event;
|
|
145
|
+
|
|
146
|
+
// ---- hooks.schema.json ----
|
|
147
|
+
/**
|
|
148
|
+
* Shape of hooks/hooks.json — event-triggered commands registered by the plugin.
|
|
149
|
+
*/
|
|
150
|
+
export interface ClaudeHooksJson {
|
|
151
|
+
hooks: {
|
|
152
|
+
SessionStart?: HookGroup[];
|
|
153
|
+
SessionEnd?: HookGroup[];
|
|
154
|
+
PreToolUse?: HookGroup[];
|
|
155
|
+
PostToolUse?: HookGroup[];
|
|
156
|
+
[k: string]: unknown;
|
|
157
|
+
};
|
|
158
|
+
[k: string]: unknown;
|
|
159
|
+
}
|
|
160
|
+
export interface HookGroup {
|
|
161
|
+
matcher?: string;
|
|
162
|
+
hooks: {
|
|
163
|
+
type: 'command';
|
|
164
|
+
command: string;
|
|
165
|
+
[k: string]: unknown;
|
|
166
|
+
}[];
|
|
167
|
+
[k: string]: unknown;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export type HooksSchema = ClaudeHooksJson;
|
|
171
|
+
|
|
172
|
+
// ---- intel.schema.json ----
|
|
173
|
+
/**
|
|
174
|
+
* Shape of intel-store slice files per reference/intel-schema.md. Each slice has a generated timestamp and one array-valued payload key matching the slice name.
|
|
175
|
+
*/
|
|
176
|
+
export interface DesignIntelJson {
|
|
177
|
+
generated: string;
|
|
178
|
+
git_hash?: string;
|
|
179
|
+
files?: {
|
|
180
|
+
path: string;
|
|
181
|
+
type: 'skill' | 'agent' | 'reference' | 'connection' | 'script' | 'hook' | 'config' | 'test' | 'other';
|
|
182
|
+
mtime?: string;
|
|
183
|
+
size_bytes?: number;
|
|
184
|
+
git_hash?: string;
|
|
185
|
+
[k: string]: unknown;
|
|
186
|
+
}[];
|
|
187
|
+
exports?: {
|
|
188
|
+
file: string;
|
|
189
|
+
kind: 'skill' | 'agent' | 'reference' | 'other';
|
|
190
|
+
name: string;
|
|
191
|
+
command?: string;
|
|
192
|
+
[k: string]: unknown;
|
|
193
|
+
}[];
|
|
194
|
+
symbols?: {
|
|
195
|
+
file: string;
|
|
196
|
+
heading: string;
|
|
197
|
+
level?: number;
|
|
198
|
+
anchor?: string;
|
|
199
|
+
line?: number;
|
|
200
|
+
[k: string]: unknown;
|
|
201
|
+
}[];
|
|
202
|
+
tokens?: {
|
|
203
|
+
file: string;
|
|
204
|
+
token: string;
|
|
205
|
+
category?: 'color' | 'spacing' | 'typography' | 'radius' | 'shadow' | 'motion' | 'other';
|
|
206
|
+
line?: number;
|
|
207
|
+
context?: string;
|
|
208
|
+
[k: string]: unknown;
|
|
209
|
+
}[];
|
|
210
|
+
components?: {
|
|
211
|
+
file: string;
|
|
212
|
+
component: string;
|
|
213
|
+
role?: 'definition' | 'reference' | 'example';
|
|
214
|
+
line?: number;
|
|
215
|
+
[k: string]: unknown;
|
|
216
|
+
}[];
|
|
217
|
+
patterns?: {
|
|
218
|
+
name: string;
|
|
219
|
+
category?:
|
|
220
|
+
| 'color-system'
|
|
221
|
+
| 'spacing-system'
|
|
222
|
+
| 'typography-system'
|
|
223
|
+
| 'component-styling'
|
|
224
|
+
| 'layout'
|
|
225
|
+
| 'interaction'
|
|
226
|
+
| 'other';
|
|
227
|
+
source_file?: string;
|
|
228
|
+
description?: string;
|
|
229
|
+
[k: string]: unknown;
|
|
230
|
+
}[];
|
|
231
|
+
dependencies?: {
|
|
232
|
+
from: string;
|
|
233
|
+
to: string;
|
|
234
|
+
kind?: 'at-reference' | 'reads-from' | 'skill-calls-agent' | 'agent-calls-agent';
|
|
235
|
+
line?: number;
|
|
236
|
+
[k: string]: unknown;
|
|
237
|
+
}[];
|
|
238
|
+
decisions?: {
|
|
239
|
+
id: string;
|
|
240
|
+
summary: string;
|
|
241
|
+
source_file?: string;
|
|
242
|
+
line?: number;
|
|
243
|
+
date?: string;
|
|
244
|
+
[k: string]: unknown;
|
|
245
|
+
}[];
|
|
246
|
+
debt?: {
|
|
247
|
+
id: string;
|
|
248
|
+
summary: string;
|
|
249
|
+
severity?: 'high' | 'medium' | 'low';
|
|
250
|
+
source_file?: string;
|
|
251
|
+
line?: number;
|
|
252
|
+
[k: string]: unknown;
|
|
253
|
+
}[];
|
|
254
|
+
nodes?: {
|
|
255
|
+
id: string;
|
|
256
|
+
type?: string;
|
|
257
|
+
name?: string;
|
|
258
|
+
[k: string]: unknown;
|
|
259
|
+
}[];
|
|
260
|
+
edges?: {
|
|
261
|
+
from: string;
|
|
262
|
+
to: string;
|
|
263
|
+
kind?: string;
|
|
264
|
+
[k: string]: unknown;
|
|
265
|
+
}[];
|
|
266
|
+
[k: string]: unknown;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export type IntelSchema = DesignIntelJson;
|
|
270
|
+
|
|
271
|
+
// ---- iteration-budget.schema.json ----
|
|
272
|
+
/**
|
|
273
|
+
* Shape of .design/iteration-budget.json produced by scripts/lib/iteration-budget.cjs. Caps the number of fix-loop iterations that can consume context before the pipeline halts for user input. All mutations are coordinated by scripts/lib/lockfile.cjs and written via temp+rename. See .planning/phases/20-gdd-sdk-foundation/20-14-PLAN.md §Task 4.
|
|
274
|
+
*/
|
|
275
|
+
export interface IterationBudget {
|
|
276
|
+
/**
|
|
277
|
+
* The configured ceiling. Initialized by reset(). `remaining` never exceeds this value after refund().
|
|
278
|
+
*/
|
|
279
|
+
budget: number;
|
|
280
|
+
/**
|
|
281
|
+
* Iterations still available for consume() calls. Starts at `budget`, drops on consume, climbs (capped at `budget`) on refund.
|
|
282
|
+
*/
|
|
283
|
+
remaining: number;
|
|
284
|
+
/**
|
|
285
|
+
* Running total of successful consume() calls since last reset().
|
|
286
|
+
*/
|
|
287
|
+
consumed: number;
|
|
288
|
+
/**
|
|
289
|
+
* Running total of refund amount since last reset() (useful for auditing the cache-hit refund path from budget-enforcer.ts).
|
|
290
|
+
*/
|
|
291
|
+
refunded: number;
|
|
292
|
+
/**
|
|
293
|
+
* ISO-8601 timestamp of the last mutation.
|
|
294
|
+
*/
|
|
295
|
+
updatedAt: string;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
export type IterationBudgetSchema = IterationBudget;
|
|
299
|
+
|
|
300
|
+
// ---- marketplace.schema.json ----
|
|
301
|
+
/**
|
|
302
|
+
* Shape of .claude-plugin/marketplace.json — the plugin marketplace descriptor.
|
|
303
|
+
*/
|
|
304
|
+
export interface ClaudeMarketplaceJson {
|
|
305
|
+
name: string;
|
|
306
|
+
owner: {
|
|
307
|
+
name: string;
|
|
308
|
+
[k: string]: unknown;
|
|
309
|
+
};
|
|
310
|
+
metadata: {
|
|
311
|
+
description: string;
|
|
312
|
+
version: string;
|
|
313
|
+
[k: string]: unknown;
|
|
314
|
+
};
|
|
315
|
+
plugins: {
|
|
316
|
+
name: string;
|
|
317
|
+
source: string;
|
|
318
|
+
description: string;
|
|
319
|
+
version: string;
|
|
320
|
+
author: {
|
|
321
|
+
name: string;
|
|
322
|
+
[k: string]: unknown;
|
|
323
|
+
};
|
|
324
|
+
homepage?: string;
|
|
325
|
+
repository: string;
|
|
326
|
+
license: string;
|
|
327
|
+
category: string;
|
|
328
|
+
keywords: string[];
|
|
329
|
+
[k: string]: unknown;
|
|
330
|
+
}[];
|
|
331
|
+
[k: string]: unknown;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export type MarketplaceSchema = ClaudeMarketplaceJson;
|
|
335
|
+
|
|
336
|
+
// ---- mcp-gdd-state-tools.schema.json ----
|
|
337
|
+
/**
|
|
338
|
+
* Combined manifest of all 11 gdd-state MCP tool input+output schemas (Plan 20-05). Individual tool schemas live under scripts/mcp-servers/gdd-state/schemas/ and the tool handlers reference them; this combined schema exists so downstream validators and codegen can compile a single surface.
|
|
339
|
+
*/
|
|
340
|
+
export interface McpGddStateTools {
|
|
341
|
+
tools: {
|
|
342
|
+
gdd_state__get: ToolSchemaEntry;
|
|
343
|
+
gdd_state__update_progress: ToolSchemaEntry;
|
|
344
|
+
gdd_state__transition_stage: ToolSchemaEntry;
|
|
345
|
+
gdd_state__add_blocker: ToolSchemaEntry;
|
|
346
|
+
gdd_state__resolve_blocker: ToolSchemaEntry;
|
|
347
|
+
gdd_state__add_decision: ToolSchemaEntry;
|
|
348
|
+
gdd_state__add_must_have: ToolSchemaEntry;
|
|
349
|
+
gdd_state__set_status: ToolSchemaEntry;
|
|
350
|
+
gdd_state__checkpoint: ToolSchemaEntry;
|
|
351
|
+
gdd_state__probe_connections: ToolSchemaEntry;
|
|
352
|
+
gdd_state__frontmatter_update: ToolSchemaEntry;
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
export interface ToolSchemaEntry {
|
|
356
|
+
/**
|
|
357
|
+
* JSON Schema fragment describing the tool's input parameters.
|
|
358
|
+
*/
|
|
359
|
+
input: {};
|
|
360
|
+
/**
|
|
361
|
+
* JSON Schema fragment describing the tool's response envelope.
|
|
362
|
+
*/
|
|
363
|
+
output: {
|
|
364
|
+
type: 'object';
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
export type McpGddStateToolsSchema = McpGddStateTools;
|
|
369
|
+
|
|
370
|
+
// ---- plugin.schema.json ----
|
|
371
|
+
/**
|
|
372
|
+
* Shape of .claude-plugin/plugin.json — the plugin manifest consumed by Claude Code.
|
|
373
|
+
*/
|
|
374
|
+
export interface ClaudePluginJson {
|
|
375
|
+
name: string;
|
|
376
|
+
short_name: string;
|
|
377
|
+
version: string;
|
|
378
|
+
description: string;
|
|
379
|
+
author: {
|
|
380
|
+
name: string;
|
|
381
|
+
url?: string;
|
|
382
|
+
[k: string]: unknown;
|
|
383
|
+
};
|
|
384
|
+
homepage?: string;
|
|
385
|
+
repository: string;
|
|
386
|
+
license: string;
|
|
387
|
+
keywords: string[];
|
|
388
|
+
skills: string[];
|
|
389
|
+
hooks?: string;
|
|
390
|
+
[k: string]: unknown;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
export type PluginSchema = ClaudePluginJson;
|
|
394
|
+
|
|
395
|
+
// ---- rate-limits.schema.json ----
|
|
396
|
+
/**
|
|
397
|
+
* Shape of .design/rate-limits/<provider>.json produced by scripts/lib/rate-guard.cjs. One file per provider (anthropic, openai, figma, ...) — header ingestion overwrites atomically via tmp+rename under scripts/lib/lockfile.cjs protection. See .planning/phases/20-gdd-sdk-foundation/20-14-PLAN.md §Task 2.
|
|
398
|
+
*/
|
|
399
|
+
export interface RateLimits {
|
|
400
|
+
/**
|
|
401
|
+
* Provider identifier (e.g. 'anthropic', 'openai', 'figma'). Matches the state file basename.
|
|
402
|
+
*/
|
|
403
|
+
provider: string;
|
|
404
|
+
/**
|
|
405
|
+
* Number of API calls the provider says are still allowed before the next reset. When ingestion sees both requests-remaining and tokens-remaining, the lower value wins (most-restrictive).
|
|
406
|
+
*/
|
|
407
|
+
remaining: number;
|
|
408
|
+
/**
|
|
409
|
+
* ISO-8601 timestamp when the rate-limit window resets. Synthesized from whichever header is present: retry-after (seconds or HTTP date), x-ratelimit-reset-requests / -tokens (Unix seconds), anthropic-ratelimit-requests-reset (ISO string). When multiple candidates are present, the latest resetAt wins.
|
|
410
|
+
*/
|
|
411
|
+
resetAt: string;
|
|
412
|
+
/**
|
|
413
|
+
* ISO-8601 timestamp when this state file was last written (ingestHeaders call time).
|
|
414
|
+
*/
|
|
415
|
+
updatedAt: string;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
export type RateLimitsSchema = RateLimits;
|
|
419
|
+
|