{
  "skill_name": "react-state-management",
  "evals": [
    {
      "id": 1,
      "prompt": "I need to share user authentication state across my entire React app. Which state management should I use?",
      "expected_output": "For auth state (low-frequency, global): Context API is appropriate — create AuthContext with user + logout function. For high-frequency global updates, prefer Zustand (no Provider boilerplate, minimal re-renders). For auth specifically, pair with React Query/SWR to handle the session fetch and cache.",
      "assertions": [
        { "type": "contains", "value": "Context" },
        { "type": "contains", "value": "Zustand" }
      ]
    },
    {
      "id": 2,
      "prompt": "I'm fetching user data in useEffect and storing it in useState. When I mutate it, the UI goes out of sync.",
      "expected_output": "Violation: No server cache as UI State. Use React Query or SWR for server data — they maintain cache consistency. Never sync server data into useState manually. useMutation from React Query handles optimistic updates and cache invalidation automatically. Delete the useEffect/useState pattern.",
      "assertions": [
        { "type": "contains", "value": "React Query" },
        { "type": "contains", "value": "cache" }
      ]
    },
    {
      "id": 3,
      "prompt": "My Redux store has 50 slices and managing the boilerplate is overwhelming the team.",
      "expected_output": "Consider migrating to Zustand for simpler apps or staying with Redux Toolkit (RTK) for large apps. RTK reduces Redux boilerplate significantly — use createSlice, createAsyncThunk, RTK Query. If switching: migrate slice by slice, not all at once. Zustand is better for small-medium apps without time-travel debugging needs.",
      "assertions": [
        { "type": "contains", "value": "Redux Toolkit" },
        { "type": "contains", "value": "Zustand" }
      ]
    }
  ],
  "should_not_trigger": [
    "Configure Redis pub/sub for real-time notifications",
    "Write a Go goroutine pool",
    "Set up a Kubernetes ingress controller"
  ]
}
