Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Standardized guidelines and patterns for Frontend React Components.
.claude/skills/valec3-frontend-react-components/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 3% | 0% |
| case-05 | ✓→✗ | ▼ Worse | 41% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 12% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 28% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 55% | 0% |
Basic Functional Component
typescriptimport { FC } from 'react'; interface ButtonProps { children: React.ReactNode; variant?: 'primary' | 'secondary'; onClick?: () => void; disabled?: boolean; } export const Button: FC<ButtonProps> = ({ children, variant = 'primary', onClick, disabled = false }) => { return ( <button className={`btn btn-${variant}`} onClick={onClick} disabled={disabled} > {children} </button> ); };
1. Compound Components
typescriptexport const Card = ({ children }: { children: React.ReactNode }) => { return <div className="card">{children}</div>; }; Card.Header = ({ children }: { children: React.ReactNode }) => { return <div className="card-header">{children}</div>; }; Card.Body = ({ children }: { children: React.ReactNode }) => { return <div className="card-body">{children}</div>; }; // Usage <Card> <Card.Header>Title</Card.Header> <Card.Body>Content</Card.Body> </Card>
2. Render Props
typescriptinterface DataFetcherProps<T> { url: string; children: (data: T | null, loading: boolean) => React.ReactNode; } export function DataFetcher<T>({ url, children }: DataFetcherProps<T>) { const [data, setData] = useState<T | null>(null); const [loading, setLoading] = useState(true); useEffect(() => { fetch(url) .then(res => res.json()) .then(data => { setData(data); setLoading(false); }); }, [url]); return <>{children(data, loading)}</>; } // Usage <DataFetcher<User> url="/api/user"> {(user, loading) => ( loading ? <Spinner /> : <UserProfile user={user} /> )} </DataFetcher>
3. Controlled vs Uncontrolled
typescript// Controlled export function ControlledInput({ value, onChange }: { value: string; onChange: (value: string) => void; }) { return ( <input value={value} onChange={e => onChange(e.target.value)} /> ); } // Uncontrolled export function UncontrolledInput({ defaultValue }: { defaultValue?: string; }) { const inputRef = useRef<HTMLInputElement>(null); return <input ref={inputRef} defaultValue={defaultValue} />; }
Do's:
typescripttype ButtonProps = | { variant: 'primary'; onClick: () => void } | { variant: 'link'; href: string };
Don'ts:
components/
├── Button/
│ ├── Button.tsx
│ ├── Button.test.tsx
│ ├── Button.stories.tsx
│ └── index.ts
└── Card/
├── Card.tsx
├── CardHeader.tsx
├── CardBody.tsx
├── index.ts
└── Card.test.tsx| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 12,315 | 8,565 | -30% | 1 | 1 | 0% | 2,827 | 2,909 | +3% | 0 | 0 | — |
case-02 | pass→pass | 11,462 | 9,184 | -20% | 1 | 1 | 0% | 2,463 | 2,770 | +12% | 0 | 0 | — |
case-03 | pass→pass | 8,994 | 5,992 | -33% | 1 | 1 | 0% | 1,676 | 2,141 | +28% | 0 | 0 | — |
case-04 | pass→pass | 7,742 | 8,252 | +7% | 1 | 1 | 0% | 1,792 | 2,778 | +55% | 0 | 0 | — |
case-05 | pass→fail | 10,754 | 9,378 | -13% | 1 | 1 | 0% | 2,085 | 2,938 | +41% | 0 | 0 | — |
case-06 | pass→pass | 15,308 | 10,863 | -29% | 1 | 1 | 0% | 2,015 | 2,830 | +40% | 0 | 0 | — |
case-07 | pass→pass | 11,616 | 5,442 | -53% | 1 | 1 | 0% | 2,387 | 2,082 | -13% | 0 | 0 | — |
case-08 | pass→pass | 12,942 | 10,233 | -21% | 1 | 1 | 0% | 2,256 | 2,110 | -6% | 0 | 0 | — |
case-09 | pass→pass | 12,470 | 9,152 | -27% | 1 | 1 | 0% | 2,696 | 3,224 | +20% | 0 | 0 | — |
case-10 | pass→pass | 10,828 | 7,118 | -34% | 1 | 1 | 0% | 1,950 | 2,466 | +26% | 0 | 0 | — |
case-11 | pass→pass | 9,285 | 7,253 | -22% | 1 | 1 | 0% | 1,776 | 2,305 | +30% | 0 | 0 | — |
case-12 | pass→pass | 11,813 | 10,291 | -13% | 1 | 1 | 0% | 1,859 | 2,574 | +38% | 0 | 0 | — |
case-13 | fail→fail | 13,287 | 8,196 | -38% | 1 | 1 | 0% | 2,145 | 2,334 | +9% | 0 | 0 | — |
case-23 | pass→pass | 13,203 | 14,075 | +7% | 1 | 1 | 0% | 2,565 | 3,689 | +44% | 0 | 0 | — |
case-14 | pass→pass | 8,548 | 6,798 | -20% | 1 | 1 | 0% | 1,458 | 2,235 | +53% | 0 | 0 | — |
case-15 | pass→pass | 6,517 | 3,973 | -39% | 1 | 1 | 0% | 1,360 | 1,797 | +32% | 0 | 0 | — |
case-16 | pass→pass | 9,600 | 6,253 | -35% | 1 | 1 | 0% | 1,448 | 2,224 | +54% | 0 | 0 | — |
case-17 | pass→pass | 5,855 | 5,053 | -14% | 1 | 1 | 0% | 1,258 | 1,954 | +55% | 0 | 0 | — |
case-18 | pass→pass | 15,606 | 6,552 | -58% | 1 | 1 | 0% | 1,861 | 2,163 | +16% | 0 | 0 | — |
case-19 | pass→pass | 7,669 | 7,820 | +2% | 1 | 1 | 0% | 1,428 | 2,493 | +75% | 0 | 0 | — |
case-20 | pass→pass | 3,244 | 2,643 | -19% | 1 | 1 | 0% | 670 | 1,472 | +120% | 0 | 0 | — |
case-21 | pass→pass | 18,698 | 13,960 | -25% | 1 | 1 | 0% | 3,759 | 4,045 | +8% | 0 | 0 | — |
case-22 | pass→pass | 10,119 | 5,694 | -44% | 1 | 1 | 0% | 1,949 | 2,196 | +13% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of 0 percentage points is the difference between those two pass rates over the 23 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.