regen-baselines

A process for rebuilding Linux screenshots used as visual-regression baselines, which are reference images that automated tests compare against. It runs the regeneration in CI, the automated build environment, and brings the resulting files back to the branch.

In plain words
What is it for?
Use it when a pull request's visual tests fail after rendering changes or when Storybook stories are added, renamed, removed, or deliberately redesigned.
Why use it?
It avoids unreliable local screenshots caused by differences between operating systems, fonts, and text rendering. It also provides a repeatable way to refresh expected images after intentional visual changes.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/aziontech/webkit/regen-baselines
Any agent
npx skills add aziontech/webkit --skill regen-baselines
Clone the repo
git clone --depth 1 https://github.com/aziontech/webkit

Made for: Claude Code, Codex.

Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,813 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00051 $0.01813
Opus 5 $0.00026 $0.00907
Sonnet 5 $0.00010 $0.00363
Haiku 4.5 $0.00005 $0.00181

Measured 2d ago against content hash 751e3264e329, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

regen-baselines scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/regen-baselines/SKILL.md · 135 lines

How it starts

The opening of the file, as written. The whole thing — 135 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Skill: regen-baselines

Purpose

Refresh the visual-regression baselines that the governance.yml visual job (test:visual:ci) compares every PR against. Baselines live in apps/storybook/.storybook/test-visual/__image_snapshots__/linux/ and are platform-specific: only snapshots rendered on the CI runner (ubuntu) are valid. A local run on macOS renders with different font metrics/AA and would poison the folder — regeneration therefore always happens in CI via the Storybook Regenerate Baseline workflow (app-storybook-generate-baseline.yml), and the resulting artifact is committed manually. This skill is that end-to-end flow.

When to invoke

  • A PR branch merged main and main brought rendering changes (theme tokens, typography), so the branch's committed baselines no longer match what its tree renders.
  • The branch itself changes rendering on purpose (component fix, token change) and the PR's visual job fails with expected diffs.
  • A story was added/renamed/removed and its snapshots must be (re)created or pruned.

Inputs

  • Branch or PR — a branch name, or a PR number/URL to resolve via gh pr view <n> --json headRefName.
  • Modes (optional) — comma-separated subset of the 6-mode matrix ({dark,light} × {desktop,tablet,mobile}, keys in apps/storybook/.storybook/visual-modes.js, e.g. light-desktop,dark-mobile). Empty = full matrix. The mode key is the snapshot filename suffix; the historical dark-desktop snapshot carries no suffix (<story>.png, not <story>--dark-desktop.png).

Workflow

  1. Resolve + preflight. Resolve the branch (from the PR when given) and confirm it exists on origin (git ls-remote --heads origin <branch>). The workflow runs the branch HEAD on origin — anything that must be reflected (e.g. the main merge) has to be pushed first.
  2. Trigger the workflow.
    gh workflow run app-storybook-generate-baseline.yml --ref <branch> -f update_baselines=true [-f modes=<csv>]
    
    update_baselines=true is mandatory — without it the run only builds Storybook and uploads nothing. Then grab the run:
    gh run list --workflow=app-storybook-generate-baseline.yml --branch <branch> --limit 1 --json databaseId,status,url,headSha
    
  3. Wait for completion. ~5 min with warm caches (60 min workflow timeout). Poll gh run view <id> --json status,conclusion every ~30 s until status == "completed". Shell gotcha: never name the poll variable status — it is a read-only special variable in zsh and the loop dies with read-only variable: status. Re-triggering on the same ref cancels the in-progress run (concurrency group), so do not double-fire.
  4. Download the artifact (retention: 7 days) into a fresh temp dir:
    gh run download <id> -n visual-baselines-linux -D <fresh-tmp-dir>
    
  5. Checkout the branch and mirror. git fetch origin <branch> && git checkout <branch> (snapshots folder must be clean), then:
    rsync -a --delete <fresh-tmp-dir>/ apps/storybook/.storybook/test-visual/__image_snapshots__/linux/
    
    The artifact is the complete folder state after the CI run, so --delete correctly propagates snapshots of deleted/renamed stories. Never cherry-pick files out of it.
  6. Review the diff scope before committing. Group the changed files by story and check byte deltas:
    git status --porcelain apps/storybook/.storybook/test-visual/__image_snapshots__/linux/ | awk '{print $1}' | sort | uniq -c
    git diff --stat apps/storybook/.storybook/test-visual/__image_snapshots__/linux/
    
    The changed stories must be explainable by the branch's diff (e.g. a calendar fix touching only components-inputs-calendar--*, or a main merge touching the component its theme fix affects). Unexplained stories = stop and investigate (flake or unintended global change) instead of committing.
  7. Commit only the snapshots folder, push.
    git add apps/storybook/.storybook/test-visual/__image_snapshots__/linux/
    git commit -m "test(storybook): regenerate linux baselines <context>"
    git push origin <branch>
    
    test is commitlint-valid and non-releasing (see release-types). Context examples used on real branches: … after main merge, … for the calendar field contract. No attribution footers (see git-workflow). The push updates the open PR and re-runs its visual job.

Read the full file on GitHub · 135 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 135 lines · 51 tokens per session scan A 751e3264e329

Subscribe to this mod's changes

regen-baselines is a skill published in the GitHub repository aziontech/webkit (2 stars, last pushed 4d ago), licensed MIT. It adds 51 tokens to every session and 1,813 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

monorepo-management

Sets up or audits a monorepo workspace: tool selection, package naming, shared tooling, inter-package dependencies, selective CI, and versioning strategy. Invoked when the user asks to set up a monorepo, add a workspace, or manage multiple packages in a single repository.

soulcodex/agentic · 63 tokens

bazel-monorepo-expert

Expert knowledge for managing large-scale Bazel monorepos with multiple services, shared libraries, and cross-cutting concerns. Use for workspace structure, visibility, and dependency management.

kinhluan/rules-quarkus-skills · 43 tokens

pnpm

Skill "pnpm" from pledgeandgrow/pledge-skills, covering pnpm documentation skill, key benefits, file index, quick start and install pnpm.

pledgeandgrow/pledge-skills · 31 tokens

fast-typescript-check

Keep www-sacred's TypeScript fast to type-check and fast to run. Use when touching the ASCII/canvas animation components (the only real per-frame code here), tightening type-check wall-clock, or auditing a change for runtime or compiler regressions. Scoped to this repo — a React 19 / Next.js 16 component library plus…

internet-development/www-sacred · 84 tokens

port-sacred-terminal-ui-to-react-using-same-conventions

Take a CLI screen written for Simulacrum — the sacred CLI framework (scripts/cli/templates/.ts or scripts/python/templates/.py) — and produce a React component that lives inside components/examples/ (or components/) using only sacred's existing primitives — Window, Card, SimpleTable, ActionButton, RowSpaceBetween…

internet-development/www-sacred · 0 tokens

port-sacred-terminal-ui-to-typescript-cli

Take a React Window.tsx (or any sacred component) and produce a terminal CLI screen written in TypeScript that uses Simulacrum — the sacred CLI framework in scripts/cli/lib/.

internet-development/www-sacred · 0 tokens