Checks and rules
Find where saved code leaves your design system, and set what your project does about it.
Where the check runs
The same engine runs in all three places and gives the same answer.
In your coding agent
The plugin for Claude Code and Codex checks each edit. Ask the agent to run check at any time.
On each push and pull request
A GitHub Actions check runs the project’s own copy of the engine, and passes or fails with a log.
Run a check
- In the app: open Checks in the right panel and choose Check now or Check again.
- In your agent: ask it to check the files it changed.
The check reads saved source against the components and values found in the project. A saved fragments.config.json adds your own rules. It is not required.
Findings cover Colour, Spacing, Type, Radius and Components. The desktop app also reports missing accessible names on pictured pages. Suggestions are listed separately and never fail the check.
Read the finding
Expand a finding to see why and where. A source finding names a file and line. A defect measured on a page may name only the page.
- Replace
- Offered when a token can take the value’s place. A nearby value that would look different is a suggestion, never an automatic replacement.
- Ask
- Puts the repair request in Chat for you to review before sending.
After a repair, run the check again and look at the affected interface.
Review coverage
Open Where it looks to see what the check read and what it could not.
- A result for some files says nothing about the rest of the app.
- It reads static CSS and SCSS, including Modules, and supported classes and markup. It does not run arbitrary Sass or JavaScript.
- Review yourself: indented Sass, unresolved style expressions and theme-dependent object styles.
- Accessibility findings from pictured pages are not part of the CI verdict.
Use approved tokens
Approved tokens live in .fragments/tokens.json.
- Adding a token does not approve it. Its uses still count until you choose Approve in Design system, or replace it with an approved value.
- The first list writes itself. Creating the first rule, or making a Strict baseline, approves the app’s existing tokens when no list exists.
- With no list, every token found in the project may be used. Being found is not a recorded approval.
The rules file
- Where:
fragments.config.jsonin your repo, with a few files under.fragments/. Your agent and the check both read it. - What it holds: the components to build with, the approved tokens, and how strictly new drift is treated.
- Optional. A project can be checked without one.
- To change it: use Settings / Design feedback in the app, or ask your agent. The agent shows the change, and Fragments writes only after you confirm.
- Nothing is committed. The change goes through your normal review.
Choose the project policy
- Off
- No design feedback. The check passes.
- Allowed
- Drift is listed. The check passes.
- Strict
- New drift fails the check until it is fixed or accepted.
- No mode chosen
- The project check fails on any counted finding. In your agent, findings are advice.
- An incomplete read cannot pass in any mode, including Allowed.
- A policy change is not committed automatically. It appears in Changes with Undo.
- Choosing a mode does not make CI run. Use Add to CI in the app, or ask your agent, to prepare a GitHub Actions file. Commit and push it to run it.
- It blocks merging only if the repository requires that check.
Understand the baseline
Strict saves your current findings in .fragments/baseline.json after a complete read. They stay as a backlog. New findings beyond it fail.
- Keep today’s drift
- Replaces the baseline with the current findings.
- Tighten
- Removes allowances for findings already fixed, so they cannot return unnoticed.
- Strict off, then on
- Keeps the previous baseline.
The baseline counts how often a rule and value appear in each file, not single lines. Fixing one and adding the same value elsewhere in that file leaves the count unchanged. Read the diff as well as the result. See Review the change.
Next steps
- Use it in Claude Code and CodexThe same check, as your agent writes.
- Get started with FragmentsStart in your agent or the desktop app.
- Troubleshoot the desktop appFix source, page capture and Undo problems.