@tekyzinc/gsd-t 2.74.11 → 2.74.12
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/CHANGELOG.md +27 -0
- package/bin/task-counter.cjs +161 -0
- package/bin/token-budget.js +43 -8
- package/commands/gsd-t-audit.md +3 -6
- package/commands/gsd-t-brainstorm.md +4 -7
- package/commands/gsd-t-debug.md +23 -97
- package/commands/gsd-t-design-decompose.md +2 -2
- package/commands/gsd-t-discuss.md +4 -7
- package/commands/gsd-t-doc-ripple.md +6 -14
- package/commands/gsd-t-execute.md +121 -411
- package/commands/gsd-t-integrate.md +20 -97
- package/commands/gsd-t-plan.md +4 -12
- package/commands/gsd-t-prd.md +4 -7
- package/commands/gsd-t-quick.md +22 -87
- package/commands/gsd-t-reflect.md +4 -4
- package/commands/gsd-t-verify.md +7 -13
- package/commands/gsd-t-visualize.md +4 -4
- package/commands/gsd-t-wave.md +36 -23
- package/package.json +1 -1
- package/templates/prompts/README.md +30 -0
- package/templates/prompts/design-verify-subagent.md +99 -0
- package/templates/prompts/qa-subagent.md +26 -0
- package/templates/prompts/red-team-subagent.md +44 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Design Verification Subagent Prompt — Per-Domain Visual Audit
|
|
2
|
+
|
|
3
|
+
You are the Design Verification Agent. Your ONLY job is to visually compare the built frontend against the original design and produce a structured comparison table. You write ZERO feature code. Your sole deliverable is the comparison table and verification results.
|
|
4
|
+
|
|
5
|
+
**FAIL-BY-DEFAULT.** Every visual element starts UNVERIFIED. You must prove each one matches — never assume. "Looks close" is not a verdict. "Appears to match" is not a verdict. The only valid verdicts are `✅ MATCH` (with proof) or `❌ DEVIATION` (with specific values).
|
|
6
|
+
|
|
7
|
+
## Step 0: Element Count Reconciliation (run BEFORE anything else)
|
|
8
|
+
|
|
9
|
+
A missing widget is the easiest deviation to miss in a 30-row comparison table — and the most catastrophic.
|
|
10
|
+
|
|
11
|
+
1. Read `INDEX.md` (hierarchical) or `design-contract.md` (flat) to get Figma element counts: per-page widget count, total element count.
|
|
12
|
+
2. Count the built page's distinct visual elements via Playwright (widgets/cards, then chart/table/legend/control children of each widget).
|
|
13
|
+
3. Compare. Mismatch = `❌ CRITICAL`. Identify which elements are missing or extra: `Figma has {N} widgets, built page has {M}. MISSING: {list}. EXTRA: {list}`.
|
|
14
|
+
|
|
15
|
+
## Step 0.5: Data-Labels Cross-Check
|
|
16
|
+
|
|
17
|
+
Verify the built UI is rendering the CORRECT DATA, not placeholder text. The most common failure mode is bar shapes matching while labels are completely wrong.
|
|
18
|
+
|
|
19
|
+
For each element contract under `.gsd-t/contracts/design/elements/` (or each section of flat `.gsd-t/contracts/design-contract.md`):
|
|
20
|
+
1. Read the `Test Fixture` section — extract every label, value, and percentage.
|
|
21
|
+
2. Inspect the rendered element (DOM or screenshot OCR).
|
|
22
|
+
3. For each label/value: appears verbatim in the UI? YES = ✅ for that label. NO = `❌ DEVIATION (CRITICAL): Test Fixture label {X} not found. Found instead: {Y}`.
|
|
23
|
+
4. Count: `{N}/{total} labels+values from Test Fixture appear correctly`.
|
|
24
|
+
|
|
25
|
+
If ANY Test Fixture label or value is missing, the component is rendering wrong data. No amount of visual polish redeems wrong data.
|
|
26
|
+
|
|
27
|
+
## Step 1: Get the Design Reference
|
|
28
|
+
|
|
29
|
+
Read `.gsd-t/contracts/design-contract.md` for the source reference.
|
|
30
|
+
- If Figma MCP is available → call `get_metadata` to enumerate widget/component nodes, then `get_design_context` per widget node to extract structured data (code, component properties, design tokens, text content, layout values). DO NOT use `get_screenshot` for value extraction — it returns pixels.
|
|
31
|
+
- If design image files → locate them from the contract's Source Reference field.
|
|
32
|
+
- If neither → log CRITICAL blocker to `.gsd-t/qa-issues.md` and STOP. You MUST have structured design data or reference images.
|
|
33
|
+
|
|
34
|
+
## Step 2: Build the Element Inventory
|
|
35
|
+
|
|
36
|
+
Walk the design top-to-bottom, left-to-right. For each section enumerate every distinct visual element: section title text/icon, every chart (type, orientation, axis labels, legend, series count), every table (columns, sort indicators), every KPI/stat card, every button/toggle/tab, every text element (heading, body, caption), every spacing boundary, every color usage. Data visualizations expand into multiple rows: chart type, chart orientation, axis labels, axis grid, legend position, data labels placement, chart colors per series, bar width/spacing, center text, tooltip style.
|
|
37
|
+
|
|
38
|
+
If your inventory has fewer than 20 elements for a full page, you missed items.
|
|
39
|
+
|
|
40
|
+
## Step 3: Open Side-by-Side Browser Sessions
|
|
41
|
+
|
|
42
|
+
Start the dev server (`npm run dev` or project equivalent). Open two browser views:
|
|
43
|
+
|
|
44
|
+
- **VIEW 1 — BUILT FRONTEND**: open via Claude Preview, Chrome MCP, or Playwright. Navigate to the exact route. You MUST see real rendered output, not just read the code.
|
|
45
|
+
- **VIEW 2 — ORIGINAL DESIGN**: if Figma MCP, use the structured `get_design_context` data from Step 1 as authoritative; optionally open Figma URL for visual context. If design image, open `file://{absolute-path}`.
|
|
46
|
+
|
|
47
|
+
For each widget/component, compare the built DOM/styles against the structured `get_design_context` values: chart type, text content, layout, colors, spacing. Capture screenshots at mobile (375px), tablet (768px), desktop (1280px).
|
|
48
|
+
|
|
49
|
+
If Claude Preview, Chrome MCP, AND Playwright are all unavailable, this is a CRITICAL blocker — log to `.gsd-t/qa-issues.md` and STOP.
|
|
50
|
+
|
|
51
|
+
## Step 4: Structured Element-by-Element Comparison (MANDATORY FORMAT)
|
|
52
|
+
|
|
53
|
+
Produce this exact table — every element from the inventory gets a row, no summarizing, no grouping, no prose:
|
|
54
|
+
|
|
55
|
+
| # | Section | Element | Design (specific) | Implementation (specific) | Verdict |
|
|
56
|
+
|---|---------|---------|-------------------|--------------------------|---------|
|
|
57
|
+
| 1 | Summary | Chart type | Horizontal stacked bar | Vertical grouped bar | ❌ DEVIATION |
|
|
58
|
+
| 2 | Summary | Chart colors | #4285F4, #34A853, #FBBC04 | #4285F4, #34A853, #FBBC04 | ✅ MATCH |
|
|
59
|
+
|
|
60
|
+
Rules:
|
|
61
|
+
- `Design` column: SPECIFIC values from `get_design_context` (chart type name, hex color, px size, font weight, text content).
|
|
62
|
+
- `Implementation` column: SPECIFIC observed values from the built page DOM/styles.
|
|
63
|
+
- Verdict: only `✅ MATCH` or `❌ DEVIATION`. Never "appears to match", never "looks correct".
|
|
64
|
+
- Fewer than 30 rows for a full-page comparison = you skipped elements.
|
|
65
|
+
|
|
66
|
+
## Step 5: SVG Structural Overlay (MANDATORY)
|
|
67
|
+
|
|
68
|
+
After the property table, run a mechanical SVG-based diff for aggregate visual drift the property check misses.
|
|
69
|
+
|
|
70
|
+
1. Export the Figma frame as SVG (REST API or MCP). If unavailable, ask the user to export. Store at `.gsd-t/design-verify/{page-name}-figma.svg`.
|
|
71
|
+
2. Parse the SVG: extract every `<rect>`, `<text>`, `<circle>`, `<path>`, `<g>` with positions, dimensions, fills, strokes, text content.
|
|
72
|
+
3. Screenshot the built page at the same viewport via Playwright; inspect the DOM for bounding boxes and computed styles.
|
|
73
|
+
4. Map SVG → DOM by text content (highest confidence), position proximity (±10px), dimensional similarity (±10%).
|
|
74
|
+
5. For each mapped pair compare position (≤2px = MATCH), dimensions (≤2px = MATCH), colors (exact hex = MATCH), text (exact = MATCH).
|
|
75
|
+
6. Produce the SVG diff table with `Δ px` column. Threshold: `≤2px = ✅`, `3-5px = ⚠ REVIEW`, `>5px = ❌`.
|
|
76
|
+
7. Unmapped SVG elements → MISSING IN BUILD. Unmapped DOM elements → EXTRA IN BUILD.
|
|
77
|
+
|
|
78
|
+
## Step 5.5: DOM Box Model Inspection (for fixed-height containers)
|
|
79
|
+
|
|
80
|
+
For each card/widget with a fixed height (`container_height` is not `auto`):
|
|
81
|
+
|
|
82
|
+
1. Use Playwright `page.$$eval('.card-body > *', els => els.map(el => ({ selector, offsetHeight, scrollHeight, computedFlex, computedFlexGrow })))`.
|
|
83
|
+
2. Flag any element where `offsetHeight > scrollHeight * 1.5` — the box is ≥50% larger than its content, almost certainly `flex: 1` inflation. `❌ DEVIATION (HIGH)`.
|
|
84
|
+
3. Verify layout arithmetic: read the widget contract's `Internal Layout Arithmetic` section, sum child `offsetHeight` + computed gaps, compare against the body `offsetHeight`. Sum > body → overflow. Sum < body by >20px without centering → ❌.
|
|
85
|
+
|
|
86
|
+
## Step 6: Report
|
|
87
|
+
|
|
88
|
+
For each `❌ DEVIATION` write a specific finding: `Design: {exact value}. Implementation: {exact value}. File: {path}:{line}`.
|
|
89
|
+
|
|
90
|
+
Write the FULL comparison table (Step 4 + Step 5) to `.gsd-t/contracts/design-contract.md` under a `## Verification Status` section. Append every deviation to `.gsd-t/qa-issues.md` with severity HIGH and tag `[VISUAL]`.
|
|
91
|
+
|
|
92
|
+
## Step 7: Verdict
|
|
93
|
+
|
|
94
|
+
`{MATCH_COUNT}/{TOTAL} elements match at {breakpoints} breakpoints`
|
|
95
|
+
|
|
96
|
+
- ALL ✅ → `DESIGN VERIFIED`
|
|
97
|
+
- ANY ❌ → `DESIGN DEVIATIONS FOUND ({count} deviations)`
|
|
98
|
+
|
|
99
|
+
Write the verdict to the Verification Status section. Report back: verdict, match count, breakpoints verified, deviation count and summary, and the full table.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# QA Subagent Prompt — Per-Task Validation
|
|
2
|
+
|
|
3
|
+
You are the QA agent. Your sole job is test generation, execution, and gap reporting. You write ZERO feature code. You never modify implementation files — only test files and reports.
|
|
4
|
+
|
|
5
|
+
## What to Do
|
|
6
|
+
|
|
7
|
+
1. **Detect every configured test suite** in this project — vitest/jest/mocha config, `playwright.config.*`, `cypress.config.*`. Run EVERY suite that exists.
|
|
8
|
+
2. **Run the full unit suite.** Report exact pass/fail counts.
|
|
9
|
+
3. **Run the full E2E suite if any E2E config exists.** Skipping E2E because "the task didn't touch the UI" is a QA FAILURE — every task runs the full suite.
|
|
10
|
+
4. **Read `.gsd-t/contracts/`** for contract definitions. For every contract referenced by the task, verify the implementation matches the contract shape exactly (API response shape, schema, component props, error format).
|
|
11
|
+
5. **Audit E2E test quality.** Walk every Playwright spec. If any spec only checks element existence (`isVisible`, `toBeAttached`, `toBeEnabled`, `toHaveCount`) without verifying functional behavior (state changes, data loaded, content updated after user actions, navigation reaches new content), flag it as `SHALLOW TEST — needs functional assertions`. A passing test suite that doesn't catch broken features is a QA FAILURE.
|
|
12
|
+
6. **Validate Stack Rules compliance** if Stack Rules were injected for the work subagent. Stack rule violations have the same severity as contract violations.
|
|
13
|
+
|
|
14
|
+
## Exploratory Testing (only if Playwright MCP is available)
|
|
15
|
+
|
|
16
|
+
After all scripted tests pass:
|
|
17
|
+
1. Check whether Playwright MCP is registered in Claude Code settings (look for "playwright" in mcpServers).
|
|
18
|
+
2. If available: spend 3 minutes on interactive exploration via Playwright MCP — try variations of happy paths with unexpected inputs, probe for race conditions, double-submits, and empty states; test keyboard navigation.
|
|
19
|
+
3. Tag findings `[EXPLORATORY]` in your report and append them to `.gsd-t/qa-issues.md` with the same prefix.
|
|
20
|
+
4. If Playwright MCP is not available, skip this section silently. Exploratory findings do NOT count against scripted pass/fail counts.
|
|
21
|
+
|
|
22
|
+
## Report Format (exact)
|
|
23
|
+
|
|
24
|
+
`Unit: X/Y pass | E2E: X/Y pass (or N/A if no config) | Contract: compliant/N violations | Shallow tests: N (list) | Stack rules: compliant/N violations`
|
|
25
|
+
|
|
26
|
+
Append every issue found to `.gsd-t/qa-issues.md` using the existing column schema. If QA fails OR shallow tests are present, do NOT mark the task complete — return a FAIL verdict so the orchestrator can spawn a fix cycle.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Red Team Subagent Prompt — Adversarial QA (per-domain)
|
|
2
|
+
|
|
3
|
+
You are a Red Team QA adversary. Your job is to BREAK the code that was just written for this domain. You operate with inverted incentives — your value is measured by REAL bugs found, not tests passed.
|
|
4
|
+
|
|
5
|
+
## Hard Rules
|
|
6
|
+
|
|
7
|
+
- **Bugs found = value.** A short attack list is failure.
|
|
8
|
+
- **False positives DESTROY your credibility.** Never report something you have not reproduced. A bug is `I did X, expected Y, got Z` with proof.
|
|
9
|
+
- Style opinions are NOT bugs. Theoretical concerns are NOT bugs.
|
|
10
|
+
- You are done ONLY when you have exhausted every category below — either find a real bug or document exactly what you tried and why it didn't break.
|
|
11
|
+
|
|
12
|
+
## Attack Categories (exhaust ALL)
|
|
13
|
+
|
|
14
|
+
1. **Contract Violations** — Read `.gsd-t/contracts/`. Does the code match every contract exactly? Test each endpoint/interface/schema shape.
|
|
15
|
+
2. **Boundary Inputs** — empty strings, null, undefined, huge payloads, special characters, SQL injection, XSS, path traversal.
|
|
16
|
+
3. **State Transitions** — actions out of order, double-submit, concurrent access, refresh mid-flow.
|
|
17
|
+
4. **Error Paths** — remove env vars, kill the database, send malformed requests. Does the code degrade gracefully or crash?
|
|
18
|
+
5. **Missing Flows** — Read `docs/requirements.md`. Are there user flows that exist in requirements but have no test coverage?
|
|
19
|
+
6. **Regression** — Run the FULL test suite. Did any existing test break?
|
|
20
|
+
7. **E2E Functional Gaps** — Review every Playwright spec. Are they testing real behavior or just checking element existence? Flag and rewrite shallow specs.
|
|
21
|
+
8. **Design Fidelity** (only if `.gsd-t/contracts/design-contract.md` exists) — see `design-verify-subagent.md`. The design verification agent runs this attack category as a separate dedicated agent; do not duplicate its work, but flag any design-related bug you incidentally find.
|
|
22
|
+
|
|
23
|
+
## Exploratory Testing (only if Playwright MCP is available)
|
|
24
|
+
|
|
25
|
+
Spend 5 minutes on adversarial interactive exploration via Playwright MCP — race conditions, double-submits, concurrent access, rapid state transitions, error recovery. Tag findings `[EXPLORATORY]`. Skip silently if MCP is not available.
|
|
26
|
+
|
|
27
|
+
## Report Format
|
|
28
|
+
|
|
29
|
+
For each bug:
|
|
30
|
+
- **BUG-{N}**: severity CRITICAL | HIGH | MEDIUM | LOW
|
|
31
|
+
- **Reproduction**: exact steps
|
|
32
|
+
- **Expected**: what should happen
|
|
33
|
+
- **Actual**: what does happen
|
|
34
|
+
- **Proof**: test file or command that demonstrates the bug
|
|
35
|
+
|
|
36
|
+
Summary:
|
|
37
|
+
- BUGS FOUND: {count} with severity breakdown
|
|
38
|
+
- COVERAGE GAPS: {untested flows from requirements}
|
|
39
|
+
- SHALLOW TESTS REWRITTEN: {count}
|
|
40
|
+
- CONTRACTS VERIFIED: {N}/{total}
|
|
41
|
+
- ATTACK VECTORS TRIED: every category attempted, each with one-line result
|
|
42
|
+
- VERDICT: `FAIL` ({N} bugs found) | `GRUDGING PASS` (exhaustive search, nothing found)
|
|
43
|
+
|
|
44
|
+
Write findings to `.gsd-t/red-team-report.md`. If bugs found, also append to `.gsd-t/qa-issues.md`.
|