UI Craft
v1.0.0UI quality checks: anti-slop, accessibility, design tokens, scoring and workflow routing.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
route_task Route Task
Call this FIRST on any UI request, before reading reference files. Takes the task in natural language and returns the references, commands and MCP tools that cover it, ranked, plus the single first move to make. Deterministic lexical ranking over a synonym map, so a prompt reaches the right entry even when its words do not match our filenames — "analytics panel" finds recipe-dashboard.md, which never says analytics. Recipes are also indexed by what they contain, so "pricing block" finds recipe-landing.md. Returns POINTERS only: every design rule stays in the files it points at. An unmatched…
| Parameter | Type | Description |
|---|---|---|
prompt * | string | The task in natural language — e.g. "analytics panel with KPIs" |
limit | integer | Max hits per kind (default 5, clamped to 12) |
check_anti_slop Check Anti-Slop
Scans source code for anti-slop violations using the deterministic rules from ui-craft-detect. Accepts either a `code` string (inline source) or a `path` string (file or directory). Returns findings with severity, rule ID, file, line, and message. These are the 43 deterministic rules only — no taste or aesthetic judgment.
| Parameter | Type | Description |
|---|---|---|
code | string | Inline source code to scan (alternative to path) |
path | string | File or directory path to scan (alternative to code) |
tokens_lint Tokens Lint
Static analysis for off-system token values: raw hex colors, non-scale border-radius px values, non-8pt spacing values, and magic z-index integers. Token scale source of truth: references/tokens.md. Accepts `code` string or `path`. Returns structured findings + summary.
| Parameter | Type | Description |
|---|---|---|
code | string | Inline source code to lint (alternative to path) |
path | string | File or directory path to lint (alternative to code) |
acceptance_bar Acceptance Bar
Returns the deterministic acceptance checklist for a UI surface. Data is bundled from recipe-dashboard.md, recipe-landing.md, recipe-auth.md, and finish-bar.md. Surfaces: dashboard, landing, auth, generic. Returns DATA only — no scoring or judgment. Scoring uses check_anti_slop + tokens_lint results.
| Parameter | Type | Description |
|---|---|---|
surface * | string | The UI surface to retrieve the acceptance bar for |
ux_coverage UX Coverage
Returns the parts a screen of a given kind needs in order to be complete, and the contract for reporting them. This is the COMPLETENESS axis — "does this screen have the parts screens of its kind need". It is not the distinction axis: acceptance_bar and score_ui answer "is this designed". Report the two side by side; never fold coverage into a score, a count or a percentage. Report-only — coverage never gates and never fails a build. Archetypes: data-table, settings, search-filter, detail-view, empty-first-run, billing, pricing, docs-page, checkout, onboarding, destructive-confirm, invite-…
| Parameter | Type | Description |
|---|---|---|
archetype | string | Screen archetype to retrieve coverage parts for. Accepts the key, the label, or a synonym ("table", "plans", "are you sure"). Omit to list the catalogue. |
score_ui Score UI
Composite design-quality scorer (UICraftScore). Combines three deterministic dimensions into a single 0-100 score + letter grade (A/B/C/D/F) + per-dimension subscores and findings. Dimensions: anti-slop (38 rules via ui-craft-detect), token-discipline (raw hex / off-scale values), and static a11y (5 checks: img-no-alt, non-semantic-interactive, positive-tabindex, aria-invalid-no-describedby, no-reduced-motion). Accepts either a `code` string (inline source) or a `path` string (file). Formula: score = 100 − (antiSlop_crit×8) − (antiSlop_major×4) − (antiSlop_warn×1) − (token_findingsÃ…
| Parameter | Type | Description |
|---|---|---|
code | string | Inline source code to score (alternative to path) |
path | string | File path to score (alternative to code) |
fold_candidates Fold Candidates
Draws composition classes for a landing fold, preferring ones this project has not spent yet. Variety cannot be requested in prose — asking a model to "be different" returns its default every time — so the class is drawn instead — ordered by a per-project seed, then by what this project has already spent. Pass the classes already used in this project as `used`. Classes: type-only, full-bleed-overlay, split, stacked, product-dominant, band. `split` is drawn last on purpose: it is the fold every generator reaches for unprompted. Returns each class with what it demands and what it sacrifice…
| Parameter | Type | Description |
|---|---|---|
count | integer | How many candidates to draw (default 3) |
seed | string | Overrides the per-project seed. Defaults to the working directory, which is what makes two projects draw differently while one project stays stable across runs. |
used | array | Composition class ids already used in this project (deprioritised in the draw) |
check_fold Check Fold
Renders a URL and reports what its fold actually is: a screenshot, the composition class it belongs to, drift from the class you set out to build, three judged invariants, and four measurements reported WITHOUT a verdict. The unjudged four (identification, single dominance, asymmetry, restraint budget) are measured but not scored: calibration against reference landing pages showed those thresholds do not yet discriminate, so they are yours to interpret. Treat the screenshot as the primary output — look at it. Invariant 7 (a costly detail) is unmeasurable by construction: pass what you commit…
| Parameter | Type | Description |
|---|---|---|
url * | string | URL of the rendered page — a local dev server URL is fine |
costly_detail | string | The one element of this fold that could not have come from a template, and what it cost |
expected_class | string | The composition class you set out to build, to detect drift |
height | integer | Viewport height (default 900) |
width | integer | Viewport width (default 1440) |