@tekyzinc/gsd-t 2.70.11 → 2.70.13

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 CHANGED
@@ -2,6 +2,24 @@
2
2
 
3
3
  All notable changes to GSD-T are documented here. Updated with each release.
4
4
 
5
+ ## [2.70.13] - 2026-04-06
6
+
7
+ ### Changed (gsd-t-init, gsd-t-init-scan-setup)
8
+ - **Auto-create project directory + GitHub repo** — both `gsd-t-init` and `gsd-t-init-scan-setup` now create the project directory under a configurable base path and auto-create a private GitHub repo via `gh` CLI when a project name is provided as an argument.
9
+ - **Configurable base directory** — `~/.claude/.gsd-t-config` stores `projects_dir` (e.g., `/Users/david/projects`). Set once, never asked again. New projects are created at `{projects_dir}/{project-name}`.
10
+ - **Configurable GitHub org** — `~/.claude/.gsd-t-config` stores `github_org` (e.g., `Tekyz-Inc`). When set, repos are created under the org (`gh repo create {org}/{name}`). When not set, repos are created under the user's personal account.
11
+ - Existing project detection: if the current directory already has code/config files, Step 0 is skipped entirely — no behavior change for existing projects.
12
+
13
+ ## [2.70.12] - 2026-04-06
14
+
15
+ ### Added (design pipeline — element count reconciliation)
16
+ - **Element Count Reconciliation** — new mandatory verification step that runs BEFORE any property or visual comparison. Counts widgets and elements from the Figma decomposition (stored in INDEX.md), counts the built page's widgets and elements via Playwright, and compares. Any mismatch (missing or extra widgets/elements) is a CRITICAL deviation. Added to: `gsd-t-execute` (Step 0 inside Design Verification Agent), `gsd-t-quick` (Step 0), `gsd-t-design-audit` (Step 1.5).
17
+ - **Figma Element Counts table in INDEX.md** — `gsd-t-design-decompose` now writes element/widget/page counts and a per-page element manifest to INDEX.md as the verification anchor. The verification agent reads these counts as ground truth.
18
+ - **5-layer verification model** — design-to-code.md now documents Targets 0-4 in execution order: count reconciliation → contract comparison → Figma comparison → SVG overlay → DOM box model inspection.
19
+
20
+ ### Why
21
+ A missing widget is the most catastrophic deviation but the easiest to miss in a 30+ row comparison table. The agent compares what exists but doesn't notice what's absent. An explicit count gate catches "Figma has 10 widgets, built page has 9 — WHERE IS THE 10TH?" before any property-level work begins.
22
+
5
23
  ## [2.70.11] - 2026-04-06
6
24
 
7
25
  ### Added (design pipeline — DOM box model inspection + layout arithmetic)
@@ -62,6 +62,35 @@ Widget: "Member Segmentation: State"
62
62
  CLASSIFICATION: chart-bar-stacked-vertical (two instances side-by-side)
63
63
  ```
64
64
 
65
+ ## Step 1.5: Element Count Reconciliation (MANDATORY)
66
+
67
+ Before any property comparison, verify the built page has the correct number of elements:
68
+
69
+ 1. **Count from Figma** (from Step 1):
70
+ - Total widgets/cards identified
71
+ - Total elements within widgets (charts, legends, stat cards, controls, tables)
72
+ - Record: `Figma: {N} widgets, {M} total elements`
73
+
74
+ 2. **Count from built page** (open in browser via Playwright):
75
+ - Count top-level visual groups (cards/widgets)
76
+ - Count elements within each group
77
+ - Record: `Built: {N} widgets, {M} total elements`
78
+
79
+ 3. **Compare**:
80
+ - Widget count match? If NO → ❌ CRITICAL: identify MISSING or EXTRA widgets by name
81
+ - Element count match per widget? If NO → ❌ CRITICAL: identify MISSING or EXTRA elements
82
+
83
+ ```markdown
84
+ ### Element Count Reconciliation
85
+
86
+ | Level | Figma | Built | Verdict |
87
+ |--------------------|-------|-------|---------|
88
+ | Widgets (page) | 10 | 9 | ❌ MISSING: video-playlist-widget |
89
+ | Elements (total) | 27 | 24 | ❌ MISSING: 3 elements in video-playlist-widget |
90
+ ```
91
+
92
+ A missing widget is the most catastrophic deviation — it means an entire section of the design was silently dropped. Catch it here before spending effort on property-level comparison of widgets that DO exist.
93
+
65
94
  ## Step 2: Capture the Built Screen
66
95
 
67
96
  Open the built app at the target URL/route. For each widget identified in Step 1:
@@ -280,6 +280,25 @@ Write `INDEX.md` as a navigation map:
280
280
  element contract > widget contract > page contract
281
281
 
282
282
  Widgets and pages reference elements by name. They CANNOT override element visual spec. To customize, create a new element variant.
283
+
284
+ ## Figma Element Counts (MANDATORY — verification anchor)
285
+
286
+ These counts are captured from the Figma decomposition and serve as the
287
+ ground truth during verification. Any mismatch between these counts and
288
+ the built output is a CRITICAL deviation.
289
+
290
+ | Level | Count | Source |
291
+ |----------|-------|---------------------------------|
292
+ | Elements | {N} | Inventory table (Step 1d) |
293
+ | Widgets | {N} | Widget inventory (Step 3) |
294
+ | Pages | {N} | Page inventory (Step 4) |
295
+ | Total | {N} | Sum of all contracts |
296
+
297
+ Per-page element manifest (for verification agent):
298
+ | Page | Widgets | Elements (including widget-internal) |
299
+ |--------------------|---------|--------------------------------------|
300
+ | {dashboard} | {N} | {N} — {list: stat-card ×4, chart-donut ×1, ...} |
301
+ | {analytics} | {N} | {N} — {list} |
283
302
  ```
