/flagrare:visual-diff-branchesfrom Flagrare
Captures before/after screenshots of pages on two git refs and pixel-diffs them to show visual regressions. Useful for design-system, tokens, typography, or styling PRs.
Ships in Flagrare. 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; scripts run unread.
Answer "what does this branch change on these pages" with evidence: the same pages captured on each ref, pixel-diffed to show where, and measured with computed styles to show what. Everything runs on the browser the project already has (Playwright's Chromium), so nothing gets installed.
Scripts live in scripts/ next to this file. They resolve @playwright/test from the project's node_modules, so run them with the project root as the working directory and pass the scripts by absolute path. The only file you write per project is a shots.mjs config (contract in references/config.md, worked example in references/shots.example.mjs).
A PR branch is usually behind its base. Comparing the raw branch against main mixes the PR's own changes with every fix main landed since the branch forked, and those show up as regressions the PR did not cause. Decide up front and say which one you compared:
| Question | Compare |
|---|---|
| "What will land if this merges?" (the usual case) | a throwaway branch: git checkout -B smoke/<name> origin/<branch> && git merge --no-edit origin/main |
| "What does the branch look like exactly as pushed?" | the branch itself |
Check git rev-list --count origin/<branch>..origin/main and quote the number in the report. If a difference appears on the raw branch but not on the merged one, it is a missing main fix, not a PR finding; say so and name the commit (git log --oneline origin/<branch>..origin/main -- <file>).
Tell the user before the first checkout. Their working tree is about to change branches under a running dev server.
shots.mjsOne config per project, kept out of git (.build/ or the scratchpad). It names the base URL, the saved login state, the locales and viewports, the shot list (a URL plus an optional after(page) that clicks into a flyout, picks a menu, opens an editor), and the measurement targets. See references/config.md.
Pick pages that exercise what the branch touches: a list with a table, a form with inputs and buttons, a flyout or modal, an empty state. Include every locale the product ships if the change is typographic; a font-size change can be harmless in one script and unreadable in another.
Probe each URL once before running the matrix. One URL that redirects to login or fires a logout call (a venue the saved session cannot open, for example) turns every later shot in the run into a login page. Drop it or switch to a URL the session can reach.
pnpm exec playwright test --project=setup # or whatever refreshes the saved session
node <skill>/scripts/capture.mjs ./shots.mjs main ./shots
git checkout -B smoke/pr origin/feat/pr && git merge --no-edit origin/main
<skill>/scripts/wait-for-rebuild.sh <dev-server-log> <any-watched-source-file>
pnpm exec playwright test --project=setup
node <skill>/scripts/capture.mjs ./shots.mjs pr ./shots
Three things the loop above encodes, learned the hard way:
wait-for-rebuild.sh waits for a new compile line without errors and re-touches a file when the last one was dirty.capture.mjs prints the rendered page size per shot. A shot that is viewport-height when its siblings are three screens tall was captured on a spinner; re-run it with --only <name>.Run capture with the sandbox disabled when your agent sandbox blocks localhost.
Pixel diffs locate a change; they cannot tell a 3px radius from a pill, or 16px from 14px. Run the measurement pass on each variant and compare:
node <skill>/scripts/measure.mjs ./shots.mjs main ./shots
node <skill>/scripts/measure.mjs ./shots.mjs pr ./shots
node <skill>/scripts/compare-measures.mjs ./shots main pr
Targets are Playwright locators, so use text and roles (getByText('Save changes'), getByRole('button', …)) that survive markup changes. Mark containers with box: true to also record background, border, radius, padding, height and width. The compare output lists only rows that differ, with the base value first.
Every finding in the report should rest on a measured pair, not on how a screenshot looks. "Buttons look rounder" becomes "button radius 3px → 80px on Save, Cancel, New Modifier", which the author can act on and the reviewer can verify.
node <skill>/scripts/diff.mjs ./shots main pr
node <skill>/scripts/compose.mjs ./shots main pr ./for-design --labels "main (today)|design-system PR" \
modifiers.en.1280.png:190,80,900,600 item-flyout.en.1280.png
diff.mjs writes diff-pr/<file>.png with changed pixels in red over a faded base and prints changed %, both sizes and the bounding box per file. Use the table to pick which shots deserve a composite; a 0.3% change confined to one row is a note, a 7% change across the page is a screenshot. Read at least two diff images before describing a variant as "only X changed". A localized red blob you did not expect is a finding.
compose.mjs draws two shots side by side with labels, optionally cropped (file:x,y,w,h) so the designer sees the buttons and inputs, not the sidebar. Number the files in the order you want them read.
Report in this shape:
Then git checkout <original branch>, delete the throwaway branches, wait for the rebuild once more, and say what the checkout is.
| Mistake | What to do instead |
|---|---|
| Cloning the repo and starting a second dev server on another port | One server, throwaway branch, wait-for-rebuild.sh. Cloning costs a full install and drifts on config; the watcher already rebuilds on checkout. |
| Installing pixelmatch, pngjs, sharp or Pillow | diff.mjs and compose.mjs use a canvas in the headless browser the project already has. |
| Explaining "what changed" from the SCSS diff | The diff says what the author touched; measure.mjs says what the page renders. Both, and the report cites the measured one. |
| One saved session for the whole run | Refresh per variant; check the size column for the login-page tell. |
| Comparing the raw branch and reporting a regression that is a missing main fix | Step 1. Merge main on a throwaway branch and name the commit when the raw branch differs. |
| Placeholder ready-selectors ("fix once I can see the page") | Probe the URL first, then write the after step against the real markup. |
| Leaving the repo on the throwaway branch | Step 6. The user's next git status should look like it did before you started. |
references/config.md (opens in a new tab)references/shots.example.mjs (opens in a new tab)scripts/capture.mjs (opens in a new tab)scripts/compare-measures.mjs (opens in a new tab)scripts/compose.mjs (opens in a new tab)scripts/diff.mjs (opens in a new tab)scripts/lib.mjs (opens in a new tab)scripts/measure.mjs (opens in a new tab)scripts/wait-for-rebuild.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub flagrare/agent-skills --plugin flagrare43 skills in this plugin
/atdd-planProduce an ATDD-first implementation plan in Claude Code's native plan mode, with named design patterns called out where they earn their keep. The skill enters plan mode automatically (via the EnterPlanMode tool), runs /flagrare:codebase-explore to ground the plan in the actual codebase, then produces a plan-mode plan that MUST include both: (1) 3-5 acceptance tests in plain English defining 'done' before any implementation, written behavior-first against the public API only; and (2) any non-trivial structural decisions named as design patterns with a one-line rationale. Plan mode's native approve/edit/reject button UI is the close, ExitPlanMode is how the skill ends. Use whenever the user wants to plan a feature, fix, or refactor, 'how should we implement X', 'plan this', 'let's design X', 'where do we start on Y'. Tests follow Kent Dodds Testing Trophy: behavior over implementation, integration-heavy, public-API-only, refactor-proof. The skill stops at the plan; it does not write implementation code./brag-docGenerate a comprehensive, impact-framed brag-doc entry for a chosen time window (day, week, biweek, month, or custom). Pulls authored PRs, reviews given, commits, deploys, and linked tickets across GitHub, local git, and configured MCPs, then synthesises a themed narrative, leading with outcomes, quantifying impact, owning the work in first-person past tense, separating IC contributions from amplification, and naming the judgment exercised. Output is designed to drop straight into a developer journal, a personal bragging sheet, or a performance-review packet. Accepts a mode argument, `/flagrare:brag-doc resumancer` renders the output as ready-to-paste Resumancer CLI commands (`resumancer impact "..." --branch ...`) instead of markdown. Use whenever the user says "brag doc", "brag sheet", "what did I do this week", "weekly recap", "monthly recap", "performance review prep", "what should I tell my manager", "summarise my impact", "career log entry", "give me my wins", "biweekly recap", or any variant about looking back over a longer window than a single day's standup. Also trigger near review season ("self-review", "perf packet", "evaluation prep"), and on phrases like "log my wins to resumancer" or "make resumancer entries for this week" (which should pass the `resumancer` mode). For windows longer than about a month, a tenure retrospective, a departure record, or "everything I did at this company", hand off to `/flagrare:impact-timeline` instead; this skill's window tops out at a month./bug-bashProgrammatic bug bashing, ingest a prescribed test plan (Notion, markdown, pasted spec), drive a real running system (browser via Chrome DevTools / Playwright MCP, backend via API tools when relevant), run every prescribed case with evidence, then do exploratory passes (viewports, edge inputs, multi-actor flows, codebase-driven concerns, additional context like meeting transcripts, emails and links checked in the real inbox with a control case, other languages, failures and races) without ever claiming a bug it didn't itself reproduce. Fills free-text fields with tagged, playful test data that also probes something (unicode, HTML, template syntax, length). Lands results in a local MD file by default, optionally writes back to the source (Notion bug DB, test case Eng QA columns, etc.) in the user's voice. Use whenever the user says 'bug bash', 'QA this feature', 'run the test cases', 'go through this test plan', 'verify these scenarios', 'do a bash on X', when they hand over a Notion test case page, or any time programmatic end-to-end verification of a feature against a checklist is needed. Also use it when a smoke test passed but the user wants more cases tested, or asks 'what else should we test' and then 'test it yourself'. Make sure to use this skill even when the user just says 'test this Notion page' or 'check these scenarios', anything that smells like running someone else's prescribed test plan against a live system./careerRun the career skills that are due, in one pass, and return one short combined digest plus an updated board. It reads timestamps and flags to decide: the promotion map's first run when there is none (after asking), a refresh of map sections that are older than 90 days or flagged by a scan, an opportunity scan when the last one is a month old, and an impact scan every time. The digest leads with the initiative the user owns and its next step, then up to 5 threads worth weighing in on, one line on the promotion map (open rubric rows, people who haven't seen the work, when to talk to the manager, the packet deadline), anything that needs the user, and an "all answering, nothing owned" warning when the user keeps replying but owns nothing. A scheduled run (from /loop or a schedule) never asks questions and never posts; it lists what needs the user as pending. Use when the user says "career", "career check", "career digest", "run my career skills", "what should I do for my promotion this week", "daily career scan", or sets up a recurring career run. Also trigger for a scheduled career run./codebase-exploreExplore the codebase to map conventions, reusable utilities, analogous features, and data flows relevant to a planned change. Returns raw findings (file paths, patterns, code snippets), does NOT produce a plan. Used by /flagrare:atdd-plan as its codebase understanding step./communication-setupSet up, change or remove how Claude talks to you: a custom output style with your reply rules, a reminder of those rules on every message, and a Stop hook that quietly nudges Claude when a reply runs a little long and blocks one that runs far past your limit. Use when the user says Claude's replies are too long, exhausting, hard to skim, full of process narration or caveats, 'you make me work for the information', 'talk to me shorter', 'communication setup', 'set up how you talk to me'; when the length check or reply-length hook blocked a reply it shouldn't have, or the user wants a different limit or style; or asks to remove or undo it ('remove communication setup', 'go back to normal replies').Other plugins' skills for the same job