Standards by Applied Form

v5.0.0
io.github.Applied-Form/standards Checked 6 hours ago Published 25 days ago

Lint rendered pages against a design system in a real browser, across six widths, with the fix.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

standards_lint

Measure a page against the design system in a real browser and return every violation with the fix. Pass html for a draft, or url for something already served. This is the loop: draft, lint, apply the fixes, lint again.

ParameterTypeDescription
htmlstringA complete HTML document to measure.
registerstringWhich register the page is in, if the document does not declare it.
urlstringA file:// or https:// page to measure instead.
viewportsarrayWidths to measure. Defaults to the system's four plus two sampled from between them.

standards_fix

Apply the fixes Standards can make on its own to a draft, measured in a real browser, and return the fixed HTML with a report: rules fixed, patches applied and refused, and what still fails, by element. No model is called, and a fix that makes any rule worse is not applied. Pass html; what remains needs a change to the markup.

ParameterTypeDescription
html *stringA complete HTML document to fix.
registerstringWhich register the page is in, if the document does not declare it.
viewportsarrayWidths to measure and fix at. Defaults to the system's four plus two sampled from between them.

standards_rules

Every rule the gate enforces: what it requires, why, how to fix it, and which WCAG criteria it touches. Filter by group to keep the answer small.

ParameterTypeDescription
groupstring
wcagbooleanOnly rules that touch a WCAG criterion.

standards_tokens

The values the system permits: colours, spacing scale, type scale, voices, floors, ratios, and what it declares absent. Ask for this instead of guessing a value.

ParameterTypeDescription
groupstringcolour, spacing, type, floors, absent — omit for all.

standards_contrast

Measure a foreground against a background: the WCAG 2 ratio, the floor required at that size and weight, whether it passes, and the APCA reading as an advisory.

ParameterTypeDescription
background *string
foreground *string
sizePxnumber
weightnumber

standards_brand

Derive a complete palette from a hue and a paper colour, measured against every floor, or refuse it with the reasons. Use this instead of inventing a palette.

ParameterTypeDescription
hue *number
paper *string

standards_move

The recipe for a named compositional move: its cells, layers, voices and ground. One move is active per artefact; ask for the one you need rather than reading all of them.

ParameterTypeDescription
namestringOmit to list the moves that exist.

standards_system

Read a design system authored elsewhere (a Standards pack tokens.json) into this one, reporting what it stated, what had to be derived, and what could not be carried across.

ParameterTypeDescription
pack *objectThe pack's token contract, parsed.

standards_drift

Measure what a design system actually is on pages that were not built to this one, and how far they have drifted from it: the palette, spacing step and type scale in use, plus how many values are indistinguishable duplicates. Use this to learn somebody else's system before working in it, rather than guessing from a screenshot.

ParameterTypeDescription
declaredarrayHex colours the organisation publishes, to report where the guideline and the site disagree.
htmlarrayComplete HTML documents to measure.
urlsarrayfile:// or https:// pages to measure instead. More pages give a truer system; one page gives one page's habits.
viewportsarrayWidths to measure. Defaults to 1280.