@tekyzinc/gsd-t 2.55.11 → 2.56.10

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/README.md CHANGED
@@ -12,7 +12,7 @@ A methodology for reliable, parallelizable development using Claude Code with op
12
12
  **Generates visual scan reports** — every `/gsd-t-scan` produces a self-contained HTML report with 6 live architectural diagrams, a tech debt register, and domain health scores; optional DOCX/PDF export via `--export docx|pdf`.
13
13
  **Self-learning rule engine** — declarative rules in rules.jsonl detect failure patterns from task metrics. Candidate patches progress through a 5-stage lifecycle (candidate, applied, measured, promoted, graduated) with >55% improvement gates before becoming permanent methodology artifacts.
14
14
  **Cross-project learning** — proven rules propagate to `~/.claude/metrics/` and sync across all registered projects via `update-all`. Rules validated in 3+ projects become universal; 5+ projects qualify for npm distribution. Cross-project signal comparison and global ELO rankings available via `gsd-t-metrics --cross-project` and `gsd-t-status`.
15
- **Stack Rules Engine** — auto-detects project tech stack (React, TypeScript, Node API, Python, Go, Rust) from manifest files and injects mandatory best-practice rules into subagent prompts at execute-time. Universal security rules always apply; stack-specific rules layer on top. Includes **design-to-code** rules for pixel-perfect frontend implementation from Figma, screenshots, or design images — with Figma MCP integration, design token extraction, stack capability evaluation, and visual verification loops. Extensible: drop a `.md` file in `templates/stacks/` to add a new stack.
15
+ **Stack Rules Engine** — auto-detects project tech stack (React, TypeScript, Node API, Python, Go, Rust) from manifest files and injects mandatory best-practice rules into subagent prompts at execute-time. Universal security rules always apply; stack-specific rules layer on top. Includes **design-to-code** rules for pixel-perfect frontend implementation from Figma, screenshots, or design images — with Figma MCP integration, design token extraction, stack capability evaluation, and mandatory visual verification: every screen is rendered in a real browser, screenshotted at mobile/tablet/desktop, and compared pixel-by-pixel against the Figma design. Auto-bootstraps during partition when design references are detected. Extensible: drop a `.md` file in `templates/stacks/` to add a new stack.
16
16
  **Self-Calibrating QA** — `qa-calibrator.js` tracks QA miss-rates across milestones, detects weak-spot categories (error paths, boundaries, state transitions), and automatically injects targeted guidance into QA subagent prompts. Projects on the same stack share miss-rate data for faster calibration.
17
17
  **Token-Aware Orchestration** — `token-budget.js` tracks session token consumption and applies graduated degradation: downgrade model assignments when approaching limits, checkpoint and skip non-essential operations to conserve budget, and halt cleanly with a resume instruction at the ceiling. Wave and execute phases check budget before each subagent spawn.
18
18
  **Quality North Star** — projects define a `## Quality North Star` section in CLAUDE.md (1–3 sentences, e.g., "This is a published npm library. Every public API must be intuitive and backward-compatible."). `gsd-t-init` auto-detects preset (library/web-app/cli) from package.json signals; `gsd-t-setup` configures it for existing projects. Subagents read it as a quality lens; absent = silent skip (backward compatible).
@@ -53,8 +53,8 @@ if [ -d "$STACKS_DIR" ]; then
53
53
  ([ -f "playwright.config.ts" ] || [ -f "playwright.config.js" ]) && _add playwright.md
54
54
  [ -f "go.mod" ] && _add go.md
55
55
  [ -f "Cargo.toml" ] && _add rust.md
56
- # Design-to-code detection (design contract, design tokens, or Figma config)
57
- ([ -f ".gsd-t/contracts/design-contract.md" ] || [ -f "design-tokens.json" ] || [ -d "design-tokens" ] || [ -f ".figmarc" ] || [ -f "figma.config.json" ]) && _add design-to-code.md
56
+ # Design-to-code detection (design contract, design tokens, Figma config, or Figma MCP configured)
57
+ ([ -f ".gsd-t/contracts/design-contract.md" ] || [ -f "design-tokens.json" ] || [ -d "design-tokens" ] || [ -f ".figmarc" ] || [ -f "figma.config.json" ] || grep -q '"figma"' ~/.claude/settings.json 2>/dev/null) && _add design-to-code.md
58
58
  fi
