UI Design
Use this skill when the problem is visual quality, not just functional correctness.
Default stance:
- preserve the existing design language when one already exists
- prefer editable artifacts over one-shot mockups
- use AI for momentum, not for final visual judgment
- avoid generic filler, weak hierarchy, washed-out gradients, and fake complexity
If the task includes a Figma URL or node ID, also use figma or figma-implement-design.
Decide The Lane First
Pick one lane before editing:
code-direct: the system is already strong and the work is mainly polish, density, hierarchy, or implementation
figma-first: direction is weak, several variants are needed, or manual visual refinement will be faster in Figma than in code
figma-fidelity: a specific Figma frame already exists and the main task is faithful implementation
Do not start in code by reflex if the hard part is visual judgment.
Do not start in Figma by reflex if the hard part is straightforward implementation.
Pick One Mode
Inside the chosen lane, use one mode:
project-native: refine the existing language without importing a new one
hybrid-reference: keep the local system but borrow composition, typography, or token ideas from one strong anchor
template-led: the current UI is weak or generic, so choose one anchor and rebuild toward it
Do not average multiple references together. Choose one primary anchor and at most one narrow secondary reference.
References
Use references deliberately.
TypeUI
TypeUI is the main source for visual anchors and page-type direction.
Read in this order:
references/typeui-registry/catalog.md
references/typeui-registry/page-type-variants.md
- only the specific
references/typeui-registry/skills/*.md files you actually need
Figma
Figma is the editable iteration surface.
Read:
references/figma-first-workflow.md
references/figma-prompt-patterns.md
Use Figma for:
- editable first-pass generation
- structural or stylistic variants
- manual spacing, typography, and rhythm tuning
- comparing alternatives side by side
- locking the chosen frame before implementation
Workflow
1. Ground the task in the real system
Before changing UI, inspect:
- component system and primitives
- typography and color tokens
- spacing density
- target surface such as desktop, mobile, admin, landing page, workflow, or settings
- whether the user wants fidelity, variation, or a stronger reset
For shadcn projects, inspect local components.json, global CSS, token definitions, and components/ui/* before inventing new patterns.
2. State the design thesis
For substantial changes, write one sentence that fixes direction before editing.
Examples:
project-native, code-direct: denser CRM review screen with clearer status hierarchy and less chrome
hybrid-reference, figma-first: existing app sharpened with mono-heavy technical typography and stronger left-nav structure
template-led, figma-first: editorial marketing page with restrained serif contrast and large sectional rhythm
3. Use the right medium
Use code-direct when:
- the visual language already exists
- the issue is mostly spacing, structure, or component polish
- implementation speed matters more than exploration
Use figma-first when:
- the current direction is weak or undefined
- you need a few variants before committing
- the user wants direct visual control
- layout, typography, and rhythm are the hard part
Use figma-fidelity when:
- a frame already exists and should be implemented with high fidelity
- the task is handoff, not exploration
4. Run the editable loop when needed
If you choose figma-first:
- generate a first pass with Figma AI
- duplicate the frame before large mutations
- branch into a small number of meaningful variants
- use prompts for macro changes
- use manual edits for spacing, alignment, typography, grouping, and emphasis
- pick the winning frame
- hand the exact frame or node back to Codex for implementation
Use AI for macro moves.
Use manual editing for micro moves.
If the issue is a 10-pixel judgment call, stop prompting and edit the frame.
5. Implement from primitives
- reuse or extend existing primitives first
- keep component APIs composable and unsurprising
- translate reference logic into local code instead of copying template structure mechanically
- prefer CSS variables, tokens, and shared classes over repeated literals
- if a screen only looks good in the mockup but not in code, the design is not finished
6. Validate the interaction layer
Check:
- empty, loading, error, and success states
- hover, focus, active, disabled, and selected states
- label clarity and units
- mobile and desktop behavior
- scanability of tables, forms, and charts
Before finalizing, also read references/anti-ai-patterns.md and remove the lazy defaults that make generated UI feel generic.
Manual Intervention Rule
Manual design edits are first-class, not a fallback.
If the user wants direct visual control:
- keep the work in Figma long enough to settle layout, type, and rhythm
- avoid forcing them to validate small visual choices in code
- capture the chosen result back in code once the frame is stable
Output Expectations
When the work is substantial:
- say which lane and mode you used
- make the visual direction explicit
- keep hierarchy and interaction coherent across the whole surface
- avoid filler sections and fake complexity
- leave behind editable assets when they help, especially a stable Figma frame or node link
1---2name: ui-design3description: Improve UI design quality for web and app interfaces. Use when Codex should design, redesign, polish, modernize, restyle, improve layout, hierarchy, density, spacing, typography, color, navigation, forms, dashboards, admin panels, landing pages, chart UI, or design systems. Also use when Codex should choose a visual direction from reference libraries, generate an editable first pass in Figma, support a loop of AI draft to manual visual edits to AI implementation, or translate a manually refined Figma frame back into production code.4---56# UI Design78Use this skill when the problem is visual quality, not just functional correctness.910Default stance:1112- preserve the existing design language when one already exists13- prefer editable artifacts over one-shot mockups14- use AI for momentum, not for final visual judgment15- avoid generic filler, weak hierarchy, washed-out gradients, and fake complexity1617If the task includes a Figma URL or node ID, also use `figma` or `figma-implement-design`.1819## Decide The Lane First2021Pick one lane before editing:2223- `code-direct`: the system is already strong and the work is mainly polish, density, hierarchy, or implementation24- `figma-first`: direction is weak, several variants are needed, or manual visual refinement will be faster in Figma than in code25- `figma-fidelity`: a specific Figma frame already exists and the main task is faithful implementation2627Do not start in code by reflex if the hard part is visual judgment.28Do not start in Figma by reflex if the hard part is straightforward implementation.2930## Pick One Mode3132Inside the chosen lane, use one mode:3334- `project-native`: refine the existing language without importing a new one35- `hybrid-reference`: keep the local system but borrow composition, typography, or token ideas from one strong anchor36- `template-led`: the current UI is weak or generic, so choose one anchor and rebuild toward it3738Do not average multiple references together. Choose one primary anchor and at most one narrow secondary reference.3940## References4142Use references deliberately.4344### TypeUI4546TypeUI is the main source for visual anchors and page-type direction.4748Read in this order:49501. `references/typeui-registry/catalog.md`512. `references/typeui-registry/page-type-variants.md`523. only the specific `references/typeui-registry/skills/*.md` files you actually need5354### Figma5556Figma is the editable iteration surface.5758Read:59601. `references/figma-first-workflow.md`612. `references/figma-prompt-patterns.md`6263Use Figma for:6465- editable first-pass generation66- structural or stylistic variants67- manual spacing, typography, and rhythm tuning68- comparing alternatives side by side69- locking the chosen frame before implementation7071## Workflow7273### 1. Ground the task in the real system7475Before changing UI, inspect:7677- component system and primitives78- typography and color tokens79- spacing density80- target surface such as desktop, mobile, admin, landing page, workflow, or settings81- whether the user wants fidelity, variation, or a stronger reset8283For shadcn projects, inspect local `components.json`, global CSS, token definitions, and `components/ui/*` before inventing new patterns.8485### 2. State the design thesis8687For substantial changes, write one sentence that fixes direction before editing.8889Examples:9091- `project-native, code-direct: denser CRM review screen with clearer status hierarchy and less chrome`92- `hybrid-reference, figma-first: existing app sharpened with mono-heavy technical typography and stronger left-nav structure`93- `template-led, figma-first: editorial marketing page with restrained serif contrast and large sectional rhythm`9495### 3. Use the right medium9697Use `code-direct` when:9899- the visual language already exists100- the issue is mostly spacing, structure, or component polish101- implementation speed matters more than exploration102103Use `figma-first` when:104105- the current direction is weak or undefined106- you need a few variants before committing107- the user wants direct visual control108- layout, typography, and rhythm are the hard part109110Use `figma-fidelity` when:111112- a frame already exists and should be implemented with high fidelity113- the task is handoff, not exploration114115### 4. Run the editable loop when needed116117If you choose `figma-first`:1181191. generate a first pass with Figma AI1202. duplicate the frame before large mutations1213. branch into a small number of meaningful variants1224. use prompts for macro changes1235. use manual edits for spacing, alignment, typography, grouping, and emphasis1246. pick the winning frame1257. hand the exact frame or node back to Codex for implementation126127Use AI for macro moves.128Use manual editing for micro moves.129130If the issue is a 10-pixel judgment call, stop prompting and edit the frame.131132### 5. Implement from primitives133134- reuse or extend existing primitives first135- keep component APIs composable and unsurprising136- translate reference logic into local code instead of copying template structure mechanically137- prefer CSS variables, tokens, and shared classes over repeated literals138- if a screen only looks good in the mockup but not in code, the design is not finished139140### 6. Validate the interaction layer141142Check:143144- empty, loading, error, and success states145- hover, focus, active, disabled, and selected states146- label clarity and units147- mobile and desktop behavior148- scanability of tables, forms, and charts149150Before finalizing, also read `references/anti-ai-patterns.md` and remove the lazy defaults that make generated UI feel generic.151152## Manual Intervention Rule153154Manual design edits are first-class, not a fallback.155156If the user wants direct visual control:157158- keep the work in Figma long enough to settle layout, type, and rhythm159- avoid forcing them to validate small visual choices in code160- capture the chosen result back in code once the frame is stable161162## Output Expectations163164When the work is substantial:165166- say which lane and mode you used167- make the visual direction explicit168- keep hierarchy and interaction coherent across the whole surface169- avoid filler sections and fake complexity170- leave behind editable assets when they help, especially a stable Figma frame or node link