- Home
- Skills
- Frontend & Web Apps
- UI Component Architect: Reusable, Accessible Components
Works with the AI Agents you already use
UI Component Architect: Reusable, Accessible Components
UI Component Architect makes your agent design components like a design-system engineer.
Free
UI Component Architect: Reusable, Accessible Components
Example session with this skill installed
We have 6 different modal implementations in our React app. Build one accessible Modal component (with confirm and form variants) and replace the others.
- Read your context and instructions
- Compiled the ui component architect
- Generated the UI component
Inventory
React 18 + TypeScript, Tailwind, Vitest + Testing Library, Storybook 8. @radix-ui/react-dialog already installed (used by 1 of 6 modals) → build on it.
| File | Problems found |
|---|---|
OrderModal.tsx | no focus trap, Esc doesn't close |
ConfirmDelete.tsx | div buttons, no labels |
AddressModal.tsx | body scroll not locked, hard-coded colours |
InviteModal.tsx | focus not returned on close |
NotesModal.tsx, ExportModal.tsx | duplicated markup, 3 different paddings |
API
<Modal open={open} onOpenChange={setOpen} size="md">
<Modal.Title>Edit address</Modal.Title>
<Modal.Description>Changes apply to future shipments.</Modal.Description>
<Modal.Body>{/* form */}</Modal.Body>
<Modal.Footer><Button variant="secondary">Cancel</Button><Button>Save</Button></Modal.Footer>
</Modal>
<ConfirmModal open={open} onOpenChange={setOpen} tone="danger"
title="Delete shipment?" description="This can't be undone." confirmLabel="Delete" onConfirm={remove} />
Props: size (sm/md/lg), tone (default/danger); controlled or uncontrolled; tokens only.
Accessibility
Radix Dialog: role=dialog, aria-modal, labelled by Title, described by Description, focus trapped, Esc and overlay close (overlay close disabled for forms with unsaved changes), focus returned to trigger, scroll locked, reduced-motion animations.
Delivered
ui/modal/Modal.tsx,ConfirmModal.tsx,modal.stories.tsx(7 stories: sizes, danger confirm, long content, form with validation, loading)modal.test.tsx: 9 tests (Esc, focus return, trap, confirm/cancel, axe) — all passing- 6 old modals migrated, −412 lines;
tsc --noEmitand lint clean
Migration note
All call sites updated in this PR; OrderModal kept a custom footer via Modal.Footer. No visual changes except unified padding (24 px) and the focus ring.
OrderModal.tsx
TSX · React component
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
Components your team reuses instead of copying
Most codebases end up with five slightly different buttons, modals without focus traps and props like isPrimary, isBig, isRed. UI Component Architect makes your agent design components like a design-system engineer.
What it does
- Inventory first: framework, styling (Tailwind, CSS Modules, Vuetify, MUI, shadcn), TypeScript, tests, Storybook; builds on headless primitives you already have (Radix, React Aria, Headless UI, Reka) instead of re-implementing focus traps.
- Tokens before components: colour roles, spacing, radii, type, shadows, motion; light and dark via CSS variables; no hard-coded values.
- API designed before code:
variantandsizeenums instead of boolean soup, composition with slots or compound components, controlled + uncontrolled, forwarded refs and native attributes, consistent naming and deprecation paths. - Every state: hover, focus-visible, active, disabled, loading, error, empty, selected, read-only, long text, RTL, small screens.
- Accessibility built in: WAI-ARIA patterns for 12 common components (dialog, menu, tabs, combobox, toast, table...) with keyboard maps, focus management, labels, contrast and reduced motion.
- Docs & tests: a story per variant and state, props table, do/don't; behaviour and axe accessibility tests; typecheck and lint green.
- Refactor mode: finds duplicated UI, consolidates it into one component with variants and gives a migration list.
Includes
- SKILL.md workflow
- references/patterns.md - tokens, React (cva) and Vue 3 button examples, compound components, API anti-patterns, story template
- references/a11y.md - accessibility patterns table and checklist
Pairs with Frontend Design Pro and Vue Pro Patterns. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI and any SKILL.md-compatible agent.
Requires existing framework context. Does not add new UI libraries without permission. Interactive widgets require headless primitives or custom keyboard mapping logic.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
This skill has been used 11 times.
Trust & safety
Security scan
Security scan passed 8 days ago
- Free with an Agensi account
Permissions
No special permissions declared or detected