Frontend Review State logo

Frontend Review State

Community
mizchi
frontend-review-state

Use when reviewing state management architecture — classifying state types (server/URL/form/UI), checking for over-globalization, Jotai/Zustand/Redux patterns, derived state, and logout/cache invalidation. Covers checklist 23-state-management.md.

Overview

Publishermizchi
Repositoryskills
Skill namefrontend-review-state
Stars
333
Forks
4
Bundled files
Instructions only
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by mizchi on GitHub. Read the source before you install it.

Installation

Install the Frontend Review State AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/mizchi/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/frontend-review-state .claude/skills/frontend-review-state
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Frontend Review State in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Frontend Review State on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Frontend Review State is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Frontend Review — State Management

You are reviewing the state management architecture of a frontend project. The most common AI-generated problems are: putting everything in global state, storing server data in a global store instead of TanStack Query, and using coarse-grained selectors that cause the whole component tree to re-render.

Procedure

  1. Read package.json to identify the state management libraries in use.
  2. Grep for global state usage patterns:
    bash
    # Jotai
    grep -rn "atom\|useAtom\|useAtomValue" src/ --include='*.ts' --include='*.tsx' | wc -l
    # Zustand
    grep -rn "create\b\|useStore\b" src/ --include='*.ts' --include='*.tsx' | head -20
    # Redux
    grep -rn "createSlice\|useSelector\|useDispatch" src/ --include='*.ts' --include='*.tsx' | head -20
    # Context
    grep -rn "createContext\|useContext" src/ --include='*.ts' --include='*.tsx' | head -20
  3. Sample 3–5 of the largest atom / store definitions and assess what they contain.
  4. Check for server state stored in global store (should be TanStack Query / SWR instead).
  5. Check for URL state stored in global store (should be useSearchParams / nuqs).
  6. Check for form state stored in global store (should be React Hook Form).

State Classification

Correctly classify state by type. Each type has a dedicated tool — using the wrong tool is the root cause of most state management bugs.

Server state   → TanStack Query / SWR        (not global store)
URL state      → useSearchParams / nuqs      (not global store)
Form state     → React Hook Form             (not global store)
UI local       → useState / useReducer       (component-scoped)
UI global      → Jotai / Zustand / Context   (minimum scope)

Flag any server, URL, or form state found in a global Jotai/Zustand/Redux store. These are always bugs or design mistakes.

Library-Specific Checks

Jotai

  • Atom granularity: one atom per logical unit; no large object atoms ({ user, theme, notifications, ... }).
  • Derived state: use atom(get => ...) for computed values instead of storing redundant computed data.
  • Side effects: isolate in atomEffect / useAtomEffect, not in atom setter callbacks.
  • Testability: atoms declared at module top-level become global singletons — use Provider scoping in tests / Storybook.
ts
// Bad: monolithic atom
const appStateAtom = atom({ user: null, theme: 'light', selectedItems: [], filterQuery: '' });

// Good: split + derived
const userAtom = atom<User | null>(null);
const themeAtom = atom<'light' | 'dark'>('light');
const filteredItemsAtom = atom((get) =>
  get(allItemsAtom).filter(item => item.name.includes(get(filterQueryAtom)))
);

Zustand

  • Selector usage: useStore(state => state.specificField) — never subscribe to the entire store object.
  • Shallow compare: use shallow from zustand/shallow when selecting multiple fields as an object.
  • No direct mutation: always use set / get, never mutate state outside of Zustand's setter.
ts
// Bad: subscribes to everything
const { user, theme, cart } = useStore();

// Good: selector per field (or shallow for multi-field)
const user = useStore(state => state.user);
const { theme, cart } = useStore(useShallow(state => ({ theme: state.theme, cart: state.cart })));

Redux Toolkit

  • Is createSlice used (not hand-written reducers)?
  • Is async data fetched via createAsyncThunk or RTK Query, not manual dispatch chains?
  • Is server state in RTK Query / TanStack Query rather than a slice?

Context API

  • Context re-renders every Consumer when any value changes. If the context value is an object, split it into separate contexts per logical group (e.g., AuthContext, ThemeContext).
  • Context is suitable for stable, low-frequency values (auth user, theme, i18n locale).
  • Do not use Context as a general-purpose state manager for high-frequency updates.

Logout & Cache Invalidation

A common bug: after logout, the next user who logs in sees cached data from the previous session.

Check that the logout handler:

  1. Calls the server logout endpoint (session revocation)
  2. Clears TanStack Query / SWR cache (queryClient.clear())
  3. Resets all auth-related global atoms / Zustand stores
  4. Navigates to /login (after clearing, not before)

Output

Write <client-repo>/.frontend-review/report/latest/md/state-review.md with:

  • State inventory: which libraries are used, rough count of atoms/stores/contexts
  • Misclassified state: server/URL/form state found in global store (these are bugs)
  • Anti-patterns found: with file:line references
  • Logout/cache gap if found
  • Recommended PRs: each scoped to one logical refactor

Keep under 200 lines. File-level details stay in the raw search output, not in the report.

Boundaries

  • Do NOT rewrite state management code. The report identifies gaps; engineering implements fixes.
  • Do NOT touch source files in the client repo.
  • Rendering performance (re-renders, memo usage) is covered by frontend-review-performance.

Reference

  • Checklist: 23-state-management.md, 17-pure-io-separation.md, 21-api-layer.md
  • Related: frontend-review-performance (re-render profiling)

Frequently asked questions

What does the Frontend Review State AI skill do?

Use when reviewing state management architecture — classifying state types (server/URL/form/UI), checking for over-globalization, Jotai/Zustand/Redux patterns, derived state, and logout/cache invalidation. Covers checklist 23-state-management.md.

Why use Frontend Review State on TypingMind?

Because you install it once and use it with any model. Frontend Review State is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Frontend Review State in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/mizchi/skills/tree/main/frontend-review-state. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Frontend Review State?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Frontend Review State?

As many as you like. As long as a model supports skills, you can use Frontend Review State with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Frontend Review State AI skill free?

It is published on GitHub by mizchi. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