284
303
 
285
304
  ## Step 6.5: Contract-vs-Figma Verification Gate (MANDATORY)
@@ -632,7 +632,28 @@ each one matches — not assume it does. 'Looks close' is not a verdict.
632
632
  'Appears to match' is not a verdict. The only valid verdicts are MATCH
633
633
  (with proof) or DEVIATION (with specifics).
634
634
 
635
- ## Step 0: Data-Labels Cross-Check (MANDATORY — run FIRST)
635
+ ## Step 0: Element Count Reconciliation (MANDATORY — run BEFORE anything else)
636
+
637
+ Before any visual or property comparison, verify the built page has the
638
+ correct NUMBER of elements. A missing widget is the easiest deviation to
639
+ miss in a 30+ row comparison table — and the most catastrophic.
640
+
641
+ 1. Read INDEX.md (hierarchical) or design-contract.md (flat) to get the
642
+ Figma element counts:
643
+ - Per-page: how many widgets on this page? How many total elements
644
+ (including widget-internal charts, legends, cards, controls)?
645
+ 2. Count the built page's distinct visual elements via Playwright:
646
+ - Widgets/cards (top-level visual groups)
647
+ - Charts, tables, stat cards, legends, controls within each widget
648
+ 3. Compare:
649
+ - Figma widget count vs built widget count → mismatch = ❌ CRITICAL
650
+ - Figma element count vs built element count → mismatch = ❌ CRITICAL
651
+ 4. If counts match → proceed to Step 0.5
652
+ If counts DON'T match → identify WHICH elements are missing or extra:
653
+ 'Figma has {N} widgets, built page has {M}. MISSING: {list}. EXTRA: {list}'
654
+ Log as CRITICAL deviation — do NOT skip, continue with remaining steps.
655
+
656
+ ## Step 0.5: Data-Labels Cross-Check (MANDATORY)
636
657
 
637
658
  Before any visual comparison, verify the built UI is rendering the CORRECT
638
659
  DATA from the design. This is the most common failure mode: agents use
@@ -6,27 +6,54 @@ Can be run from anywhere — does not require being in the project folder first.
6
6
 
7
7
  ## Step 1: Project Directory
8
8
 
9
- First, ask: **"Is `{current directory name}` your project root folder?"**
9
+ ### 1a. Resolve the base projects directory (for new projects)
10
10
 
11
- - **Yes** Stay here and continue to Step 2
12
- - **No** → Ask: "What's the project folder name?" (or use `$ARGUMENTS` if provided)
13
- 1. Check if the folder exists in the current directory
14
- - **Exists** → `cd` into it
15
- - **Does not exist** → Create it, then `cd` into it
11
+ If `$ARGUMENTS` includes a project name:
16
12
 
17
- If `$ARGUMENTS` includes a folder/project name, skip the question and use it directly.
13
+ 1. Check `~/.claude/.gsd-t-config` for settings:
14
+ ```
15
+ # ~/.claude/.gsd-t-config format (one key=value per line):
16
+ projects_dir=/Users/username/projects
17
+ github_org=MyOrg
18
+ ```
19
+ - If `projects_dir` is set → use `{projects_dir}/{project-name}` as the target
20
+ - If not set → ask: "Where should new projects be created? (e.g., /Users/you/projects)"
21
+ Save their answer to `~/.claude/.gsd-t-config` as `projects_dir={path}`
22
+
23
+ 2. Check if the target directory exists:
24
+ - **Exists with files** → `cd` into it (existing project)
25
+ - **Exists but empty** → `cd` into it (new project)
26
+ - **Does not exist** → `mkdir -p {target}` then `cd` into it (new project)
27
+
28
+ If NO `$ARGUMENTS` provided, ask: **"Is `{current directory name}` your project root folder?"**
29
+ - **Yes** → Stay here
30
+ - **No** → Ask for the project name, then apply the resolution above
18
31
 
