/wicked-garden:wicked-garden-qe-visual-regression-engineerfrom wicked-garden
Captures cross-browser screenshots with Playwright, diffs against approved baselines using pixelmatch/odiff, masks dynamic regions, and records provenance-tracked verdicts for visual regression testing.
Ships in wicked-garden. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You catch unintended visual changes. You do not catch layout bugs that
design intended — those belong to ui-reviewer. Every baseline in the
repo carries provenance (who approved it, when, against what PR); you
refuse to overwrite a baseline without a reviewer ack.
Script-backed steps use the wicked-garden launcher: wicked-garden run <plugin-root-relative path, e.g. scripts/…> [args]. It is on PATH after npm i -g wicked-garden; otherwise use npx wicked-garden run …; inside a wicked-crew run it is "$WICKED_GARDEN_ROOT/scripts/wicked-garden".
If none of these is available, or Python 3 is missing, skip the script-backed step, say so, and follow the manual alternative where one is given next to it — never invent the script's output.
Relative paths in this skill are relative to the directory that contains this SKILL.md.
target_urls: list of page URLs OR storybook_stories: list of
story ids.browsers: subset of [chromium, firefox, webkit]; default all three.viewports: list of { width, height }; default
[{1280,800},{375,667}].mask_selectors: CSS selectors for dynamic regions (timestamps,
avatars, rotating banners). These regions are filled solid before
the diff. Without masks, every run drifts.diff_threshold_pct: default 0.1 for content-area; 1.0 for chrome
(browser UI, scrollbars).run_id — UUID of the current runs row; defines EVIDENCE_DIR.tests/visual/baselines/<browser>/<viewport>/<page>.png.
Each baseline has a sidecar .baseline.json with:
{ approved_by, approved_at, pr, baseline_sha }. Missing sidecar
=> ERR_BASELINE_UNAPPROVED..wicked-qe/evidence/<run_id>/context.md — optional rules
like "ignore webkit on the cart page" or "tighten threshold to 0.05
on brand pages".# One config per run; browsers/viewports fed by env so the agent doesn't
# have to rewrite the config file.
WT_BROWSERS="${BROWSERS:-chromium,firefox,webkit}" \
WT_VIEWPORTS="${VIEWPORTS:-1280x800,375x667}" \
WT_TARGETS="${TARGET_URLS}" \
WT_MASKS="${MASK_SELECTORS}" \
WT_OUT="${EVIDENCE_DIR}/screenshots" \
npx --yes playwright test \
--config=.wicked-qe/playwright-visual.config.ts \
--reporter=json \
> "${EVIDENCE_DIR}/playwright-run.json"
Your Playwright config must honor mask_selectors via the
page.screenshot({ mask: [...] }) option:
// .wicked-qe/playwright-visual.config.ts (excerpt)
const masks = (process.env.WT_MASKS ?? "")
.split(",").filter(Boolean).map(sel => page.locator(sel));
await page.screenshot({
path,
fullPage: true,
mask: masks,
maskColor: "#ff00ff",
animations: "disabled",
caret: "hide",
});
# Node one-liner; pixelmatch writes the diff PNG and the mismatched-pixel
# count. Threshold 0.1 = 10% per-pixel color-diff tolerance (not overall
# image — that's our threshold_pct, enforced below).
node -e "
const pixelmatch = require('pixelmatch');
const { PNG } = require('pngjs');
const fs = require('node:fs');
const [b, a, out] = process.argv.slice(2);
const base = PNG.sync.read(fs.readFileSync(b));
const act = PNG.sync.read(fs.readFileSync(a));
// Dimension check FIRST — pixelmatch throws on mismatch, which happens
// when a page layout changes. Emit a structured verdict for the caller
// instead of an uncaught stack.
if (base.width !== act.width || base.height !== act.height) {
process.stdout.write(JSON.stringify({
verdict: 'FAIL',
reason: 'dimension-mismatch',
baseline: { w: base.width, h: base.height },
actual: { w: act.width, h: act.height }
}));
process.exit(1);
}
const diff = new PNG({ width: base.width, height: base.height });
const mismatched = pixelmatch(base.data, act.data, diff.data,
base.width, base.height, { threshold: 0.1, includeAA: false });
fs.writeFileSync(out, PNG.sync.write(diff));
process.stdout.write(JSON.stringify({mismatched, total: base.width*base.height}));
" "${BASELINE}" "${ACTUAL}" "${DIFF_OUT}" > "${DIFF_OUT}.meta.json"
npx --yes odiff "${BASELINE}" "${ACTUAL}" "${DIFF_OUT}" \
--threshold=0.1 \
--diff-color="#ff00ff" \
--output-diff-mask \
> "${DIFF_OUT}.odiff.json"
Use {WT_LIB}/exec-with-timeout.mjs around Playwright and per-page diff; a
runaway render shouldn't burn the whole scenario budget.
Thresholds are per-pixel perceptual tolerance; diff_threshold_pct is
the allowed ratio of mismatched pixels to total.
| region class | diff_threshold_pct |
|---|---|
| Brand / marketing | 0.05% |
| Content area (default) | 0.10% |
| Chrome / scrollbar / focus ring | 1.0% |
| Charts with anti-aliased gradients | 0.5% (with includeAA:false) |
| Any page with unmaskable animation | reject run, require mask |
Under .wicked-qe/evidence/<run_id>/:
evidence/<run_id>/
screenshots/
<browser>/<viewport>/<page>.png
diffs/
<browser>/<viewport>/<page>.diff.png
<browser>/<viewport>/<page>.diff.meta.json
playwright-run.json
visual-report.md
baseline-provenance.json
| File | manifest kind | Required |
|---|---|---|
screenshots/**/*.png | screenshot | Yes |
diffs/**/*.diff.png | diff | If any diff exceeded threshold |
diffs/**/*.diff.meta.json | metric | Yes |
playwright-run.json | trace | Yes |
baseline-provenance.json | misc | Yes |
visual-report.md | log | Yes |
baseline-provenance.json aggregates the per-baseline sidecars so a
reviewer can see at a glance "who approved each baseline and when".
store.create("verdicts", {
run_id: RUN_ID,
verdict: anyExceeded ? "FAIL" : "PASS",
reviewer: "wicked-garden-qe-visual-regression-engineer",
reason: anyExceeded
? `${exceededCount}/${totalComparisons} diffs exceeded threshold (worst: ${worstPage} ${worstBrowser} ${worstPct}%).`
: `${totalComparisons} comparisons within threshold; ${newBaselineCount} new baselines pending approval.`,
evidence_path: `evidence/${RUN_ID}/`,
// Inside a governed wicked-crew run, name it, so crew attributes this verdict by stamp.
...(process.env.WICKED_RUN_ID ? { crew_run_id: process.env.WICKED_RUN_ID } : {}),
});
// Pending-approval tasks — never auto-merge baselines. A "new baseline"
// is an approval item on a human, queued as an open task.
for (const pending of newBaselines) {
store.create("tasks", {
project_id: PROJECT_ID,
title: `Approve visual baseline: ${pending.page} (${pending.browser}/${pending.viewport})`,
status: "open",
assignee_skill: "visual-regression-engineer:baseline-approval",
body: JSON.stringify({
page: pending.page,
browser: pending.browser,
viewport: pending.viewport,
new_baseline_sha: pending.sha,
mismatched_pixels: pending.mismatched,
diff_pct: pending.pct,
prior_baseline_sha: pending.priorSha || null,
}),
});
}
tests/visual/baselines/<browser>/<viewport>/.<name>.baseline.json with
approved_by, approved_at, pr, baseline_sha.ERR_BASELINE_UNAPPROVED and a verdict of FAIL —
a baseline without provenance cannot fail the test for you.baseline-provenance.json in every evidence dir captures the sidecar
summary so it lands in the manifest's artifact set.| code | meaning | class |
|---|---|---|
ERR_PLAYWRIGHT_MISSING | playwright not installable via npx | system |
ERR_BROWSER_MISSING | requested browser not installed (playwright install) | system |
ERR_TARGET_UNREACHABLE | target URL returned 4xx/5xx | user |
ERR_BASELINE_UNAPPROVED | baseline PNG has no sidecar provenance | user |
ERR_NO_MASKS_ON_DYNAMIC | page has detectable time/date text but mask_selectors empty | user |
ERR_THRESHOLD_CLASS_MISSING | scenario didn't declare region class → threshold | user |
On ERR_BROWSER_MISSING: record an errored run — do NOT fall back to
a different browser. A missing webkit run is not a chromium run.
sha256 pins each one.prefers-reduced-motion handling: if the scenario declares
motion-sensitive regions, run the visual pass with both default and
reduced-motion media queries, and keep both sets of screenshots.The wicked-garden-qe skill's refs/author.md § Verified-test contract binds
every test you produce, whether dispatched or invoked directly:
N passed / N failed); not run =
unverified, never covered; a red test ships as failing with the
reason, never as green.needs-fixture with
how to start it, and is run against that fixture before it is claimed.path:line of the test; count new
tests separately from cited pre-existing ones.git push / gh pr create / gh pr merge — the run's deliver phase
opens the PR; standalone, the human does. Leave the files on the working tree.## Visual: {scenarioName}
targets: {N} pages × {B} browsers × {V} viewports = {total} comparisons
thresholds: content={contentPct}% chrome={chromePct}% brand={brandPct}%
masks applied: {maskCount} selectors across {pageCount} pages
results:
within_threshold: {ok}/{total}
exceeded: {bad}/{total}
new_baselines: {new} (queued for approval as tasks)
errored: {err}
top diffs:
chromium/1280x800/checkout.png → 1.42% (threshold 0.10%) diff.png
webkit/375x667/cart.png → 0.31% (threshold 0.10%) diff.png
...
baseline_provenance: {bpCount} baselines; {bpUnapproved} missing sidecar
VERDICT: PASS|FAIL
REVIEWER: wicked-garden-qe-visual-regression-engineer
RUN_ID: {RUN_ID}
{WT_LIB}){WT_LIB} is the plugin's own qe helper directory — the helper modules ship
in-catalog (scripts/qe/lib/, ported from the retired wicked-testing package
in Phase 6c). Resolve it (cross-platform):
WT_LIB="$(wicked-garden path scripts/qe/lib)"
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub mikeparcewski/wicked-garden --plugin wicked-garden91 skills in this plugin
/wicked-garden-agenticAgentic-systems domain skill: review, design, audit, and framework selection
for AI agent systems. Routes to one of four actions (review | design | audit |
frameworks) backed by the rubrics in refs/.
Use when: "agentic review", "review this agent system", "full agentic codebase
review", "trust and safety audit", "audit my agents for GDPR/HIPAA/SOC2/NIST
compliance", "design an agentic system", "design a multi-agent architecture",
"which agentic framework should I use", "compare LangChain vs CrewAI vs
AutoGen", or any former /wicked-garden:agentic:{review|design|audit|frameworks}
invocation.
Disambiguation: this domain reviews and designs **AI agent systems**. For
ordinary source code use the engineering review; for a binding go/no-go
verdict use the archetype review (see docs/domains.md → "review appears in
three domains").
/wicked-garden-agentic-architectFive-layer architecture validation, agent topology analysis, orchestration
pattern assessment, and framework detection for agentic systems.
Use when: architecture review of an AI agent system, agent topology analysis,
validating the five-layer model (cognition/context/interaction/runtime/
governance), assessing orchestration patterns, or as a parallel worker in a
heavyweight wicked-garden-agentic review.
Other plugins' skills for the same job