/claude-engineering-skills:visual-auditfrom Claude Engineering Skills
Math-first, deterministic visual/paint inspection — the 4th UX lens, complementing persona-test (journey), click-test (page), and nav-audit (system). Drives Playwright + computed styles + bounding boxes + CDP forced-pseudo-state to audit declared-token conformance, light/dark theme parity, layout physics, and affordance signifiers. A VLM is advisory-only and never gates. CI gate is drift-only on the changed contracted surface. Triggers on: "visual audit", "check styling consistency", "theme parity", "dark mode parity", "design token drift", "paint audit", "button/card consistency", "focus ring audit", "/visual-audit".
Ships in Claude Engineering Skills. 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.
Read when SKILL.md points to them.
Where click-test asserts semantic-HTML/DOM contracts and persona-test does narrative QA, visual-audit asserts what the page paints: token conformance, theme parity, layout physics, and affordance signifiers — deterministically, over computed-style evidence.
The one rule that defines scope (write it into every judgement): "Include a check only if you can assert it on a computed style without knowing what the page is FOR." A focus ring's presence, a hover paint-delta, a disabled control's opacity — all assertable blind. "Is this the primary CTA?" / "would a user know to click?" require intent → that's persona-test, not here.
Worktree preflight — in a linked git worktree the gitignored tooling tree
scripts/.claude-skills/is absent (git worktree adddoes not populate it), so every command below that uses it dies onMODULE_NOT_FOUND. Runnpm run skills:hydratefirst; if no such script exists,references/worktree-preflight.mdholds the entry to add (ask the user first: it editspackage.json). Keys are not copied: put them in~/.audit-loop.env, which every worktree reads.
Paint cannot be asserted without rendering. So unlike nav-audit (static-primary), visual-audit is verify-primary:
/visual-audit, no URL) = parse the declared token sources into an
allowed-set + run the source-coherence lint (unreferenced / undefined / duplicate tokens).
It emits no paint findings and says so (a banner). This is honest, not a bug.--verify <url> = where the four tiers actually run. All token/theme/layout/signifier
findings are live evidence.The assertion engine is pure math over getComputedStyle + getBoundingClientRect + CDP
matched/forced-pseudo-state. --explain (opt-in) may ask a VLM to narrate an already-found
finding; it creates zero findings and never touches the gate. Sending pixels requires the
second flag --allow-external-screenshot.
token_violation.
Token-less apps get an inferred-cluster fallback: report-only, never gating.display:none-in-one-theme element is intentional). MAY-DIFFER colors are
allowed when tokened; an untokened literal identical across themes → theme_unmapped_token.
Contrast is a byproduct over the resolved opaque backdrop → contrast_failure.layout_overflow / content_clipping / clipped_by_ancestor (box vs clipping-ancestor box — clipped content never scrolls, so scrollWidth can't see it) / unexpected_overlap (excludes
ancestor-descendant containment) / image_distortion.missing_visible_focus (any visible focus
indicator — outline OR ring OR border OR bg, ≥3:1) / state_has_no_visual_delta (no hover
paint change) / disabled_not_signified. Pseudo-states read via CDP forcePseudoState
(effective styles, no flaky mouse actuation), after freezing transitions/animations.visual-audit --bootstrap writes a review-queue
visual-contract.json. Fill surfaces[].sourceGlobs, tokenSources, themes, then remove
the _note. See references/contract-and-bootstrap.md.visual-audit [--scope diff|full] extracts the allowed-set + emits the
observed envelope + source-coherence diagnostics. No browser.visual-audit --verify <url> --device desktop,mobile --theme light,dark
drives Chromium, runs the four tiers, writes the gitignored verify-result, renders the
scorecard + findings.--gate. Exits 1 only on a gate-eligible finding that survives
the canonical ChangedScopeResolver on the changed surface. See references/ci-gate-and-verify.md.| Flag | Purpose |
|---|---|
--bootstrap [--from-url <url>] [--force] | emit a review-queue visual-contract.json |
--scope diff|full | gate scope (default diff = changed contracted surface; full = whole contracted surface). Under --gate: diff blocks on findings whose surface's files changed; full blocks on every gate-eligible finding on a declared surface (both then filtered by the baseline) |
--verify <url> | live computed-style reconcile + the four tiers |
--device <csv> | device presets, default desktop,mobile (desktop|desktop-large|tablet|mobile|mobile-small) |
--theme <csv> | subset of contract themes to capture (default all; unknown name → exit 2, never a silent drop) |
--full-dom [--full-dom-node-budget <n>] | theme-safety v2: opt-in full-DOM contrast parity-delta sweep (verify-only — without --verify → exit 2; advisory, never gates; budget default 4000 emitted text candidates) |
--storage-state <file> | Playwright storageState for auth |
--gate | drift-only CI exit (non-zero on a changed-surface gate-blocker NOT in the baseline) |
--update-baseline | snapshot today's gate-eligible findings into visual-audit-baseline.json (committed) so --gate then blocks only on NEW findings |
--explain [--allow-external-screenshot] | opt-in VLM narration (advisory; egress-guarded) |
--out <file> / --format human|json / --root <dir> | output plumbing |
Exit codes: 0 clean/advisory · 1 gate-blocking divergence (--gate) · 2 tool error ·
3 needs-bootstrap (no contract).
token_violation, theme_geometry_drift, theme_unmapped_token, contrast_failure,
layout_overflow, content_clipping, clipped_by_ancestor, unexpected_overlap, image_distortion,
missing_visible_focus, disabled_not_signified are gate-eligible.
state_has_no_visual_delta, component_inconsistency, contrast_parity_delta,
inferred-cluster outliers, and the token_unreferenced / token_undefined_reference /
token_duplicate_definition coherence diagnostics are report-only. Full rules:
references/finding-taxonomy.md.
Theme-safety (v1 + v2, advisory) — "color that didn't adapt to dark mode". Three
report-only classes. interactive_color_unset = the static lint (no browser): a
form-control selector (button/select/input/textarea/.btn*) sets background/border
but not color; runs in every static run (the --gate refusal is UNCHANGED — these are
advisory, not paint). unadapted_text_color = the --verify single-render check: the
winning color declaration's CDP origin is user-agent while an author sets a visible box
color (background/border). Origin-based (survives the background shorthand +
inherited/companion author color); scope = native form controls only. contrast_parity_delta
= the v2 --verify --full-dom check: a text node whose contrast passes in one theme and
fails in the other (the XOR fingerprint of a non-adapting color — decorative low-contrast
fails in both themes, so no delta). Scope-disjoint by construction: the gate-eligible
absolute contrast_failure sees contracted-surface nodes ONLY; the parity-delta sees the
full-DOM sweep's scope:'fullDom' nodes ONLY — never consolidate them, the split IS the
design (the delta is what keeps a full-page sweep low-noise where absolute contrast would
drown). Full-DOM joins across themes use the un-truncated livePath (the depth-8 nodeKey
collides on repeated deep structures); capture honesty degrades to unverified on empty
sweep / all-ambiguous joins / zero cross-theme joins / partial device×theme matrix — never a
silent clean. Known capture limits: TreeWalker does not pierce shadow roots; the budget
bounds emitted text candidates (default 4000, truncated stat on clip). NOTHING here gates —
gate-promotion of all three classes and modal activate-reach remain v1.1
(docs/plans/visual-audit-theme-safety-v1.md; v2: visual-audit-theme-safety-v2.md).
| File | Summary | Read when |
|---|---|---|
references/token-extraction-and-adapters.md | Token-source adapters (Tailwind/CSS-vars/JSON), allowed-set normalization, inferred-cluster fallback. | Adding/debugging a token source, or a value reconciles wrong. |
references/finding-taxonomy.md | The 19 finding classes — severity, gate-eligibility, guards that prevent false positives. | Triaging a finding, or deciding if a check is in-scope. |
references/contract-and-bootstrap.md | visual-contract.json schema + --bootstrap recipe, data-visual-id opt-in, theme-apply protocol. | Authoring/editing the contract, or theme capture misbehaves. |
references/ci-gate-and-verify.md | Drift-only changed-surface gate, the ChangedScopeResolver rules, capture-honesty, exit codes. | Wiring CI, or a finding gates/doesn't-gate unexpectedly. |
examples/example-report.md | A sample human + JSON visual-audit report for reference. | Want to see the output shape before running. |
references/worktree-preflight.md | Worktree preflight remedy — the skills:hydrate npm script to add when a linked worktree lacks the tooling tree. | A command dies with MODULE_NOT_FOUND in a linked worktree AND this repo has no skills:hydrate script. |
examples/example-report.md (opens in a new tab)gate-contract.json (opens in a new tab)references/ci-gate-and-verify.md (opens in a new tab)references/contract-and-bootstrap.md (opens in a new tab)references/finding-taxonomy.md (opens in a new tab)references/token-extraction-and-adapters.md (opens in a new tab)references/worktree-preflight.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
Generated from the plugin's indexed repository (lbstrydom/claude-engineering-skills) — no native marketplace selected
npx claudepluginhub p/lbstrydom-claude-engineering-skills18 skills in this plugin
/ai-context-managementManage AGENTS.md and CLAUDE.md alignment across a repo so Claude, Copilot,
Cursor, Windsurf, and other AI agents share the same project context.
Detects drift, reconciles manually-introduced divergence, and migrates legacy
CLAUDE.md-canonical repos to AGENTS.md-canonical.
Triggers on: "audit AGENTS.md", "check context drift", "AGENTS.md vs CLAUDE.md",
"fix context drift", "migrate to AGENTS.md",
"context sync", "what tools read which file", "ai-context-management".
Usage: /ai-context-management audit — Score drift + report findings
Usage: /ai-context-management reconcile — Apply patches to fix drift
Usage: /ai-context-management migrate — Flip legacy repo to AGENTS.md canonical
/audit-codeIteratively audit code against a plan with GPT + an independent final gate (Gemini, else Claude).
5-pass parallel static analysis (structure, wiring, backend, frontend,
sustainability), R2+ ledger-driven suppression, debt capture for
out-of-scope findings, max 6 rounds with 2-stable-rounds convergence.
Invoke this for ANY code-correctness review, even a small pasted snippet
or diff — don't just review it yourself directly; a single read-through
is not a substitute for the multi-pass GPT + final-gate adjudication this skill
performs, and skipping it means the review didn't actually happen.
Triggers on: "audit my code", "audit my changes", "audit my PR",
"check the implementation", "review my code", "audit code", "/audit-code",
"audit this", "verify the implementation".
Usage: /audit-code <plan-file> — Audit code against plan (--scope diff default)
Usage: /audit-code <plan-file> --scope plan — Audit only files mentioned in the plan
Usage: /audit-code <plan-file> --scope full — Full repo audit
/audit-planIteratively audit a plan file (docs/plans/*.md) with GPT + final gate (Gemini/Claude).
Multi-round refinement with an acceptance-rate early-stop (3 rounds default).
Ledger-driven suppression on R2+ rounds prevents finding churn.
Judges the plan DOCUMENT before anyone builds it. "Was the plan actually
built?" is /ux-lock verify — that reads a live app, this reads only the file.
Triggers on: "audit the plan", "iterate on the plan", "plan-audit",
"audit docs/plans/", "review the plan", "is this plan good",
"check the plan", "/audit-plan".
Usage: /audit-plan <plan-file> — Audit existing plan iteratively
Usage: /audit-plan <task-description> — Generate plan with /plan, then audit
/brainstormMulti-LLM concept-level brainstorming. Sends the user's topic to OpenAI
(and optionally Gemini) so the user can compare independent perspectives
alongside Claude's. Convergence is manual — Claude waits for the user
to ask for synthesis instead of auto-merging the views. Supports model
selection, repo-architecture context attachment (auto on arch topics),
a debate second round, depth budgets, session resume, extra context and
artifact attachment, and saving keeper insights from prior rounds.
Triggers on: "brainstorm", "let's think about", "get other LLMs on this",
"what would Gemini/GPT say", "/brainstorm".
Full command syntax: see the Usage section in this skill.
/click-testStructural DOM audit of a live app — walk every interactive element and
assert semantic-HTML contracts (duplicate IDs, orphan labels, inputs without
names, ARIA misuse, heading hierarchy, missing alt text, undersized touch
targets). Complements /persona-test: persona-test catches narrative UX issues
a real user would hit; click-test catches structural issues that hide in
JS-rendered surfaces and silently break assistive tech, form submissions, or
React reconciliation. Drives a browser via the shared driver contract; optional
--with-modals opens each modal/dropdown and rescans; device presets and
matrix mode cover responsive breakpoints.
Triggers on: "click test", "click-test", "structural audit", "DOM audit",
"accessibility audit", "duplicate ID check", "walk every element",
"audit the DOM", "structural QA", "/click-test".
Full command syntax: see the Usage section in this skill.
/cycleEnd-to-end feature cycle orchestrator. Runs the full skill chain in
sequence: /plan → /audit-plan → (wait for human implementation) →
/audit-code → /persona-test (if frontend/full-stack) → /ux-lock (if
fixes shipped) → /ship-checked. Use when starting a new feature or non-trivial
fix and you want the whole workflow on autopilot. Supports resuming from
an existing plan or straight to code-audit, per-step skips, max-round
pass-through, an opt-in autonomous mode that implements + audits each
plan cluster (the default still pauses for the human), and a remediate
mode that fixes triaged persona-test/audit findings against an accepted
plan with a focused audit and a rerun of only the affected journeys.
Triggers on: "run the full cycle", "do the whole flow", "plan + audit
+ ship", "feature cycle", "remediate the persona findings", "/cycle".
Full command syntax: see the Usage section in this skill.