Use Justified with an AI agent
A coding agent writes a lot of interface code quickly. Justified’s rules tell it how that interface should behave: where errors go, when they appear, when a button stays enabled, when a control is a link and when it is a button. The rules are published as instructions an agent can read. Why agents need rules written this way is explained in Design system rules for AI coding agents; this page is the how-to.
| File | For |
|---|---|
| SKILL.md | Claude Code, as a skill it loads when you work on interface code |
| AGENTS.md | Any agent that reads an instructions file |
| AGENTS-full.md | An agent that cannot open links: every rule in full, in one large file |
SKILL.md and AGENTS.md are short. They hold every rule and guideline as one statement each, and tell the agent to open the full rule, with its Do, Don’t and Exceptions, when its work touches it. Each full rule is its own file, such as frm-002a.md. All of it is generated from the Patterns pages.
The files also tell the agent how firmly to hold each one. A rule that WCAG requires and a rule the judges decide are followed. A guideline, which is our own choice, gives way to a convention your project already has. How the levels work
Claude Code in VS Code
Section titled “Claude Code in VS Code”-
Install the Claude Code extension from the VS Code Marketplace and sign in.
-
Open your project. If it is not set up for shadcn yet, follow Use Justified with shadcn first, so the agent can use Justified’s components.
-
Add the skill to the project. In VS Code’s terminal, in the project folder:
Terminal window mkdir -p .claude/skillscurl -fsSL https://blackwoodblake.com/design-system/agents/justified-skill.tar.gz | tar -xz -C .claude/skillsThis puts SKILL.md and every full rule in
.claude/skills/justified/, so Claude reads a rule from your project instead of fetching it from the web. You can also download the skill as a zip and unpack it there.Or install it with npm and copy the same folder from the package:
Terminal window npm install --save-dev @blackwoodblake/justified-agentsmkdir -p .claude/skillscp -R node_modules/@blackwoodblake/justified-agents/dist/skills/justified .claude/skills/ -
Commit the folder, so everyone working on the project, and their agents, gets the same rules.
-
Ask Claude for interface work as usual. For example:
Build a sign-up form with name, email and a terms checkbox. Use the Justified components and follow the Justified rules.
The skill’s description tells Claude to use it for forms, buttons, dialogs, messages and other interface code, so it can pick it up on its own. To be sure, name it: “Use the justified skill.”
Download or npm?
Section titled “Download or npm?”Both ways give you the same files, and you commit them either way: Claude reads skills from your project, not from node_modules.
- Download when you want the latest rules without another dependency, or your project does not use npm. To update, run the command again.
- npm when your team wants one fixed version that everyone shares, and wants to see when a new one is out, for example through Dependabot or Renovate. To update, update the package and copy the folder again.
Reviewing with the rules
Section titled “Reviewing with the rules”A second skill, justified-review, reviews code against every rule and answers in a fixed report. Add it next to the first:
curl -fsSL https://blackwoodblake.com/design-system/agents/justified-review-skill.tar.gz | tar -xz -C .claude/skillsOr download it as a zip, or copy dist/skills/justified-review from the npm package the same way as above.
Then type /justified-review in Claude Code. It reviews your uncommitted changes, or, if there are none, the current branch. To review something else, name it:
/justified-review src/checkout
For each place that may break a rule, the report gives the file and line, the rule’s id and verdict, what is wrong, how to fix it and a link to the rule. Rules come before guidelines, and a guideline is left out where your project already has a way of its own. What only shows in a running app, such as where focus goes when a dialog closes, is listed for you to check there. The skill changes no code until you ask it to fix what it found.
A review finds some problems, not all. When it finds none, it says “No problems found against Justified’s rules”, not that the code is accessible. Test with real people and assistive technology too.
Without the review skill, you can still ask for a review in your own words:
Review the checkout form against the Justified rules and list every place that breaks one, by rule id.
When you want something else
Section titled “When you want something else”If you ask for something a rule advises against, the skill tells the agent to do what you ask and to say which rule it departs from, and whether a WCAG criterion is involved. The rules inform your choices; they do not take them from you.
Other agents
Section titled “Other agents”Download AGENTS.md, or take it from dist/ in the npm package @blackwoodblake/justified-agents, and put it where your agent looks for instructions, for example AGENTS.md in the project root, or paste it into the agent’s rules or instructions file. Check your agent’s documentation for the exact place.
Keep the rules current
Section titled “Keep the rules current”Rules marked proposed may still change, and a decided rule may still be made clearer. Run the download command again to update, or, if you installed the npm package, update it and copy the folder again. Each rule’s page shows its version and history.
Justified is an independent project. It is not affiliated with, sponsored or endorsed by the organisations whose guidance it cites. Read the full statement.
Apple is a trademark of Apple Inc., registered in the U.S. and other countries and regions.