Skip to content

v0.5 audit-fixes + drift loop closing — B7 + rule #3 + B8 active + drifts-mapping.md - #6

Merged
k-rutten merged 2 commits into
mainfrom
audit-fixes-v0.4
May 12, 2026
Merged

v0.5 audit-fixes + drift loop closing — B7 + rule #3 + B8 active + drifts-mapping.md#6
k-rutten merged 2 commits into
mainfrom
audit-fixes-v0.4

Conversation

@k-rutten

@k-rutten k-rutten commented May 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Three audit-driven SKILL.md updates from internal pre-skill testing + skills.sh comparison. Single PR scope: v0.3 → v0.4.

No individual contributor names in any committed file. Verified via grep before commit.

Wat dit concreet toevoegt en bijdraagt

Probleem (geobserveerd) Fix Waarde — kwaliteit / UI polish
Page-overschrijving — bestaande page-code volledig vervangen ipv aangevuld (pre-skill internal testing) B7 § File-path determination: Read(target-path) vóór emit, prefer extend > replace, halt-op-twijfel per regel-range Workflow-safeguard (geen direct UI polish). Voorkomt code-loss + revert/restart cyclus (~30 min per occurrence).
Dual-styling regressionclassName alongside Emotion in zelfde element (pre-skill internal testing) Rule #3 verhard naar binary halt-on-mismatch. Implement leest tokens.md § Project styling stack bij B4.3, halt direct op tweede styling-API UI consistentie: één styling-API per element. Voorkomt specificity-conflicts en handmatige refactor.
Post-emit blindheid — visuele drift gemist tot PR-review (skills.sh stap 7 actief, onze v0.3 B8 passief) B8 actief: B8.1 dev server → B8.2 screenshot → B8.3 diff tegen Figma → B8.4 7-point check op diff → B8.5 in-session prompt UI verificatie + actie in-session. Dev krijgt visuele bevestiging vóór doorwerken; voorkomt drift die anders in prod eindigt.

Bewust niet in scope

v0.5 design-fidelity fixes (Resolution-mode 4 inline-fix met audit-trail, asset-materialize primary, fidelity-priority per element) — gecaptured in plan-file, na v0.4 dogfood-evidence.

v1.0 drift loop closing (drifts-implement.md write-authority, drift-summary in chat na emit, decision-routing) — onafhankelijk van mapping coordination via aparte drifts-implement.md file, maar wacht op v0.4 dogfood.

Files changed

  • SKILL.md — frontmatter 0.3 → 0.4, B7 + rule Fase 3 templates + v0.3 — resolved beslissingen + scope clausule #3 + B8 herzieningen
  • templates/post-emit-visual-check.md — B8.1-B8.5 procedure + rollback-prompt template
  • LESSONS.md — entry 3 [confirmation] over drie fixes met evidence
  • DEFERRED-FIXES.md — audit items I1, I2, I3 → resolved-decisions
  • PLAN.md — Owner-veld verwijderd (geen individuele namen)

Bloat-check verklaring

Per fix is een Cost/benefit geëxpliciteerd in commit-message. Bewust geschrapt:

  • B6 gating hardening — v0.3 zegt al "Halt on any failure". Geen aanvullende rule-wijziging nodig.
  • Rule #13 — B8 actief maken is procedure-update via B8.1-B8.5, geen rule-text wijziging. Skill blijft op 12 rules.

Test plan

  • version: "0.4" in frontmatter
  • Rule Fase 3 templates + v0.3 — resolved beslissingen + scope clausule #3 leest "Single styling API — halt on mismatch (binary)"
  • B7 noemt Read(target-path) + extend>replace + halt-on-doubt per regel-range
  • B8 heeft B8.1-B8.5 actieve stappen met in-session 3-optie prompt
  • templates/post-emit-visual-check.md bevat B8.1-B8.5 procedure-blok
  • LESSONS entry 3 documenteert drie fixes
  • DEFERRED-FIXES audit I1, I2, I3 in resolved-decisions
  • PLAN.md heeft geen Owner: veld
  • grep -r "Pelle\|Kevin Rutten\|<andere namen>" --include="*.md" op deze branch geeft nul hits
  • Dogfood-pass na merge: run /figma-to-code-implement <Figma-link> op een echt project; verifieer dat replace-regression, dual-styling en visuele drift daadwerkelijk worden gevangen