59
59
  ```
60
60
 
@@ -193,8 +193,8 @@ if [ -d "$STACKS_DIR" ]; then
193
193
  ([ -f "playwright.config.ts" ] || [ -f "playwright.config.js" ]) && _add playwright.md
194
194
  [ -f "go.mod" ] && _add go.md
195
195
  [ -f "Cargo.toml" ] && _add rust.md
196
- # Design-to-code detection (design contract, design tokens, or Figma config)
197
- ([ -f ".gsd-t/contracts/design-contract.md" ] || [ -f "design-tokens.json" ] || [ -d "design-tokens" ] || [ -f ".figmarc" ] || [ -f "figma.config.json" ]) && _add design-to-code.md
196
+ # Design-to-code detection (design contract, design tokens, Figma config, or Figma MCP configured)
197
+ ([ -f ".gsd-t/contracts/design-contract.md" ] || [ -f "design-tokens.json" ] || [ -d "design-tokens" ] || [ -f ".figmarc" ] || [ -f "figma.config.json" ] || grep -q '"figma"' ~/.claude/settings.json 2>/dev/null) && _add design-to-code.md
198
198
  fi
199
199
  ```
200
200
 
@@ -282,16 +282,37 @@ Execute the task above:
282
282
  recovers (retry button works, form can be resubmitted, etc.).
283
283
  A test that would pass on an empty HTML page with the right element IDs is useless.
284
284
  Every assertion must prove the FEATURE WORKS, not that the ELEMENT EXISTS.
