@tekyzinc/gsd-t 2.70.15 → 2.70.16

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.
@@ -252,11 +252,38 @@ For each widget contract:
252
252
  1. Copy `templates/widget-contract.md` as scaffold
253
253
  2. Reference elements by name in the "Elements Used" table
254
254
  3. Define layout, data binding, responsive behavior, widget-level verification
255
+ 4. **Extract layout CSS from `get_design_context` output (MANDATORY)**:
256
+ The Figma MCP returns code with explicit CSS layout properties. Parse these into the
257
+ widget contract's "Internal Element Layout" section:
258
+ - `body_layout`: Look at the parent container's CSS in the Figma output.
259
+ `flex flex-row` or `flex gap-[16px] items-center` → `flex-row`.
260
+ `flex flex-col` or `flex-col gap-[16px]` → `flex-column`.
261
+ `grid grid-cols-2` → `grid 2-col`. Write EXACTLY what the Figma shows.
262
+ - `body_gap`: Extract the gap value from the Figma CSS (e.g., `gap-[16px]` → `16px`)
263
+ - Legend position: If legend is a SIBLING of the chart in a `flex-row` container →
264
+ legend is BESIDE the chart (`body_sidebar`). If legend is BELOW the chart in a
265
+ `flex-col` container → legend is in `footer_legend`. This distinction is CRITICAL —
266
+ it's the difference between a side-by-side layout and a stacked layout.
267
+ - `container_height`: If the Figma shows `h-[334px]` → fixed height `334px`.
268
+ If no explicit height → `auto`.
255
269
 
256
270
  For each page contract:
257
271
  1. Copy `templates/page-contract.md` as scaffold
258
272
  2. Reference widgets in grid positions
259
273
  3. Define route, data loading, global states, performance budget
274
+ 4. **Extract grid structure from `get_design_context` output (MANDATORY)**:
275
+ The Figma MCP returns the page's layout as nested containers. Parse the structure:
276
+ - Count "Row" or `flex-row` containers and their children to determine grid dimensions
277
+ (e.g., 2 Row containers with 2 cards each → `grid 2×2`, NOT `grid 1×4`)
278
+ - Extract `gap` values between rows and between cards within rows
279
+ - Extract explicit heights on cards (e.g., `h-[334px]`)
280
+ - Document in the page contract's "Widgets Used" table:
281
+ ```
282
+ | grid[row=1, cols=1-2] | most-popular-tools + number-of-tools | 2 per row |
283
+ | grid[row=2, cols=1-2] | time-on-page + number-of-visits | 2 per row |
284
+ ```
285
+ - **Anti-pattern**: Seeing 4 sibling cards and writing `grid-cols-4` when the Figma
286
+ groups them into 2 rows of 2. ALWAYS check the parent container structure.
260
287
 
261
288
  Write `INDEX.md` as a navigation map:
262
289
 
@@ -309,12 +309,57 @@ Execute the task above:
309
309
  recovers (retry button works, form can be resubmitted, etc.).
310
310
  A test that would pass on an empty HTML page with the right element IDs is useless.
311
311
  Every assertion must prove the FEATURE WORKS, not that the ELEMENT EXISTS.
