Create a UI Surface
A UI Surface defines the visual layout and interactive elements of a screen or component. It uses a restricted Pug DSL for wireframing and layout.
Phase 1 β Context
Identify which feature, action, or event this UI serves.
Verify that the target document exists in content/.
Phase 2 β Layout Strategy
Determine the high-level layout container:
section: Large page sectioncard: Grouped content blockmodal: Overlay windownav: Navigation shell
Phase 3 β Detailed Design (Pug DSL)
Author the surface block.
- Use indentation for nesting.
- Use literal strings for content (e.g.,
heading "Title Text",button Click Meorcheckbox Remember me). - Use semantic components:
stack,row,input,button,list,table. - Add
placeholdertags for missing visual elements.
Phase 4 β Interactive Elements
Define form fields, buttons, and navigation links. Ensure every primary action (button/link) corresponds to a requirement or domain action.
Phase 5 β Draft & Confirm
Present the complete .surface.mdoc draft for confirmation before writing.
Output: content/uis/{id}.ui.mdoc
Doβs and Donβts
Do:
- Identify which feature, action, or event this UI serves before designing
- Use semantic components (stack, row, input, button, list, table) in the Pug DSL
- Ensure every primary action (button/link) corresponds to a requirement or domain action
- Use
placeholdertags for missing visual elements that will be designed later - Present the full draft for confirmation before writing
Donβt:
- Donβt use implementation-level components (React, Vue, etc.) in the Pug DSL
- Donβt design a surface without a linked feature β surfaces always serve a feature
- Donβt create interactive elements that have no backing requirement or domain action
- Donβt mix tabs and spaces for indentation; inconsistent indentation breaks renders
- Donβt skip the context phase; knowing what the UI serves shapes every design decision
Definition of Done
- Draft presented to user for confirmation
- Document written as
content/uis/{id}.ui.mdocwith correct frontmatter and root tag forattribute links to an existing feature or domain document- Every primary action corresponds to a requirement or domain action
- Indentation is consistent throughout
- All cross-references resolve to existing documents
pnpm compilesucceeds