@petukhovart/agent-view 0.8.1 → 0.9.0

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.
@@ -1,199 +1,286 @@
1
- ---
2
- name: verify-recipe
3
- description: "Generates a concrete, command-by-command agent-view recipe for verifying a feature or bugfix. Use when the developer wants to write a verify-recipe.md, create a verification plan, build an agent-view recipe, or produce a verify checklist for a change they shipped. Triggers on: write a verify-recipe, write verification steps, generate verify steps for the feature/bug I just shipped/fixed, make a verify-recipe.md, what should I run to verify X, create a verification plan, agent-view recipe for this fix, verify checklist for this feature. Does NOT execute the checks — it authors the plan. For running checks against a live app, use the verify skill instead."
4
- allowed-tools: Read, Write, Bash(agent-view *)
5
- ---
6
-
7
- # Verification Recipe Generator
8
-
9
- You help the developer author a disciplined, cheapest-first verification recipe for a feature they shipped or a bug they fixed. You do not run the checks — you produce a `.claude/verify-recipes/<slug>.md` file that any AI coding agent can execute later.
10
-
11
- ## What this produces
12
-
13
- A file at `.claude/verify-recipes/<kebab-slug>.md` containing:
14
-
15
- - **REPRO STEPS** — exact state the app must be in before checks run (free-form prose)
16
- - **NARROWED SIGNAL** — the measurable indicator that proves success or failure
17
- - **EVIDENCE COMMANDS** — ordered `agent-view` calls, cheapest first, each annotated with what it proves
18
- - **POSITIVE-CASE ASSERTIONS** — what "pass" looks like for each command
19
- - **REGRESSION CHECKS** — adjacent paths that must not have broken
20
- - **DESIGN CONFORMANCE** *(optional)* pairs of `(label, screenshot command, expected reference image)` to compare against local design exports. Executed inline by the `verify` skill — no subagent.
21
-
22
- Create the directory if missing: `mkdir -p .claude/verify-recipes`
23
-
24
- ## Methodology
25
-
26
- Frame the recipe with **hard-debug** discipline: REPRO → narrowed signal → minimize scope → root-cause check → fix verification.
27
-
28
- 1. Start from a reproducible starting state, not "open the app and poke around".
29
- 2. Convert vague expectations ("looks right") into measurable signals (`store.user.role === 'admin'`).
30
- 3. Prefer the cheapest tool that can answer the question a value check costs ~50 tokens, a screenshot costs ~6 000.
31
- 4. Include at least one negative-case check (the old symptom must no longer appear).
32
- 5. Include at least one regression check (an adjacent flow must still work).
33
-
34
- ## Tool-cost decision tree
35
-
36
- Pick the first row that can answer the question. Only go lower when the row above can't:
37
-
38
- | Question | Command | Why it's cheapest |
39
- |---|---|---|
40
- | Element exists / has specific text / role | `agent-view dom --filter "<text>" --depth 2` | Structured text, zero vision tokens |
41
- | App state, store value, computed flag | `agent-view eval "<expr>"` | Returns the value directly; DOM inference is wasteful and fragile |
42
- | What changed between action and final state | `agent-view watch "<expr>" --until "<condition>"` or `--max-changes 1` | `eval` shows the snapshot; `watch` shows the trajectory |
43
- | SharedWorker / ServiceWorker internal state | `agent-view eval --target <name> "<expr>"` | Workers have no DOM; this is the only path |
44
- | Did this action throw or warn silently? | `agent-view console --clear` before, `agent-view console --level error,warn` after | Catches uncaught exceptions and network failures invisible to DOM |
45
- | Layout, spacing, visual regression | `agent-view screenshot --scale 0.5` | Last resort the only tool that sees pixels, but costs ~6 000 tokens |
46
- | Canvas / WebGL scene state | `agent-view scene --diff` | DOM is empty for canvas apps |
47
-
48
- **Anti-patterns to reject:**
49
- - Opening with a screenshot to "see the state" use `dom --filter` or `eval` first.
50
- - Using `eval` when `dom --filter` answers the question.
51
- - Assertions that depend on transient state without `watch --until` to stabilize first.
52
- - "Check that it looks right" — every assertion must be a concrete pass/fail criterion. The single legitimate exception is the optional `## Design Conformance` section.
53
- - Inventing design reference paths (`.figma-refs/...`) when the developer did not provide them. No refs → no Design Conformance section.
54
-
55
- ## Workflow
56
-
57
- ### Step 1gather context
58
-
59
- When invoked, ask the developer in plain text (no tool calls yet):
60
-
61
- 1. What was shipped or fixed? (feature name or bug description)
62
- 2. What was the original symptom or expected behavior?
63
- 3. Any known failure mode or edge case to cover?
64
- 4. *(Optional)* Any local design reference images to compare screenshots against (Figma exports, hand-off PNGs, screenshots from disk)? **Local files only** — agent-view does NOT fetch from Figma URLs. If none — skip the Design Conformance section.
65
-
66
- Wait for the response before continuing.
67
-
68
- ### Step 2 draft the recipe
69
-
70
- Use the answers to produce a recipe with these sections:
71
-
72
- ````markdown
73
- # Verify: <feature or fix name>
74
-
75
- Generated: <date>
76
- Scope: <one sentence describing what this covers>
77
-
78
- ## Repro Steps
79
- 1. <Exact starting state window open, user logged in, specific route, etc.>
80
- 2. <Action(s) that trigger the behavior under test>
81
-
82
- ## Narrowed Signal
83
- <!-- The one measurable thing that proves it works -->
84
- `<agent-view command>` must return `<expected value>`.
85
-
86
- ## Evidence Commands
87
-
88
- ### 1. <What this proves>
89
- ```bash
90
- agent-view <command>
91
- ```
92
- Expected: <concrete criterion — value, text, absence of error>
93
- Cost: ~<N> tokens
94
-
95
- ### 2. ...
96
-
97
- ## Positive-Case Assertions
98
- - [ ] <criterion>
99
- - [ ] <criterion>
100
-
101
- ## Regression Checks
102
- - [ ] <adjacent flow> — `agent-view <command>` → `<expected>`
103
-
104
- ## Design Conformance
105
- <!-- Include ONLY if the developer provided design refs in question 4. -->
106
-
107
- | Step Label | Screenshot Command | Expected Reference |
108
- |---|---|---|
109
- | <area name e.g. "filter panel collapsed"> | `agent-view screenshot --crop "<area>" --scale 0.5` | `<absolute path to expected PNG/JPEG>` |
110
-
111
- Tolerance: `normal` (default).
112
-
113
- ## Anti-patterns avoided
114
- - <note any recipe-specific traps, e.g. "state resets on reload — watch needed before dom check">
115
- ````
116
-
117
- The Design Conformance table is consumed inline by the `verify` skill: it runs each screenshot command, opens both the captured image and the expected reference via `Read`, and reports `match` / `minor_mismatch` / `major_mismatch` per row. No subagent no separate tool. Just list the pairs.
118
-
119
- ### Step 3 — save the file
120
-
121
- Determine a kebab-slug from the feature/fix name (e.g. `login-redirect-fix`, `cart-total-display`).
122
-
123
- Save to `.claude/verify-recipes/<slug>.md`. Create the directory first if it doesn't exist.
124
-
125
- Confirm the path to the developer.
126
-
127
- ## Worked example: "fixed login redirect bug"
128
-
129
- **Developer input:**
130
- > Fixed a bug where after login, the redirect went to `/home` instead of `/dashboard`. Store mutation `SET_REDIRECT_PATH` was missing. No visual change purely a routing issue.
131
-
132
- **Recipe produced:**
133
-
134
- ````markdown
135
- # Verify: Login Redirect Fix
136
-
137
- Generated: 2026-04-27
138
- Scope: Confirms that a successful login routes to /dashboard, not /home, and that the store mutation fires correctly.
139
-
140
- ## Repro Steps
141
- 1. App running, user logged out, at `/login`
142
- 2. Fill email + password, click "Sign in"
143
-
144
- ## Narrowed Signal
145
- `agent-view eval "router.currentRoute.path"` must return `"/dashboard"`.
146
-
147
- ## Evidence Commands
148
-
149
- ### 0. Setup baseline console (before any action)
150
- ```bash
151
- agent-view console --clear
152
- ```
153
-
154
- ### 1. Confirm redirect target
155
- ```bash
156
- agent-view fill <email-ref> "admin@example.com"
157
- agent-view fill <password-ref> "password"
158
- agent-view click <signin-ref>
159
- agent-view watch "router.currentRoute.path" --until "router.currentRoute.path === '/dashboard'"
160
- ```
161
- Expected: `replace / "/login" "/dashboard"` in watch output
162
- Cost: ~100 tokens
163
-
164
- ### 2. Confirm mutation fired
165
- ```bash
166
- agent-view eval "store.state.auth.redirectPath"
167
- ```
168
- Expected: `"/dashboard"` (not `"/home"`, not `null`)
169
- Cost: ~50 tokens
170
-
171
- ### 3. No errors during login flow
172
- ```bash
173
- agent-view console --level error,warn
174
- ```
175
- Expected: `(no console messages)`
176
- Cost: ~30 tokens
177
-
178
- ### 4. Regression logout returns to /login
179
- ```bash
180
- agent-view click <logout-ref>
181
- agent-view eval "router.currentRoute.path"
182
- ```
183
- Expected: `"/login"`
184
- Cost: ~60 tokens
185
-
186
- ## Positive-Case Assertions
187
- - [ ] `router.currentRoute.path` === `/dashboard` after login
188
- - [ ] `store.state.auth.redirectPath` === `/dashboard`
189
- - [ ] No console errors during the flow
190
-
191
- ## Regression Checks
192
- - [ ] Logout → `/login` still works
193
-
194
- ## Anti-patterns avoided
195
- - Not using screenshot to confirm route (route is a string eval is 120× cheaper)
196
- - watch used before eval so route change is confirmed to have settled, not just sampled mid-transition
197
- ````
198
-
199
- **Saved to:** `.claude/verify-recipes/login-redirect-fix.md`
1
+ ---
2
+ name: verify-recipe
3
+ description: "Generates a concrete, command-by-command agent-view recipe for verifying a feature or bugfix. Use when the developer wants to write a verify-recipe.md, create a verification plan, build an agent-view recipe, or produce a verify checklist for a change they shipped. Triggers on: write a verify-recipe, write verification steps, generate verify steps for the feature/bug I just shipped/fixed, make a verify-recipe.md, what should I run to verify X, create a verification plan, agent-view recipe for this fix, verify checklist for this feature. Does NOT execute the checks — it authors the plan. For running checks against a live app, use the verify skill instead."
4
+ allowed-tools: Read, Write, Bash(agent-view *)
5
+ ---
6
+
7
+ # Verification Recipe Generator (rigor edition)
8
+
9
+ You help the developer author a disciplined, cheapest-first verification recipe for a feature they shipped or a bug they fixed. You do not run the checks — you produce a `.claude/verify-recipes/<slug>.md` file that any AI coding agent can execute later.
10
+
11
+ This edition is hardened against the failure mode of "construction-validated only" recipes that pass while real bugs sit in plain sight in the same data. See `## Bug-class invariants` and `## Discipline rules`.
12
+
13
+ ## What this produces
14
+
15
+ A file at `.claude/verify-recipes/<kebab-slug>.md` containing:
16
+
17
+ - **REPRO STEPS** — exact state the app must be in before checks run.
18
+ - **NARROWED SIGNAL** — the measurable indicator that proves success or failure.
19
+ - **EVIDENCE COMMANDS** — ordered `agent-view` calls, cheapest first.
20
+ - **POSITIVE-CASE ASSERTIONS** — what "pass" looks like for each command.
21
+ - **BUG-CLASS INVARIANTS** *(required)* — properties that must hold across all states the recipe touches, not just the action-result state.
22
+ - **ROUND-TRIP CHECKPOINT** *(required when the feature touches persistence or mutable structure)* — a save-and-reload (or equivalent) comparison.
23
+ - **REGRESSION CHECKS** — adjacent paths that must not have broken.
24
+ - **DESIGN CONFORMANCE** *(optional)* — reference image comparisons.
25
+
26
+ Create the directory if missing: `mkdir -p .claude/verify-recipes`
27
+
28
+ ## Methodology
29
+
30
+ Frame the recipe with **hard-debug** discipline: REPRO narrowed signal minimize scope root-cause check fix verification.
31
+
32
+ 1. Start from a reproducible starting state, not "open the app and poke around".
33
+ 2. Convert vague expectations ("looks right") into measurable signals (`store.user.role === 'admin'`).
34
+ 3. Prefer the cheapest tool that can answer the question — a value check costs ~50 tokens, a screenshot costs ~6 000.
35
+ 4. Include at least one negative-case check (the old symptom must no longer appear).
36
+ 5. Include at least one regression check (an adjacent flow must still work).
37
+ 6. **Construction-only verification is not enough.** For any non-trivial feature, add invariant checks (see next section) and a round-trip checkpoint.
38
+
39
+ ## Bug-class invariants (required section in every recipe)
40
+
41
+ The recipe must include an `## Invariants` section listing properties that hold *regardless of how state was reached*. These catch bugs that construction-only tests cannot see, because the bug lives in the gap between what the model says and what the user sees / what persistence preserves.
42
+
43
+ Pick at least one invariant from each applicable class. Skip a class only if it provably cannot apply to the feature.
44
+
45
+ ### Class AUI Model
46
+ For every visible representation of state (tree, list, panel, breadcrumb, overlay, badge, count):
47
+ - **Count parity:** `count(DOM rows of kind X) === count(model nodes of kind X)`.
48
+ - **Hierarchy parity:** for any parent/child relationship the model expresses, the DOM must mirror it. A flat-rendered DOM of a nested model is a UI bug, not a model bug.
49
+ - **Text parity:** the label shown in the UI for a node must equal `model.get(nodeId).name` (or whichever field the UI claims to display).
50
+
51
+ Encode this as a single `eval` that returns a JSON struct so a single failed comparison is unambiguous:
52
+
53
+ ```bash
54
+ agent-view eval "var model=<source-of-truth>;var dom=<measurement>;JSON.stringify({modelCount:model.size, domCount:dom.length, match:model.size===dom.length})"
55
+ ```
56
+
57
+ If `match: false`that is a FAIL. Do not rationalize a DOM/model count mismatch as "label reuse" or "the breadcrumb counts too" without confirming the matched elements' bounding boxes and DOM ancestry first.
58
+
59
+ ### Class B Round-trip
60
+ For any feature that creates / mutates persisted structure:
61
+ - `state deserialize(serialize(state))` (model survives save→load with bit-identical structure for the projected fields).
62
+ - `world(child) === origWorld(child)` immediately after a wrap/unwrap action (the wrapping must not silently shift the wrapped element).
63
+ - Reloading the page (`agent-view eval "location.reload()"`) and re-reading the same state must produce an identical signature.
64
+
65
+ A round-trip discrepancy that the save serializer silently "fixes" is a model bug, not a save-format bug. Live-vs-persisted divergence between actions and reloads is a class-B failure even if save/load round-trips cleanly with itself.
66
+
67
+ ### Class C — Reversibility & identity
68
+ - Every user-facing command produces exactly one `commandHistory` entry (`canUndo→true`; one `undo()` fully reverses).
69
+ - `undo` then `redo` produces an identical state to "do once".
70
+ - The set of nodes after `do → undo → redo` equals the set after one `do`. Compare full IDs, not counts — a swap of one node for another with the same name is a real bug.
71
+
72
+ ### Class D — No phantom state
73
+ - For each visible entity the user can interact with, there exists exactly one corresponding model node.
74
+ - For each model node, there exists at most one corresponding UI entity in each view.
75
+ - An entity that appears in two views (e.g. tree and canvas) must have the same identity in both (the same `nodeId` resolves both).
76
+
77
+ This class is the one most often missed. Verify it explicitly when the feature changes structure.
78
+
79
+ ### Class EConfig conformance (rendering vs. configured constraint)
80
+
81
+ Class A compares model to DOM. Class E compares the **rendered output** (DOM bounds, canvas geometry, computed styles, layout sizes) to an **explicit configuration value** the system declares it must respect. This is the home for invariants that have no DOM counterpart to diff against — they assert against a config the user (or product) chose.
82
+
83
+ Typical examples adapt names to the project:
84
+
85
+ - **Snap/grid:** every shape's bounding box must satisfy `x % gridSize === 0` (and same for `y / width / height`). Read `gridSize` from the live config (`store.gridSettings.gridSize`, `theme.grid.size`, `viewport.snap`, …); do not hardcode.
86
+ - **Viewport bounds:** elements declared "viewport-contained" must have `getBoundingClientRect()` within the viewport rect.
87
+ - **Z-order / layering:** elements declared "above modals" must have computed `z-index` above the modal's. Compare against the configured layer table, not a literal number.
88
+ - **Spacing / density tokens:** if the design system declares a spacing scale, computed `margin` / `padding` must be a multiple of the base token.
89
+ - **Theme tokens:** computed colors / fonts must match the active theme's declared values, not literal hex codes.
90
+
91
+ Generic helper shape:
92
+
93
+ ```bash
94
+ agent-view eval "var cfg=<read live config value>; var items=<measure rendered items>; var off=items.filter(function(it){return !<conforms(it, cfg)>}); JSON.stringify({cfg:cfg, total:items.length, offCount:off.length, sample:off.slice(0,3)})"
95
+ ```
96
+
97
+ Expected: `offCount: 0`. A non-zero count means the renderer ignored a config the system promised to honor — that is a real bug class, even if the model is internally consistent and round-trips cleanly. Bugs of the form "element is half a pixel off the grid", "modal renders behind the toast", "freshly-created group is not snapped" all live here and fall between the other classes.
98
+
99
+ When generating recipes, ask: *what config values does this feature claim to respect?* Each one is one Class-E invariant. If the answer is "none" — say so explicitly in the recipe, so a future reader doesn't wonder why the class is absent.
100
+
101
+ ## Discipline rules
102
+
103
+ These rules govern how the recipe is *executed* — they must appear verbatim in the recipe's `## Discipline` section so the executor cannot forget them.
104
+
105
+ 1. **A failed `Expected:` line is FAIL, not "actually fine".** Rationalizations belong in the bug report after the run, not inline in the run log. If the actual output disagrees with the expected line, mark `FAIL` and continue to the next step; do not edit the expected line, do not invent a "label reuse" or "convention" explanation that makes the discrepancy disappear from the count.
106
+
107
+ 2. **Prefer model-vs-DOM mismatches as the bug, not as noise.** When a Class-A invariant fails, the default hypothesis is "the UI renderer is wrong", not "the DOM filter matched something extra". To rule out the latter, query bounding boxes and ancestor chains for every match; if the matches turn out to be sibling rows in the same list, the renderer is the bug.
108
+
109
+ 3. **Defensive eval reads.** Every read of `node.transform.x` (or any model field) must include a sentinel: `isFinite(value)` or `value !== undefined`. A silent `NaN`/`null` from a renamed field looks like a real `0` in arithmetic and will fail-pass the assertion.
110
+
111
+ 4. **No hardcoded literal IDs.** All node IDs in evals must be resolved by role at runtime (e.g. "the first group at root", "the line at root not inside any group"). Hardcoded prefixes silently degrade the recipe to no-op when the scene differs.
112
+
113
+ 5. **The reload checkpoint is not optional.** For any recipe that touches mutable structure, include at least one `location.reload()` between an action and a re-measurement. Compare the projected signature before and after; differences are real bugs, not "fixed-up on save".
114
+
115
+ 6. **Compose, do not narrate.** Final report is `pass / fail / requires_visual_review` counts plus one-line failure reasons. Do not paste raw stdout. Do not include prose justifications in the per-step output.
116
+
117
+ 7. **`requires_visual_review` is an executor verdict, not an authoring shortcut.** When generating the recipe, draft every step so it executes through `agent-view`. Do not write `requires_visual_review` as the planned status of a step just because the path looks tricky (event delegation, canvas hit-test, file dialog, etc.) — first encode the cheapest sub-check that *can* run programmatically (e.g. "no console error during the action", "model state changed", "command history advanced by one"). The `requires_visual_review` label is set by the *executor* at run time, only after at least one genuine attempt to drive the action via agent-view failed for a reason they record. Authoring the recipe with `requires_visual_review` prebaked is what lets real regressions sit unobserved.
118
+
119
+ ## Tool-cost decision tree
120
+
121
+ Pick the first row that can answer the question. Only go lower when the row above can't:
122
+
123
+ | Question | Command | Why it's cheapest |
124
+ |---|---|---|
125
+ | Element exists / has specific text / role | `agent-view dom --filter "<text>" --depth 2` | Structured text, zero vision tokens |
126
+ | Count of matching elements | `agent-view dom --filter X --count` | Single integer, zero tree tokens |
127
+ | App state, store value, computed flag | `agent-view eval "<expr>"` | Returns the value directly; DOM inference is wasteful and fragile |
128
+ | What changed between action and final state | `agent-view watch "<expr>" --until "<condition>"` or `--max-changes 1` | `eval` shows the snapshot; `watch` shows the trajectory |
129
+ | SharedWorker / ServiceWorker internal state | `agent-view eval --target <name> "<expr>"` | Workers have no DOM |
130
+ | Did this action throw or warn silently? | `agent-view console --clear` before, `agent-view console --level error,warn` after | Catches uncaught exceptions invisible to DOM |
131
+ | Layout, spacing, visual regression | `agent-view screenshot --scale 0.5` | Last resort — only tool that sees pixels (~6 000 tokens) |
132
+ | Canvas / WebGL scene state | `agent-view scene --diff` | DOM is empty for canvas apps |
133
+
134
+ **Anti-patterns to reject:**
135
+ - Opening with a screenshot to "see the state" — use `dom --filter` or `eval` first.
136
+ - Using `eval` when `dom --filter` answers the question.
137
+ - Assertions that depend on transient state without `watch --until` to stabilize first.
138
+ - "Check that it looks right" every assertion must be a concrete pass/fail criterion. Single legitimate exception: `## Design Conformance`.
139
+ - Inventing design reference paths (`.figma-refs/...`) when the developer did not provide them.
140
+ - **Treating SG (or any model layer) as the sole source of truth.** Model is one of several representations; the bug may live in the gap between model and UI. The recipe must check the gap explicitly.
141
+
142
+ ## Workflow
143
+
144
+ ### Step 1 — gather context
145
+
146
+ Ask in plain text (no tool calls yet):
147
+
148
+ 1. What was shipped or fixed?
149
+ 2. What was the original symptom or expected behavior?
150
+ 3. Any known failure mode or edge case to cover?
151
+ 4. Does this feature touch persisted structure (YAML, IndexedDB, server)? If yes → mandatory round-trip section.
152
+ 5. Which views render this state (tree, panel, list, canvas, breadcrumb)? Each named view → one UI-≡-Model invariant in Class A.
153
+ 6. Which **configured constraints** does this feature claim to respect (grid/snap, viewport, z-order/layer table, spacing tokens, theme tokens, density)? Each named constraint → one Class-E invariant. If none — say so explicitly.
154
+ 7. *(Optional)* Local design reference images? Local files only.
155
+
156
+ Wait for the response before continuing.
157
+
158
+ ### Step 2 — derive invariants before drafting commands
159
+
160
+ Before writing any `agent-view` call, list the invariants the feature must satisfy. For each, write one sentence in the form:
161
+ > "After any sequence of allowed actions, `<measurable property>` must hold."
162
+
163
+ This list seeds the `## Invariants` section. If you cannot articulate three invariants for a non-trivial feature, the feature is under-specified — ask the developer for clarification.
164
+
165
+ ### Step 3 — draft the recipe
166
+
167
+ ```markdown
168
+ # Verify: <feature or fix name>
169
+
170
+ Generated: <date>
171
+ Scope: <one sentence>
172
+
173
+ ## Repro Steps
174
+ 1. <Exact starting state>
175
+ 2. <Action(s) that trigger the behavior under test>
176
+
177
+ ## Narrowed Signal
178
+ `<agent-view command>` must return `<expected value>`.
179
+
180
+ ## Invariants
181
+ <!-- Required. List each invariant the feature must maintain. -->
182
+
183
+ - **A1 (UI≡Model — <view name>):** `<eval expression that returns {model: N, dom: M, match: bool}>` must return `match: true`.
184
+ - **A2 (Hierarchy):** For each model node with `parentId === X`, its UI row must be a DOM-descendant of the UI row of `X`.
185
+ - **B1 (Round-trip):** After `location.reload()`, the projected signature `<projection>` is identical to the pre-reload signature.
186
+ - **B2 (No silent wrap-shift):** After `<wrap-creating action>`, `getWorldTransform(child).x === origWorldX(child)` for every wrapped child.
187
+ - **C1 (Single undo):** After `<action>`, `commandHistory.canUndo === true` and one `undo()` produces a signature identical to the pre-action signature.
188
+ - **D1 (No phantoms):** For each visible UI row of kind `<X>`, there exists exactly one model node it resolves to via its `nodeId` data-attribute (or the equivalent identifier).
189
+ - **E1 (Config conformance <constraint name>):** Every rendered `<entity>` must satisfy `<conforms(rendered, configValue)>`, where `<configValue>` is read live from `<config source>` (do not hardcode). `offCount: 0` is required.
190
+
191
+ ## Discipline
192
+
193
+ 1. A failed `Expected:` line is FAIL, not "actually fine".
194
+ 2. UI-vs-model mismatches are the bug; confirm by ancestry/bbox before dismissing.
195
+ 3. Every `node.field` read in eval must be sentinel-checked (`isFinite` / `!== undefined`).
196
+ 4. No hardcoded literal IDs; resolve by role at runtime.
197
+ 5. Reload checkpoint is mandatory when the feature touches mutable structure.
198
+ 6. Report `pass / fail / requires_visual_review` per step; failure prose belongs in the bug report only.
199
+ 7. Do not pre-bake `requires_visual_review` as the planned status of a step. Every step ships with an executable `agent-view` path (at minimum a console-error gate around the action). The executor sets `requires_visual_review` only after a real attempt fails for a recorded reason.
200
+
201
+ ## Evidence Commands
202
+
203
+ ### 0. Setup — capture baseline signature
204
+ ```bash
205
+ agent-view eval "<signature expression — projection of all structural fields>"
206
+ ```
207
+ Stash the output as `BASELINE_SIG`.
208
+
209
+ ### 1. <What this proves>
210
+ ```bash
211
+ agent-view <command>
212
+ ```
213
+ Expected: <concrete criterion>
214
+ Cost: ~<N> tokens
215
+
216
+ ### 2. ... (one per action / invariant pair)
217
+
218
+ ### N. Round-trip checkpoint (if applicable)
219
+ ```bash
220
+ agent-view eval "location.reload()"
221
+ # wait for app to come back
222
+ agent-view eval "<same signature expression as step 0>"
223
+ ```
224
+ Expected: identical to `BASELINE_SIG` after the action's expected effect is accounted for. Diff any drift.
225
+
226
+ ## Positive-Case Assertions
227
+ - [ ] <criterion>
228
+
229
+ ## Regression Checks
230
+ - [ ] <adjacent flow> — `agent-view <command>` → `<expected>`
231
+
232
+ ## Design Conformance
233
+ <!-- Optional. Include ONLY if developer provided design refs. -->
234
+
235
+ | Step Label | Screenshot Command | Expected Reference |
236
+ |---|---|---|
237
+ | <area name> | `agent-view screenshot --crop "<area>" --scale 0.5` | `<absolute path>` |
238
+
239
+ Tolerance: `normal`.
240
+
241
+ ## Anti-patterns avoided
242
+ - <recipe-specific traps>
243
+ ```
244
+
245
+ ### Step 4 — save the file
246
+
247
+ Determine a kebab-slug. Save to `.claude/verify-recipes/<slug>.md`. Create the directory first.
248
+
249
+ Confirm the path to the developer.
250
+
251
+ ## Worked example: "added group component to scene editor"
252
+
253
+ **Developer input:**
254
+ > Added a group component that wraps multiple scene elements. Ctrl+G groups selected elements; Ctrl+Shift+G ungroups. Groups appear in the left tree panel as collapsible nodes. Groups are persisted in YAML.
255
+
256
+ **Recipe excerpt (Invariants + Round-trip — the parts that catch the bugs construction-only recipes miss):**
257
+
258
+ ```markdown
259
+ ## Invariants
260
+
261
+ - **A1 (UI≡Model, tree count):**
262
+ ```
263
+ agent-view eval "var sg=window.__editorCore.sceneGraph;var modelCount=0;sg.nodes.forEach(function(n){if(n.componentType==='group')modelCount++});var domCount=[...document.querySelectorAll('[role=treeitem]')].filter(function(e){return e.textContent.includes('Группа')}).length;JSON.stringify({modelCount:modelCount, domCount:domCount, match:modelCount===domCount})"
264
+ ```
265
+ must return `match: true`.
266
+
267
+ - **A2 (Tree hierarchy):**
268
+ ```
269
+ agent-view eval "var sg=window.__editorCore.sceneGraph;var violations=[];sg.nodes.forEach(function(n,id){if(n.componentType==='group'){n.childrenIds.forEach(function(cid){var domChild=document.querySelector('[data-node-id=\"'+cid+'\"]');var domParent=document.querySelector('[data-node-id=\"'+id+'\"]');if(domChild&&domParent&&!domParent.contains(domChild))violations.push({c:cid,p:id})})}});JSON.stringify({violations:violations.length})"
270
+ ```
271
+ must return `violations: 0`.
272
+
273
+ - **B1 (Round-trip after Ctrl+G + reload):**
274
+ Capture signature, dispatch Ctrl+G, capture signature, reload, capture signature. The post-reload signature must equal the post-Ctrl+G signature *projected to the persisted fields*. Drift in `transform.x` of any wrapped child means the wrap path did not normalize coords.
275
+
276
+ - **B2 (No silent wrap-shift):**
277
+ Before Ctrl+G: capture `getWorldTransform(child).x` for each leaf. After Ctrl+G: re-capture. Difference must be 0 (within float epsilon). Non-zero means the wrap action shifted the child in world space — a regression.
278
+
279
+ - **C1 (Single undo):**
280
+ After Ctrl+G, `commandHistory.canUndo === true`. After one `undo()`, signature equals pre-Ctrl+G signature exactly.
281
+
282
+ - **D1 (No phantom group rows):**
283
+ Same eval as A1; if the result is `modelCount: 1, domCount: 2`, that is a phantom-row bug. Confirm by `agent-view eval "[...document.querySelectorAll('span')].filter(e=>e.textContent==='Группа'&&e.children.length===0).map(e=>{var r=e.getBoundingClientRect();return{x:r.x,y:r.y}})"` — two adjacent rows in the same column = phantom.
284
+ ```
285
+
286
+ This single example pair (A1 + D1 + B1 + B2) catches the three bugs from the 4.7 grouping session that the construction-only recipes missed.