@rolepod/uiproof 0.4.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.
@@ -0,0 +1,85 @@
1
+ ---
2
+ name: scaffold-e2e
3
+ description: Generate a runnable e2e test file (playwright-test, vitest+playwright, or pytest+selenium) from a scenario description plus an optional replay bundle from a prior /verify-ui run.
4
+ ---
5
+
6
+ # /scaffold-e2e
7
+
8
+ Single-backend skill. Calls **`rolepod_scaffold_e2e`** on the rolepod-uiproof
9
+ MCP server. No fallback (D-024).
10
+
11
+ ## When to use
12
+
13
+ - The user asks to generate an e2e test for a flow they just verified
14
+ interactively.
15
+ - A replay bundle from `/verify-ui` exists and should be transcribed into
16
+ a real test file.
17
+
18
+ ## When NOT to use
19
+
20
+ - A unit or integration test is sufficient — pick a closer framework
21
+ manually.
22
+ - The scenario is too vague to scaffold — ask the user to clarify before
23
+ calling.
24
+
25
+ ## Inputs
26
+
27
+ - `framework` — `playwright-test` | `vitest+playwright` | `pytest+selenium`.
28
+ - `scenario_nl` — natural-language description of the scenario.
29
+ - `url` — entry URL.
30
+ - `recorded_bundle` *(optional)* — path to a replay bundle from a prior
31
+ `/verify-ui` run; when present, steps and expectations are transcribed.
32
+ - `filename` *(optional)* — override the generated file name.
33
+
34
+ ## Outputs
35
+
36
+ - `run_id` — folder under `./.rolepod-uiproof/artifacts/`.
37
+ - `test_file_path` — path to the generated test file.
38
+ - `language` — `typescript` | `python`.
39
+ - `dependencies` — packages the user needs to install.
40
+ - `setup_notes` — what to run after install.
41
+ - `from_replay_bundle` — boolean indicating whether the file was
42
+ transcribed from a recorded run.
43
+
44
+ ## Process
45
+
46
+ 1. Build `rolepod_scaffold_e2e` input.
47
+ 2. Call the tool.
48
+ 3. Print the generated file path and the setup steps. Surface
49
+ `dependencies` as an install command.
50
+
51
+ ## If the tool is unavailable
52
+
53
+ Surface plainly:
54
+
55
+ > The `/scaffold-e2e` skill needs the **rolepod-uiproof** MCP server, which
56
+ > is not currently available. Confirm the plugin is installed and try
57
+ > again.
58
+
59
+ Do not attempt another backend (D-024).
60
+
61
+ ## Examples
62
+
63
+ ### Transcribe a replay bundle to a Playwright Test file
64
+
65
+ ```json
66
+ {
67
+ "framework": "playwright-test",
68
+ "scenario_nl": "user opens example.com and clicks Learn more",
69
+ "url": "https://example.com",
70
+ "recorded_bundle": ".rolepod-uiproof/artifacts/verify_…/replay.json"
71
+ }
72
+ ```
73
+
74
+ Returns:
75
+
76
+ ```json
77
+ {
78
+ "run_id": "scaffold_…",
79
+ "test_file_path": ".rolepod-uiproof/artifacts/scaffold_…/user-opens-example-com-and-clicks-learn-more.spec.ts",
80
+ "language": "typescript",
81
+ "dependencies": ["@playwright/test"],
82
+ "setup_notes": "Install: npm i -D @playwright/test && npx playwright install. Run: npx playwright test.",
83
+ "from_replay_bundle": true
84
+ }
85
+ ```
@@ -0,0 +1,134 @@
1
+ ---
2
+ name: verify-ui
3
+ description: Drive a real browser session through steps and assert expected outcomes; save evidence under ./.rolepod-uiproof/artifacts/. Use when a diff changes visible behavior and code-level tests do not prove it. v0.1 web only.
4
+ ---
5
+
6
+ # /verify-ui
7
+
8
+ Single-backend skill. Calls **`rolepod_verify_ui_flow`** on the rolepod-uiproof
9
+ MCP server and surfaces the structured result. No fallback (D-024) — if the
10
+ tool is unavailable, this skill fails with a clear diagnostic so the caller
11
+ (typically the user, or the parent `rolepod` plugin's `check-work` skill)
12
+ can decide what to do next.
13
+
14
+ ## When to use
15
+
16
+ - A diff changes user-visible behavior on a web target.
17
+ - A URL is reachable (dev server is running, or the target is a deployed URL).
18
+ - Code-level tests (unit, type-check, lint) do not prove the visible
19
+ outcome.
20
+
21
+ ## When NOT to use
22
+
23
+ - Backend-only diffs (no UI change).
24
+ - Doc, config, or build-tool changes with no behavior surface.
25
+ - No dev server / target available — ask the user to spin one up first
26
+ before invoking.
27
+ - iOS / Android targets — mobile ships in v0.3 (`platform: 'ios' | 'android'`).
28
+
29
+ ## Modes
30
+
31
+ - `mode: 'assert'` (default) — the assertions describe what the **feature
32
+ should do**; pass = feature works.
33
+ - `mode: 'reproduce'` — the assertions describe what the **bug looks like**;
34
+ pass = bug reproduces. When `minimize: true` (default) the tool then
35
+ removes steps one-by-one to find the shortest still-reproducing sequence
36
+ and writes a `replay-minimized.json` bundle next to `replay.json`.
37
+
38
+ ## Inputs
39
+
40
+ - `target` — the URL to open (web only in v0.1).
41
+ - `steps` — ordered UI actions. Each is one of:
42
+ - `{ kind: 'click', query: <accessible name substring> }`
43
+ - `{ kind: 'type', query: <accessible name substring>, text: <string>, clear_first?: boolean }`
44
+ - `{ kind: 'key', key: <e.g. 'Enter'> }`
45
+ - `{ kind: 'wait_for', condition: { kind, ... } }`
46
+ - `{ kind: 'navigate', url: <string> }`
47
+ - `expect` — ordered assertions. Each is one of:
48
+ - `{ kind: 'text_visible', text: <string> }`
49
+ - `{ kind: 'text_absent', text: <string> }`
50
+ - `{ kind: 'url_matches', pattern: <regex string> }`
51
+ - `{ kind: 'ref_in_state', query: <accessible name substring>, state: 'visible' | 'enabled' | 'focused' }`
52
+ - `capture` *(optional)* — defaults to `['screenshot']`. v0.1 only emits
53
+ screenshots and a replay bundle; HAR / console / video land in later
54
+ milestones.
55
+ - `close_on_finish` *(optional)* — defaults to `true`.
56
+
57
+ ## Outputs
58
+
59
+ - `run_id` — folder name under `./.rolepod-uiproof/artifacts/`.
60
+ - `passed` — boolean.
61
+ - `failed_at_step` *(when not passed)* — 0-based step index.
62
+ - `failure_reason` *(when not passed)* — human-readable explanation.
63
+ - `evidence_paths` — `{ screenshots: string[], replay_bundle?: string }`.
64
+ - `final_url_or_screen` — page URL at the end of the run.
65
+
66
+ ## Process
67
+
68
+ 1. Construct a `rolepod_verify_ui_flow` input from the user's intent:
69
+ - `mode: 'assert'`
70
+ - `open: { platform: 'web', url: <target> }`
71
+ - `steps`, `expect`, `capture`, `close_on_finish` per inputs above.
72
+ 2. Call the tool.
73
+ 3. Report the structured result. If `passed: false`, include
74
+ `failed_at_step`, `failure_reason`, and the screenshot path so the user
75
+ can inspect the failure.
76
+
77
+ ## If the tool is unavailable
78
+
79
+ The rolepod-uiproof MCP server is not registered or is not responding. Surface
80
+ this plainly:
81
+
82
+ > The `/verify-ui` skill needs the **rolepod-uiproof** MCP server, which is
83
+ > not currently available. Confirm the plugin is installed and try again,
84
+ > or check that `npx -y @rolepod/uiproof` is reachable.
85
+
86
+ Do **not** attempt this work via Playwright MCP, Chrome DevTools MCP, or
87
+ any other backend from inside this skill. Multi-backend routing is the
88
+ job of the parent `rolepod` plugin's `check-work` / `debug-issue` skills
89
+ (D-024).
90
+
91
+ ## Examples
92
+
93
+ ### Success — verify a search result on example.com
94
+
95
+ User: "Verify that opening https://example.com shows the heading 'Example
96
+ Domain' and links to iana.org."
97
+
98
+ Skill invokes `rolepod_verify_ui_flow` with:
99
+
100
+ ```json
101
+ {
102
+ "mode": "assert",
103
+ "open": { "platform": "web", "url": "https://example.com" },
104
+ "steps": [],
105
+ "expect": [
106
+ { "kind": "text_visible", "text": "Example Domain" },
107
+ { "kind": "text_visible", "text": "More information" }
108
+ ]
109
+ }
110
+ ```
111
+
112
+ Returns:
113
+
114
+ ```json
115
+ {
116
+ "run_id": "verify_20260524T101512_a1b2c3d4",
117
+ "passed": true,
118
+ "evidence_paths": {
119
+ "screenshots": [".rolepod-uiproof/artifacts/verify_…/final.png"],
120
+ "replay_bundle": ".rolepod-uiproof/artifacts/verify_…/replay.json"
121
+ },
122
+ "final_url_or_screen": "https://example.com/"
123
+ }
124
+ ```
125
+
126
+ ### Failure — MCP server not available
127
+
128
+ The MCP server is not registered. The skill returns:
129
+
130
+ > The `/verify-ui` skill needs the **rolepod-uiproof** MCP server, which is
131
+ > not currently available. Confirm the plugin is installed and try again.
132
+
133
+ No other backend is attempted. The caller decides whether to escalate to
134
+ the parent rolepod plugin's `check-work` skill.
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: visual-diff
3
+ description: Capture a screenshot of the current UI and compare against a stored baseline under ./.rolepod-uiproof/baselines/. First capture for a baseline_id seeds the baseline; subsequent capture diffs it.
4
+ ---
5
+
6
+ # /visual-diff
7
+
8
+ Single-backend skill. Calls **`rolepod_visual_diff`** on the rolepod-uiproof
9
+ MCP server. No fallback (D-024).
10
+
11
+ ## When to use
12
+
13
+ - Detecting visual regressions against a known-good baseline.
14
+ - Verifying a CSS / styling change does not perturb unrelated elements.
15
+
16
+ ## When NOT to use
17
+
18
+ - No baseline exists yet AND the user is not OK with this run becoming
19
+ the baseline (the first call always seeds).
20
+ - The page has highly dynamic content (rotating banners, timestamps,
21
+ animations) — the diff will be noisy. Either freeze the dynamic content
22
+ via a flag or pick a different verification approach.
23
+
24
+ ## Inputs
25
+
26
+ - `target` — URL.
27
+ - `baseline_id` — short stable name (e.g. `homepage-light`, `checkout-success`).
28
+ - `viewport` — optional `{ width, height }` so the baseline and the current
29
+ capture share dimensions. Default uses the browser's natural viewport.
30
+ - `threshold_pct` — tolerated diff fraction. Default `0.1` (= 10%).
31
+ - `pixel_threshold` — pixelmatch sensitivity 0..1. Default `0.1`.
32
+
33
+ ## Outputs
34
+
35
+ - `run_id` — folder under `./.rolepod-uiproof/artifacts/`.
36
+ - `diff_pct` — fraction of differing pixels.
37
+ - `passed` — `diff_pct <= threshold_pct`.
38
+ - `baseline_path`, `current_path`, `diff_image_path`.
39
+
40
+ ## Process
41
+
42
+ 1. Build `rolepod_visual_diff` input from the user's intent.
43
+ 2. Call the tool.
44
+ 3. Report `diff_pct`, `passed`, and the three image paths. If the baseline
45
+ was just seeded, say so explicitly.
46
+
47
+ ## If the tool is unavailable
48
+
49
+ Surface plainly:
50
+
51
+ > The `/visual-diff` skill needs the **rolepod-uiproof** MCP server, which is
52
+ > not currently available. Confirm the plugin is installed and try again.
53
+
54
+ Do not attempt another backend (D-024).
55
+
56
+ ## Examples
57
+
58
+ ### Seed a baseline then diff
59
+
60
+ First run:
61
+
62
+ ```json
63
+ {
64
+ "open": { "platform": "web", "url": "https://example.com" },
65
+ "baseline_id": "example-home",
66
+ "viewport": { "width": 1280, "height": 720 }
67
+ }
68
+ ```
69
+
70
+ Returns `passed: true, diff_pct: 0, note: "Baseline did not exist…"`.
71
+
72
+ Second run (after a CSS change) returns `passed: false, diff_pct: 0.18,
73
+ diff_image_path: …diff.png`.