Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Standardized guidelines and patterns for Frontend React Component Composition.
.claude/skills/valec3-frontend-react-component-composition/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 26% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 41% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 5% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 36% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 36% | 0% |
Basic Children
typescriptinterface ContainerProps { children: React.ReactNode; } export const Container = ({ children }: ContainerProps) => { return <div className="container">{children}</div>; };
Typed Children
typescriptimport { ReactElement } from 'react'; interface TabsProps { children: ReactElement<TabProps> | ReactElement<TabProps>[]; } export const Tabs = ({ children }: TabsProps) => { const tabs = React.Children.toArray(children); return <div>{tabs}</div>; };
typescriptinterface MouseTrackerProps { render: (position: { x: number; y: number }) => React.ReactNode; } export function MouseTracker({ render }: MouseTrackerProps) { const [position, setPosition] = useState({ x: 0, y: 0 }); useEffect(() => { const handleMove = (e: MouseEvent) => { setPosition({ x: e.clientX, y: e.clientY }); }; window.addEventListener('mousemove', handleMove); return () => window.removeEventListener('mousemove', handleMove); }, []); return <>{render(position)}</>; } // Usage <MouseTracker render={({ x, y }) => ( <div>Mouse at {x}, {y}</div> )} />
typescriptimport { createContext, useContext, useState } from 'react'; // Context for internal state interface TabsContextValue { activeTab: string; setActiveTab: (id: string) => void; } const TabsContext = createContext<TabsContextValue | null>(null); export const Tabs = ({ children }: { children: React.ReactNode }) => { const [activeTab, setActiveTab] = useState(''); return ( <TabsContext.Provider value={{ activeTab, setActiveTab }}> <div className="tabs">{children}</div> </TabsContext.Provider> ); }; Tabs.List = ({ children }: { children: React.ReactNode }) => { return <div className="tab-list">{children}</div>; }; Tabs.Tab = ({ id, children }: { id: string; children: React.ReactNode }) => { const context = useContext(TabsContext); if (!context) throw new Error('Tab must be used within Tabs'); return ( <button className={context.activeTab === id ? 'active' : ''} onClick={() => context.setActiveTab(id)} > {children} </button> ); }; Tabs.Panel = ({ id, children }: { id: string; children: React.ReactNode }) => { const context = useContext(TabsContext); if (!context) throw new Error('Panel must be used within Tabs'); return context.activeTab === id ? <div>{children}</div> : null; }; // Usage <Tabs> <Tabs.List> <Tabs.Tab id="home">Home</Tabs.Tab> <Tabs.Tab id="profile">Profile</Tabs.Tab> </Tabs.List> <Tabs.Panel id="home">Home Content</Tabs.Panel> <Tabs.Panel id="profile">Profile Content</Tabs.Panel> </Tabs>
typescriptinterface LayoutProps { header?: React.ReactNode; sidebar?: React.ReactNode; content: React.ReactNode; footer?: React.ReactNode; } export const Layout = ({ header, sidebar, content, footer }: LayoutProps) => { return ( <div className="layout"> {header && <header>{header}</header>} <div className="main"> {sidebar && <aside>{sidebar}</aside>} <main>{content}</main> </div> {footer && <footer>{footer}</footer>} </div> ); }; // Usage <Layout header={<Header />} sidebar={<Nav />} content={<Article />} footer={<Footer />} />
typescriptfunction withLoading<P extends object>( Component: React.ComponentType<P> ) { return function WithLoadingComponent( props: P & { loading: boolean } ) { if (props.loading) { return <div>Loading...</div>; } return <Component {...props} />; }; } // Usage const UserProfileWithLoading = withLoading(UserProfile); <UserProfileWithLoading user={user} loading={isLoading} />
typescriptinterface InputProps { label: string; error?: string; } export const Input = forwardRef<HTMLInputElement, InputProps>( ({ label, error, ...props }, ref) => { return ( <div> <label>{label}</label> <input ref={ref} {...props} /> {error && <span className="error">{error}</span>} </div> ); } ); Input.displayName = 'Input';
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-04 | pass→pass | 13,460 | 8,938 | -34% | 1 | 1 | 0% | 3,016 | 3,173 | +5% | 0 | 0 | — |
case-01 | fail→pass | 14,197 | 8,477 | -40% | 1 | 1 | 0% | 2,415 | 3,050 | +26% | 0 | 0 | — |
case-02 | pass→pass | 8,895 | 6,210 | -30% | 1 | 1 | 0% | 1,886 | 2,562 | +36% | 0 | 0 | — |
case-03 | pass→pass | 15,464 | 15,506 | +0% | 1 | 1 | 0% | 2,988 | 4,054 | +36% | 0 | 0 | — |
case-05 | pass→pass | 13,972 | 7,547 | -46% | 1 | 1 | 0% | 2,241 | 2,714 | +21% | 0 | 0 | — |
case-06 | pass→pass | 4,599 | 3,316 | -28% | 1 | 1 | 0% | 859 | 1,833 | +113% | 0 | 0 | — |
case-07 | pass→pass | 11,970 | 7,891 | -34% | 1 | 1 | 0% | 2,385 | 2,892 | +21% | 0 | 0 | — |
case-08 | pass→pass | 10,918 | 6,616 | -39% | 1 | 1 | 0% | 2,353 | 2,668 | +13% | 0 | 0 | — |
case-09 | pass→pass | 8,735 | 5,886 | -33% | 1 | 1 | 0% | 1,675 | 2,506 | +50% | 0 | 0 | — |
case-10 | pass→pass | 10,082 | 6,312 | -37% | 1 | 1 | 0% | 2,160 | 2,616 | +21% | 0 | 0 | — |
case-11 | pass→pass | 12,078 | 6,115 | -49% | 1 | 1 | 0% | 2,552 | 2,471 | -3% | 0 | 0 | — |
case-12 | pass→pass | 7,609 | 4,961 | -35% | 1 | 1 | 0% | 1,454 | 2,371 | +63% | 0 | 0 | — |
case-13 | pass→pass | 7,846 | 6,717 | -14% | 1 | 1 | 0% | 1,637 | 2,831 | +73% | 0 | 0 | — |
case-14 | pass→pass | 12,048 | 13,199 | +10% | 1 | 1 | 0% | 2,313 | 3,362 | +45% | 0 | 0 | — |
case-15 | fail→fail | 6,304 | 5,094 | -19% | 1 | 1 | 0% | 1,378 | 2,320 | +68% | 0 | 0 | — |
case-16 | pass→pass | 5,578 | 3,092 | -45% | 1 | 1 | 0% | 1,042 | 1,930 | +85% | 0 | 0 | — |
case-17 | pass→pass | 8,005 | 7,127 | -11% | 1 | 1 | 0% | 1,707 | 2,701 | +58% | 0 | 0 | — |
case-18 | pass→pass | 4,607 | 2,313 | -50% | 1 | 1 | 0% | 852 | 1,709 | +101% | 0 | 0 | — |
case-19 | fail→pass | 8,385 | 11,168 | +33% | 1 | 1 | 0% | 1,715 | 2,413 | +41% | 0 | 0 | — |
case-20 | pass→pass | 15,416 | 7,979 | -48% | 1 | 1 | 0% | 2,595 | 3,135 | +21% | 0 | 0 | — |
case-21 | pass→pass | 13,767 | 11,901 | -14% | 1 | 1 | 0% | 3,742 | 4,310 | +15% | 0 | 0 | — |
case-22 | fail→fail | 4,226 | 3,858 | -9% | 1 | 1 | 0% | 894 | 2,117 | +137% | 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. 22 cases were attempted. The headline lift of +9 percentage points is the difference between those two pass rates over the 22 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.