Fret UI review (framework-aligned audit)
This skill is the “audit lens” companion to the builder/recipe skills. It is inspired by the style of
guideline-based skills (e.g. Vercel’s web interface checks), but tailored to Fret’s layered architecture.
When to use
- “Review my Fret UI” / “audit UX” / “polish this screen”.
- You suspect a regression caused by layering, focus, overlay policy, or token drift.
- You want to ensure an app repo uses Fret in a way that stays stable across refactors.
Choose this vs adjacent skills
- Use this skill when the task is review/audit (produce findings + recommended fixes/gates).
- Use
fret-framework-consumer-audit when the task is to simulate a framework user's journey and uncover onboarding/example/API friction rather than review one existing surface.
- Use
fret-app-ui-builder when you want to build/refactor a UI via a golden-path workflow.
- Use
fret-diag-workflow when the primary deliverable is a deterministic repro + gate + bundle.
- If a component behavior seems wrong, treat it as a framework/eco responsibility:
- leave a minimal
fret-diag-workflow repro (script + bundle) and file it for the component owners.
Inputs to collect (ask the user)
- What files or directories should be reviewed (
src/, a specific module, or one component)?
- Target surface: settings/forms, workspace shell, data table, overlay-heavy flows?
- Platform(s): native/web; keyboard-first expectations?
- Is the review about user-facing behavior only, or also about whether the code teaches the intended Fret authoring surface?
- What is the acceptance criterion: “looks cohesive”, “no focus bugs”, “parity with Radix”, “no perf hitches”?
Defaults if unclear:
- Review the smallest surface that shows the issue and prioritize: authoring-surface drift + tokens + focus-visible + overlays + gating +
test_id.
Smallest starting point (one command)
rg -n "Px\\(|\\.overflow\\(|test_id|when\\s*:\\s*\\\"|OverlayRequest::" src
Quick start
Audit in this priority order:
- Authoring surface: examples/snippets teach the intended facade/import/build pattern.
- Theme/tokens: token-driven spacing/radius/colors (avoid per-component magic numbers).
- Focus-visible: focus ring visible, not clipped; keyboard-first paths work.
- Overlays: dismiss + focus restore rules are in policy layers (
ecosystem/), not runtime.
- Commands/keymaps: stable
CommandId + explicit when gating (avoid firing in text inputs/IME).
- Automation stability: stable
test_id targets for interactive affordances.
- Regression gates: at least one script/test for the most fragile interaction.
- Polish pass (style-agnostic): apply
rule_id checklist from:
.agents/skills/fret-app-ui-builder/references/polish/polish-pass.md
Output format (recommended)
Keep findings terse and reviewable (Vercel-style):
path:line - category/rule_id - message (what to change + why)
- When possible, make the broken truth explicit in the message instead of only naming the local code smell.
Workflow
- Identify the review scope (files/patterns) and the smallest runnable target.
1.25) Write 3-5 review truths before scanning details:
- What must be true for this surface to be considered correct?
- Which truths are user-facing behavior, and which are teaching-surface truths?
- Which truths already have proof, and which are only assumed?
1.5) If this is a first-party surface, compare the right UI Gallery layers before reviewing styling:
- snippet file = canonical example source
- page file = docs composition around the snippet
- driver/render flow = geometry/test-id/diagnostics ownership
Also verify the intended surface against:
docs/crate-usage-guide.md
docs/shadcn-declarative-progress.md
- Check layering alignment first:
- mechanism/contract surfaces belong in
crates/*
- interaction policy and recipes belong in
ecosystem/*
- Run a “token drift” scan:
- Prefer tokens (
Space/Radius/MetricRef/ColorRef) and UiBuilder patches.
- Flag large or repeated
Px(...) usage unless justified.
- Check focus-visible and overflow:
- Focus rings must remain visible (avoid clipping at pressable/root level).
- Confirm overlay focus trap/restore semantics are deterministic.
- Check commands and gating:
- Global shortcuts should gate on focus/composition state (
focus.is_text_input == false unless intentionally editing).
- Ensure automation stability:
- Add stable
test_id to interactive affordances that must be gated by diag scripts.
- Avoid selector strategies based on geometry/pixels.
- Leave a regression artifact:
- For state machines: a
tools/diag-scripts/*.json script (schema v2 preferred) + capture_bundle.
- For deterministic logic: unit/integration tests.
- For layout ownership/size negotiation: geometry assertions or
capture_layout_sidecar.
- For visual chrome/clipping/focus rings:
capture_screenshot when a screenshot carries more signal than a prose note.
- For perf-sensitive changes: a small perf probe/baseline.
- Report findings goal-backward:
- start from the broken or unproven truth,
- then point to the missing/wrong artifact or wiring,
- then recommend the smallest gate that would prove the truth next time.
Definition of done (what to leave behind)
Minimum deliverables (3-pack): Repro (smallest surface), Gate (script/test/perf), Evidence (anchors + command). See fret-skills-playbook.
- Findings are reported as concrete issues with evidence anchors (file paths + key functions).
- The highest-risk findings are framed as broken or unproven truths, not just code-style complaints.
- Fix recommendations map to the correct layer (mechanism vs policy vs recipe).
- At least one regression artifact is proposed (or added) for the highest-risk issue.
Evidence anchors
- Shared conventions:
.agents/skills/fret-skills-playbook/SKILL.md
- Goal-backward verification note:
.agents/skills/fret-skills-playbook/references/goal-backward-verification.md
- Crate/layer selection:
docs/crate-usage-guide.md
- Shadcn authoring golden path:
docs/shadcn-declarative-progress.md
- Build playbook (tokens + recipes):
.agents/skills/fret-app-ui-builder/SKILL.md, .agents/skills/fret-app-ui-builder/references/
- Polish pass rules:
.agents/skills/fret-app-ui-builder/references/polish/polish-pass.md
- Contracts/ADRs:
docs/architecture.md, docs/runtime-contract-matrix.md, docs/adr/
- Diag gates:
.agents/skills/fret-diag-workflow/SKILL.md
- UI Gallery exemplar + evidence note:
.agents/skills/fret-shadcn-source-alignment/references/ui-gallery-exemplar-and-evidence.md
- UI Gallery authoring gates:
apps/fret-ui-gallery/src/lib.rs
- UI Gallery snippet exemplars:
apps/fret-ui-gallery/src/ui/snippets/
- UI Gallery geometry/test-id helpers:
apps/fret-ui-gallery/src/driver/render_flow.rs
Examples
Common pitfalls
- Reviewing page glue while ignoring the snippet file that actually teaches the public example surface.
- Over-polishing visuals without fixing focus/keyboard paths.
- Fixing policy mismatches by adding runtime knobs.
- Missing
when gating, causing shortcuts to fire inside text inputs / IME.
- Missing
test_id, causing scripts to rot immediately.
Troubleshooting
- Symptom: review findings are hard to prove.
- Fix: pair the review with a minimal
fretboard diag script + bundle evidence.
- Symptom: there are too many potential issues.
- Fix: triage into P0 correctness (focus, dismissal, input) vs P1 polish (spacing, tokens).
Related skills
fret-framework-consumer-audit
fret-app-ui-builder
fret-external-app-mode
fret-diag-workflow
- Framework/eco authors only:
fret-shadcn-source-alignment
1---2name: fret-ui-review3description: This skill should be used when the user asks to "review a Fret UI", "polish UX", "audit focus/overlays", or "check token drift and `test_id` stability". Provides a framework-aligned audit workflow (tokens, focus-visible, overlays, commands gating) with outcome-first findings, recommended regression gates, and evidence anchors.4---56# Fret UI review (framework-aligned audit)78This skill is the “audit lens” companion to the builder/recipe skills. It is inspired by the style of9guideline-based skills (e.g. Vercel’s web interface checks), but tailored to Fret’s layered architecture.1011## When to use1213- “Review my Fret UI” / “audit UX” / “polish this screen”.14- You suspect a regression caused by layering, focus, overlay policy, or token drift.15- You want to ensure an app repo uses Fret in a way that stays stable across refactors.1617## Choose this vs adjacent skills1819- Use this skill when the task is **review/audit** (produce findings + recommended fixes/gates).20- Use `fret-framework-consumer-audit` when the task is to simulate a framework user's journey and uncover onboarding/example/API friction rather than review one existing surface.21- Use `fret-app-ui-builder` when you want to build/refactor a UI via a golden-path workflow.22- Use `fret-diag-workflow` when the primary deliverable is a deterministic repro + gate + bundle.23- If a component behavior seems wrong, treat it as a framework/eco responsibility:24 - leave a minimal `fret-diag-workflow` repro (script + bundle) and file it for the component owners.2526## Inputs to collect (ask the user)2728- What files or directories should be reviewed (`src/`, a specific module, or one component)?29- Target surface: settings/forms, workspace shell, data table, overlay-heavy flows?30- Platform(s): native/web; keyboard-first expectations?31- Is the review about user-facing behavior only, or also about whether the code teaches the intended Fret authoring surface?32- What is the acceptance criterion: “looks cohesive”, “no focus bugs”, “parity with Radix”, “no perf hitches”?3334Defaults if unclear:3536- Review the smallest surface that shows the issue and prioritize: authoring-surface drift + tokens + focus-visible + overlays + gating + `test_id`.3738## Smallest starting point (one command)3940- `rg -n "Px\\(|\\.overflow\\(|test_id|when\\s*:\\s*\\\"|OverlayRequest::" src`4142## Quick start4344Audit in this priority order:45461. **Authoring surface**: examples/snippets teach the intended facade/import/build pattern.472. **Theme/tokens**: token-driven spacing/radius/colors (avoid per-component magic numbers).483. **Focus-visible**: focus ring visible, not clipped; keyboard-first paths work.494. **Overlays**: dismiss + focus restore rules are in policy layers (`ecosystem/`), not runtime.505. **Commands/keymaps**: stable `CommandId` + explicit `when` gating (avoid firing in text inputs/IME).516. **Automation stability**: stable `test_id` targets for interactive affordances.527. **Regression gates**: at least one script/test for the most fragile interaction.538. **Polish pass** (style-agnostic): apply `rule_id` checklist from:54 - `.agents/skills/fret-app-ui-builder/references/polish/polish-pass.md`5556## Output format (recommended)5758Keep findings terse and reviewable (Vercel-style):5960- `path:line - category/rule_id - message (what to change + why)`61- When possible, make the broken truth explicit in the message instead of only naming the local code smell.6263## Workflow64651) Identify the review scope (files/patterns) and the smallest runnable target.66671.25) Write 3-5 review truths before scanning details:6869- What must be true for this surface to be considered correct?70- Which truths are user-facing behavior, and which are teaching-surface truths?71- Which truths already have proof, and which are only assumed?72731.5) If this is a first-party surface, compare the right UI Gallery layers before reviewing styling:7475- snippet file = canonical example source76- page file = docs composition around the snippet77- driver/render flow = geometry/test-id/diagnostics ownership7879Also verify the intended surface against:8081- `docs/crate-usage-guide.md`82- `docs/shadcn-declarative-progress.md`83842) Check layering alignment first:8586- mechanism/contract surfaces belong in `crates/*`87- interaction policy and recipes belong in `ecosystem/*`88893) Run a “token drift” scan:9091- Prefer tokens (`Space`/`Radius`/`MetricRef`/`ColorRef`) and `UiBuilder` patches.92- Flag large or repeated `Px(...)` usage unless justified.93944) Check focus-visible and overflow:9596- Focus rings must remain visible (avoid clipping at pressable/root level).97- Confirm overlay focus trap/restore semantics are deterministic.98995) Check commands and gating:100101- Global shortcuts should gate on focus/composition state (`focus.is_text_input == false` unless intentionally editing).1021036) Ensure automation stability:104105- Add stable `test_id` to interactive affordances that must be gated by diag scripts.106- Avoid selector strategies based on geometry/pixels.1071087) Leave a regression artifact:109110- For state machines: a `tools/diag-scripts/*.json` script (schema v2 preferred) + `capture_bundle`.111- For deterministic logic: unit/integration tests.112- For layout ownership/size negotiation: geometry assertions or `capture_layout_sidecar`.113- For visual chrome/clipping/focus rings: `capture_screenshot` when a screenshot carries more signal than a prose note.114- For perf-sensitive changes: a small perf probe/baseline.1151168) Report findings goal-backward:117118- start from the broken or unproven truth,119- then point to the missing/wrong artifact or wiring,120- then recommend the smallest gate that would prove the truth next time.121122## Definition of done (what to leave behind)123124Minimum deliverables (3-pack): Repro (smallest surface), Gate (script/test/perf), Evidence (anchors + command). See `fret-skills-playbook`.125126- Findings are reported as concrete issues with evidence anchors (file paths + key functions).127- The highest-risk findings are framed as broken or unproven truths, not just code-style complaints.128- Fix recommendations map to the correct layer (mechanism vs policy vs recipe).129- At least one regression artifact is proposed (or added) for the highest-risk issue.130131## Evidence anchors132133- Shared conventions: `.agents/skills/fret-skills-playbook/SKILL.md`134- Goal-backward verification note: `.agents/skills/fret-skills-playbook/references/goal-backward-verification.md`135- Crate/layer selection: `docs/crate-usage-guide.md`136- Shadcn authoring golden path: `docs/shadcn-declarative-progress.md`137- Build playbook (tokens + recipes): `.agents/skills/fret-app-ui-builder/SKILL.md`, `.agents/skills/fret-app-ui-builder/references/`138- Polish pass rules: `.agents/skills/fret-app-ui-builder/references/polish/polish-pass.md`139- Contracts/ADRs: `docs/architecture.md`, `docs/runtime-contract-matrix.md`, `docs/adr/`140- Diag gates: `.agents/skills/fret-diag-workflow/SKILL.md`141- UI Gallery exemplar + evidence note: `.agents/skills/fret-shadcn-source-alignment/references/ui-gallery-exemplar-and-evidence.md`142- UI Gallery authoring gates: `apps/fret-ui-gallery/src/lib.rs`143- UI Gallery snippet exemplars: `apps/fret-ui-gallery/src/ui/snippets/`144- UI Gallery geometry/test-id helpers: `apps/fret-ui-gallery/src/driver/render_flow.rs`145146## Examples147148- Example: audit focus + keyboard UX149 - User says: "Tab order feels wrong and focus ring is inconsistent."150 - Actions: check focus-visible rules, roving tabindex patterns, and command/keymap integration.151 - Result: a concrete list of issues + recommended gates (scripts/tests).152153- Example: overlay correctness review154 - User says: "Menus/tooltips sometimes appear in the wrong place."155 - Actions: verify overlay placement, outside-press dismissal, and viewport constraints.156 - Result: actionable fixes + evidence anchors.157158## Common pitfalls159160- Reviewing page glue while ignoring the snippet file that actually teaches the public example surface.161- Over-polishing visuals without fixing focus/keyboard paths.162- Fixing policy mismatches by adding runtime knobs.163- Missing `when` gating, causing shortcuts to fire inside text inputs / IME.164- Missing `test_id`, causing scripts to rot immediately.165166## Troubleshooting167168- Symptom: review findings are hard to prove.169 - Fix: pair the review with a minimal `fretboard diag` script + bundle evidence.170- Symptom: there are too many potential issues.171 - Fix: triage into P0 correctness (focus, dismissal, input) vs P1 polish (spacing, tokens).172173## Related skills174175- `fret-framework-consumer-audit`176- `fret-app-ui-builder`177- `fret-external-app-mode`178- `fret-diag-workflow`179 - Framework/eco authors only: `fret-shadcn-source-alignment`