312
- 8. **Visual Design Note** (when design-to-code stack rule is active):
313
- Do NOT perform visual verification yourself a dedicated Design Verification Agent
314
- (Step 5.25) runs after all domain tasks complete and handles the full visual comparison.
315
- Your job: write precise code from the design contract tokens. Use exact hex colors,
316
- exact spacing values, exact typography. Every CSS value must trace to the design contract.
317
- The verification agent will open a browser and prove whether your code matches.
312
+ 8. **Render-Measure-Compare Loop** (when design-to-code stack rule is active — MANDATORY):
313
+ After implementing the component, you MUST verify it renders correctly by measuring
314
+ the actual DOM output against the contract's layout spec. This is not optional.
315
+ Do NOT rely on visual inspection or screenshots measure mechanically.
316
+
317
+ a. **Render**: Start the dev server if not running. Navigate to a route where the
318
+ component is visible (or create a temporary test route that renders it in isolation).
319
+
320
+ b. **Measure via Playwright** — run `page.evaluate()` to extract DOM properties:
321
+ ```javascript
322
+ // For a widget: measure its internal layout
323
+ const el = document.querySelector('.widget-selector');
324
+ const style = getComputedStyle(el);
325
+ return {
326
+ display: style.display, // 'flex' or 'grid'
327
+ flexDirection: style.flexDirection, // 'row' or 'column'
328
+ gap: style.gap,
329
+ gridTemplateColumns: style.gridTemplateColumns,
330
+ width: el.offsetWidth,
331
+ height: el.offsetHeight,
332
+ childCount: el.children.length,
333
+ children: Array.from(el.children).map(c => ({
334
+ tag: c.tagName,
335
+ width: c.offsetWidth,
336
+ height: c.offsetHeight,
337
+ display: getComputedStyle(c).display,
338
+ flexDirection: getComputedStyle(c).flexDirection,
339
+ }))
340
+ };
341
+ ```
342
+
343
+ c. **Compare to contract** — check each measured value against the contract spec:
344
+ - `body_layout: flex-row` → verify `flexDirection === 'row'`
345
+ - `container_height: 334px` → verify `height === 334` (±2px tolerance)
346
+ - Grid `2×2` → verify parent has 2 row children, each with 2 card children
347
+ - Legend position: if contract says `body_sidebar` (beside chart) →
348
+ verify legend and chart share a `flex-row` parent.
349
+ If contract says `footer_legend` (below chart) →
350
+ verify legend is in a `flex-column` parent below the chart.
351
+
352
+ d. **Fix mismatches** — if ANY measurement doesn't match the contract:
353
+ - Log: "LAYOUT MISMATCH: {property} expected {contract value}, got {measured value}"
354
+ - Fix the code to match the contract spec
355
+ - Re-render and re-measure (max 2 fix cycles)
356
+ - If still mismatched after 2 cycles → log to `.gsd-t/deferred-items.md`
357
+
358
+ e. **All pass** → log "RENDER-MEASURE PASS: {N} layout properties verified" and proceed.
359
+
360
+ This loop catches the exact class of errors that visual inspection misses:
361
+ grid-cols-4 instead of 2×2, legend below instead of beside, wrong flex-direction.
362
+ These are data comparisons, not visual judgments — the same kind of check as a unit test.
318
363
  9. Run ALL test suites — this is NOT optional, not conditional, not "if applicable":
319
364
  a. Detect configured test runners: check for vitest/jest config, playwright.config.*, cypress.config.*
320
365
  b. Run EVERY detected suite. Unit tests alone are NEVER sufficient when E2E exists.
@@ -159,8 +159,16 @@ When you encounter unexpected situations:
159
159
  - If building/modifying a PAGE: IMPORT existing widget components — do NOT rebuild widget functionality inline.
160
160
  - **Contract is authoritative**: Follow the contract spec, not the Figma screenshot, when they appear to disagree.
161
161
  5. Make the change — **adapt new code to existing structures**, not the other way around
162
- 6. Verify it works
163
- 7. Commit: `[quick] {description}`
162
+ 6. **Render-Measure-Compare** (if design component — MANDATORY):
163
+ After implementing, verify via Playwright DOM measurement (not screenshots):
164
+ - Render the component in browser
165
+ - `page.evaluate()` to extract: display, flexDirection, gap, gridTemplateColumns,
166
+ offsetWidth, offsetHeight, child count and layout
167
+ - Compare each value to the contract's layout spec (body_layout, container_height, etc.)
168
+ - Mismatches → fix code → re-measure (max 2 cycles)
169
+ - This catches: wrong grid structure, legend below vs beside, wrong flex-direction
170
+ 7. Verify it works
171
+ 8. Commit: `[quick] {description}`
164
172
 
165
173
  ## Step 3.5: Emit Task Metrics
166
174
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekyzinc/gsd-t",
3
- "version": "2.70.15",
3
+ "version": "2.70.16",
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",