agentleFS
robmclartyrobmclarty/trailhead/.claude/skills/add-visual-linting/SKILL.md

add-visual-linting

Skill0 starsChanged 7 months agoMITView on GitHub

Wire visual and accessibility linting (Playwright, Stylelint, axe-core, CSS analyzer) into a target app. Use when a UI-heavy app under apps/* needs automated visual and a11y checks. Copies presets from tools/visual/presets/ into the app and installs the concrete devDependencies there so the workspace root stays light.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 2 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Pick the target app: Must exist under apps/* and have its own package.json.

    line 50
  2. Very specific:

    Copy the preset files: Use the Bash tool with cp for each — do not re-generate from memory.

    line 52
  3. Very specific:

    Add the five devDeps listed above.

    line 55
  4. Very specific:

    Add the check:visual script.

    line 56
  5. Very specific:

    Install the deps: Run pnpm --filter <app> add -D @playwright/test stylelint stylelint-config-standard @axe-core/playwright …

    line 58
  6. Distinctive:

    If the app stops needing visual linting:

    line 81
  7. Distinctive:

    Remove the four copied files

    line 83
  8. Very specific:

    Remove the five devDeps with pnpm --filter <app> remove @playwright/test stylelint stylelint-config-standard @axe-core/playwright …

    line 84
  9. Very specific:

    Remove the check:visual script

    line 85

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

add-visual-linting

Activates the opt-in visual-linting presets under tools/visual/ for a target app. The repo ships the presets as static files; this skill is how they get put to work.

When to use this skill

  • An app in apps/* renders HTML/CSS and needs automated visual regression, style, or accessibility checks
  • The target app currently has no Playwright, Stylelint, or axe-core setup
  • You've been asked to add UI-level quality gates to an existing app

When NOT to use this skill

  • Packages under packages/* — libraries don't have a UI; visual linting belongs with the app that composes them
  • Apps that already have their own visual-testing stack — don't layer on top
  • Non-UI apps (CLIs, daemons, scripts) — these presets add friction with no payoff

What gets wired

Four files copied from tools/visual/presets/ into the target app:

SourceDestination (in target app)
presets/playwright.config.ts<app>/playwright.config.ts
presets/stylelint.config.mjs<app>/stylelint.config.mjs
presets/axe.setup.ts<app>/tests/e2e/axe.setup.ts
presets/css-analyzer.config.mjs<app>/css-analyzer.config.mjs

Five devDependencies added to the target app's package.json:

  • @playwright/test
  • stylelint
  • stylelint-config-standard
  • @axe-core/playwright
  • @projectwallace/css-analyzer

One script added to the target app's package.json:

"check:visual": "playwright test && stylelint '**/*.css' && css-analyzer"

Steps

  1. Pick the target app. Must exist under apps/* and have its own package.json. If not, run pnpm scaffold:app <name> first.
  2. Copy the preset files. Use the Bash tool with cp for each — do not re-generate from memory; the source files are the source of truth.
  3. Edit <app>/package.json.
    • Add the five devDeps listed above. Leave versions unpinned ("*") and let pnpm add resolve them in the next step.
    • Add the check:visual script.
  4. Install the deps. Run pnpm --filter <app> add -D @playwright/test stylelint stylelint-config-standard @axe-core/playwright @projectwallace/css-analyzer.
  5. Install browser binary (optional but usually needed).
    pnpm --filter <app> exec playwright install chromium
    Skip this on servers that already have Chromium, or when using a remote browser MCP (see add-browser-mcp).
  6. Verify.
    pnpm --filter <app> run check:visual
    First run may fail with "no tests found" — that's fine, it confirms the wiring. Add a sample e2e test in <app>/tests/e2e/ next.
  7. Do not touch the root pnpm check. Visual linting stays app-local by design; surfacing it at the root would slow the fast-mode feedback loop for every consumer.

Customization

  • Tune the copied configs in the target app. Don't edit tools/visual/presets/ unless you're changing the starter for all future apps.
  • For shared visual conventions across multiple apps, create a package under packages/ that exports the overrides; each app's config can extends from it.

Uninstalling

If the app stops needing visual linting:

  1. Remove the four copied files
  2. Remove the five devDeps with pnpm --filter <app> remove @playwright/test stylelint stylelint-config-standard @axe-core/playwright @projectwallace/css-analyzer
  3. Remove the check:visual script

The workspace-root tools/visual/ directory stays put — other apps may still use it.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.