fec-accessibility-chec…
Use when reviewing or improving frontend accessibility, semantic structure, keyboard support, focus management, ARIA labels, screen reader behavior, WCAG 2.2…
Use when choosing, implementing, reviewing, or refactoring frontend state ownership across React, Vue, Next.js, Nuxt, URL state, server state, form state, browser persistence, or global stores. Prefer narrower skills for TanStack Query cache details, browser storage persistence,
$ npx -y skills add bovinphang/frontend-craft --skill fec-state-management --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/fec-state-managementContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when choosing, implementing, reviewing, or refactoring frontend state ownership across React, Vue, Next.js, Nuxt, URL state, server state, form state, browser persistence, or global stores. Prefer narrower skills for TanStack Query cache details, browser storage persistence,
name: fec-state-management description: Use when choosing, implementing, reviewing, or refactoring frontend state ownership across React, Vue, Next.js, Nuxt, URL state, server state, form state, browser persistence, or global stores. Prefer narrower skills for TanStack Query cache details, browser storage persistence, or form validation internals; Chinese triggers include state management, state ownership, store selection.
Determine clear ownership of front-end state to avoid global store bloat, duplicate caching, and derived state synchronization errors.
Don't choose Redux, Zustand, Pinia or Context first. First mark each state to its unique owner, and then decide on the tool.
| Status Type | Typical Example | Default Attribution | | ---------------- | ------------------------------------ | ------------------------ | | Local UI state | Pop-up window switch, tab, expand row, hover editing state | In-component state / ref | | Form status | Input value, dirty field, validation error, submitting | Form library or form component | | Server status | List, details, paging results, remote errors | Request cache library | | URL status | Search terms, filter, sort, page number, selected tab | Routing parameters / search params | | Global client status | Login users, topics, permission snapshots, shopping cart drafts | Global store | | Browser persistent state | Drafts, preferences, offline queues retained across refreshes | Storage layer + state adapter |
type ReportsStateMap = {
search: "url";
selectedReportId: "url";
reports: "server-state-cache";
isFilterPanelOpen: "local-ui";
draftColumns: "browser-persistence";
};Do not save a new copy of a value that can be inferred from props, server state, URL, or existing state.
interface Invoice {
id: string;
status: "draft" | "sent" | "paid";
}
function InvoiceList({ invoices }: { invoices: Invoice[] }) {
const paidInvoices = invoices.filter((invoice) => invoice.status === "paid");
return <span>{paidInvoices.length}</span>;
}Priority is given to localization and combination in React; the global store is only introduced when cross-page, cross-feature or unified actions are required.
import { create } from "zustand";
interface WorkspaceState {
activeWorkspaceId: string | null;
setActiveWorkspaceId: (workspaceId: string) => void;
}
export const useWorkspaceStore = create<WorkspaceState>((set) => ({
activeWorkspaceId: null,
setActiveWorkspaceId: (activeWorkspaceId) => set({ activeWorkspaceId }),
}));Decision order:
1. Use only in one component or a small subtree: `useState` / `useReducer`. 2. Low-frequency global configuration or dependency injection: Context. 3. Moderately complex business status: Zustand or Jotai, priority will be given based on the existing selection of the warehouse. 4. Large applications, strict action flow, auditing or time travel debugging: Redux Toolkit. 5. Remote data: Use the data acquisition skill to manage query keys, cache and invalidation policies.
In Vue 3, use `provide/inject` for local cross-level transfer; use Pinia or the existing store of the project for global business status.
import { computed, readonly, ref } from "vue";
import { defineStore } from "pinia";
export const useSessionStore = defineStore("session", () => {
const userId = ref<string | null>(null);
const isSignedIn = computed(() => userId.value !== null);
function signIn(nextUserId: string) {
userId.value = nextUserId;
}
return {
userId: readonly(userId),
isSignedIn,
signIn,
};
});When reconstructing the state, first make a state list, and then gradually move the read and write entries. Each step should keep the behavior verifiable.
interface StateMigrationItem {
name: string;
currentOwner: "component" | "context" | "store" | "query-cache" | "url";
targetOwner: "component" | "context" | "store" | "query-cache" | "url";
verification: string;
}
const migrationPlan: StateMigrationItem[] = [
{
name: "dashboard filters",
currentOwner: "store",
targetOwner: "url",
verification: "refreshing the page preserves filters through search params",
},
];Load [references/state-patterns.md](references/state-patterns.md) when you need Store shape examples, selector patterns, URL state synchronization, persistence adapters, SSR boundaries, or review checklists.
Output status attribution list, selection reasons, store/API boundaries and verification steps. Key behaviors such as loading/error/empty, refresh, rollback, cross-routing, and permission changes should be retained during implementation.
frontend-craft is a universal frontend plugin that brings the same opinionated engineering standards to all 15 AI coding assistants.
Repo: bovinphang/frontend-craft
Use when reviewing or improving frontend accessibility, semantic structure, keyboard support, focus management, ARIA labels, screen reader behavior, WCAG 2.2…
Use when absorbing ideas, capabilities, workflows, architecture, quality systems, ecosystem extensions, or engineering practices from any reference system into…
Use when designing, implementing, or reviewing frontend-to-backend API integration, typed API clients, REST/tRPC/OpenAPI client choices, auth refresh, API…
Use when frontend work needs to communicate data, action, state, permission, validation, or business-rule needs to backend teams without dictating endpoint…
Use when choosing, implementing, or reviewing browser storage such as localStorage, sessionStorage, IndexedDB, cookies, client persistence, offline data,…
Use when building or reviewing Canvas 2D, Three.js/WebGL, React Three Fiber, GLSL shaders, ShaderToy-to-WebGL adaptation, 2D/3D visualization, game rendering,…