Frontend UI Development Skill
This skill provides repo-specific guidance for building UI components in the open-sharia-enterprise monorepo. It covers design tokens, component patterns, accessibility, anti-patterns, and per-app brand context.
When This Skill Triggers
- Editing
.tsx component files in apps/*/src/components/
- Editing
globals.css or Tailwind configuration
- Creating or modifying shared UI components in
libs/web-ui/
- Working on design tokens in
libs/web-ui-token/
Reference Modules
Consult these reference docs for detailed guidance on specific topics:
- Design Tokens Reference — Token architecture, current values, Tailwind mapping
- Design Tokens — Spacing and Format Reference — Spacing scale, token format differences across apps
- Component Patterns Reference — Standard template, complete Button example
- Component Patterns — Key Patterns and Testing — CVA/Radix key patterns, Storybook, unit tests, checklist
- Anti-Patterns Catalog — 13 repo-specific anti-patterns with before/after examples
- Accessibility Reference — Per-component ARIA checklists, keyboard navigation
- Brand Context Reference — Per-app audience, personality, palette guidance
- Top Rules Reference — Quick-reference Do/Do-Not checklist
Test-Driven Development for UI
TDD applies to UI component and page work. Write the failing check before writing the component:
- Vitest unit test (
component-name.test.tsx): failing assertion on render, variant output,
or toHaveNoViolations() (vitest-axe) — write this first.
- Visual snapshot (Playwright visual diff): failing screenshot comparison — write before
finalizing visual styles.
- Accessibility check (axe): failing
toHaveNoViolations() in unit test or Playwright — write
before adding interactive states or ARIA markup.
- E2E Playwright spec: failing user-flow assertion — write before implementing flows that cross
component boundaries.
Mini-TDD passes work well for UI: one Red→Green→Refactor cycle per variant, state, or interaction.
Quality-Gate Lifecycle Handoff
When the UI quality gate provides delegated-gate-ids and an evidence ledger, omit only exact
registry IDs or predicates connected through verifies. Preserve pending state; never rerun,
infer, revalidate, or fix delegated work. The seven semantic UI dimensions remain in scope. See the
lifecycle ownership policy.
Fixers invalidate evidence whose registered scope intersects their changed files.
The UI gate has two checker roles: one full discovery and, only after its single fixer invocation,
one verification limited to the original in-threshold findings plus regression smoke over affected
components. A clean discovery passes immediately. Verification never becomes another full audit,
and no result automatically starts another pass.
Canonical reference:
Test-Driven Development Convention
— covers all test levels (unit, snapshot/visual, a11y, E2E, manual verification) and the full
Red→Green→Refactor cycle.
Governance References
1---2name: swe-developing-frontend-ui3description: UI development skill covering design token usage, shadcn/ui + Radix composition patterns, accessibility requirements, anti-patterns catalog, and brand context for OrganicLever and OSE Platform. Auto-loads when working on TSX components, CSS, or UI design tasks.4---56# Frontend UI Development Skill78This skill provides repo-specific guidance for building UI components in the open-sharia-enterprise monorepo. It covers design tokens, component patterns, accessibility, anti-patterns, and per-app brand context.910## When This Skill Triggers1112- Editing `.tsx` component files in `apps/*/src/components/`13- Editing `globals.css` or Tailwind configuration14- Creating or modifying shared UI components in `libs/web-ui/`15- Working on design tokens in `libs/web-ui-token/`1617## Reference Modules1819Consult these reference docs for detailed guidance on specific topics:2021- [Design Tokens Reference](./reference/design-tokens.md) — Token architecture, current values, Tailwind mapping22- [Design Tokens — Spacing and Format Reference](./reference/design-tokens-spacing-and-format.md) — Spacing scale, token format differences across apps23- [Component Patterns Reference](./reference/component-patterns.md) — Standard template, complete Button example24- [Component Patterns — Key Patterns and Testing](./reference/component-patterns-key-patterns-and-testing.md) — CVA/Radix key patterns, Storybook, unit tests, checklist25- [Anti-Patterns Catalog](./reference/anti-patterns.md) — 13 repo-specific anti-patterns with before/after examples26- [Accessibility Reference](./reference/accessibility.md) — Per-component ARIA checklists, keyboard navigation27- [Brand Context Reference](./reference/brand-context.md) — Per-app audience, personality, palette guidance28- [Top Rules Reference](./reference/top-rules.md) — Quick-reference Do/Do-Not checklist2930## Test-Driven Development for UI3132TDD applies to UI component and page work. Write the failing check before writing the component:3334- **Vitest unit test** (`component-name.test.tsx`): failing assertion on render, variant output,35 or `toHaveNoViolations()` (vitest-axe) — write this first.36- **Visual snapshot** (Playwright visual diff): failing screenshot comparison — write before37 finalizing visual styles.38- **Accessibility check** (axe): failing `toHaveNoViolations()` in unit test or Playwright — write39 before adding interactive states or ARIA markup.40- **E2E Playwright spec**: failing user-flow assertion — write before implementing flows that cross41 component boundaries.4243Mini-TDD passes work well for UI: one Red→Green→Refactor cycle per variant, state, or interaction.4445## Quality-Gate Lifecycle Handoff4647When the UI quality gate provides `delegated-gate-ids` and an evidence ledger, omit only exact48registry IDs or predicates connected through `verifies`. Preserve pending state; never rerun,49infer, revalidate, or fix delegated work. The seven semantic UI dimensions remain in scope. See the50[lifecycle ownership policy](../../../repo-governance/workflows/meta/workflow-identifier/check-fix-lifecycle-validation-ownership.md).51Fixers invalidate evidence whose registered scope intersects their changed files.5253The UI gate has two checker roles: one full discovery and, only after its single fixer invocation,54one verification limited to the original in-threshold findings plus regression smoke over affected55components. A clean discovery passes immediately. Verification never becomes another full audit,56and no result automatically starts another pass.5758**Canonical reference**:59[Test-Driven Development Convention](../../../repo-governance/development/workflow/test-driven-development.md)60— covers all test levels (unit, snapshot/visual, a11y, E2E, manual verification) and the full61Red→Green→Refactor cycle.6263## Governance References6465- [Design Tokens Convention](../../../repo-governance/development/frontend/design-tokens.md)66- [Component Patterns Convention](../../../repo-governance/development/frontend/component-patterns.md)67- [Accessibility Convention](../../../repo-governance/development/frontend/accessibility.md)68- [Styling Convention](../../../repo-governance/development/frontend/styling.md)69- [Color Accessibility Convention](../../../repo-governance/conventions/formatting/color-accessibility.md) — 5-color palette for docs only; UI uses any WCAG AA compliant colors70- [Accessibility First Principle](../../../repo-governance/principles/content/accessibility-first.md)