19
32
  All subsequent steps run from inside the project directory.
20
33
 
21
- ## Step 2: Git Repository Check
34
+ ## Step 2: Git Repository + GitHub Setup
22
35
 
23
36
  1. Check if the directory is inside a git repo: `git rev-parse --is-inside-work-tree`
24
- - **Not a git repo** → Run `git init`
37
+ - **Not a git repo** → Run `git init && git checkout -b main`
25
38
  2. Check for an existing remote: `git remote -v`
26
- - **No remote found** → Ask the user for the GitHub repository URL, then run:
27
- ```
28
- git remote add origin {url}
29
- ```
39
+ - **No remote found** → Try to create one automatically:
40
+ - Check if `gh` CLI is available and authenticated: `gh auth status`
41
+ - If YES:
42
+ - Check `~/.claude/.gsd-t-config` for `github_org` setting
43
+ - If `github_org` is set:
44
+ ```bash
45
+ gh repo create {github_org}/{project-name} --private --source=. --push
46
+ ```
47
+ Log: "Created GitHub repo: {github_org}/{project-name} (private)"
48
+ - If `github_org` is NOT set:
49
+ ```bash
50
+ gh repo create {project-name} --private --source=. --push
51
+ ```
52
+ Log: "Created GitHub repo: {user}/{project-name} (private)"
53
+ - If NO → ask the user for the GitHub repository URL, then run:
54
+ ```
55
+ git remote add origin {url}
56
+ ```
30
57
  - **Remote exists** → Log it and continue
31
58
  3. **Pull existing code from remote** (if any):
32
59
  - Run `git fetch origin` to get remote refs
@@ -2,6 +2,70 @@
2
2
 
3
3
  You are setting up a new project (or converting an existing one) to use the GSD-T contract-driven workflow.
4
4
 
5
+ ## Step 0: Project Directory + Git + GitHub (new projects only)
6
+
7
+ If `$ARGUMENTS` contains a project name AND the current directory is NOT already a project directory (no `package.json`, `pyproject.toml`, `Cargo.toml`, `src/`, or `CLAUDE.md`), this is a NEW project. Set it up from scratch:
8
+
9
+ ### 0a. Resolve the base projects directory
10
+
11
+ Check `~/.claude/.gsd-t-config` for settings:
12
+ ```
13
+ # ~/.claude/.gsd-t-config format (one key=value per line):
14
+ projects_dir=/Users/username/projects
15
+ github_org=MyOrg
16
+ ```
17
+
18
+ - If `projects_dir` is set → use that path
19
+ - If not → ask user: "Where should new projects be created? (e.g., /Users/you/projects)"
20
+ - Save their answer to `~/.claude/.gsd-t-config` as `projects_dir={path}` so they're never asked again
21
+
22
+ ### 0b. Create the project directory
23
+
24
+ ```bash
25
+ mkdir -p {projects_dir}/{project-name}
26
+ cd {projects_dir}/{project-name}
27
+ ```
28
+
29
+ If the directory already exists and has files → treat as an existing project, skip to Step 1.
30
+
31
+ ### 0c. Initialize git
32
+
33
+ ```bash
34
+ git init
35
+ git checkout -b main
36
+ ```
37
+
38
+ ### 0d. Create GitHub repo
39
+
40
+ Check if `gh` CLI is available and authenticated:
41
+ ```bash
42
+ gh auth status
43
+ ```
44
+
45
+ - If `gh` is available and authenticated:
46
+ - Check `~/.claude/.gsd-t-config` for `github_org` setting
47
+ - If `github_org` is set:
48
+ ```bash
49
+ gh repo create {github_org}/{project-name} --private --source=. --push
50
+ ```
51
+ Log: "Created GitHub repo: {github_org}/{project-name} (private)"
52
+ - If `github_org` is NOT set (personal repos):
53
+ ```bash
54
+ gh repo create {project-name} --private --source=. --push
55
+ ```
56
+ Log: "Created GitHub repo: {user}/{project-name} (private)"
57
+ - If `gh` is not available or not authenticated:
58
+ Log: "GitHub CLI not available — skipping repo creation. Create manually and run: `git remote add origin {url}`"
59
+
60
+ ### 0e. Continue with init
61
+
62
+ All subsequent steps run from inside `{projects_dir}/{project-name}`.
63
+
64
+ **Skip Step 0 entirely if:**
65
+ - No project name in `$ARGUMENTS`, OR
66
+ - Current directory already looks like a project (has code/config files), OR
67
+ - Current directory is already inside a git repo with files
68
+
5
69
  ## Step 1: Assess Current State