Summary by CodeRabbit

  • Documentation
    • Updated v0.4 procedures: read-before-write file handling and binary halt-on-styling-mismatch
    • Replaced post-emit check with a 5-step visual verification workflow including screenshot diffing and in-session decision prompts
    • Added emit-time drift-summary chat and a new implement-owned drifts-mapping template for recording drift decisions (skill spec bumped to v0.5)
    • Minor planning/status metadata cleanup

Review Change Stack

…tive diff

Three audit-driven SKILL.md updates from internal pre-skill testing +
skills.sh comparison. All fixes addressed in a single PR scope.

SKILL.md changes:
- frontmatter version 0.3 → 0.4
- B7 § File-path determination: read-before-write procedure.
  Run Read(target-path) first; on file-found prefer extend > replace;
  halt-on-doubt per regel-range. Addresses page-overwrite regression
  observed in pre-skill internal testing.
- Rule #3: hardened from "refuse to introduce parallel paradigm" to
  binary halt-on-mismatch. Implement reads tokens.md § Project styling
  stack at B4.3 start, hardcodes the API, halts on second styling-API
  detection in same element. Addresses dual-styling regression.
- B8 § Post-emit visual validation: rewritten as active diff with
  five sub-steps (B8.1-B8.5). B8.1 starts dev server, B8.2 captures
  rendered screenshot, B8.3 diffs against Figma reference, B8.4
  applies 7-point check to delta-list, B8.5 prompts user with three
  options (rollback / accept as drift / update mapping) on critical
  mismatch. Closes post-emit-blindheid gap before PR-review.
  No new rule #13 — procedure update only.

templates/post-emit-visual-check.md updated with B8.1-B8.5 procedure
and rollback-prompt template matching SKILL.md B8.

LESSONS.md entry 3 [confirmation] documents the three fixes with
rationale and dogfood proposal.

DEFERRED-FIXES.md audit items I1, I2, I3 moved to resolved-decisions.

PLAN.md: Owner field removed (no individual names in skill files).

v0.5 design-fidelity fixes (Resolution-mode 4 inline-fix audit-trail,
asset-materialize, fidelity-priority) and v1.0 drift loop closing
(drifts-implement.md write authority) are out of scope for this PR —
captured in plan-file for follow-up.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 12, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR updates the figma-to-code-implement spec and templates: skill version bumped to 0.5, file-path rules changed to read-before-write, single-styling-API detection now halts the emit, post-emit validation becomes an active five-step visual-diff with in-session drift decisions, and an implement-owned drifts-mapping.md template is added. Project lessons and a small PLAN metadata line were updated.

Changes

Spec, templates, and project records

Layer / File(s) Summary
Version bump and audit resolution record
SKILL.md, DEFERRED-FIXES.md
Skill version updated (→ 0.5) and DEFERRED-FIXES.md extended with I1–I3 and C1 recording read-before-write, styling halt, and active post-emit drift steps.
File-path determination (read-before-write)
SKILL.md
File-path determination rewritten to Read(target-path) first, prefer minimal-scope Edit/extension, require per-range permission for replacements, and halt/ask when a new file target is needed.
Single styling-API binary halt
SKILL.md
“Single styling API” rule now requires reading tokens.md project styling stack at B4.3 start and halts the emit pass on detection of a second styling API (reported as B6 check #2).
Post-emit active visual diff & drift decision loop
SKILL.md, templates/post-emit-visual-check.md, templates/drifts-mapping.md
B8 replaced with a five-step active workflow (dev server, screenshot, Figma diff, 7-point checklist, in-session decision). Adds an emit-time drift-summary chat step and instructs implement-owned drifts-mapping.md for recording per-drift/batch decisions. Templates updated to match.
Lessons and project metadata
LESSONS.md, PLAN.md
Two LESSONS.md entries appended (2026-05-12) documenting v0.4 fixes and v0.5 loop-closing steps; **Owner:** Kevin Rutten. line removed from PLAN.md status block.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 From tokens checked to files read first,
I hop through diffs where pixels conversed,
When styles collide I stop and stare,
Drifts get logged with careful care—
A little rabbit approves this burst!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title mentions v0.5 audit-fixes + drift loop closing with B7, rule #3, B8, and drifts-mapping.md, which aligns with the primary changes across SKILL.md, DEFERRED-FIXES.md, LESSONS.md, templates, and the new drifts-mapping.md template.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch audit-fixes-v0.4

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
templates/post-emit-visual-check.md (1)

49-62: 💤 Low value

Consider adding language specifier to the code block.

The in-session prompt structure with three explicit options (rollback / accept as drift / update mapping) properly enforces the drift discipline. However, the code block at line 50 lacks a language specifier.

📝 Suggested improvement for consistency

While the block contains template output rather than executable code, adding a language specifier (e.g., text or markdown) improves consistency with markdown best practices:

-**On mismatch (1+ mismatches) — B8.5 in-session prompt:**
-```
+**On mismatch (1+ mismatches) — B8.5 in-session prompt:**
+```text
 ⚠️ B8 visual validation: <X> mismatch(es) detected.

As per coding guidelines, this addresses the markdownlint warning about fenced code blocks requiring a language specification.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@templates/post-emit-visual-check.md` around lines 49 - 62, The fenced code
block under the "**On mismatch (1+ mismatches) — B8.5 in-session prompt:**"
heading (the block starting with "⚠️ B8 visual validation: <X> mismatch(es)
detected.") is missing a language specifier; update the opening fence from ```
to a language-tagged fence such as ```text (or ```markdown) to satisfy
markdownlint and maintain consistency, and apply the same change to any similar
template blocks if present.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@templates/post-emit-visual-check.md`:
- Around line 49-62: The fenced code block under the "**On mismatch (1+
mismatches) — B8.5 in-session prompt:**" heading (the block starting with "⚠️ B8
visual validation: <X> mismatch(es) detected.") is missing a language specifier;
update the opening fence from ``` to a language-tagged fence such as ```text (or
```markdown) to satisfy markdownlint and maintain consistency, and apply the
same change to any similar template blocks if present.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 972ba3c2-c5c4-4260-b00b-7fa1c7876c2a

