List Rules
list-rulesLists checklist rules as records, filtered by component, ID, scope, layer, level or check. Each rule has a stable ID to cite in reviews and commits, its level (must or should), its scope, its requirement, how to check it (like a unit test, a review or axe's button-name rule) and a link to it.
WHEN TO USE: to review code rule by rule, to get only the rules that apply to a task, to look rules up by ID, or to find the ones a tool can check. Pass scope ["component", "both"] to build or review a component, and ["usage", "both"] to review a screen that uses it. WHEN NOT TO USE: for a component's API, DOM contract and tokens, use get-contract, which has every rule too.
It returns up to 50 rules at a time, and total counts every rule that matches. When there are more, pass nextOffset as offset, with the same filters, to get the next page.
A component meets the standard when it meets every must rule. Each should rule is expected unless there's a good reason not to follow it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ids | No | The IDs of the rules to look up, like ["button/keep-focus"]. | |
| check | No | How the rule is checked. | |
| layer | No | ui (how it looks), ux (user experience), dx (developer experience) or ax (agentic experience). | |
| level | No | ||
| limit | No | How many rules to return, at most. | |
| scope | No | Who meets the rule: component (the component itself), usage (the code that uses it) or both. Rules without a scope, like the Design Tokens', match any scope. | |
| offset | No | Where the page starts: 0, or the nextOffset of the page before. | |
| automated | No | true for the rules tools check all of (unit tests, axe, a type check, a linter or a visual regression test), false for the ones a person checks, at least in part. | |
| component | No | The component or foundation, like button or design-tokens. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rules | Yes | ||
| total | Yes | How many rules match, on every page. | |
| unknown | No | The IDs asked for that no rule has, with the ones that might have been meant. | |
| nextOffset | No | The offset of the next page, when there is one. |