Opik Frontend Patterns
comet-ml/opik
Sets the conventions for the Opik React frontend: TanStack Query for data, Zustand for shared state, one-way layer imports and a fix for Google Translate crashes.
A skill your agent uses when choosing state management solutions, implementing global stores (Zustand, Pinia), managing server state (TanStack Query), or handling URL state in frontend applications…
$ npx skills add MadAppGang/claude-code --skill state-management -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install MadAppGang/claude-code state-management --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/MadAppGang/claude-code.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/dev/skills/frontend/state-management .claude/skills/state-management && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "state-management" agent skill from https://github.com/MadAppGang/claude-code/tree/main/plugins/dev/skills/frontend/state-management into .claude/skills/state-management/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "state-management", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/MadAppGang/claude-code/tree/main/plugins/dev/skills/frontend/state-managementType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add MadAppGang/claude-code --skill state-management -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install MadAppGang/claude-code state-management --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/MadAppGang/claude-code.git skills-src && mkdir -p .agents/skills && cp -r skills-src/plugins/dev/skills/frontend/state-management .agents/skills/state-management && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "state-management" agent skill from https://github.com/MadAppGang/claude-code/tree/main/plugins/dev/skills/frontend/state-management into .agents/skills/state-management/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "state-management", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add MadAppGang/claude-code --skill state-management -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install MadAppGang/claude-code state-management --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/MadAppGang/claude-code.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/plugins/dev/skills/frontend/state-management .cursor/skills/state-management && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "state-management" agent skill from https://github.com/MadAppGang/claude-code/tree/main/plugins/dev/skills/frontend/state-management into .cursor/skills/state-management/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "state-management", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/MadAppGang/claude-code.git --path plugins/dev/skills/frontend/state-management--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add MadAppGang/claude-code --skill state-management -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install MadAppGang/claude-code state-management --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/MadAppGang/claude-code.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/plugins/dev/skills/frontend/state-management .gemini/skills/state-management && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "state-management" agent skill from https://github.com/MadAppGang/claude-code/tree/main/plugins/dev/skills/frontend/state-management into .gemini/skills/state-management/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "state-management", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install MadAppGang/claude-code state-managementInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add MadAppGang/claude-code --skill state-management -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/MadAppGang/claude-code.git skills-src && mkdir -p .github/skills && cp -r skills-src/plugins/dev/skills/frontend/state-management .github/skills/state-management && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "state-management" agent skill from https://github.com/MadAppGang/claude-code/tree/main/plugins/dev/skills/frontend/state-management into .github/skills/state-management/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "state-management", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add MadAppGang/claude-code --skill state-management -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install MadAppGang/claude-code state-management --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/MadAppGang/claude-code.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/plugins/dev/skills/frontend/state-management .opencode/skills/state-management && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "state-management" agent skill from https://github.com/MadAppGang/claude-code/tree/main/plugins/dev/skills/frontend/state-management into .opencode/skills/state-management/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "state-management", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
state-managementA skill your agent uses when choosing state management solutions, implementing global stores (Zustand, Pinia), managing server state (TanStack Query), or handling URL state in frontend applications…
State Management is an agent skill from MadAppGang/claude-code. Use when choosing state management solutions, implementing global stores (Zustand, Pinia), managing server state (TanStack Query), or handling URL state in frontend applications across React and Vue.
Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Frontend & Design, covering State management. It works with TanStack, Zustand, Vue.js and React. The repository describes itself as: claude code plugins marketplace. The licence is MIT.
8 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 6097ad4. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
State Management loads about 2.6k tokens when it runs. Until then it costs about 54 tokens; SKILL.md has 190 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from MadAppGang/claude-code at commit 6097ad4, republished under its MIT licence (© MadAppGang). 190 words, ~2,580 tokens.
.claude/skills/state-management/SKILL.md (or your agent's skills folder).Patterns and best practices for managing state in frontend applications across different frameworks.
| Type | Scope | Examples | Solution |
|---|---|---|---|
| Local UI | Single component | Form inputs, modals, dropdowns | useState, ref |
| Shared UI | Component subtree | Theme, sidebar state | Context, provide/inject |
| Server | Cached API data | Users, products, orders | TanStack Query, SWR |
| Global App | Entire app | Auth, settings, notifications | Zustand, Pinia, Redux |
| URL | Browser URL | Filters, pagination, search | Router params/query |
┌─────────────────────────────────────────────────────────┐
│ Does only this component need it? │
│ YES → Local state (useState/ref) │
│ NO ↓ │
├─────────────────────────────────────────────────────────┤
│ Is it server data that needs caching/sync? │
│ YES → Server state library (TanStack Query) │
│ NO ↓ │
├─────────────────────────────────────────────────────────┤
│ Is it in the URL (shareable state)? │
│ YES → URL state (router) │
│ NO ↓ │
├─────────────────────────────────────────────────────────┤
│ Is it needed across unrelated components? │
│ YES → Global store (Zustand/Pinia) │
│ NO → Lift state up or Context │
└─────────────────────────────────────────────────────────┘// Define query
function useUsers(filters: UserFilters) {
return useQuery({
queryKey: ['users', filters],
queryFn: () => api.getUsers(filters),
staleTime: 5 * 60 * 1000, // 5 minutes
gcTime: 30 * 60 * 1000, // 30 minutes
});
}
// Use in component
function UserList() {
const [filters, setFilters] = useState<UserFilters>({});
const { data, isLoading, error } = useUsers(filters);
if (isLoading) return <Spinner />;
if (error) return <Error message={error.message} />;
return <List items={data} />;
}function useCreateUser() {
const queryClient = useQueryClient();
return useMutation({
mutationFn: (data: CreateUserInput) => api.createUser(data),
onSuccess: () => {
// Invalidate and refetch
queryClient.invalidateQueries({ queryKey: ['users'] });
},
});
}
// Usage
const createUser = useCreateUser();
await createUser.mutateAsync({ name: 'John', email: 'john@example.com' });function useUpdateUser() {
const queryClient = useQueryClient();
return useMutation({
mutationFn: (data: UpdateUserInput) => api.updateUser(data),
onMutate: async (newData) => {
// Cancel outgoing refetches
await queryClient.cancelQueries({ queryKey: ['user', newData.id] });
// Snapshot previous value
const previous = queryClient.getQueryData(['user', newData.id]);
// Optimistically update
queryClient.setQueryData(['user', newData.id], (old: User) => ({
...old,
...newData,
}));
return { previous };
},
onError: (err, newData, context) => {
// Rollback on error
queryClient.setQueryData(['user', newData.id], context?.previous);
},
onSettled: () => {
queryClient.invalidateQueries({ queryKey: ['users'] });
},
});
}interface AppStore {
// State
theme: 'light' | 'dark';
sidebarOpen: boolean;
notifications: Notification[];
// Actions
setTheme: (theme: 'light' | 'dark') => void;
toggleSidebar: () => void;
addNotification: (notification: Notification) => void;
removeNotification: (id: string) => void;
}
export const useAppStore = create<AppStore>((set) => ({
theme: 'light',
sidebarOpen: true,
notifications: [],
setTheme: (theme) => set({ theme }),
toggleSidebar: () => set((state) => ({ sidebarOpen: !state.sidebarOpen })),
addNotification: (notification) =>
set((state) => ({
notifications: [...state.notifications, notification],
})),
removeNotification: (id) =>
set((state) => ({
notifications: state.notifications.filter((n) => n.id !== id),
})),
}));// BAD: Re-renders on any store change
const { theme, notifications } = useAppStore();
// GOOD: Only re-renders when theme changes
const theme = useAppStore((state) => state.theme);
// GOOD: Multiple selectors with shallow comparison
const { theme, sidebarOpen } = useAppStore(
(state) => ({ theme: state.theme, sidebarOpen: state.sidebarOpen }),
shallow
);const useAppStore = create<AppStore>((set, get) => ({
notifications: [],
// Derived state as selector
unreadCount: () => get().notifications.filter((n) => !n.read).length,
// Or compute in selector
}));
// Usage with computed
const unreadCount = useAppStore((state) =>
state.notifications.filter((n) => !n.read).length
);export const useAppStore = defineStore('app', () => {
// State
const theme = ref<'light' | 'dark'>('light');
const sidebarOpen = ref(true);
const notifications = ref<Notification[]>([]);
// Getters (computed)
const unreadCount = computed(() =>
notifications.value.filter((n) => !n.read).length
);
// Actions
function setTheme(newTheme: 'light' | 'dark') {
theme.value = newTheme;
}
function toggleSidebar() {
sidebarOpen.value = !sidebarOpen.value;
}
return {
theme,
sidebarOpen,
notifications,
unreadCount,
setTheme,
toggleSidebar,
};
});// React with react-router
function useSearchParams() {
const [searchParams, setSearchParams] = useSearchParams();
const filters = useMemo(
() => ({
page: parseInt(searchParams.get('page') || '1'),
search: searchParams.get('search') || '',
sort: searchParams.get('sort') || 'name',
}),
[searchParams]
);
const setFilters = (newFilters: Partial<typeof filters>) => {
setSearchParams((prev) => {
Object.entries(newFilters).forEach(([key, value]) => {
if (value) prev.set(key, String(value));
else prev.delete(key);
});
return prev;
});
};
return [filters, setFilters] as const;
}Keep state as close to where it's used as possible.
// BAD: Global state for local concern
const useGlobalStore = create(() => ({
isModalOpen: false,
toggleModal: () => {},
}));
// GOOD: Local state for local concern
function UserProfile() {
const [isModalOpen, setModalOpen] = useState(false);
}Don't duplicate state across stores.
// BAD: Duplicated user in multiple places
const authStore = { user: { id: 1, name: 'John' } };
const profileStore = { user: { id: 1, name: 'John' } }; // Duplicated!
// GOOD: Reference by ID
const authStore = { userId: 1 };
const usersCache = { 1: { id: 1, name: 'John' } };Compute derived data instead of storing it.
// BAD: Storing derived state
const store = {
items: [],
itemCount: 0, // Derived!
filteredItems: [], // Derived!
totalPrice: 0, // Derived!
};
// GOOD: Compute on demand
const store = {
items: [],
};
// Compute when needed
const itemCount = items.length;
const filteredItems = items.filter(predicate);
const totalPrice = items.reduce((sum, i) => sum + i.price, 0);// BAD: Nested data
const store = {
orders: [
{
id: 1,
user: { id: 1, name: 'John' },
items: [{ id: 1, product: { id: 1, name: 'Widget' } }],
},
],
};
// GOOD: Normalized
const store = {
orders: { 1: { id: 1, userId: 1, itemIds: [1] } },
users: { 1: { id: 1, name: 'John' } },
items: { 1: { id: 1, productId: 1, orderId: 1 } },
products: { 1: { id: 1, name: 'Widget' } },
};interface AsyncState<T> {
data: T | null;
loading: boolean;
error: Error | null;
}
// Always handle all three states
function UserList({ state }: { state: AsyncState<User[]> }) {
if (state.loading) return <Spinner />;
if (state.error) return <Error error={state.error} />;
if (!state.data?.length) return <Empty />;
return <List items={state.data} />;
}// BAD: Passing through many levels
<App theme={theme}>
<Layout theme={theme}>
<Sidebar theme={theme}>
<MenuItem theme={theme} /> // 4 levels deep!
</Sidebar>
</Layout>
</App>
// GOOD: Context or store
const theme = useTheme(); // Access anywhere// BAD: Manual cache management
const store = {
users: [],
fetchUsers: async () => {
const users = await api.getUsers();
set({ users });
},
};
// GOOD: Use server state library
const { data: users } = useQuery(['users'], api.getUsers);// BAD: Direct mutation
state.users.push(newUser);
state.users[0].name = 'Updated';
// GOOD: Immutable updates
set({ users: [...state.users, newUser] });
set({
users: state.users.map((u) =>
u.id === id ? { ...u, name: 'Updated' } : u
),
});State management patterns for frontend applications
© MadAppGang, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in plugins/dev/skills/frontend/state-management of MadAppGang/claude-code.
Open the folder on GitHubat commit 6097ad4
State Management next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| State Management this skillMadAppGang/claude-code | 285 | — | ~2.6k | Automated safety check: Pass | MIT | |
| Opik Frontend Patternscomet-ml/opik | 22k | — | ~1.1k | Automated safety check: Pass | Apache-2.0 | |
| Tanstack Querybskimball/tanstack-hono | 119 | 1 repos | ~5.4k | Automated safety check: Pass | MIT | |
| State Managementemanueleielo/deepagents-open-lovable | 111 | — | ~1.7k | Automated safety check: Pass | None | |
| React ExpertJeffallan/claude-skills | 12k | — | ~1.4k | Automated safety check: Pass | MIT | |
| React Webalinaqi/maggy | 707 | — | ~3.6k | Automated safety check: Pass | MIT |
comet-ml/opik
Sets the conventions for the Opik React frontend: TanStack Query for data, Zustand for shared state, one-way layer imports and a fix for Google Translate crashes.
bskimball/tanstack-hono
Powerful asynchronous state management, server-state utilities, and data fetching for TS/JS, React, Vue, Solid, Svelte & Angular.
emanueleielo/deepagents-open-lovable
State management patterns - Zustand, Jotai, Context. An agent skill from emanueleielo/deepagents-open-lovable.
Jeffallan/claude-skills
Builds React 19 components in TypeScript with Server Components, useActionState forms, custom hooks and state libraries, checked with tsc and React Testing Library.
alinaqi/maggy
React web development with hooks, React Query, Zustand. An agent skill from alinaqi/maggy.
cohen-liel/hivemind
Frontend state management patterns for React apps. An agent skill from cohen-liel/hivemind.
MadAppGang/claude-code
Content brief template and creation methodology for SEO-optimized content.
MadAppGang/claude-code
A skill your agent uses when detecting project technology stack from files/configs/directory structure, auto-loading framework-specific skills, or analyzing multi-stack fullstack projects (e.g…
MadAppGang/claude-code
On-page SEO optimization techniques including keyword density, meta tags, heading structure, and readability.
MadAppGang/claude-code
Techniques for expanding seed keywords and clustering by topic and intent.
MadAppGang/claude-code
SERP analysis techniques for intent classification, feature identification, and competitive intelligence.
MadAppGang/claude-code
A skill your agent uses when deciding whether to launch an agent, selecting which agent to use, or coordinating multiple agents.
Categories
A skill your agent uses when choosing state management solutions, implementing global stores (Zustand, Pinia), managing server state (TanStack Query), or handling URL state in frontend applications…. State Management is an agent skill from MadAppGang/claude-code. Use when choosing state management solutions, implementing global stores (Zustand, Pinia), managing server state (TanStack Query), or handling URL state in frontend applications across React and Vue.
State Management fits situations like: choosing state management solutions; implementing global stores (Zustand; managing server state (TanStack Query); handling URL state in frontend applications across React and Vue.
Run `npx skills add MadAppGang/claude-code --skill state-management -a claude-code`. Or copy the skill folder (plugins/dev/skills/frontend/state-management in MadAppGang/claude-code) into .claude/skills/state-management in your project. Claude Code loads it when a task matches its description.
Run `npx skills add MadAppGang/claude-code --skill state-management -a codex`. Or copy the skill folder (plugins/dev/skills/frontend/state-management in MadAppGang/claude-code) into .agents/skills/state-management in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add MadAppGang/claude-code --skill state-management -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/state-management, .gemini/skills/state-management, .github/skills/state-management and .opencode/skills/state-management in your project.
SKILL.md names no scripts, command-line tools or credentials: State Management is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
State Management is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with State Management: Opik Frontend Patterns (comet-ml/opik, 22k stars), Tanstack Query (bskimball/tanstack-hono, 119 stars), State Management (emanueleielo/deepagents-open-lovable, 111 stars) and React Expert (Jeffallan/claude-skills, 12k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
MadAppGang (a GitHub organization) maintains it in MadAppGang/claude-code, which has 285 GitHub stars. The repository holds 69 skills in this directory. The repository was last updated on March 15, 2026.
Source: MadAppGang/claude-code on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.