285
- 7. **Visual Design Verification** (only if design-to-code stack rule is active):
286
- If the task involves UI implementation from a design reference:
287
- a. Check if Claude Preview or Chrome MCP browser tools are available
288
- b. If available: render the implemented component at each target breakpoint (mobile 375px, tablet 768px, desktop 1280px)
289
- c. Screenshot each rendered breakpoint
290
- d. Compare against the source design reference (from `.gsd-t/contracts/design-contract.md`)
291
- e. Identify any deviations: spacing, color, typography, alignment, sizing
292
- f. Fix deviations every fix must trace to a design contract value (max 2 fix iterations)
293
- g. Log verification results in the design contract's Verification Status table
294
- h. If no browser tools available: log warning "Visual verification unavailable — manual review recommended" to `.gsd-t/qa-issues.md`
285
+ 7. **Visual Design Verification** (MANDATORY when design-to-code stack rule is active):
286
+ If the task involves UI implementation from a design reference, this step is NOT optional:
287
+ a. **Get the Figma reference screenshot**: If Figma MCP is available, call `get_screenshot` with the
288
+ relevant nodeId and fileKey from `.gsd-t/contracts/design-contract.md`. Save this as the reference.
289
+ If no Figma MCP, use the design image/screenshot provided in the contract.
290
+ b. **Render the built component in a real browser**: Start the dev server if not running.
291
+ Use Claude Preview, Chrome MCP, or Playwright to open the page at the correct URL.
292
+ Capture screenshots at each target breakpoint:
293
+ - Mobile: 375px width
294
+ - Tablet: 768px width
295
+ - Desktop: 1280px width
296
+ c. **Pixel-by-pixel comparison**: Place the Figma screenshot and browser screenshot side-by-side.
297
+ Systematically compare every element:
298
+ - Chart types (bar vs stacked bar vs donut — exact match required)
299
+ - Colors (exact hex match — #1A73E8 is not #1A74E9)
300
+ - Typography (font family, weight, size, line-height, letter-spacing)
301
+ - Spacing (padding, margins, gaps — exact pixel match)
302
+ - Layout (grid structure, alignment, element positioning)
303
+ - Component states (toggles, active states, expanded/collapsed sections)
304
+ - Data visualization style (chart axis, labels, legends, distribution bars)
305
+ d. **Log every deviation** with specifics: "Donut chart missing center text '485 Total Interactions',
306
+ Number of Tools uses vertical bars but design shows horizontal stacked bar"
307
+ e. **Fix ALL deviations** — max 3 fix-and-recheck iterations per component.
308
+ After each fix, re-render and re-compare. Every fix must trace to a design contract value.
309
+ f. **If deviations remain after 3 iterations**: log to `.gsd-t/qa-issues.md` with severity CRITICAL
310
+ and tag `[VISUAL]`. This BLOCKS task completion — the task is NOT done.
311
+ g. **Log results** in the design contract's Verification Status table.
312
+ h. **If no browser/preview tools available**: This is a CRITICAL blocker, not a warning.
313
+ Log to `.gsd-t/qa-issues.md`: "CRITICAL: No browser tools available for visual verification.
314
+ Install Claude Preview or configure Playwright for visual testing."
315
+ The task CANNOT be marked complete without visual verification.
295
316
  Skip this step entirely if no design-to-code stack rule was injected.
296
317
  8. Run ALL test suites — this is NOT optional, not conditional, not "if applicable":
297
318
  a. Detect configured test runners: check for vitest/jest config, playwright.config.*, cypress.config.*
@@ -231,6 +231,7 @@ Use these when user asks for help on a specific command:
231
231
  - **Auto-invoked**: Yes (in wave, after milestone)
232
232
  - **Creates**: `.gsd-t/domains/*/`, `.gsd-t/contracts/`
233
233
  - **Use when**: Breaking down a milestone for parallel work
234
+ - **Note (M33)**: Auto-creates `.gsd-t/contracts/design-contract.md` when Figma URLs or design references are detected in requirements — bootstraps the design-to-code stack rule for execute.
234
235
 
235
236
  ### discuss
236
237
  - **Summary**: Explore design decisions from multiple perspectives
@@ -260,7 +261,7 @@ Use these when user asks for help on a specific command:
260
261
  - **Note (M22)**: Task-level fresh dispatch (one subagent per task, ~10-20% context each). Team mode uses worktree isolation (`isolation: "worktree"`) — zero file conflicts. Adaptive replanning between domain completions.
261
262
  - **Note (M26)**: Active rule injection — evaluates declarative rules from rules.jsonl before dispatching each domain's tasks. Fires matching rules as warnings in subagent prompts.
262
263
  - **Note (M29)**: Stack Rules Engine — auto-detects project tech stack from manifest files and injects mandatory best-practice rules into each task subagent prompt. Universal rules (`_security.md`, `_auth.md`) always apply; stack-specific rules layer on top. Violations are task failures (same weight as contract violations).
263
- - **Note (M33)**: Design-to-code — when a design contract, design tokens, or Figma config is detected, injects pixel-perfect implementation rules: Figma MCP auto-detection, design token extraction, stack capability evaluation (recommends alternatives if stack can't achieve the design), visual verification loop via Claude Preview or Chrome MCP. Adds Step 7 (Visual Design Verification) to task execution flow.
264
+ - **Note (M33)**: Design-to-code — activated when design contract, design tokens, Figma config, or Figma MCP in settings.json is detected. Injects pixel-perfect implementation rules: design token extraction, stack capability evaluation, component decomposition. Step 7 (Visual Design Verification) is MANDATORY renders each screen in a real browser, screenshots at mobile/tablet/desktop, compares pixel-by-pixel against the Figma design via MCP `get_screenshot`. Visual deviations block task completion. Also triggers from Figma MCP being configured in `~/.claude/settings.json`.
264
265
 
265
266
  ### test-sync
266
267
  - **Summary**: Keep tests aligned with code changes
@@ -64,7 +64,7 @@ If rolled-back domains exist, report them to the user (or if Level 3: log to `.g
64
64
 
65
65
  **Stack Rules Detection (before spawning subagent):**
66
66
  Run via Bash to detect project stack and collect matching rules:
67
- `GSD_T_DIR=$(npm root -g 2>/dev/null)/@tekyzinc/gsd-t; STACKS_DIR="$GSD_T_DIR/templates/stacks"; STACK_RULES=""; if [ -d "$STACKS_DIR" ]; then for f in "$STACKS_DIR"/_*.md; do [ -f "$f" ] && STACK_RULES="${STACK_RULES}$(cat "$f")"$'\n\n'; done; if [ -f "package.json" ]; then grep -q '"react"' package.json 2>/dev/null && [ -f "$STACKS_DIR/react.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/react.md")"$'\n\n'; (grep -q '"typescript"' package.json 2>/dev/null || [ -f "tsconfig.json" ]) && [ -f "$STACKS_DIR/typescript.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/typescript.md")"$'\n\n'; grep -qE '"(express|fastify|hono|koa)"' package.json 2>/dev/null && [ -f "$STACKS_DIR/node-api.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/node-api.md")"$'\n\n'; fi; [ -f "requirements.txt" ] || [ -f "pyproject.toml" ] && [ -f "$STACKS_DIR/python.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/python.md")"$'\n\n'; [ -f "go.mod" ] && [ -f "$STACKS_DIR/go.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/go.md")"$'\n\n'; [ -f "Cargo.toml" ] && [ -f "$STACKS_DIR/rust.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/rust.md")"$'\n\n'; ([ -f ".gsd-t/contracts/design-contract.md" ] || [ -f "design-tokens.json" ] || [ -d "design-tokens" ] || [ -f ".figmarc" ] || [ -f "figma.config.json" ]) && [ -f "$STACKS_DIR/design-to-code.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/design-to-code.md")"$'\n\n'; fi`
67
+ `GSD_T_DIR=$(npm root -g 2>/dev/null)/@tekyzinc/gsd-t; STACKS_DIR="$GSD_T_DIR/templates/stacks"; STACK_RULES=""; if [ -d "$STACKS_DIR" ]; then for f in "$STACKS_DIR"/_*.md; do [ -f "$f" ] && STACK_RULES="${STACK_RULES}$(cat "$f")"$'\n\n'; done; if [ -f "package.json" ]; then grep -q '"react"' package.json 2>/dev/null && [ -f "$STACKS_DIR/react.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/react.md")"$'\n\n'; (grep -q '"typescript"' package.json 2>/dev/null || [ -f "tsconfig.json" ]) && [ -f "$STACKS_DIR/typescript.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/typescript.md")"$'\n\n'; grep -qE '"(express|fastify|hono|koa)"' package.json 2>/dev/null && [ -f "$STACKS_DIR/node-api.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/node-api.md")"$'\n\n'; fi; [ -f "requirements.txt" ] || [ -f "pyproject.toml" ] && [ -f "$STACKS_DIR/python.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/python.md")"$'\n\n'; [ -f "go.mod" ] && [ -f "$STACKS_DIR/go.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/go.md")"$'\n\n'; [ -f "Cargo.toml" ] && [ -f "$STACKS_DIR/rust.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/rust.md")"$'\n\n'; ([ -f ".gsd-t/contracts/design-contract.md" ] || [ -f "design-tokens.json" ] || [ -d "design-tokens" ] || [ -f ".figmarc" ] || [ -f "figma.config.json" ] || grep -q '"figma"' ~/.claude/settings.json 2>/dev/null) && [ -f "$STACKS_DIR/design-to-code.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/design-to-code.md")"$'\n\n'; fi`
68
68
 
69
69
  If STACK_RULES is non-empty, append to the subagent prompt:
70
70
  ```
@@ -371,6 +371,53 @@ Generate the file using this format:
371
371
 
372
372
  Log in `.gsd-t/progress.md` Decision Log: `- {date}: Design brief generated at .gsd-t/contracts/design-brief.md — UI signals detected: {list of signals}`
373
373
 
374
+ ## Step 3.6: Design Contract Bootstrap (Figma/Design Reference Detection)
375
+
376
+ After the design brief, check whether this project has a design reference (Figma, images, prototypes). If found, create `.gsd-t/contracts/design-contract.md` to activate the design-to-code stack rule during execute.
377
+
378
+ **Skip this step if `.gsd-t/contracts/design-contract.md` already exists.**
379
+
380
+ ### Detection — check for ANY of the following
381
+
382
+ | Signal | How to check |
383
+ |--------|-------------|
384
+ | Figma URL in requirements | `docs/requirements.md` contains `figma.com/design/` or `figma.com/file/` |
385
+ | Figma URL in CLAUDE.md | `CLAUDE.md` contains `figma.com/design/` or `figma.com/file/` |
386
+ | Figma MCP configured | `~/.claude/settings.json` has `mcpServers.figma` |
387
+ | Figma config files | `.figmarc` or `figma.config.json` exists |
388
+ | Design token files | `design-tokens.json` or `design-tokens/` directory exists |
389
+ | Design images in docs | `docs/designs/`, `designs/`, or `mockups/` directory exists with image files |
390
+ | Design references in requirements | `docs/requirements.md` contains "design", "mockup", "pixel-perfect", or "Figma" |
391
+
392
+ If NONE of the above match → skip this step. Log: "Design contract: skipped — no design references detected."
393
+
394
+ ### Generate `.gsd-t/contracts/design-contract.md`
395
+
396
+ 1. Copy the design contract template from the GSD-T package:
397
+ ```bash
398
+ GSD_T_DIR=$(npm root -g 2>/dev/null)/@tekyzinc/gsd-t
399
+ TEMPLATE="$GSD_T_DIR/templates/design-contract.md"
400
+ if [ -f "$TEMPLATE" ]; then cp "$TEMPLATE" .gsd-t/contracts/design-contract.md; fi
401
+ ```
402
+
403
+ 2. If a Figma URL was found, populate the Source section:
404
+ - Set `Source Type` to `Figma MCP` (if MCP configured) or `Screenshot` (if not)
405
+ - Set `Source Reference` to the Figma URL
406
+ - Set `Precision Level` to `Exact (MCP)` or `Estimated (visual analysis)`
407
+
408
+ 3. If Figma MCP is available, use `get_design_context` or `get_metadata` to pre-populate:
409
+ - Color palette from design variables/styles
410
+ - Typography from text styles
411
+ - Spacing from auto-layout values
412
+
413
+ **This file activates the design-to-code stack rule during execute**, ensuring:
414
+ - Design tokens are extracted before coding
415
+ - Every CSS value traces to the contract
416
+ - Visual verification loop runs after implementation
417
+ - Stack capability is evaluated before implementation begins
418
+
419
+ Log in `.gsd-t/progress.md` Decision Log: `- {date}: Design contract created at .gsd-t/contracts/design-contract.md — design reference detected: {source type + URL or signal}`
420
+
374
421
  ## Step 4: Initialize Progress
375
422
 
376
423
  Write `.gsd-t/progress.md`:
@@ -68,8 +68,8 @@ if [ -d "$STACKS_DIR" ]; then
68
68
  ([ -f "playwright.config.ts" ] || [ -f "playwright.config.js" ]) && _add playwright.md
69
69
  [ -f "go.mod" ] && _add go.md
70
70
  [ -f "Cargo.toml" ] && _add rust.md
71
- # Design-to-code detection (design contract, design tokens, or Figma config)
72
- ([ -f ".gsd-t/contracts/design-contract.md" ] || [ -f "design-tokens.json" ] || [ -d "design-tokens" ] || [ -f ".figmarc" ] || [ -f "figma.config.json" ]) && _add design-to-code.md
71
+ # Design-to-code detection (design contract, design tokens, Figma config, or Figma MCP configured)
72
+ ([ -f ".gsd-t/contracts/design-contract.md" ] || [ -f "design-tokens.json" ] || [ -d "design-tokens" ] || [ -f ".figmarc" ] || [ -f "figma.config.json" ] || grep -q '"figma"' ~/.claude/settings.json 2>/dev/null) && _add design-to-code.md
73
73
  fi
74
74
  ```
75
75
 
@@ -79,7 +79,15 @@ Standard dimensions (adjust based on project):
79
79
  5. **E2E Tests**: Run the FULL Playwright suite — all specs must pass. If new features lack specs, create them before proceeding.
80
80
  6. **Security**: Auth flows, input validation, data exposure, dependencies
81
81
  7. **Integration Integrity**: Do the seams between domains hold under stress?
82
- 8. **Requirements Traceability Close-Out**: Mark verified requirements as complete and report orphans:
82
+ 8. **Design Fidelity** (only when `.gsd-t/contracts/design-contract.md` exists):
83
+ - Open every implemented screen in a real browser (dev server + Claude Preview, Chrome MCP, or Playwright)
84
+ - Screenshot each screen at mobile (375px), tablet (768px), and desktop (1280px) widths
85
+ - Get the Figma reference: call Figma MCP `get_screenshot` if available, or use design images from the contract
86
+ - Compare every screen pixel-by-pixel against the Figma design:
87
+ Chart types, colors, typography, spacing, layout, component states, data visualization style
88
+ - Any deviation = FAIL with specifics (e.g., "Number of Tools: build uses vertical bars, design uses horizontal stacked bars")
89
+ - Design fidelity FAIL blocks milestone completion — it has the same weight as functional test failures
90
+ 9. **Requirements Traceability Close-Out**: Mark verified requirements as complete and report orphans:
83
91
  - Read `docs/requirements.md` traceability table (added by plan phase)
84
92
  - For each REQ-ID that is fully implemented and tested: update Status to `complete` in the traceability table
85
93
  - **Orphan report**: List any REQ-IDs with no task mapping (planning gap) and any tasks with no REQ-ID (potential scope creep)
@@ -67,7 +67,7 @@ For each phase, spawn the agent like this:
67
67
 
68
68
  **Stack Rules Detection (before spawning subagent):**
69
69
  Run via Bash to detect project stack and collect matching rules:
70
- `GSD_T_DIR=$(npm root -g 2>/dev/null)/@tekyzinc/gsd-t; STACKS_DIR="$GSD_T_DIR/templates/stacks"; STACK_RULES=""; if [ -d "$STACKS_DIR" ]; then for f in "$STACKS_DIR"/_*.md; do [ -f "$f" ] && STACK_RULES="${STACK_RULES}$(cat "$f")"$'\n\n'; done; if [ -f "package.json" ]; then grep -q '"react"' package.json 2>/dev/null && [ -f "$STACKS_DIR/react.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/react.md")"$'\n\n'; (grep -q '"typescript"' package.json 2>/dev/null || [ -f "tsconfig.json" ]) && [ -f "$STACKS_DIR/typescript.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/typescript.md")"$'\n\n'; grep -qE '"(express|fastify|hono|koa)"' package.json 2>/dev/null && [ -f "$STACKS_DIR/node-api.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/node-api.md")"$'\n\n'; fi; [ -f "requirements.txt" ] || [ -f "pyproject.toml" ] && [ -f "$STACKS_DIR/python.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/python.md")"$'\n\n'; [ -f "go.mod" ] && [ -f "$STACKS_DIR/go.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/go.md")"$'\n\n'; [ -f "Cargo.toml" ] && [ -f "$STACKS_DIR/rust.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/rust.md")"$'\n\n'; ([ -f ".gsd-t/contracts/design-contract.md" ] || [ -f "design-tokens.json" ] || [ -d "design-tokens" ] || [ -f ".figmarc" ] || [ -f "figma.config.json" ]) && [ -f "$STACKS_DIR/design-to-code.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/design-to-code.md")"$'\n\n'; fi`
70
+ `GSD_T_DIR=$(npm root -g 2>/dev/null)/@tekyzinc/gsd-t; STACKS_DIR="$GSD_T_DIR/templates/stacks"; STACK_RULES=""; if [ -d "$STACKS_DIR" ]; then for f in "$STACKS_DIR"/_*.md; do [ -f "$f" ] && STACK_RULES="${STACK_RULES}$(cat "$f")"$'\n\n'; done; if [ -f "package.json" ]; then grep -q '"react"' package.json 2>/dev/null && [ -f "$STACKS_DIR/react.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/react.md")"$'\n\n'; (grep -q '"typescript"' package.json 2>/dev/null || [ -f "tsconfig.json" ]) && [ -f "$STACKS_DIR/typescript.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/typescript.md")"$'\n\n'; grep -qE '"(express|fastify|hono|koa)"' package.json 2>/dev/null && [ -f "$STACKS_DIR/node-api.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/node-api.md")"$'\n\n'; fi; [ -f "requirements.txt" ] || [ -f "pyproject.toml" ] && [ -f "$STACKS_DIR/python.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/python.md")"$'\n\n'; [ -f "go.mod" ] && [ -f "$STACKS_DIR/go.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/go.md")"$'\n\n'; [ -f "Cargo.toml" ] && [ -f "$STACKS_DIR/rust.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/rust.md")"$'\n\n'; ([ -f ".gsd-t/contracts/design-contract.md" ] || [ -f "design-tokens.json" ] || [ -d "design-tokens" ] || [ -f ".figmarc" ] || [ -f "figma.config.json" ] || grep -q '"figma"' ~/.claude/settings.json 2>/dev/null) && [ -f "$STACKS_DIR/design-to-code.md" ] && STACK_RULES="${STACK_RULES}$(cat "$STACKS_DIR/design-to-code.md")"$'\n\n'; fi`
71
71
 
72
72
  If STACK_RULES is non-empty, append to the subagent prompt:
73
73
  ```
@@ -270,7 +270,7 @@ GSD-T auto-detects your project's tech stack and injects mandatory best-practice
270
270
  | `requirements.txt` with `celery`, `dramatiq`, `rq`, or `arq` | `queues.md` |
271
271
  | `requirements.txt` with `openai`, `anthropic`, `langchain` | `llm.md` |
272
272
  | `pubspec.yaml` | `flutter.md` |
273
- | `.gsd-t/contracts/design-contract.md`, `design-tokens.json`, `design-tokens/`, `.figmarc`, or `figma.config.json` | `design-to-code.md` |
273
+ | `.gsd-t/contracts/design-contract.md`, `design-tokens.json`, `design-tokens/`, `.figmarc`, `figma.config.json`, or Figma MCP in `settings.json` | `design-to-code.md` |
274
274
 
275
275
  ### Commands That Inject Stack Rules
276
276
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekyzinc/gsd-t",
3
- "version": "2.55.11",
3
+ "version": "2.56.10",
4
4
  "description": "GSD-T: Contract-Driven Development for Claude Code — 51 slash commands with headless CI/CD mode, graph-powered code analysis, real-time agent dashboard, execution intelligence, task telemetry, doc-ripple enforcement, backlog management, impact analysis, test sync, milestone archival, and PRD generation",
5
5
  "author": "Tekyz, Inc.",
6
6
  "license": "MIT",
@@ -617,7 +617,7 @@ GSD-T auto-detects project tech stack at subagent spawn time and injects mandato
617
617
 
618
618
  **Stack-specific rules**: Injected only when the matching stack is detected (e.g., `react.md` when `"react"` is in `package.json`).
619
619
 
620
- **Design-to-code**: Activated when `.gsd-t/contracts/design-contract.md`, `design-tokens.json`, `design-tokens/`, `.figmarc`, or `figma.config.json` exists. Enforces pixel-perfect frontend implementation from designs with: Figma MCP auto-detection, design token extraction protocol, stack capability evaluation (recommends alternatives if stack can't achieve the design), component decomposition, responsive breakpoint strategy, and a visual verification loop using Claude Preview or Chrome MCP.
620
+ **Design-to-code**: Activated when `.gsd-t/contracts/design-contract.md`, `design-tokens.json`, `design-tokens/`, `.figmarc`, or `figma.config.json` exists, OR when Figma MCP is configured in `~/.claude/settings.json`. Auto-bootstrapped during partition when Figma URLs or design references are detected in requirements. Enforces pixel-perfect frontend implementation from designs with: Figma MCP auto-detection, design token extraction protocol, stack capability evaluation (recommends alternatives if stack can't achieve the design), component decomposition, responsive breakpoint strategy, and a mandatory visual verification loop every implemented screen must be rendered in a real browser, screenshotted at mobile/tablet/desktop breakpoints, and compared pixel-by-pixel against the Figma design. Visual deviations block task completion.
621
621
 
622
622
  **Enforcement**: Stack rule violations have the same weight as contract violations — they are task failures, not warnings.
623
623
 
@@ -398,28 +398,59 @@ MANDATORY:
398
398
 
399
399
  ```
400
400
  MANDATORY:
401
- ├── After implementing any design component, run a visual verification:
402
- 1. Render the component (Claude Preview, Chrome MCP, or dev server)
403
- 2. Screenshot the rendered output
404
- │ 3. Compare side-by-side with the source design
405
- 4. Identify EVERY deviation (spacing, color, font, alignment, sizing)
406
- 5. Fix each deviation trace fix to design contract values
407
- 6. Re-render and re-compare
408
- ├── Maximum 3 verification iterations per component
409
- │ If still deviating after 3 log specific deltas to .gsd-t/qa-issues.md
410
- ├── Tool priority for rendering:
411
- 1. Claude Preview (if available) fastest loop
412
- 2. Chrome MCP (if available)full browser rendering
413
- 3. Dev server + manual screenshot — last resort
414
- ├── Check at EVERY breakpoint not just desktop
401
+ ├── After implementing any design component, you MUST verify it visually.
402
+ Skipping this step is a TASK FAILURE — not optional, not "if tools available".
403
+
404
+ ├── Step 1: GET THE FIGMA REFERENCE
405
+ If Figma MCP available call get_screenshot with nodeId + fileKey
406
+ If no MCP use design image/screenshot from the design contract
407
+ You MUST have a reference image before proceeding
408
+
409
+ ├── Step 2: RENDER IN A REAL BROWSER
410
+ │ Start the dev server (npm run dev, etc.)
411
+ Open the page using Claude Preview, Chrome MCP, or Playwright
412
+ You MUST see real rendered output not just read the code
413
+
414
+ ├── Step 3: SCREENSHOT AT EVERY BREAKPOINT
415
415
  │ Mobile (375px), Tablet (768px), Desktop (1280px) minimum
416
- ├── Verification is NOT optional — skipping it is a task failure
417
- └── Log verification results in the design contract Verification Status table
416
+ │ Each breakpoint is a separate screenshot
417
+
418
+ ├── Step 4: PIXEL-BY-PIXEL COMPARISON
419
+ │ Place Figma screenshot and browser screenshot side-by-side
420
+ │ Check EVERY element systematically:
421
+ │ Chart types — bar vs stacked bar vs donut (exact type match)
422
+ │ Colors — exact hex values, not "close enough"
423
+ │ Typography — font family, weight, size, line-height, letter-spacing
424
+ │ Spacing — padding, margins, gaps (exact pixel match)
425
+ │ Layout — grid structure, alignment, positioning
426
+ │ Component states — toggle active/inactive, expanded/collapsed
427
+ │ Data visualization — axis labels, legends, chart orientation
428
+ │ Icons and imagery — correct icon set, correct sizes
429
+
430
+ ├── Step 5: FIX EVERY DEVIATION
431
+ │ Log each deviation with specifics before fixing
432
+ │ Fix one by one, tracing each fix to the design contract
433
+ │ Re-render after each batch of fixes
434
+ │ Maximum 3 fix-and-recheck iterations
435
+
436
+ ├── Step 6: FINAL VERIFICATION
437
+ │ After fixes, take fresh screenshots at all breakpoints
438
+ │ Confirm every deviation is resolved
439
+ │ If deviations remain → CRITICAL finding in .gsd-t/qa-issues.md
440
+ │ Task is NOT complete until visual match is confirmed
441
+
442
+ ├── NO BROWSER TOOLS = BLOCKER
443
+ │ If Claude Preview, Chrome MCP, and Playwright are ALL unavailable:
444
+ │ This is a CRITICAL blocker, not a warning to log and move on
445
+ │ The task CANNOT be marked complete without visual verification
446
+ │ Log to .gsd-t/qa-issues.md with severity CRITICAL
447
+
448
+ └── Log all verification results in the design contract Verification Status table
418
449
  ```
419
450
 
420
- **BAD** — Writing CSS, committing, moving on without ever seeing the rendered result.
451
+ **BAD** — Writing CSS, committing, moving on without ever opening a browser to see the result. "Tests pass" is not visual verification.
421
452
 
422
- **GOOD** — Render → Screenshot → Compare → Fix spacing from 14px to 16px → Re-render → Confirm match → Log "verified at 3 breakpoints" in design contract.
453
+ **GOOD** — Render at 375px → Screenshot → Compare to Figma "Donut chart missing center text, stacked bars rendered as vertical bars" → Fix chart type Fix center text → Re-render → Confirm match → Repeat at 768px and 1280px → All match → Log "verified at 3 breakpoints" in design contract.
423
454
 
424
455
  ---
425
456