Audit a UI Surface
Run this audit before promoting a surface from draft to review, or from review to ready. Work through each section in order. Report all violations before proposing fixes.
Fetch Before Auditing
get_document("surface/{id}")get_document("{linked-type}/{linked-id}") β the id from the ui's `for` attributeget_instructions("starspec/agents/conventions/naming-standards")1. Frontmatter
-
type: uiis set -
idiskebab-casewith no type prefix (correct:login-screen, wrong:surface:login-screen) -
titleis present and human-readable -
statusreflects actual completeness β do not promote past the current state -
contextincludes the linked feature id so the agent bundle gets TLDR context
2. Feature Linkage
- surface has a
forattribute - The
forvalue is a valid qualified id that exists incontent/ - The linked document is
revieworreadystatus β a surface linked to adraftfeature is premature - Every primary action (button, form submit, navigation link) corresponds to a domain action or requirement in the linked feature
Flag any interactive element that has no backing requirement.
3. DSL Structure
- Indentation is consistent throughout β mixed tabs and spaces produce broken renders
- The outermost container is
section,nav,card, ormodalβ not a layout primitive likestack -
cardandmodalare not nested directly inside each other without a layout container -
tabs,accordion, andsteppercontain only their expected child types (tab,panel,step) -
tablecontains at least onecolumnchild -
listhas anitemattribute describing what is repeated
4. Accessibility
- Every
input,select,checkbox, andsliderhas alabelattribute - Every
buttonhas a label or text content - Every
nav linkhas alabelattribute - Every
tab,panel, andstephas alabelattribute -
placeholderelements are not used in place of required interactive content
5. Placeholders
- Every
placeholderhas both atypeand alabel - For
status: review: everyplaceholderhas a comment or note explaining why it is still deferred - For
status: ready: noplaceholderelements remain unless the surface explicitly documents a region as intentionally undesigned
6. Naming Coherence
-
surfaceidis plainkebab-casewith no type prefix:id="login-form" - UI file id matches the document
idin frontmatter
Reporting Format
For each failed check, report:
- Section and check number
- Current value (what is there now)
- Required fix (what it should be)
Group all violations before proposing any fixes. Present the fix plan for confirmation before editing.
Doβs and Donβts
Do:
- Work through every audit section in order before reporting
- Report all violations before proposing any fixes
- Fetch the linked feature and naming standards before auditing
- Present the fix plan for confirmation before applying any changes
- Group violations by section for clear reporting
Donβt:
- Donβt fix violations as you find them; collect all violations first, then propose a fix plan
- Donβt promote a surface past its actual completeness level
- Donβt skip the accessibility checks β they are as important as structural checks
- Donβt accept
placeholderelements inreadystatus unless explicitly justified - Donβt audit a surface without its linked feature document loaded
Definition of Done
- All audit sections checked in order
- All violations reported with section number, current value, and required fix
- Fix plan presented to user for confirmation
- Fixes applied only after user confirmation
- All cross-references resolve to existing documents
pnpm compilesucceeds after fixes