agentleFS
digdirdigdir/designsystemet/.claude/skills/cli-generated-files/SKILL.md

cli-generated-files

Skill221 starsChanged 6 days agoMITView on GitHub

Regenerate the committed files that come from the CLI. Use after changing anything under packages/cli/src (colors, tokens, schemas, figma), designsystemet.config.json or internal/digdir/digdir.config.json.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

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

    If the config schema changed, the unit tests fail on its snapshot.

    line 17
  2. Very specific:

    Only when sizes, typography, colors or semantic tokens change.

    line 19
  3. Distinctive:

    If a step gives no diff, there is nothing to commit for it.

    line 21
  4. Very specific:

    Do not edit apps/www/app/content/schemas/config/*.json by hand.

    line 27

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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

Regenerate the files the CLI generates

Several generated files are committed, and CI does not check that they are up to date. After a change to the CLI's colors, tokens or schemas, run these from the repo root, in this order, and include the resulting diff in the same pull request.

  1. pnpm build:cli
    • The apps and the Figma plugin use the CLI's built dist, not its source, so build first.
    • Also rewrites packages/cli/docs/designsystemet.config.defaults.json.
  2. pnpm update:theme
    • Rewrites packages/css/theme/ (designsystemet.css, designsystemet.tailwind.css, types.d.ts, colors.d.ts) and internal/digdir/themes/.
  3. pnpm test:cli
    • Rewrites the fixtures in packages/cli/tests/config/design-tokens/ and packages/cli/tests/config/build/, then runs the unit tests.
    • If the config schema changed, the unit tests fail on its snapshot. Check that the schema diff is what you meant, update the snapshot with pnpm --filter @digdir/designsystemet test:unit -u, and go on to step 4. See "Config schema changes" below.
  4. pnpm update:preview-tokens
    • Only when sizes, typography, colors or semantic tokens change. Rewrites internal/components/src/tokens/design-tokens/, which the token tables in the docs use.

If a step gives no diff, there is nothing to commit for it. A diff you did not expect means the change affects more output than intended; look at it before committing.

Config schema changes

  • The JSON schema is a snapshot: packages/cli/src/schemas/__snapshots__/config.schema.json. The unit tests fail when it differs. Update it on purpose with pnpm --filter @digdir/designsystemet test:unit -u.
  • A breaking change to the shape of the config needs a migration in packages/cli/src/migrations/, registered in index.ts.
  • Do not edit apps/www/app/content/schemas/config/*.json by hand. They are copied from the CLI at release.

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.