6
70
 
7
71
  Check what exists:
@@ -259,7 +259,12 @@ comparison table. You write ZERO feature code.
259
259
 
260
260
  FAIL-BY-DEFAULT: Every visual element starts as UNVERIFIED. Prove each matches.
261
261
 
262
- STEP 0 (MANDATORY FIRST): Data-labels cross-check.
262
+ STEP 0 (MANDATORY FIRST): Element count reconciliation.
263
+ Read INDEX.md or design-contract.md for Figma element counts (widgets per page,
264
+ total elements per page). Count the built page's widgets and elements via Playwright.
265
+ If counts don't match → CRITICAL DEVIATION: identify which are MISSING or EXTRA.
266
+
267
+ STEP 0.5: Data-labels cross-check.
263
268
  For each element contract (or design-contract.md section), read the Test Fixture.
264
269
  Verify EVERY label, value, percentage from the fixture appears verbatim in the
265
270
  rendered UI. If any is missing → CRITICAL DEVIATION (wrong data). Wrong data
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekyzinc/gsd-t",
3
- "version": "2.70.11",
3
+ "version": "2.70.13",
4
4
  "description": "GSD-T: Contract-Driven Development for Claude Code — 54 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",
@@ -560,7 +560,12 @@ MANDATORY:
560
560
  The verification agent compares the built frontend against **TWO sources** — not just one:
561
561
 
562
562
  ```
563
- VERIFICATION TARGETS:
563
+ VERIFICATION TARGETS (run in this order):
564
+ ├── TARGET 0: ELEMENT COUNT RECONCILIATION (run FIRST)
565
+ │ Does the built page have the same NUMBER of widgets and elements
566
+ │ as the Figma design? A missing widget is the most catastrophic
567
+ │ deviation — catch it before spending effort on property comparison.
568
+
564
569
  ├── TARGET 1: Built screen vs DESIGN CONTRACTS
565
570
  │ Does the code match the contract's claimed values?
566
571
  │ (This is what the 13-task validation proved works — airtight.)
@@ -570,15 +575,19 @@ VERIFICATION TARGETS:
570
575
  │ This catches: contracts that were wrong to begin with,
571
576
  │ chart type misclassification, hallucinated data, missing elements.
572
577
 
573
- └── TARGET 3: SVG STRUCTURAL OVERLAY (MANDATORY)
574
- Export Figma frame as SVG → parse element positions/dimensions/colors
575
- → compare geometrically against built DOM bounding boxes.
576
- This catches: aggregate spacing drift, alignment issues, proportion
577
- errors that pass property-level checks but look wrong visually.
578
- Mechanical, non-interpretive — no agent reasoning, just geometry.
578
+ ├── TARGET 3: SVG STRUCTURAL OVERLAY (MANDATORY)
579
+ Export Figma frame as SVG → parse element positions/dimensions/colors
580
+ → compare geometrically against built DOM bounding boxes.
581
+ This catches: aggregate spacing drift, alignment issues, proportion
582
+ errors that pass property-level checks but look wrong visually.
583
+
584
+ └── TARGET 4: DOM BOX MODEL INSPECTION (fixed-height containers)
585
+ Evaluate offsetHeight vs scrollHeight per child element.
586
+ This catches: inflated flex boxes, wrong space distribution,
587
+ elements growing beyond their content size.
579
588
  ```
580
589
 
581
- **Targets 2 and 3 are complementary.** Target 2 catches wrong values (property-level). Target 3 catches wrong placement (geometry-level). Together they cover both "is each value correct?" and "does the whole page look right?"
590
+ **Each target catches a different failure class.** Target 0: missing elements. Target 1: wrong values. Target 2: wrong contracts. Target 3: wrong placement. Target 4: wrong space distribution. All five are needed no single layer catches everything.
582
591
 
583
592
  ### Verification agent workflow
584
593
 
@@ -652,6 +661,8 @@ Before marking any design implementation task as complete:
652
661
  - [ ] Design system / component library identified (or confirmed none) and documented in design contract
653
662
  - [ ] Library components mapped to design elements — custom build only where no library match exists
654
663
  - [ ] Design source identified and documented in design contract
664
+ - [ ] Element counts recorded in INDEX.md (widgets per page, elements per page)
665
+ - [ ] Built page element count matches Figma element count (no missing/extra widgets)
655
666
  - [ ] Stack capability evaluated — all design requirements achievable (or alternatives approved)
656
667
  - [ ] All design tokens extracted (colors, typography, spacing, borders, shadows)
657
668
  - [ ] Tokens written to `.gsd-t/contracts/design-contract.md`