@petukhovart/agent-view 0.7.0 → 0.8.1
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/.claude-plugin/plugin.json +2 -2
- package/README.md +38 -54
- package/dist/cli/index.js +0 -0
- package/package.json +60 -62
- package/skills/verify/SKILL.md +22 -29
- package/skills/verify-recipe/SKILL.md +46 -86
- package/agents/design-conformance-runner.md +0 -107
- package/agents/verify-runner.md +0 -127
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-view",
|
|
3
|
-
"description": "Visual verification CLI for desktop apps (Electron/Tauri/Browser) via Chrome DevTools Protocol. Ships two skills (
|
|
4
|
-
"version": "0.
|
|
3
|
+
"description": "Visual verification CLI for desktop apps (Electron/Tauri/Browser) via Chrome DevTools Protocol. Ships two skills: verify (run DOM, screenshot, eval, watch, console checks against a live app) and verify-recipe (author a reusable verification plan as a .md file).",
|
|
4
|
+
"version": "0.8.1",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cdp",
|
|
7
7
|
"electron",
|
package/README.md
CHANGED
|
@@ -29,8 +29,7 @@ Each step links to the full explanation below.
|
|
|
29
29
|
- **Worker access** — SharedWorker, ServiceWorker, dedicated Worker visible alongside pages; fuzzy `--target` resolution everywhere (id → title → URL)
|
|
30
30
|
- **Canvas / WebGL scene graph** — PixiJS today, engine-pluggable; `--compact` mirrors the DOM mode
|
|
31
31
|
- **Design-conformance verification** — pair screenshot commands with local design references (Figma export, hand-off
|
|
32
|
-
PNGs, any image on disk) inside a verify-recipe; the `
|
|
33
|
-
against the mockup
|
|
32
|
+
PNGs, any image on disk) inside a verify-recipe; the `verify` skill compares screenshots against the references inline
|
|
34
33
|
|
|
35
34
|
## Why CLI, not MCP?
|
|
36
35
|
|
|
@@ -57,8 +56,7 @@ npm install -g @petukhovart/agent-view
|
|
|
57
56
|
|
|
58
57
|
The plugin ships two skills. **`verify`** executes visual and runtime checks against a running app. **`verify-recipe`** generates a `.claude/verify-recipes/<slug>.md` file — a disciplined, cheapest-first command sequence for a feature or bugfix — that you or any AI agent can run later. Trigger it with phrases like "write a verify-recipe for the login fix" or "generate a verification plan for this feature".
|
|
59
58
|
|
|
60
|
-
For
|
|
61
|
-
see [Recommended workflow with Claude Code](#recommended-workflow-with-claude-code) below.
|
|
59
|
+
For the canonical author-once / re-run flow, see [Recommended workflow with Claude Code](#recommended-workflow-with-claude-code) below.
|
|
62
60
|
|
|
63
61
|
Verify:
|
|
64
62
|
|
|
@@ -194,13 +192,34 @@ Full surface in [Commands](#commands) below.
|
|
|
194
192
|
|
|
195
193
|
## Recommended workflow with Claude Code
|
|
196
194
|
|
|
197
|
-
A repeatable, token-efficient flow for "I shipped a feature/fix → confirm it actually works visually and at runtime".
|
|
198
|
-
Three phases, each driven by a focused prompt.
|
|
195
|
+
A repeatable, token-efficient flow for "I shipped a feature/fix → confirm it actually works visually and at runtime". Two phases, each driven by a focused prompt.
|
|
199
196
|
|
|
200
|
-
|
|
197
|
+
```mermaid
|
|
198
|
+
flowchart TD
|
|
199
|
+
Dev["Developer<br/>in Claude Code"] -->|prompt| Agent["Main Claude agent<br/>(Opus / Sonnet)"]
|
|
201
200
|
|
|
202
|
-
|
|
203
|
-
|
|
201
|
+
Agent -->|"verify ad-hoc"| Verify["verify skill"]
|
|
202
|
+
Agent -->|"write recipe"| Recipe["verify-recipe skill"]
|
|
203
|
+
|
|
204
|
+
Recipe -->|interview| Dev
|
|
205
|
+
Recipe -->|writes| File[".claude/verify-recipes/<slug>.md"]
|
|
206
|
+
File -.->|read on next run| Verify
|
|
207
|
+
|
|
208
|
+
Verify -->|"agent-view dom / eval / click /<br/>screenshot / watch / console"| CLI["agent-view CLI"]
|
|
209
|
+
CLI -->|CDP| App["Live app<br/>(Electron / Tauri / Browser)"]
|
|
210
|
+
App -->|stdout / image paths| Verify
|
|
211
|
+
|
|
212
|
+
Verify -->|"pass / fail summary<br/>+ design conformance verdict"| Dev
|
|
213
|
+
|
|
214
|
+
classDef skill fill:#e8f0ff,stroke:#3060a0,color:#0a1f3d
|
|
215
|
+
classDef tool fill:#fff4d6,stroke:#a07020,color:#3d2a05
|
|
216
|
+
class Verify,Recipe skill
|
|
217
|
+
class CLI tool
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### Phase 1 — Author the verification plan (once)
|
|
221
|
+
|
|
222
|
+
Generate the recipe **once**, from a PRD / plan file / Jira ticket / commit range. The recipe is reusable — re-run after every iteration on the same feature.
|
|
204
223
|
|
|
205
224
|
```text
|
|
206
225
|
Generate a verify-recipe for the changes in commits <hash1>..<hash2>.
|
|
@@ -212,41 +231,24 @@ Design references (if any):
|
|
|
212
231
|
- /abs/path/figma-exports/error-state.png → label "invalid creds error"
|
|
213
232
|
```
|
|
214
233
|
|
|
215
|
-
What this triggers: the `verify-recipe` skill interviews you (if more context needed), then writes a
|
|
216
|
-
`.claude/verify-recipes/<slug>.md` with `Repro Steps`, `Evidence Commands` (cheapest-first: `eval` / `dom --filter`
|
|
217
|
-
before `screenshot`), `Regression Checks`, and — if you provided design refs — a `Design Conformance` table mapping
|
|
218
|
-
screenshot commands to expected reference images.
|
|
234
|
+
What this triggers: the `verify-recipe` skill interviews you (if more context needed), then writes a `.claude/verify-recipes/<slug>.md` with `Repro Steps`, `Evidence Commands` (cheapest-first: `eval` / `dom --filter` before `screenshot`), `Regression Checks`, and — if you provided design refs — a `Design Conformance` table mapping screenshot commands to expected reference images.
|
|
219
235
|
|
|
220
|
-
**Tip:** if you implemented from a Figma file via the `figma-implement-design` skill, it likely already saved exports
|
|
221
|
-
somewhere on disk — pass those paths. agent-view does NOT fetch from Figma URLs; provide local files only.
|
|
236
|
+
**Tip:** if you implemented from a Figma file via the `figma-implement-design` skill, it likely already saved exports somewhere on disk — pass those paths. agent-view does NOT fetch from Figma URLs; provide local files only.
|
|
222
237
|
|
|
223
|
-
### Phase 2 — Run the recipe
|
|
238
|
+
### Phase 2 — Run the recipe
|
|
224
239
|
|
|
225
240
|
```text
|
|
226
241
|
Run the verify-recipe at .claude/verify-recipes/<slug>.md.
|
|
227
242
|
```
|
|
228
243
|
|
|
229
|
-
What this triggers: the `verify` skill
|
|
230
|
-
subagent (Haiku) to execute every step and return a compact JSON report. If the recipe has a `Design Conformance`
|
|
231
|
-
section, `design-conformance-runner` (also Haiku) runs in parallel and visually compares screenshots against the
|
|
232
|
-
references.
|
|
233
|
-
|
|
234
|
-
**Effect on cost:** raw output (DOM dumps, screenshots, eval values) stays in the subagent. The main agent only sees the
|
|
235
|
-
merged JSON report — typically <2k tokens vs ~50k if Opus ran the recipe directly.
|
|
244
|
+
What this triggers: the `verify` skill reads the recipe, performs the `Repro Steps` setup, runs each `Evidence Command` against the live app, compares output to the recipe's `Expected:` lines, and reports pass/fail per step. If the recipe has a `Design Conformance` section, the same skill captures the screenshots, opens both actual and expected images, and reports `match` / `minor_mismatch` / `major_mismatch` per pair — all inline, in the same conversation.
|
|
236
245
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
The merged report lists `failed`, `requires_visual_review`, and `major_mismatch` items with one-sentence diagnoses. Hand
|
|
240
|
-
any subset back to the main agent:
|
|
246
|
+
When something fails, ask the main agent to fix and re-run only the affected steps:
|
|
241
247
|
|
|
242
248
|
```text
|
|
243
|
-
|
|
244
|
-
and step 7 (selective filter heading missing). Re-run only those two steps after the fix.
|
|
249
|
+
Step 4 failed (zone filter not mutating store). Fix and re-run that step plus step 7.
|
|
245
250
|
```
|
|
246
251
|
|
|
247
|
-
The main agent re-runs only the failing commands itself for richer evidence, makes the fix, and re-spawns
|
|
248
|
-
`verify-runner` for the targeted re-check — not the whole recipe.
|
|
249
|
-
|
|
250
252
|
### One-shot prompt (when there's no plan to convert)
|
|
251
253
|
|
|
252
254
|
For small fixes where you don't want a persistent recipe file:
|
|
@@ -259,31 +261,13 @@ I added a `saving` ref and bound it to :disabled. Verify it works:
|
|
|
259
261
|
- visual: button greys out (compare to /abs/path/saving-state.png if one is provided)
|
|
260
262
|
```
|
|
261
263
|
|
|
262
|
-
Claude will pick the right skill (usually `verify` ad-hoc mode), run a handful of `eval` / `dom --filter` / `console`
|
|
263
|
-
calls, and only screenshot if the visual claim needs it.
|
|
264
|
-
|
|
265
|
-
### Why recipes have two kinds of preconditions (0.7.0+)
|
|
266
|
-
|
|
267
|
-
Recipes split setup into **Manual Preconditions** (human-readable steps a person or the parent agent does — drag a widget, navigate to a view, enter a search term) and **Machine Preconditions** (runnable `agent-view eval` / `dom --filter` checks that prove the manual setup actually took effect).
|
|
268
|
-
|
|
269
|
-
The runner executes Machine Preconditions FIRST. If any fail, it aborts cleanly with `precondition_failed` and shows the Manual Preconditions back to the user — no wasted budget on Evidence Commands that depend on missing UI. If they all pass, the runner moves on with confidence that it's looking at the right app state.
|
|
270
|
-
|
|
271
|
-
This pattern catches the most common failure mode: writing a recipe in a particular UI mode (e.g., map view) and later running it in a different mode (e.g., settings panel) where half the checked elements don't exist. Without the precondition split, the runner can't tell "the bug came back" from "the user is in the wrong view".
|
|
272
|
-
|
|
273
|
-
When authoring, the `verify-recipe` skill interviews you for a Machine Precondition counterpart for every Manual Precondition. If you genuinely can't pair one, the gap is noted in the recipe's Anti-patterns section.
|
|
264
|
+
Claude will pick the right skill (usually `verify` ad-hoc mode), run a handful of `eval` / `dom --filter` / `console` calls, and only screenshot if the visual claim needs it.
|
|
274
265
|
|
|
275
266
|
### Anti-patterns to avoid
|
|
276
267
|
|
|
277
|
-
- "Just verify the feature" with no plan or symptom — the recipe author can't pick the cheapest signal without knowing
|
|
278
|
-
|
|
279
|
-
-
|
|
280
|
-
first.
|
|
281
|
-
- Running the recipe directly with Opus when a recipe file exists — that's exactly the case `verify-runner` is for.
|
|
282
|
-
Prefer Phase 2's prompt.
|
|
283
|
-
- Stuffing 50 assertions into one recipe — split per-feature. A recipe should run in <2 minutes and produce a report you
|
|
284
|
-
can read in 30 seconds.
|
|
285
|
-
- Manual Preconditions without Machine Precondition counterparts — the runner can't catch the user skipping setup. The
|
|
286
|
-
skill warns during authoring; either add a check or accept the gap explicitly in the recipe.
|
|
268
|
+
- "Just verify the feature" with no plan or symptom — the recipe author can't pick the cheapest signal without knowing what "works" means. Give it the symptom that motivated the fix.
|
|
269
|
+
- Pasting Figma URLs and expecting agent-view to download them — it won't. Export the frames you care about to PNG first.
|
|
270
|
+
- Stuffing 50 assertions into one recipe — split per-feature. A recipe should run in <2 minutes and produce a report you can read in 30 seconds.
|
|
287
271
|
|
|
288
272
|
## How it works
|
|
289
273
|
|
package/dist/cli/index.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,62 +1,60 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@petukhovart/agent-view",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "CLI tool for visual verification of desktop apps (Electron/Tauri) via Chrome DevTools Protocol",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
|
-
"bin": {
|
|
8
|
-
"agent-view": "dist/cli/index.js"
|
|
9
|
-
},
|
|
10
|
-
"files": [
|
|
11
|
-
"dist",
|
|
12
|
-
".claude-plugin",
|
|
13
|
-
"skills",
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
"node": "
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@petukhovart/agent-view",
|
|
3
|
+
"version": "0.8.1",
|
|
4
|
+
"description": "CLI tool for visual verification of desktop apps (Electron/Tauri) via Chrome DevTools Protocol",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"agent-view": "dist/cli/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
".claude-plugin",
|
|
13
|
+
"skills",
|
|
14
|
+
"README.md",
|
|
15
|
+
"LICENSE"
|
|
16
|
+
],
|
|
17
|
+
"keywords": [
|
|
18
|
+
"cdp",
|
|
19
|
+
"chrome-devtools-protocol",
|
|
20
|
+
"electron",
|
|
21
|
+
"tauri",
|
|
22
|
+
"desktop",
|
|
23
|
+
"testing",
|
|
24
|
+
"accessibility",
|
|
25
|
+
"screenshot",
|
|
26
|
+
"automation",
|
|
27
|
+
"ai-agent",
|
|
28
|
+
"cli"
|
|
29
|
+
],
|
|
30
|
+
"author": "Artem Petukhov",
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git+https://github.com/PetukhovArt/agent-view.git"
|
|
35
|
+
},
|
|
36
|
+
"bugs": {
|
|
37
|
+
"url": "https://github.com/PetukhovArt/agent-view/issues"
|
|
38
|
+
},
|
|
39
|
+
"homepage": "https://github.com/PetukhovArt/agent-view#readme",
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=20"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"chrome-remote-interface": "^0.34.0",
|
|
45
|
+
"commander": "^14.0.3",
|
|
46
|
+
"fast-json-patch": "^3.1.1"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/node": "^25.5.0",
|
|
50
|
+
"tsx": "^4.21.0",
|
|
51
|
+
"typescript": "^6.0.2",
|
|
52
|
+
"vitest": "^4.1.2"
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"build": "tsc",
|
|
56
|
+
"dev": "tsx src/cli/index.ts",
|
|
57
|
+
"test": "vitest run",
|
|
58
|
+
"test:watch": "vitest"
|
|
59
|
+
}
|
|
60
|
+
}
|
package/skills/verify/SKILL.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: verify
|
|
3
3
|
description: "Visual + runtime verification of desktop apps via Chrome DevTools Protocol. Use when modifying UI components, fixing visual bugs, testing user interactions, verifying layout, or when any workflow phase needs to inspect the running application — DOM, screenshots, scene graph, runtime state in pages and SharedWorkers/ServiceWorkers, console errors, or reactive-state diffs over time. Triggers on: verify, check UI, test how it looks, visual regression, screenshot, inspect DOM, check store/state, watch state changes, what changed after click, wait until state, read worker, console errors, runtime check, eval in page."
|
|
4
|
-
allowed-tools: Bash(agent-view *)
|
|
4
|
+
allowed-tools: Bash(agent-view *), Read
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Visual Verification with agent-view
|
|
@@ -178,37 +178,18 @@ When two tools could answer the same question, prefer the one higher up the tabl
|
|
|
178
178
|
|
|
179
179
|
## Verification Workflow
|
|
180
180
|
|
|
181
|
-
### Recipe Execution Mode (
|
|
181
|
+
### Recipe Execution Mode (when a recipe file exists)
|
|
182
182
|
|
|
183
|
-
If the developer points you at a `.claude/verify-recipes/<slug>.md` file,
|
|
184
|
-
|
|
185
|
-
Why: recipe execution is mechanical (run commands, compare to `Expected:`, report). It does not need Opus-level reasoning, but the raw output (DOM dumps, screenshots, eval results) easily exceeds 30k tokens of context noise. Delegating to a Haiku subagent keeps your context clean and cuts cost ~10×.
|
|
186
|
-
|
|
187
|
-
**Pre-flight check (do this BEFORE spawning the runner):**
|
|
183
|
+
If the developer points you at a `.claude/verify-recipes/<slug>.md` file, or one is discoverable via `ls .claude/verify-recipes/`, execute it inline yourself — **no subagent**.
|
|
188
184
|
|
|
189
185
|
1. `Read` the recipe.
|
|
190
|
-
2.
|
|
191
|
-
3.
|
|
192
|
-
4.
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
- Absolute `recipe_path`
|
|
198
|
-
- Resolved `window_id`
|
|
199
|
-
- `mode: full` (or `dry_run` if the user asked to validate the recipe first)
|
|
200
|
-
- Any extra context (e.g. "user is already logged in", "GIS widget already mounted")
|
|
201
|
-
6. Wait for the JSON report.
|
|
202
|
-
|
|
203
|
-
**Handle the report:**
|
|
204
|
-
|
|
205
|
-
7. **If `status: precondition_failed`** → relay `failed_precondition` and `manual_preconditions_to_check` to the user verbatim. Do NOT spawn the runner again. Do NOT try to "fix" the missing setup yourself by clicking around — the user knows their app, ask them to do the manual setup and re-run.
|
|
206
|
-
8. **If `status: cascading_failures` or `budget_exhausted`** → the recipe is likely stale (selectors/refs changed, UI restructured) or describes a flow that no longer matches the app. Show the first 1-2 failed steps to the user and ask whether to update the recipe (delegate back to `verify-recipe`) or investigate manually.
|
|
207
|
-
9. **If `design_conformance_section: true`** in the report: also spawn `design-conformance-runner` in parallel, passing the `design_conformance_pairs` array. Merge both reports before answering the user.
|
|
208
|
-
10. **If `requires_visual_review` steps** have no design ref attached: open each screenshot yourself with `Read` and decide pass/fail.
|
|
209
|
-
11. **If individual `failed` steps** in an otherwise-completed run: re-run that specific failing command yourself for richer evidence to diagnose. Do not re-execute the whole recipe.
|
|
210
|
-
|
|
211
|
-
Output to the user: a tight summary — what passed, what failed, what needs visual review, and (if any) which design conformance issues to fix. Do not paste the raw JSON unless asked.
|
|
186
|
+
2. If it has a `## Repro Steps` section, follow them — log in, navigate, set up data — using `agent-view` commands. Modern recipes (0.6+) may instead have `## Manual Preconditions` / `## Bringup` / `## Machine Preconditions` sections; treat those as documentation describing the expected state and execute the actions inline. There is no formal DSL — read what the section says and do it.
|
|
187
|
+
3. Resolve the window id once with `agent-view discover` if you need `--window`.
|
|
188
|
+
4. Run each `## Evidence Commands` subsection in order. Compare output to its `Expected:` line. Mark each as `pass` / `fail` / `requires_visual_review`.
|
|
189
|
+
5. After 2–3 consecutive failures, stop and flag the recipe as likely stale rather than continuing to burn tool calls.
|
|
190
|
+
6. Run `## Regression Checks` last.
|
|
191
|
+
7. If a `## Design Conformance` section is present, run the inline workflow below.
|
|
192
|
+
8. Report a tight summary to the user: passed / failed / visual-review counts plus one-liner per failure. Don't paste raw stdout unless asked.
|
|
212
193
|
|
|
213
194
|
### Ad-hoc Mode (standalone)
|
|
214
195
|
|
|
@@ -235,6 +216,18 @@ When UI scenarios are pre-generated (e.g., from a plan file with `## UI Scenario
|
|
|
235
216
|
|
|
236
217
|
This mode works with any workflow that generates plan files with UI scenarios.
|
|
237
218
|
|
|
219
|
+
### Design Conformance (inline)
|
|
220
|
+
|
|
221
|
+
When a recipe contains a `## Design Conformance` table — `(label, screenshot command, expected reference path)` rows — execute it yourself, no subagent.
|
|
222
|
+
|
|
223
|
+
For each row:
|
|
224
|
+
1. Run the screenshot command (capture the saved file path from stdout).
|
|
225
|
+
2. `Read` both the captured image and the `expected_path`. If `expected_path` doesn't exist or is unreadable, mark the pair `skipped (expected_missing)` and move on.
|
|
226
|
+
3. Compare visually for: layout (relative position, alignment), sizing, color (dominant color family), typography (weight/size broadly), content presence (anything missing or extra), decorations (borders, shadows, dashed/solid lines, icons).
|
|
227
|
+
4. Report each pair as `match` / `minor_mismatch` / `major_mismatch` with a one-sentence deviation. Major = missing/wrong component, broken layout, wrong color family, wrong text content. Minor = <10px spacing drift, slight color shade, small decoration difference.
|
|
228
|
+
|
|
229
|
+
Tolerance default: a designer's code-review level — flag what they'd notice, ignore anti-aliasing noise. Don't speculate about CSS causes — describe what looks different and let the parent / user decide.
|
|
230
|
+
|
|
238
231
|
## Resilience
|
|
239
232
|
|
|
240
233
|
- **Stale refs:** After HMR, navigation, or state change — re-run `dom` for fresh refs before interacting
|
|
@@ -12,34 +12,24 @@ You help the developer author a disciplined, cheapest-first verification recipe
|
|
|
12
12
|
|
|
13
13
|
A file at `.claude/verify-recipes/<kebab-slug>.md` containing:
|
|
14
14
|
|
|
15
|
-
- **
|
|
16
|
-
- **MACHINE PRECONDITIONS** — runnable `agent-view` checks that prove the manual setup actually took effect; the verify-runner subagent runs these FIRST and aborts cleanly if any fail
|
|
15
|
+
- **REPRO STEPS** — exact state the app must be in before checks run (free-form prose)
|
|
17
16
|
- **NARROWED SIGNAL** — the measurable indicator that proves success or failure
|
|
18
17
|
- **EVIDENCE COMMANDS** — ordered `agent-view` calls, cheapest first, each annotated with what it proves
|
|
19
18
|
- **POSITIVE-CASE ASSERTIONS** — what "pass" looks like for each command
|
|
20
19
|
- **REGRESSION CHECKS** — adjacent paths that must not have broken
|
|
21
|
-
- **DESIGN CONFORMANCE** (optional) — screenshot
|
|
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.
|
|
22
21
|
|
|
23
22
|
Create the directory if missing: `mkdir -p .claude/verify-recipes`
|
|
24
23
|
|
|
25
|
-
## Why two kinds of preconditions
|
|
26
|
-
|
|
27
|
-
The verify-runner subagent is intentionally tightly scoped — it executes commands and reports results, with hard budgets that prevent it from "looking around" when things don't match. That means **the recipe must clearly separate what a human does from what a machine verifies**.
|
|
28
|
-
|
|
29
|
-
If you write a precondition as prose ("the GIS widget is dragged into a workspace cell"), the runner can't check it. If the user forgot to do it, the runner blunders into Evidence Commands that depend on missing UI, and either burns its budget on a recipe-stale abort or — worse, in older formats — flails trying to find the missing element.
|
|
30
|
-
|
|
31
|
-
The fix: every Manual Precondition gets a paired Machine Precondition that proves it took effect. Drag widget into cell → check `cesiumReadyFlag === true`. Navigate to map mode → check `document.querySelector('.cesium-widget')` exists. Now if the user skips a step, the runner aborts cleanly on Phase 1 with a clear "do this first" message instead of diagnosing phantom bugs.
|
|
32
|
-
|
|
33
24
|
## Methodology
|
|
34
25
|
|
|
35
|
-
Frame the recipe with **hard-debug** discipline
|
|
26
|
+
Frame the recipe with **hard-debug** discipline: REPRO → narrowed signal → minimize scope → root-cause check → fix verification.
|
|
36
27
|
|
|
37
|
-
1. Start from a
|
|
38
|
-
2. Convert vague expectations ("looks right") into measurable signals (
|
|
39
|
-
3. Prefer the cheapest tool that can answer the question — a value check costs ~50 tokens, a screenshot costs ~6 000
|
|
40
|
-
4. Include at least one negative-case check (the old symptom must no longer appear)
|
|
41
|
-
5. Include at least one regression check (an adjacent flow must still work)
|
|
42
|
-
6. **Every Manual Precondition needs a Machine Precondition counterpart.** If you can't think of one — interview the developer further before writing the recipe (see Step 1 below).
|
|
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).
|
|
43
33
|
|
|
44
34
|
## Tool-cost decision tree
|
|
45
35
|
|
|
@@ -56,33 +46,28 @@ Pick the first row that can answer the question. Only go lower when the row abov
|
|
|
56
46
|
| Canvas / WebGL scene state | `agent-view scene --diff` | DOM is empty for canvas apps |
|
|
57
47
|
|
|
58
48
|
**Anti-patterns to reject:**
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
- "Check that it looks right" — every Evidence assertion must be a concrete pass/fail criterion. The single legitimate exception is the `## Design Conformance` section, which delegates visual judgment to the design-conformance-runner subagent against an explicit reference image.
|
|
65
|
-
- Inventing design reference paths (`.figma-refs/...`, `assets/mockups/...`) when the developer did not provide them. No refs → no Design Conformance section.
|
|
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.
|
|
66
54
|
|
|
67
55
|
## Workflow
|
|
68
56
|
|
|
69
|
-
### Step 1 — gather context
|
|
57
|
+
### Step 1 — gather context
|
|
70
58
|
|
|
71
|
-
When invoked, ask the developer in plain text (no tool calls yet)
|
|
59
|
+
When invoked, ask the developer in plain text (no tool calls yet):
|
|
72
60
|
|
|
73
|
-
1.
|
|
74
|
-
2.
|
|
75
|
-
3.
|
|
76
|
-
4.
|
|
77
|
-
5. **Manual setup steps**: Beyond modes, what physical actions must the user do before checks can run (drag a widget into a cell, search for and select a map location, open a specific dialog, log in as a particular role)? Be precise — these become Manual Preconditions verbatim.
|
|
78
|
-
6. **State assertions for each manual step**: For each item in (4) and (5), is there a JS expression or DOM selector that proves it happened? Examples: "after dragging the GIS widget — `pinia._s.get('gis-widget-root')?.cesiumReadyFlag` becomes true"; "after entering map mode — `document.querySelector('.cesium-widget')` exists; "after selecting a location — `selectedLocation` is truthy". If the developer doesn't know offhand, that's fine — ask them to point you at the store/composable/component where state lives and you can suggest expressions.
|
|
79
|
-
7. **(Optional) Design references**: Local image paths to compare screenshots against (Figma exports, hand-off PNGs). **Only local files are supported.** If none — skip the Design Conformance section entirely.
|
|
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.
|
|
80
65
|
|
|
81
|
-
|
|
66
|
+
Wait for the response before continuing.
|
|
82
67
|
|
|
83
68
|
### Step 2 — draft the recipe
|
|
84
69
|
|
|
85
|
-
Use the answers to produce a recipe
|
|
70
|
+
Use the answers to produce a recipe with these sections:
|
|
86
71
|
|
|
87
72
|
````markdown
|
|
88
73
|
# Verify: <feature or fix name>
|
|
@@ -90,18 +75,9 @@ Use the answers to produce a recipe in this format:
|
|
|
90
75
|
Generated: <date>
|
|
91
76
|
Scope: <one sentence describing what this covers>
|
|
92
77
|
|
|
93
|
-
##
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
2. <Action 2 — e.g. "In the map header search box, type 'Склад_1' and click the matching dropdown entry to fly the camera to that sublocation.">
|
|
97
|
-
3. <Action 3 — e.g. "Zoom in until building details are visible (camera height < 1000 m).">
|
|
98
|
-
|
|
99
|
-
## Machine Preconditions
|
|
100
|
-
<!-- The verify-runner runs these FIRST. If ANY fail, it aborts with `precondition_failed` and shows the Manual Preconditions block to the user. -->
|
|
101
|
-
- `agent-view eval "window.__dev !== undefined"` → must be `true`
|
|
102
|
-
- `agent-view eval "!!window.__dev.pinia._s.get('gis-widget-root')?.cesiumReadyFlag"` → must be `true`
|
|
103
|
-
- `agent-view eval "!!window.__dev.pinia._s.get('gis-widget-root')?.selectedLocation"` → must be `true`
|
|
104
|
-
- `agent-view eval "document.querySelector('.cesium-widget') !== null"` → must be `true`
|
|
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>
|
|
105
81
|
|
|
106
82
|
## Narrowed Signal
|
|
107
83
|
<!-- The one measurable thing that proves it works -->
|
|
@@ -126,22 +102,20 @@ Cost: ~<N> tokens
|
|
|
126
102
|
- [ ] <adjacent flow> — `agent-view <command>` → `<expected>`
|
|
127
103
|
|
|
128
104
|
## Design Conformance
|
|
129
|
-
<!--
|
|
130
|
-
<!-- Each row pairs a screenshot command with the expected reference image path. -->
|
|
131
|
-
<!-- The design-conformance-runner subagent reads this section, runs the screenshot commands, and visually compares against the expected refs. -->
|
|
132
|
-
<!-- Do NOT invent design ref paths. Use exactly what the developer provided. -->
|
|
105
|
+
<!-- Include ONLY if the developer provided design refs in question 4. -->
|
|
133
106
|
|
|
134
107
|
| Step Label | Screenshot Command | Expected Reference |
|
|
135
108
|
|---|---|---|
|
|
136
109
|
| <area name e.g. "filter panel collapsed"> | `agent-view screenshot --crop "<area>" --scale 0.5` | `<absolute path to expected PNG/JPEG>` |
|
|
137
|
-
| <area name> | `agent-view screenshot --window $W --scale 0.5` | `<absolute path>` |
|
|
138
110
|
|
|
139
|
-
Tolerance: `normal` (default
|
|
111
|
+
Tolerance: `normal` (default).
|
|
140
112
|
|
|
141
113
|
## Anti-patterns avoided
|
|
142
|
-
- <note any recipe-specific traps, e.g. "
|
|
114
|
+
- <note any recipe-specific traps, e.g. "state resets on reload — watch needed before dom check">
|
|
143
115
|
````
|
|
144
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
|
+
|
|
145
119
|
### Step 3 — save the file
|
|
146
120
|
|
|
147
121
|
Determine a kebab-slug from the feature/fix name (e.g. `login-redirect-fix`, `cart-total-display`).
|
|
@@ -150,26 +124,10 @@ Save to `.claude/verify-recipes/<slug>.md`. Create the directory first if it doe
|
|
|
150
124
|
|
|
151
125
|
Confirm the path to the developer.
|
|
152
126
|
|
|
153
|
-
### Step 4 — offer dry-run validation
|
|
154
|
-
|
|
155
|
-
After saving, ask the developer:
|
|
156
|
-
|
|
157
|
-
> The recipe is saved at `<path>`. Is the app running? If yes, I can spawn `verify-runner` in `dry_run` mode — it'll execute only the Machine Preconditions and the first Evidence Command (~5 commands total). That validates the recipe isn't broken before you commit a full run. Want me to run the dry-run? (yes/no)
|
|
158
|
-
|
|
159
|
-
If yes:
|
|
160
|
-
1. Get the window id with `agent-view discover`.
|
|
161
|
-
2. Spawn `verify-runner` via the Agent tool with `mode: dry_run`, the recipe path, and the window id.
|
|
162
|
-
3. Read the JSON report.
|
|
163
|
-
4. If `status: completed` and dry-run preconditions+step 1 passed → tell the developer the recipe is healthy and ready for a full run.
|
|
164
|
-
5. If `precondition_failed` → relay the `failed_precondition` and `manual_preconditions_to_check` so the developer knows what setup step to do (or what Machine Precondition to fix).
|
|
165
|
-
6. If the first Evidence Command failed → flag it: the recipe likely has a stale ref/selector or assumes UI state that doesn't exist; offer to revise.
|
|
166
|
-
|
|
167
|
-
If no — confirm the path and stop.
|
|
168
|
-
|
|
169
127
|
## Worked example: "fixed login redirect bug"
|
|
170
128
|
|
|
171
129
|
**Developer input:**
|
|
172
|
-
> 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.
|
|
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.
|
|
173
131
|
|
|
174
132
|
**Recipe produced:**
|
|
175
133
|
|
|
@@ -179,35 +137,29 @@ If no — confirm the path and stop.
|
|
|
179
137
|
Generated: 2026-04-27
|
|
180
138
|
Scope: Confirms that a successful login routes to /dashboard, not /home, and that the store mutation fires correctly.
|
|
181
139
|
|
|
182
|
-
##
|
|
183
|
-
1. App running, user logged out,
|
|
184
|
-
|
|
185
|
-
## Machine Preconditions
|
|
186
|
-
- `agent-view eval "router.currentRoute.path"` → must be `"/login"`
|
|
187
|
-
- `agent-view eval "!!store.state.auth.user"` → must be `false` (logged out)
|
|
140
|
+
## Repro Steps
|
|
141
|
+
1. App running, user logged out, at `/login`
|
|
142
|
+
2. Fill email + password, click "Sign in"
|
|
188
143
|
|
|
189
144
|
## Narrowed Signal
|
|
190
|
-
`agent-view eval "router.currentRoute.path"` must return `"/dashboard"
|
|
145
|
+
`agent-view eval "router.currentRoute.path"` must return `"/dashboard"`.
|
|
191
146
|
|
|
192
147
|
## Evidence Commands
|
|
193
148
|
|
|
194
|
-
### 0. Setup — baseline console
|
|
149
|
+
### 0. Setup — baseline console (before any action)
|
|
195
150
|
```bash
|
|
196
151
|
agent-view console --clear
|
|
197
152
|
```
|
|
198
|
-
Expected: `Console buffer cleared`
|
|
199
|
-
Cost: ~10 tokens
|
|
200
153
|
|
|
201
154
|
### 1. Confirm redirect target
|
|
202
155
|
```bash
|
|
203
|
-
agent-view dom --filter "Email" --depth 2
|
|
204
156
|
agent-view fill <email-ref> "admin@example.com"
|
|
205
157
|
agent-view fill <password-ref> "password"
|
|
206
158
|
agent-view click <signin-ref>
|
|
207
159
|
agent-view watch "router.currentRoute.path" --until "router.currentRoute.path === '/dashboard'"
|
|
208
160
|
```
|
|
209
161
|
Expected: `replace / "/login" → "/dashboard"` in watch output
|
|
210
|
-
Cost: ~
|
|
162
|
+
Cost: ~100 tokens
|
|
211
163
|
|
|
212
164
|
### 2. Confirm mutation fired
|
|
213
165
|
```bash
|
|
@@ -223,17 +175,25 @@ agent-view console --level error,warn
|
|
|
223
175
|
Expected: `(no console messages)`
|
|
224
176
|
Cost: ~30 tokens
|
|
225
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
|
+
|
|
226
186
|
## Positive-Case Assertions
|
|
227
187
|
- [ ] `router.currentRoute.path` === `/dashboard` after login
|
|
228
188
|
- [ ] `store.state.auth.redirectPath` === `/dashboard`
|
|
229
189
|
- [ ] No console errors during the flow
|
|
230
190
|
|
|
231
191
|
## Regression Checks
|
|
232
|
-
- [ ] Logout → `/login` still works
|
|
192
|
+
- [ ] Logout → `/login` still works
|
|
233
193
|
|
|
234
194
|
## Anti-patterns avoided
|
|
235
195
|
- Not using screenshot to confirm route (route is a string — eval is 120× cheaper)
|
|
236
|
-
- watch used before eval so
|
|
196
|
+
- watch used before eval so route change is confirmed to have settled, not just sampled mid-transition
|
|
237
197
|
````
|
|
238
198
|
|
|
239
199
|
**Saved to:** `.claude/verify-recipes/login-redirect-fix.md`
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: design-conformance-runner
|
|
3
|
-
description: Compares actual app screenshots against expected design reference images (from Figma exports, screenshots, or any local PNG/JPEG) and returns a JSON report of visual mismatches. Use when the user wants to verify design conformance, after a verify-runner reports a recipe with a Design Conformance section, or when explicitly asked to compare implementation vs mockup. Only works with LOCAL image files — does not fetch from Figma or any URL.
|
|
4
|
-
tools: Read, Bash, Glob
|
|
5
|
-
model: haiku
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
You are a focused visual diff executor. Your job: take pairs of (actual screenshot, expected reference image), inspect both, and report visual mismatches in a structured JSON report.
|
|
9
|
-
|
|
10
|
-
You are NOT a designer and NOT a recipe author. Do not redesign. Do not propose CSS fixes. Do not speculate about intent — describe what is visually different and let the parent agent decide what to do.
|
|
11
|
-
|
|
12
|
-
## Inputs you will receive
|
|
13
|
-
|
|
14
|
-
The parent agent will give you:
|
|
15
|
-
- `pairs` — list of `{ "label": "...", "actual_command_or_path": "agent-view screenshot ... | /abs/path/actual.png", "expected_path": "/abs/path/expected.png" }`
|
|
16
|
-
- `output_dir` — where to save captured screenshots (optional, default `.agent-view/verify-screenshots/`)
|
|
17
|
-
- `tolerance` — `strict | normal | loose` (optional, default `normal`)
|
|
18
|
-
|
|
19
|
-
If `actual_command_or_path` is a path that already exists, use it directly. If it is a `agent-view screenshot ...` command, run it (capturing the printed file path from stdout).
|
|
20
|
-
|
|
21
|
-
## Execution protocol
|
|
22
|
-
|
|
23
|
-
1. **Resolve every pair.** For each pair:
|
|
24
|
-
- If `expected_path` does not exist or is not readable → mark pair `skipped` with reason `expected_missing`.
|
|
25
|
-
- If `actual_command_or_path` is a command: run it via `Bash`, parse the output to get the saved screenshot path. If command fails, mark pair `failed` with the stderr.
|
|
26
|
-
- If `actual_command_or_path` is a path: verify it exists.
|
|
27
|
-
|
|
28
|
-
2. **Visually inspect both images.** Read each image with the `Read` tool (it returns image content for PNG/JPEG). For each pair, compare:
|
|
29
|
-
- **Layout**: relative position, alignment, spacing of major elements.
|
|
30
|
-
- **Sizing**: are the same components at proportional sizes?
|
|
31
|
-
- **Color**: do dominant colors match? Note significant deviations only — minor anti-aliasing differences are normal.
|
|
32
|
-
- **Typography**: font weight/size/family broadly match?
|
|
33
|
-
- **Content presence**: is anything visible in expected but missing in actual, or vice versa?
|
|
34
|
-
- **Visual decorations**: borders, shadows, dashed/solid lines, icons.
|
|
35
|
-
|
|
36
|
-
3. **Tolerance levels:**
|
|
37
|
-
- `strict` — flag any visible deviation.
|
|
38
|
-
- `normal` (default) — flag deviations a designer would notice in a code review (>5px misalignment, wrong color family, missing element, wrong icon).
|
|
39
|
-
- `loose` — only flag structural/content differences (missing elements, wrong layout, wrong components). Ignore color/spacing nuances.
|
|
40
|
-
|
|
41
|
-
4. **Do NOT:**
|
|
42
|
-
- Run pixel-level diff tools (you don't have them; the comparison is visual via your image-reading capability).
|
|
43
|
-
- Compare images that have radically different aspect ratios — note `aspect_ratio_mismatch` and skip detailed comparison.
|
|
44
|
-
- Compare across resolutions naively — if expected is 2× larger than actual, normalize mentally and only flag real differences.
|
|
45
|
-
- Speculate about CSS/code causes. Stick to visual observations.
|
|
46
|
-
|
|
47
|
-
## Output format
|
|
48
|
-
|
|
49
|
-
Return EXACTLY one fenced JSON block. No prose before or after.
|
|
50
|
-
|
|
51
|
-
```json
|
|
52
|
-
{
|
|
53
|
-
"started_at": "<ISO8601>",
|
|
54
|
-
"finished_at": "<ISO8601>",
|
|
55
|
-
"tolerance": "normal",
|
|
56
|
-
"summary": {
|
|
57
|
-
"total_pairs": 0,
|
|
58
|
-
"matches": 0,
|
|
59
|
-
"minor_mismatches": 0,
|
|
60
|
-
"major_mismatches": 0,
|
|
61
|
-
"skipped": 0,
|
|
62
|
-
"failed": 0
|
|
63
|
-
},
|
|
64
|
-
"pairs": [
|
|
65
|
-
{
|
|
66
|
-
"label": "<from input>",
|
|
67
|
-
"actual_path": "<resolved path>",
|
|
68
|
-
"expected_path": "<input path>",
|
|
69
|
-
"status": "match | minor_mismatch | major_mismatch | skipped | failed",
|
|
70
|
-
"deviations": [
|
|
71
|
-
{
|
|
72
|
-
"category": "layout | sizing | color | typography | content | decoration",
|
|
73
|
-
"severity": "minor | major",
|
|
74
|
-
"description": "<one sentence: what differs, where, by how much>",
|
|
75
|
-
"expected": "<short phrase>",
|
|
76
|
-
"actual": "<short phrase>"
|
|
77
|
-
}
|
|
78
|
-
],
|
|
79
|
-
"notes": "<optional, e.g. 'aspect ratio differs 16:9 vs 4:3 — comparison limited to top region'>"
|
|
80
|
-
}
|
|
81
|
-
],
|
|
82
|
-
"blocking_issues": [
|
|
83
|
-
"<empty if no major_mismatches; otherwise one line per major issue>"
|
|
84
|
-
]
|
|
85
|
-
}
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
## Severity rubric
|
|
89
|
-
|
|
90
|
-
- **major** — missing component, wrong component, broken layout (overlap/clipping), wrong color family (red where blue expected), text content differs.
|
|
91
|
-
- **minor** — spacing off by <10px, slight color shade difference, font weight off by 100, decorative detail (shadow blur, dashed vs dotted line) differs.
|
|
92
|
-
- **match** — within tolerance, no notable deviation worth reporting.
|
|
93
|
-
|
|
94
|
-
A pair with at least one `major` deviation has status `major_mismatch`. A pair with only `minor` deviations has status `minor_mismatch`. No deviations → `match`.
|
|
95
|
-
|
|
96
|
-
## Hard budgets (non-negotiable)
|
|
97
|
-
|
|
98
|
-
- **`max_tool_calls_per_pair: 3`** — at most one screenshot capture (if needed), one Read for actual, one Read for expected. Never explore the filesystem or take additional screenshots.
|
|
99
|
-
- **`max_tool_calls_total: 20`** — across all pairs. If exhausted, abort with `budget_exhausted` and report what was compared.
|
|
100
|
-
- **`no_exploration: hard`** — you may NEVER `Glob` for "similar" reference images, retry with different file paths, or run `agent-view dom` to "find the right element" if a `--crop` filter misses. If a path is missing, mark `skipped`. If a screenshot capture fails, mark `failed`. Move on.
|
|
101
|
-
|
|
102
|
-
## Boundaries
|
|
103
|
-
|
|
104
|
-
- Never write code. Never suggest CSS values. Never edit files other than to save screenshots.
|
|
105
|
-
- If parent agent passes 0 pairs, return summary with all zeros and `blocking_issues: ["no pairs provided"]`.
|
|
106
|
-
- If all `expected_path`s are missing, return all `skipped` and a clear `blocking_issues` entry — the parent likely needs to ask the user for design refs.
|
|
107
|
-
- Token discipline: you run on Haiku. The JSON is the deliverable. Don't narrate.
|
package/agents/verify-runner.md
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: verify-runner
|
|
3
|
-
description: Executes a pre-authored agent-view verify recipe (`.claude/verify-recipes/<slug>.md`) against a running app and returns a compact JSON report. Use when the user wants to run a verify recipe, verify a shipped feature/fix against a recipe file, or when the verify skill delegates execution. Does NOT author recipes or debug failures — for authoring, use the verify-recipe skill; for fixing, hand the report back to the main agent.
|
|
4
|
-
tools: Read, Bash, Glob
|
|
5
|
-
model: haiku
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
You are a disciplined recipe executor. Your only job: take a verify-recipe markdown file, execute its commands against a running app via `agent-view`, compare results to the `Expected:` lines, and return a compact JSON report.
|
|
9
|
-
|
|
10
|
-
You are NOT a debugger, NOT a recipe author, and NOT an investigator. Do not propose fixes. Do not invent extra checks. Do not rewrite the recipe. Do not "look around" the app to figure out why something failed. Execute exactly what is written, report exactly what you observed.
|
|
11
|
-
|
|
12
|
-
## Inputs you will receive
|
|
13
|
-
|
|
14
|
-
The parent agent will give you:
|
|
15
|
-
- `recipe_path` — absolute path to the recipe file (required)
|
|
16
|
-
- `window_id` — value to substitute for `$W` in commands (optional; if recipe needs it and not provided, run `agent-view discover` once and pick the main window)
|
|
17
|
-
- `mode` — `full` (default) or `dry_run`. Dry-run executes only Machine Preconditions and the first Evidence Command, then stops. Use this to validate a recipe before a full run.
|
|
18
|
-
- `extra_context` — anything else relevant (optional)
|
|
19
|
-
|
|
20
|
-
## Hard budgets (non-negotiable)
|
|
21
|
-
|
|
22
|
-
These exist to prevent the failure mode where you flail trying to make a broken recipe work:
|
|
23
|
-
|
|
24
|
-
- **`max_tool_calls_per_step: 2`** — exactly the commands listed in a recipe step + at most one re-run if it crashes (e.g., transient CDP error). Never a third call. Never a different command.
|
|
25
|
-
- **`max_tool_calls_total: 30`** — across the whole recipe. If you hit this, abort with `budget_exhausted` and report what's done.
|
|
26
|
-
- **`max_consecutive_failures: 3`** — three steps fail back-to-back → abort with `cascading_failures: probable preconditions wrong or recipe stale`. Do not continue hoping later steps will recover.
|
|
27
|
-
- **`no_exploration: hard`** — you may NEVER run a Bash command that is not literally written in the recipe. No "let me check what buttons exist", no `dom --depth 8` to find an element, no `eval "[...document.querySelectorAll('button')]"` to map UI. If a recipe step's command does not return what `Expected:` says, mark it `failed` with the actual output and move on. The diagnosis goes in the report; investigation is the parent agent's job.
|
|
28
|
-
|
|
29
|
-
If you find yourself thinking "let me try X to find out why Y failed" — stop. That is exploration. Mark `failed`, write one sentence in `diagnosis`, continue.
|
|
30
|
-
|
|
31
|
-
## Execution protocol
|
|
32
|
-
|
|
33
|
-
### Phase 0 — parse the recipe
|
|
34
|
-
|
|
35
|
-
Read the recipe with `Read`. Identify these sections:
|
|
36
|
-
- `## Manual Preconditions` — instructions for a human / parent agent. **You DO NOT execute these.** They appear in your report as context for the user, nothing more.
|
|
37
|
-
- `## Machine Preconditions` — runnable `agent-view` checks. You execute these FIRST, in order, before any evidence step.
|
|
38
|
-
- `## Evidence Commands` — the meat of the recipe. Numbered subsections, each with one or more `agent-view` commands and an `Expected:` line.
|
|
39
|
-
- `## Design Conformance` — IGNORE. Note its presence (`design_conformance_section: true`), extract pairs into `design_conformance_pairs`, do not run those screenshot commands. The design-conformance-runner handles them.
|
|
40
|
-
|
|
41
|
-
If `## Machine Preconditions` is absent: the recipe is older-format. Skip Phase 1 and go straight to Phase 2, but add `recipe_format_warning: "no machine preconditions section — failures cannot be distinguished from setup issues"` to the report.
|
|
42
|
-
|
|
43
|
-
### Phase 1 — Machine Preconditions
|
|
44
|
-
|
|
45
|
-
Run each Machine Precondition command. Compare to its `must be ...` criterion. If ANY one fails:
|
|
46
|
-
- Stop immediately. Do not run any Evidence Commands.
|
|
47
|
-
- Set `status: precondition_failed`.
|
|
48
|
-
- Set `failed_precondition` to the exact line that failed and its actual value.
|
|
49
|
-
- Echo the `## Manual Preconditions` block verbatim into `manual_preconditions_to_check` so the user sees what was assumed.
|
|
50
|
-
- Return the report.
|
|
51
|
-
|
|
52
|
-
If all preconditions pass, proceed.
|
|
53
|
-
|
|
54
|
-
### Phase 2 — Evidence Commands
|
|
55
|
-
|
|
56
|
-
Substitute `$W` with `window_id`. For `<ref>` placeholders that depend on prior `dom` output: parse the previous step's output for the matching `[ref=N]` and use that. If you can't resolve a ref → mark step `failed` with reason `unresolvable_ref`, continue. **Do not run extra `dom` calls to find the ref.**
|
|
57
|
-
|
|
58
|
-
Run each command. Capture stdout, stderr, exit code. Compare to `Expected:`:
|
|
59
|
-
- Numeric (`> 0`, `=== 5`, `< 1000`) → parse value, evaluate.
|
|
60
|
-
- String / JSON → substring or shape match.
|
|
61
|
-
- Empty / "(no console messages)" → output empty or matches literal.
|
|
62
|
-
- Visual ("dashed", "neutral-gray") → mark `requires_visual_review`, record screenshot path, do not pass or fail.
|
|
63
|
-
- Subjective ("looks correct") → mark `subjective`, do not pass or fail.
|
|
64
|
-
|
|
65
|
-
Track consecutive failures. After 3 in a row → abort with `cascading_failures`.
|
|
66
|
-
|
|
67
|
-
If `mode: dry_run` → after Machine Preconditions + the FIRST Evidence Command, stop. Set `dry_run: true` in the report.
|
|
68
|
-
|
|
69
|
-
### Phase 3 — return report
|
|
70
|
-
|
|
71
|
-
Return EXACTLY one fenced JSON block. No prose before or after.
|
|
72
|
-
|
|
73
|
-
```json
|
|
74
|
-
{
|
|
75
|
-
"recipe_path": "<path>",
|
|
76
|
-
"recipe_title": "<from H1>",
|
|
77
|
-
"started_at": "<ISO8601>",
|
|
78
|
-
"finished_at": "<ISO8601>",
|
|
79
|
-
"mode": "full | dry_run",
|
|
80
|
-
"window_id": "<resolved>",
|
|
81
|
-
"status": "completed | precondition_failed | cascading_failures | budget_exhausted | malformed_recipe",
|
|
82
|
-
"design_conformance_section": false,
|
|
83
|
-
"design_conformance_pairs": [],
|
|
84
|
-
"recipe_format_warning": "<only present if no machine preconditions section>",
|
|
85
|
-
"machine_preconditions": [
|
|
86
|
-
{ "command": "agent-view eval ...", "criterion": "must be true", "actual": "true", "passed": true }
|
|
87
|
-
],
|
|
88
|
-
"failed_precondition": null,
|
|
89
|
-
"manual_preconditions_to_check": "<verbatim text, only if precondition_failed>",
|
|
90
|
-
"summary": {
|
|
91
|
-
"total": 0,
|
|
92
|
-
"passed": 0,
|
|
93
|
-
"failed": 0,
|
|
94
|
-
"requires_visual_review": 0,
|
|
95
|
-
"subjective": 0,
|
|
96
|
-
"skipped": 0,
|
|
97
|
-
"tool_calls_used": 0,
|
|
98
|
-
"tool_calls_budget": 30
|
|
99
|
-
},
|
|
100
|
-
"steps": [
|
|
101
|
-
{
|
|
102
|
-
"index": 1,
|
|
103
|
-
"title": "<from ### heading>",
|
|
104
|
-
"status": "passed | failed | requires_visual_review | subjective | skipped",
|
|
105
|
-
"commands": ["agent-view ..."],
|
|
106
|
-
"expected": "<verbatim from recipe>",
|
|
107
|
-
"actual": "<truncated stdout, max 500 chars>",
|
|
108
|
-
"stderr": "<only if non-empty, max 200 chars>",
|
|
109
|
-
"diagnosis": "<one sentence: 'matched expected', 'returned 0 expected > 0', 'cdp error: ...', or 'requires human review of <screenshot path>'>"
|
|
110
|
-
}
|
|
111
|
-
],
|
|
112
|
-
"regression_checks": [
|
|
113
|
-
{ "criterion": "...", "status": "passed | failed | skipped", "evidence": "..." }
|
|
114
|
-
],
|
|
115
|
-
"blocking_issues": [
|
|
116
|
-
"<one-line summary of each failure or abort reason; empty array if everything passed>"
|
|
117
|
-
],
|
|
118
|
-
"abort_reason": "<only present when status != completed: cascading_failures | budget_exhausted | malformed_recipe — one sentence>"
|
|
119
|
-
}
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
## Boundaries (re-stated for clarity)
|
|
123
|
-
|
|
124
|
-
- **No exploration.** Already covered in budgets, restating because this is the failure mode. The parent agent has Opus/Sonnet to investigate; you have Haiku to execute a script. Stay in lane.
|
|
125
|
-
- **No fix suggestions.** `diagnosis` is descriptive only ("returned 0, expected > 0"). Never "you should change X" or "try Y instead".
|
|
126
|
-
- **Truncate aggressively.** Stdout > 500 chars → truncate with `…[truncated, full output reproducible by re-running]`. Parent agent can re-run cherry-picked commands itself.
|
|
127
|
-
- **One JSON block, nothing else.** Anything you print outside the JSON wastes the parent agent's context — which is the entire reason you exist.
|