Token pipeline (Style Dictionary v4, DTCG format): - Primitive tokens: colour palettes (brand, sage, neutral, feedback), typography (3 font families, 21-variant type scale), spacing (4px grid), border radius, shadows, opacity - Semantic tokens: text, surface, border, interactive, feedback colours; typography roles; layout spacing - Component tokens: Button (4 sizes), Input (2 sizes) - Generated outputs: CSS custom properties, JS ES6 module, flat JSON Atoms (3 components): - Button: contained/soft/outlined/text × primary/secondary, 4 sizes, loading state, underline for text variant - Typography: 21 variants across display/heading/body/label/caption/overline, maxLines truncation - Input: external label, helper text, error/success validation, start/end icons, required indicator, 2 sizes, multiline support Infrastructure: - MUI v5 theme with full token mapping - Storybook 8 with autodocs - Claude Code agents and skills for token/component workflows - Design system documentation and cross-session memory Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
50 lines
1.7 KiB
Markdown
50 lines
1.7 KiB
Markdown
---
|
|
name: review-component
|
|
description: Review a component against design system conventions
|
|
argument-hint: "[ComponentName]"
|
|
---
|
|
|
|
Review a component against FA Design System conventions and report pass/fail for each check.
|
|
|
|
**Component to review:** $ARGUMENTS
|
|
|
|
**Instructions:**
|
|
1. Read `docs/conventions/component-conventions.md` for the rules
|
|
2. Read `docs/conventions/token-conventions.md` for token usage rules
|
|
3. Read the component source file in `src/components/`
|
|
4. Read the component's Storybook stories
|
|
|
|
**Check each of these and report pass/fail:**
|
|
|
|
### Code quality
|
|
- [ ] Component uses TypeScript with proper types
|
|
- [ ] Props interface exported with JSDoc on every prop
|
|
- [ ] Uses `React.forwardRef` for interactive elements
|
|
- [ ] Accepts and forwards `sx` prop
|
|
- [ ] Uses `shouldForwardProp` for custom props on styled components
|
|
|
|
### Theme compliance
|
|
- [ ] NO hardcoded colours — all from `theme.palette.*`
|
|
- [ ] NO hardcoded spacing — all from `theme.spacing()`
|
|
- [ ] NO hardcoded typography — all from `theme.typography.*`
|
|
- [ ] NO hardcoded shadows — all from `theme.shadows`
|
|
- [ ] NO hardcoded border radius — all from `theme.shape.*`
|
|
|
|
### Accessibility
|
|
- [ ] Minimum 44px touch target on mobile
|
|
- [ ] Visible focus indicator (focus-visible)
|
|
- [ ] Appropriate ARIA attributes
|
|
- [ ] Disabled state uses `aria-disabled`
|
|
- [ ] Colour contrast meets WCAG 2.1 AA
|
|
|
|
### Storybook coverage
|
|
- [ ] Default story
|
|
- [ ] All variants story
|
|
- [ ] All sizes story (if applicable)
|
|
- [ ] Disabled state
|
|
- [ ] Loading state (if applicable)
|
|
- [ ] Long content / overflow
|
|
- [ ] autodocs tag present
|
|
|
|
**Report format:** List each check with pass/fail and specific issues found. End with a summary and recommended fixes.
|