Proactively choose the right state management pattern: derived state, URL state, server state, local state, lifted state, Context, or external store. Always apply without being asked.
84
76%
Does it follow best practices?
Impact
97%
1.16xAverage score across 5 eval scenarios
Passed
No known issues
{
"context": "Tests whether the agent proactively applies correct state management patterns when building a recipe app with search/filters, favorites (cross-cutting state), server data, and derived statistics. The task describes only business requirements -- the agent must choose the right state pattern for each concern without being told.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Search and filters in URL params",
"description": "Search query, cuisine filter, difficulty filter, sort order, and active tab use URL search params (useSearchParams or equivalent), NOT useState. Users can share or bookmark a filtered recipe URL and refresh without losing state.",
"max_score": 16
},
{
"name": "Filtered list and stats computed not stored",
"description": "The filtered/sorted recipe list, displayed count, average rating, and average total time are computed inline or with useMemo from the recipe data plus current filters, NOT stored in separate useState variables synced via useEffect.",
"max_score": 16
},
{
"name": "Total time computed not stored",
"description": "Each recipe's total time (prepTime + cookTime) is computed inline when rendering, NOT pre-calculated and stored in state.",
"max_score": 8
},
{
"name": "Favorites in Context with custom hook",
"description": "Favorites state is managed in React Context (cross-cutting, accessed from header, recipe cards, favorites tab, and potentially detail page) with a custom hook (useFavorites). This is appropriate because favorites are needed by many distant components and update infrequently.",
"max_score": 14
},
{
"name": "Context value memoized and hook has null guard",
"description": "The favorites Context value is memoized with useMemo, toggle/add/remove functions use useCallback, and the custom hook (useFavorites) checks for null and throws a descriptive error if used outside the Provider.",
"max_score": 12
},
{
"name": "Recipe data fetched in custom hooks not Context",
"description": "Recipe list and individual recipe data are fetched in custom hooks (useRecipes, useRecipe) or a data-fetching library, NOT stored in React Context or a global store.",
"max_score": 12
},
{
"name": "Fetch cleanup with AbortController",
"description": "Data-fetching useEffect hooks include AbortController or cancelled flag in cleanup to prevent stale responses.",
"max_score": 10
},
{
"name": "Favorite toggle UI state local",
"description": "Any animation or visual feedback state for the favorite toggle (e.g., heart animation) uses local useState in the card component, not in Context. The Context only stores the set of favorited IDs.",
"max_score": 6
},
{
"name": "Favorites count derived not stored",
"description": "The favorites count displayed in the header is derived from the favorites set/array length, NOT stored as a separate piece of state.",
"max_score": 6
}
]
}