CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/frontend-state-management

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

1.16x
Quality

76%

Does it follow best practices?

Impact

97%

1.16x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

criteria.jsonevals/scenario-3/

{
  "context": "Tests whether the agent proactively applies correct state management patterns when building a dashboard with filters, server data, and derived statistics. The task describes only business requirements -- the agent must choose URL params for filters, custom hooks for data fetching, and inline computation for derived values without being told.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Filters stored in URL search params",
      "description": "All filter state (date range, category, region, sort order) uses useSearchParams or equivalent URL-based state, NOT useState. The filters must survive a page refresh and produce a shareable URL.",
      "max_score": 18
    },
    {
      "name": "Summary values computed not stored",
      "description": "Total revenue, average order value, and order count are computed inline or with useMemo from the filtered sales data, NOT stored in separate useState variables. There is no useEffect that reads sales data and calls setState for these aggregates.",
      "max_score": 18
    },
    {
      "name": "Server data fetched in custom hook",
      "description": "Sales data is fetched in a custom hook (useSalesData or similar) or via a data-fetching library, NOT stored in React Context or a global store. The hook manages loading, error, and data states.",
      "max_score": 16
    },
    {
      "name": "Fetch cleanup with AbortController",
      "description": "The data-fetching useEffect includes an AbortController or cancelled flag in its cleanup function to prevent stale responses from overwriting fresh data on unmount or re-fetch.",
      "max_score": 14
    },
    {
      "name": "Filtered list computed not stored",
      "description": "The filtered and sorted list of sales records is derived from the full data plus the current filter/sort values using inline computation or useMemo, NOT stored in a separate useState that is synced via useEffect.",
      "max_score": 14
    },
    {
      "name": "Local UI state colocated",
      "description": "Any local UI state (dropdown open/close, tooltip visibility, modal visibility) uses useState in the owning component, not in a global store or Context.",
      "max_score": 10
    },
    {
      "name": "Loading and error states handled",
      "description": "The dashboard renders distinct loading UI while fetching and an error message when the fetch fails, rather than showing empty or broken state.",
      "max_score": 10
    }
  ]
}

evals

tile.json