Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Standardized guidelines for separating smart (container) components from dumb (presentational) components. Use when building reusable, testable React components with clear separation of logic and UI.
.claude/skills/valec3-frontend-architecture-container-presentational/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-05 | ✗→✓ | ▲ Improved | 5% | 0% |
| case-07 | ✗→✓ | ▲ Improved | -7% | 0% |
| case-20 | ✓→✗ | ▼ Worse | 40% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 60% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 24% | 0% |
Presentational Components
Container Components
Presentational Component
typescript// components/UserProfile.tsx interface UserProfileProps { name: string; email: string; avatarUrl: string; onEdit: () => void; isLoading?: boolean; } export function UserProfile({ name, email, avatarUrl, onEdit, isLoading = false }: UserProfileProps) { if (isLoading) { return <Skeleton />; } return ( <div className="profile"> <img src={avatarUrl} alt={name} /> <h2>{name}</h2> <p>{email}</p> <button onClick={onEdit}>Edit Profile</button> </div> ); }
Container Component
typescript// containers/UserProfileContainer.tsx import { UserProfile } from '../components/UserProfile'; export function UserProfileContainer({ userId }: { userId: string }) { const { data, isLoading } = useQuery(['user', userId], () => fetchUser(userId) ); const navigate = useNavigate(); const handleEdit = () => { navigate(`/users/${userId}/edit`); }; return ( <UserProfile name={data?.name ?? ''} email={data?.email ?? ''} avatarUrl={data?.avatarUrl ?? ''} onEdit={handleEdit} isLoading={isLoading} /> ); }
src/
├── components/ # Presentational
│ ├── Button.tsx
│ ├── Card.tsx
│ └── UserProfile.tsx
├── containers/ # Container
│ ├── UserProfileContainer.tsx
│ └── ProductListContainer.tsx
└── features/
└── users/
├── components/ # Feature-specific presentational
└── containers/ # Feature-specific containersWith hooks, you can extract logic without container components:
typescript// hooks/useUserProfile.ts export function useUserProfile(userId: string) { const { data, isLoading } = useQuery(['user', userId], () => fetchUser(userId) ); const navigate = useNavigate(); const handleEdit = () => { navigate(`/users/${userId}/edit`); }; return { user: data, isLoading, handleEdit }; } // components/UserProfile.tsx (Smart component with hook) export function UserProfile({ userId }: { userId: string }) { const { user, isLoading, handleEdit } = useUserProfile(userId); if (isLoading) return <Skeleton />; if (!user) return null; return ( <div className="profile"> <img src={user.avatarUrl} alt={user.name} /> <h2>{user.name}</h2> <button onClick={handleEdit}>Edit</button> </div> ); }
Presentational Components:
Container Components:
Custom Hooks (Modern):
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 14,012 | 10,363 | -26% | 1 | 1 | 0% | 3,212 | 3,288 | +2% | 0 | 0 | — |
case-02 | pass→pass | 10,115 | 8,613 | -15% | 1 | 1 | 0% | 1,713 | 2,742 | +60% | 0 | 0 | — |
case-03 | pass→pass | 12,253 | 8,724 | -29% | 1 | 1 | 0% | 2,040 | 2,537 | +24% | 0 | 0 | — |
case-04 | pass→pass | 9,934 | 7,116 | -28% | 1 | 1 | 0% | 1,999 | 2,405 | +20% | 0 | 0 | — |
case-17 | pass→pass | 6,923 | 2,169 | -69% | 1 | 1 | 0% | 1,219 | 1,345 | +10% | 0 | 0 | — |
case-05 | fail→pass | 10,840 | 5,779 | -47% | 1 | 1 | 0% | 2,110 | 2,221 | +5% | 0 | 0 | — |
case-06 | pass→pass | 8,576 | 5,855 | -32% | 1 | 1 | 0% | 1,635 | 1,994 | +22% | 0 | 0 | — |
case-07 | fail→pass | 10,194 | 5,279 | -48% | 1 | 1 | 0% | 2,052 | 1,916 | -7% | 0 | 0 | — |
case-08 | pass→pass | 7,275 | 3,382 | -54% | 1 | 1 | 0% | 1,250 | 1,631 | +30% | 0 | 0 | — |
case-18 | pass→pass | 10,911 | 8,191 | -25% | 1 | 1 | 0% | 2,009 | 2,394 | +19% | 0 | 0 | — |
case-09 | pass→pass | 15,351 | 7,310 | -52% | 1 | 1 | 0% | 1,837 | 2,377 | +29% | 0 | 0 | — |
case-10 | pass→pass | 6,612 | 5,502 | -17% | 1 | 1 | 0% | 1,369 | 1,835 | +34% | 0 | 0 | — |
case-11 | pass→pass | 4,485 | 5,619 | +25% | 1 | 1 | 0% | 867 | 1,843 | +113% | 0 | 0 | — |
case-12 | pass→pass | 12,336 | 9,381 | -24% | 1 | 1 | 0% | 2,155 | 2,758 | +28% | 0 | 0 | — |
case-13 | pass→pass | 8,701 | 5,560 | -36% | 1 | 1 | 0% | 1,693 | 2,027 | +20% | 0 | 0 | — |
case-14 | pass→pass | 10,687 | 5,641 | -47% | 1 | 1 | 0% | 1,676 | 1,952 | +16% | 0 | 0 | — |
case-15 | pass→pass | 10,536 | 7,272 | -31% | 1 | 1 | 0% | 1,947 | 2,202 | +13% | 0 | 0 | — |
case-16 | pass→pass | 5,559 | 4,263 | -23% | 1 | 1 | 0% | 955 | 1,701 | +78% | 0 | 0 | — |
case-19 | pass→pass | 6,902 | 2,933 | -58% | 1 | 1 | 0% | 1,272 | 1,483 | +17% | 0 | 0 | — |
case-20 | pass→fail | 7,448 | 6,201 | -17% | 1 | 1 | 0% | 1,678 | 2,350 | +40% | 0 | 0 | — |
case-21 | pass→pass | 8,014 | 5,524 | -31% | 1 | 1 | 0% | 1,775 | 2,241 | +26% | 0 | 0 | — |
case-22 | pass→pass | 13,034 | 6,986 | -46% | 1 | 1 | 0% | 2,544 | 2,420 | -5% | 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 +5 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.