agentleFS
digdirdigdir/designsystemet/.claude/skills/web/SKILL.md

web

Skill221 starsChanged 6 days agoMITView on GitHub

Rules for working on the web components in packages/web, so far that their tests must pass in Chromium, Firefox and WebKit. Use when changing or adding anything under packages/web, or when a test there fails in one browser only.

13 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 12 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before pushing, run the tests for what you changed in all three browsers, so a failure in one browser is not first found in CI.

    line 11
  2. Very specific:

    Don't call a change tested in all three browsers from a local Chromium run.

    line 12
  3. Distinctive:

    Don't make a test pass by skipping a browser or loosening what it checks.

    line 14

“Common” is measured: kept by at least 6 in 10 of the 12 edited versions of this file we could read. “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

Working on the web components (packages/web)

Tests must pass in all three browsers

  • A change is done when the test check on the pull request is green. It runs every test in Chromium, Firefox and WebKit; WebKit is how we test Safari.
  • Before pushing, run the tests for what you changed in all three browsers, so a failure in one browser is not first found in CI. You don't need to run the whole suite locally.
  • Don't call a change tested in all three browsers from a local Chromium run. Say what you ran, and check the result of the check with gh pr checks.
  • packages/web/vitest.config.ts runs every test five times: in the three browsers (the Playwright project), and in JSDOM and Happy DOM. CI runs all of them and fails if one does; see .github/workflows/test.yml.
  • Don't make a test pass by skipping a browser or loosening what it checks. If the browsers behave differently, the component must handle it, or the difference is a bug to report.

Running them locally

  • pnpm test:web --run <name> runs the test files whose path has <name>, e.g. popover. Without a name it runs everything; without --run it watches.
  • The browsers must be installed first: pnpm exec playwright install chromium firefox webkit.
  • Each Playwright version needs its own browser builds. If a run fails with "Executable doesn't exist", Playwright has been updated: run the install again. It is not a failing test.
  • For one browser: pnpm test:web --run --project Playwright --browser=firefox.

Tests that need a real browser

  • JSDOM and Happy DOM lack things like layout, focus handling and popovers. A test that needs them is marked so it only runs in the browsers:
    • a whole file is named <name>.browser.test.ts
    • a single test gets tags: ['browser']
  • Mark only what needs it. A test that can run in JSDOM and Happy DOM should, as they are much faster.

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.