📥 Commits

Reviewing files that changed from the base of the PR and between db038ef and 56e8bc2.

📒 Files selected for processing (5)
  • DEFERRED-FIXES.md
  • LESSONS.md
  • PLAN.md
  • SKILL.md
  • templates/post-emit-visual-check.md
💤 Files with no reviewable changes (1)
  • PLAN.md

…ption

Sluit de "drift = archief" valkuil door drift-summary in chat na elke emit
met decision-prompt per drift, plus implement-owned drifts-mapping.md file
voor status-tracking. Onafhankelijk van mapping-coordination.

SKILL.md changes:
- frontmatter version 0.4 → 0.5
- Rule #8 uitgebreid: na emit-completion print drift-summary in chat met
  decision-prompt per drift (Rollback / Accept / Update code / Update
  mapping). User reageert per drift of in batch. Status-update direct
  in drifts-mapping.md.
- Rule #10 uitzondering: implement schrijft in eigen drifts-mapping.md
  (parallel aan mapping's drifts.md). Andere mapping-files blijven
  read-only.
- § Mapping → implement contract § Write herstructureerd:
  - Mapping-owned files (drifts.md, verify-queue.md, etc.) read-only met
    twee propose-to-user exceptions
  - Implement-owned drifts-mapping.md: direct schrijven na user-decision
    (geen propose-to-user gate)
- B8.5 prompt-options uitgebreid: 4 opties met automatische
  status-tracking in drifts-mapping.md
- Nieuwe B8.6 step: post-emit drift-summary in chat voor alle drifts
  (B8 detectie + mapping's drifts.md items in scope)

templates/drifts-mapping.md (nieuw):
- Format documentatie: [date][severity][owner] origin — description.
  Decision: <action>. Status: <STATUS>
- Schema-versie tracking voor toekomstige iteraties
- Append-only entry-sectie

LESSONS.md entry 4 [confirmation] documenteert loop-closing rationale +
proposal voor dogfood-validatie.

DEFERRED-FIXES.md C1 (Loop closing implement → propose-to-mapping)
verschoven naar resolved-decisions.

Architectuur-keuze: aparte file drifts-mapping.md ipv schrijven in
mapping's drifts.md. Heldere scheiding van write-authority — mapping
owns drifts.md, implement owns drifts-mapping.md. Geen
coordination-PR met mapping nodig voor v0.5 ship.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@k-rutten k-rutten changed the title v0.4 audit-fixes — B7 read-before-write + rule #3 binary halt + B8 active diff v0.5 audit-fixes + drift loop closing — B7 + rule #3 + B8 active + drifts-mapping.md May 12, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@DEFERRED-FIXES.md`:
- Line 117: Update the option count text in the "Audit I3: Post-emit
screenshot-diff actief" entry so the in-session prompt count matches the actual
listed actions: change the phrase "3 opties" to "4 opties" (or otherwise adjust
the listed actions to three) to align with B8/B8.5 prompt semantics referenced
in the diff; specifically edit the line containing "B8 herzien naar vijf actieve
sub-stappen (..., in-session prompt bij critical mismatch met 3 opties)" to
reflect "4 opties" (or remove one action) so the procedure and prompt remain
consistent.

In `@LESSONS.md`:
- Line 22: The LESSONS.md text references the wrong artifact name: replace
"drifts-implement.md" with the actual artifact name "drifts-mapping.md" (or vice
versa if the artifact should be renamed) so the proposal line consistently
points to the correct file; update the string in the Proposal sentence in
LESSONS.md and any other occurrences to ensure the reference to the drifts
mapping/implementation artifact is consistent across the repo.

In `@SKILL.md`:
- Line 68: Rule `#8`'s drift actions and the Write schema / B8.5 enums are
inconsistent (examples: "Inline-fix-override" vs "Update mapping", "revert" vs
"rollback"); unify to a single canonical action set (choose one normalized set
such as: Rollback, Accept, UpdateMapping, InlineFixOverride) and replace all
occurrences accordingly in the decision generator, the drift-summary chat
prompt, and the writer that emits to drifts-mapping.md; update enum/constant
names in the components handling drift decisions (references: Rule `#8` text,
drifts.md consumer/generator, Write schema, B8.5 decision logic, and the
drifts-mapping.md writer) and ensure the logging/parsing code expects the
canonical tokens so parsing and status updates remain deterministic.
- Around line 319-345: B8 currently contains both detection steps (B8.3/B8.4)
and implementation decisions, conflicting with the SKILL.md verb-role rule;
update SKILL.md so detection lives in the mapping skill and implementation only
performs actions on decisions: change B8.3/B8.4 wording to mapping verbs like
"capture", "compare", "generate delta-list" and move any "detect" / "mark"
responsibilities to mapping, and keep B8.5 as the implement-step for user-driven
actions ("Rollback", "Accept", "Update code", "Update mapping"); ensure the
verbs list in the header and the lines for B8.3, B8.4, and B8.5 consistently use
mapping vs implement verbs per the guideline.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0f5560c1-4731-4b1d-9f15-cfbb2fc5a37f

📥 Commits

Reviewing files that changed from the base of the PR and between 56e8bc2 and f521a0e.

📒 Files selected for processing (4)
  • DEFERRED-FIXES.md
  • LESSONS.md
  • SKILL.md
  • templates/drifts-mapping.md

Comment thread DEFERRED-FIXES.md
- **Confirmation gate before B7 emit** — resolved (v0.3): no skill-level confirmation gate. Host environment provides the safety nets — Claude Code's permission-system asks per file-write, and the project's PR-review process catches issues before merge to main. A skill-level halt-and-ask would duplicate those gates without adding safety. SKILL.md B7 makes this explicit.
- **Audit I1: Differential emit op bestaande files** — resolved (v0.4): B7 § File-path determination herzien naar Read-before-write. Bestaande file: prefer extend > replace. Twijfel → halt per regel-range. Voorkomt page-overschrijving regression uit pre-skill testing.
- **Audit I2: Stack-hardcoding refuse-on-mismatch** — resolved (v0.4): rule #3 verhard naar binary halt-on-mismatch. Implement leest `tokens.md § Project styling stack` bij start B4.3, halt direct op tweede styling-API. Voorkomt dual-styling regression uit pre-skill testing.
- **Audit I3: Post-emit screenshot-diff actief** — resolved (v0.4): B8 herzien naar vijf actieve sub-stappen (dev server start, screenshot capture, diff tegen Figma, 7-point check op diff, in-session prompt bij critical mismatch met 3 opties). Procedure-update, geen rule-text bloat.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update option count to match B8.5 prompt.

This says “3 opties,” but the current flow lists 4 actions (Rollback, Accept, Update code, Update mapping). Keep these aligned to avoid procedural drift.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@DEFERRED-FIXES.md` at line 117, Update the option count text in the "Audit
I3: Post-emit screenshot-diff actief" entry so the in-session prompt count
matches the actual listed actions: change the phrase "3 opties" to "4 opties"
(or otherwise adjust the listed actions to three) to align with B8/B8.5 prompt
semantics referenced in the diff; specifically edit the line containing "B8
herzien naar vijf actieve sub-stappen (..., in-session prompt bij critical
mismatch met 3 opties)" to reflect "4 opties" (or remove one action) so the
procedure and prompt remain consistent.

Comment thread LESSONS.md
[LESSON — 2026-05-12] [confirmation]
Situation: Audit-based v0.4 fixes from skills.sh comparison + pre-skill internal testing observations. Three fixes landed: B7 differential emit (Read-before-write to prevent page-overschrijving), Rule #3 binair halt-on-mismatch (dual-styling regression prevention), B8 actief screenshot-diff (post-emit verification in-session).
What worked: Each fix has Wat-dit-toevoegt rationale + minimal text-investering. B7 is workflow-safeguard for proven regression. Rule #3 hardening makes "refuse" actionable as halt. B8 active diff closes the post-emit-blindness gap before PR-review (workflow-context: Claude Code session = primary safety net, not PR).
Proposal: Dogfood v0.4 on a real implement-pass before adding v0.5 (design-fidelity) or v1.0 (drift loop closing via drifts-implement.md). Confirm fixes prevent observed failures; only then expand scope.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix artifact name mismatch (drifts-implement.md vs drifts-mapping.md).

This references a file name that doesn’t match the introduced artifact and may create tracking confusion in later updates.

- Proposal: Dogfood v0.4 on a real implement-pass before adding v0.5 (design-fidelity) or v1.0 (drift loop closing via drifts-implement.md).
+ Proposal: Dogfood v0.4 on a real implement-pass before adding v0.5 (design-fidelity) or v1.0 (drift loop closing via drifts-mapping.md).
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Proposal: Dogfood v0.4 on a real implement-pass before adding v0.5 (design-fidelity) or v1.0 (drift loop closing via drifts-implement.md). Confirm fixes prevent observed failures; only then expand scope.
Proposal: Dogfood v0.4 on a real implement-pass before adding v0.5 (design-fidelity) or v1.0 (drift loop closing via drifts-mapping.md). Confirm fixes prevent observed failures; only then expand scope.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@LESSONS.md` at line 22, The LESSONS.md text references the wrong artifact
name: replace "drifts-implement.md" with the actual artifact name
"drifts-mapping.md" (or vice versa if the artifact should be renamed) so the
proposal line consistently points to the correct file; update the string in the
Proposal sentence in LESSONS.md and any other occurrences to ensure the
reference to the drifts mapping/implementation artifact is consistent across the
repo.

Comment thread SKILL.md
7. **Verify-queue blocks emit — same per-component spec only.** If `verify-queue.md` has an item linked to the **same per-component spec** as the emit-scope: pause and ask user. Items in other specs do not block (smallest meaningful blocking scope; broader definitions deadlock the user on every implement run). Don't improvise.

8. **Surface mapping-recorded drift — never silently resolve.** Read `drifts.md` and per-component spec drift notes before emit. Drifts in scope are surfaced to the user as design decisions, not silently fixed. Implement does not detect new drift — mapping does that.
8. **Surface drift — and close the decision loop.** Read `drifts.md` (mapping-owned) and per-component spec drift notes before emit. **After emit-completion, print a drift-summary in chat** with decision-prompt per drift (Rollback / Accept / Update code / Inline-fix-override). User reageert per drift of in batch. Implement writes status updates to **`drifts-mapping.md`** (implement-owned, parallel to mapping's `drifts.md`). Drift wordt beslispunt, niet archief.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Unify drift decision enums across Rule #8, Write schema, and B8.5.

The allowed actions are currently inconsistent (Inline-fix-override vs Update mapping, and revert vs rollback). This breaks deterministic handling and log parsing for drifts-mapping.md.

Suggested alignment (single canonical action set)
-8. **Surface drift — and close the decision loop.** ... (Rollback / Accept / Update code / Inline-fix-override).
+8. **Surface drift — and close the decision loop.** ... (Rollback / Accept / Update code / Update mapping).

-[YYYY-MM-DD] ... Decision: <revert | accept | update-code | inline-fix-override>. Status: ...
+[YYYY-MM-DD] ... Decision: <rollback | accept | update-code | update-mapping>. Status: ...

Also applies to: 124-128, 338-343

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@SKILL.md` at line 68, Rule `#8`'s drift actions and the Write schema / B8.5
enums are inconsistent (examples: "Inline-fix-override" vs "Update mapping",
"revert" vs "rollback"); unify to a single canonical action set (choose one
normalized set such as: Rollback, Accept, UpdateMapping, InlineFixOverride) and
replace all occurrences accordingly in the decision generator, the drift-summary
chat prompt, and the writer that emits to drifts-mapping.md; update
enum/constant names in the components handling drift decisions (references: Rule
`#8` text, drifts.md consumer/generator, Write schema, B8.5 decision logic, and
the drifts-mapping.md writer) and ensure the logging/parsing code expects the
canonical tokens so parsing and status updates remain deterministic.

Comment thread SKILL.md
Comment on lines +319 to +345
### B8. Post-emit visual validation — active diff

Compare the emit against the screenshot captured in B3.
Run actively in the same Claude Code session as B7. Five sub-steps:

| # | Check |
|---|---|
| 1 | Layout — spacing, alignment, sizing match the screenshot |
| 2 | Typography — font-family, size, weight, line-height |
| 3 | Colors — exact match on token values |
| 4 | Interactive states render per variant-mapping |
| 5 | Responsive behavior follows Figma constraints |
| 6 | Assets render correctly |
| 7 | Accessibility — aria-labels, alt text, semantic structure |

Mismatch found → surface as drift (rule #8), never as inline pixel-fix (rule #11).
- **B8.1 Start dev server.** Use project's documented run-command (`npm run dev`, `pnpm dev`, `bun dev`, etc.). If not running, start in background; if running, reuse existing port. Wait for "ready" output before continuing.
- **B8.2 Capture rendered screenshot.** Open the rendered route in Claude Code preview (or framework-equivalent), capture as image.
- **B8.3 Diff against Figma reference.** Compare rendered screenshot against `mcp__Figma__get_screenshot(<nodeId>)` from B3. Generate a delta-list per visual category.
- **B8.4 7-point check on the diff.** Apply original 7-point checklist to the delta-list, not the rendered screenshot alone. Mark each row as ✓ match, ⚠ minor delta, or ✗ critical delta:

| # | Check |
|---|---|
| 1 | Layout — spacing, alignment, sizing match the screenshot |
| 2 | Typography — font-family, size, weight, line-height |
| 3 | Colors — exact match on token values |
| 4 | Interactive states render per variant-mapping |
| 5 | Responsive behavior follows Figma constraints |
| 6 | Assets render correctly |
| 7 | Accessibility — aria-labels, alt text, semantic structure |

- **B8.5 In-session prompt on critical mismatch.** If ≥1 ✗ critical delta: do not let the emit pass without user-decision. Prompt (per drift of in batch):
- **Rollback** — `git restore` the changed files, end implement-pass with no commit.
- **Accept** — write drift-row in `drifts-mapping.md` met status `ACCEPTED`. Code blijft staan.
- **Update code** — implement past emit aan op user-aanwijzing. Drift-row in `drifts-mapping.md` met status `RESOLVED`.
- **Update mapping** — route to `/figma-to-code-mapping map <node>` before re-emit. Drift-row met status `SCHEDULED`.

Mismatch never resolved by inline pixel-fix (rule #11). All prompt-options write to `drifts-mapping.md` to keep the decision-loop closed (rule #8).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Resolve boundary conflict: B8 now detects drift, but spec still says implement “does not detect.”

B8.3/B8.4 explicitly perform detection (screenshot diff + delta classification). Keep one authoritative model; right now the contract is self-contradictory.

As per coding guidelines, "In SKILL.md, enforce the mapping/implementation line: verbs like 'consume, refuse, translate, search-and-adopt, halt, emit' belong in implement; verbs like 'document, detect, inventory, mark, link, capture' belong in mapping skill".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@SKILL.md` around lines 319 - 345, B8 currently contains both detection steps
(B8.3/B8.4) and implementation decisions, conflicting with the SKILL.md
verb-role rule; update SKILL.md so detection lives in the mapping skill and
implementation only performs actions on decisions: change B8.3/B8.4 wording to
mapping verbs like "capture", "compare", "generate delta-list" and move any
"detect" / "mark" responsibilities to mapping, and keep B8.5 as the
implement-step for user-driven actions ("Rollback", "Accept", "Update code",
"Update mapping"); ensure the verbs list in the header and the lines for B8.3,
B8.4, and B8.5 consistently use mapping vs implement verbs per the guideline.

@k-rutten
k-rutten merged commit 28bb7d6 into main May 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant