[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79TK4XYX4YBSATBCK3D4GTF":3,"skill-same:01M79TK4XYX4YBSATBCK3D4GTF":53},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":32,"commitSha":33,"skillDirectory":34,"forksCount":14,"repositoryHtmlUrl":35,"repositoryHomepageUrl":6,"ownerHtmlUrl":36,"ownerBlogUrl":6,"ownerDescription":37,"updatedAt":38,"install":39,"resources":52},"01M79TK4XYX4YBSATBCK3D4GTF","react-state-management-architect",null,"Architect-level state strategy for React apps — deciding between local, lifted, URL, server-cache and global state, and choosing among TanStack Query, SWR, Zustand, Redux Toolkit, Jotai and Context. Use when state is being duplicated, synced by effects, or when adding a store is on the table.","SriAkhilSJ\u002FPulseAIRepo","SriAkhilSJ","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F206201543?v=4","01M79RWFD1Q09B89SXTTKKJY6Z","Sri Akhil SJ","01M79RWFE26NPG0BZ1FRNX376H",0,"MIT","https:\u002F\u002Fgithub.com\u002FSriAkhilSJ\u002FPulseAIRepo\u002Fblob\u002Fmain\u002Fskills\u002Fwebsite-architect\u002Ffrontend-development-architect\u002Freact-architect\u002Freact-state-management-architect\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: react-state-management-architect\ndescription: Architect-level state strategy for React apps — deciding between local, lifted, URL, server-cache and global state, and choosing among TanStack Query, SWR, Zustand, Redux Toolkit, Jotai and Context. Use when state is being duplicated, synced by effects, or when adding a store is on the table.\nlicense: MIT\ncompatibility: React 18+; framework-agnostic\nmetadata:\n  crusor-domain: website-architect\n  crusor-path: website-architect\u002Ffrontend-development-architect\u002Freact-architect\u002Freact-state-management-architect\n  crusor-origin: original\n  crusor-sources: \"react.dev\u002Flearn\u002Fmanaging-state; tanstack.com\u002Fquery; zustand docs; redux-toolkit docs; vercel-labs\u002Fagent-skills@063bee94 (react-best-practices)\"\n  crusor-verified-on: \"2026-10-30\"\n  crusor-triggers: \"react state, client state, state ownership, zustand, jotai, context vs store, url state, app state, server state ownership\"\n---\n\n# React State Management (decision skill)\n\nThere is no \"React state library\" problem. There are **five kinds of state**, and\nmost architecture failures come from putting one kind in another kind's home.\n\n## When to use\n\n- Before adding any store, context or query client.\n- When a value needs `useEffect` to stay in sync with another value.\n- When two screens disagree about the same entity.\n- When the team cannot answer \"who owns this state?\"\n\n## When NOT to use\n\n- A value used by one component: it is `useState`, decision over.\n- A styling or rendering change with no new state.\n\n## Decision 1 — The five homes\n\n| Kind | What it is | Home |\n|---|---|---|\n| Local UI | open\u002Fclosed, hover, draft text | `useState` in the owning component |\n| Lifted | shared by siblings | nearest common parent |\n| URL | filters, tab, page, selected id, query | router search params |\n| Server | anything the backend is the source of truth for | TanStack Query \u002F SWR \u002F RSC |\n| Global client | cross-feature, session-lifetime UI or drafts | Zustand \u002F Redux Toolkit \u002F Jotai |\n\nDecision rule: **server data is a cache, not state.** If the server owns it, a\nclient store must not also own it.\n\n## Decision 2 — Choosing the library\n\n| Need | Use | Why not the others |\n|---|---|---|\n| Server data, caching, revalidation | **TanStack Query** (or SWR if minimal) | a global store gives you no invalidation, dedupe or staleness model |\n| Small global client state, minimal ceremony | **Zustand** | Redux's ceremony buys nothing at this size |\n| Large app, devtools\u002Faudit, event-sourced updates | **Redux Toolkit** | Zustand gives no action log or enforced reducer boundaries |\n| Many independent atoms, fine-grained subscriptions | **Jotai** | one big store over-renders or needs manual selector discipline |\n| Values that rarely change (theme, locale, auth user) | **Context** | context re-renders every consumer on change |\n\nTwo libraries maximum. A codebase with a query client, a store *and* a context\nholding the same entity has three sources of truth and zero owners.\n\n## Decision 3 — Boundaries\n\n- **Query owns the entity lifecycle** (fetch, cache, invalidate). Components read\n  from the query cache; mutations invalidate tags\u002Fkeys.\n- **Store owns client-only facts**: selected rows, unsaved draft, panel layout,\n  wizard step. It must be serialisable and must not contain server payloads.\n- **URL owns anything shareable** — if refreshing should preserve it, it belongs\n  in the URL, not the store.\n- **Context owns dependency injection** (theme, i18n, client instances), not\n  application data.\n\n## Rules that prevent the usual rewrite\n\n1. **Derive, don't sync.** If B is computed from A, compute it during render.\n   `useEffect` mirroring is the signature of a missing derivation.\n2. **One writer per fact.** A fact written by two layers will eventually\n   disagree.\n3. **No fetching in components when a query hook exists.** Otherwise you get\n   duplicate requests and per-component loading states.\n4. **Select narrowly.** Subscribe to the field, not the object; shallow-compare\n   only when the shape is truly stable.\n5. **Normalise only when there is a real need** (same entity in several views,\n   or updates that must propagate). Otherwise keep server data in the query\n   cache untouched.\n6. **Store shape is part of the public contract.** Renaming a slice is a\n   migration, not a refactor.\n\n## Failure modes\n\n- Query cache + Zustand + local state holding the same list — three copies, one\n  refresh path, guaranteed drift.\n- A global store created for a modal's open flag.\n- Context provider at the root holding a rapidly changing value; every consumer\n  re-renders on every keystroke.\n- Optimistic update with no rollback path.\n- Storing derived booleans (`isValid`, `hasChanges`) instead of the inputs.\n\n## Anti-patterns\n\n- `useEffect(() => setLocal(serverValue), [serverValue])`.\n- `useState` + `useEffect` fetch in a codebase that already has a query client.\n- Redux for a form; the form library already owns that state.\n- Passing setters four levels down instead of lifting, or lifting when the\n  value belongs in the URL.\n- A store whose actions call `fetch` directly, bypassing the cache layer.\n\n## Verification receipts\n\n1. A refresh of the page preserves everything that lives in the URL.\n2. A mutation invalidates and refetches exactly the affected query keys (log the\n   keys, do not assume).\n3. Render-count check: typing in an input does not re-render unrelated screens.\n4. Devtools\u002Fstate dump shows one copy of each entity.\n5. Tests: the query hook's loading\u002Ferror\u002Fempty paths, not just success.\n","# React State Management (decision skill)\n\nThere is no \"React state library\" problem. There are **five kinds of state**, and\nmost architecture failures come from putting one kind in another kind's home.\n\n## When to use\n\n- Before adding any store, context or query client.\n- When a value needs `useEffect` to stay in sync with another value.\n- When two screens disagree about the same entity.\n- When the team cannot answer \"who owns this state?\"\n\n## When NOT to use\n\n- A value used by one component: it is `useState`, decision over.\n- A styling or rendering change with no new state.\n\n## Decision 1 — The five homes\n\n| Kind | What it is | Home |\n|---|---|---|\n| Local UI | open\u002Fclosed, hover, draft text | `useState` in the owning component |\n| Lifted | shared by siblings | nearest common parent |\n| URL | filters, tab, page, selected id, query | router search params |\n| Server | anything the backend is the source of truth for | TanStack Query \u002F SWR \u002F RSC |\n| Global client | cross-feature, session-lifetime UI or drafts | Zustand \u002F Redux Toolkit \u002F Jotai |\n\nDecision rule: **server data is a cache, not state.** If the server owns it, a\nclient store must not also own it.\n\n## Decision 2 — Choosing the library\n\n| Need | Use | Why not the others |\n|---|---|---|\n| Server data, caching, revalidation | **TanStack Query** (or SWR if minimal) | a global store gives you no invalidation, dedupe or staleness model |\n| Small global client state, minimal ceremony | **Zustand** | Redux's ceremony buys nothing at this size |\n| Large app, devtools\u002Faudit, event-sourced updates | **Redux Toolkit** | Zustand gives no action log or enforced reducer boundaries |\n| Many independent atoms, fine-grained subscriptions | **Jotai** | one big store over-renders or needs manual selector discipline |\n| Values that rarely change (theme, locale, auth user) | **Context** | context re-renders every consumer on change |\n\nTwo libraries maximum. A codebase with a query client, a store *and* a context\nholding the same entity has three sources of truth and zero owners.\n\n## Decision 3 — Boundaries\n\n- **Query owns the entity lifecycle** (fetch, cache, invalidate). Components read\n  from the query cache; mutations invalidate tags\u002Fkeys.\n- **Store owns client-only facts**: selected rows, unsaved draft, panel layout,\n  wizard step. It must be serialisable and must not contain server payloads.\n- **URL owns anything shareable** — if refreshing should preserve it, it belongs\n  in the URL, not the store.\n- **Context owns dependency injection** (theme, i18n, client instances), not\n  application data.\n\n## Rules that prevent the usual rewrite\n\n1. **Derive, don't sync.** If B is computed from A, compute it during render.\n   `useEffect` mirroring is the signature of a missing derivation.\n2. **One writer per fact.** A fact written by two layers will eventually\n   disagree.\n3. **No fetching in components when a query hook exists.** Otherwise you get\n   duplicate requests and per-component loading states.\n4. **Select narrowly.** Subscribe to the field, not the object; shallow-compare\n   only when the shape is truly stable.\n5. **Normalise only when there is a real need** (same entity in several views,\n   or updates that must propagate). Otherwise keep server data in the query\n   cache untouched.\n6. **Store shape is part of the public contract.** Renaming a slice is a\n   migration, not a refactor.\n\n## Failure modes\n\n- Query cache + Zustand + local state holding the same list — three copies, one\n  refresh path, guaranteed drift.\n- A global store created for a modal's open flag.\n- Context provider at the root holding a rapidly changing value; every consumer\n  re-renders on every keystroke.\n- Optimistic update with no rollback path.\n- Storing derived booleans (`isValid`, `hasChanges`) instead of the inputs.\n\n## Anti-patterns\n\n- `useEffect(() => setLocal(serverValue), [serverValue])`.\n- `useState` + `useEffect` fetch in a codebase that already has a query client.\n- Redux for a form; the form library already owns that state.\n- Passing setters four levels down instead of lifting, or lifting when the\n  value belongs in the URL.\n- A store whose actions call `fetch` directly, bypassing the cache layer.\n\n## Verification receipts\n\n1. A refresh of the page preserves everything that lives in the URL.\n2. A mutation invalidates and refetches exactly the affected query keys (log the\n   keys, do not assume).\n3. Render-count check: typing in an input does not re-render unrelated screens.\n4. Devtools\u002Fstate dump shows one copy of each entity.\n5. Tests: the query hook's loading\u002Ferror\u002Fempty paths, not just success.\n",{"name":5,"license":15,"metadata":24,"description":7,"compatibility":31},{"crusor-path":25,"crusor-domain":26,"crusor-origin":27,"crusor-sources":28,"crusor-triggers":29,"crusor-verified-on":30},"website-architect\u002Ffrontend-development-architect\u002Freact-architect\u002Freact-state-management-architect","website-architect","original","react.dev\u002Flearn\u002Fmanaging-state; tanstack.com\u002Fquery; zustand docs; redux-toolkit docs; vercel-labs\u002Fagent-skills@063bee94 (react-best-practices)","react state, client state, state ownership, zustand, jotai, context vs store, url state, app state, server state ownership","2026-10-30","React 18+; framework-agnostic","main","8fa4e240be65b98472c9b2d3a505ade2aea1a5c6","skills\u002Fwebsite-architect\u002Ffrontend-development-architect\u002Freact-architect\u002Freact-state-management-architect","https:\u002F\u002Fgithub.com\u002FSriAkhilSJ\u002FPulseAIRepo","https:\u002F\u002Fgithub.com\u002FSriAkhilSJ","Studying in CMR institute of Technology\r\n2024 - 2028","2026-11-13 21:02:23",{"source":8,"skillName":5,"commands":40,"prompt":50,"zipAvailable":51},[41,44,47],{"tool":42,"command":43},"npx","npx skills add SriAkhilSJ\u002FPulseAIRepo --skill react-state-management-architect",{"tool":45,"command":46},"bunx","bunx skills add SriAkhilSJ\u002FPulseAIRepo --skill react-state-management-architect",{"tool":48,"command":49},"pnpm","pnpm dlx skills add SriAkhilSJ\u002FPulseAIRepo --skill react-state-management-architect","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSriAkhilSJ\u002FPulseAIRepo\u002Fblob\u002Fmain\u002Fskills\u002Fwebsite-architect\u002Ffrontend-development-architect\u002Freact-architect\u002Freact-state-management-architect\u002FSKILL.md",true,[],[54,61,68,75,82,89],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M79TTAJNACCNXCEN3649CMMD","interaction-patterns-architect","Architect-level interaction design in code — choosing established patterns over invented ones, feedback and latency behaviour, destructive-action safeguards, navigation and overlay conventions, and the state model behind every interactive surface. Use when a screen has to behave, not just look.","https:\u002F\u002Fgithub.com\u002FSriAkhilSJ\u002FPulseAIRepo\u002Fblob\u002Fmain\u002Fskills\u002Fwebsite-architect\u002Fui-ux-implementation-architect\u002Finteraction-patterns-architect\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M79TT2ESKB1TKZBYY9KYJHV9","design-system-ops-architect","Architect-level operation of a design system in code — token pipelines and versioning, component API and variant policy, the catalogue as the contract, adoption metrics, and the governance that stops a system from forking into three. Use when a component library must survive several teams.","https:\u002F\u002Fgithub.com\u002FSriAkhilSJ\u002FPulseAIRepo\u002Fblob\u002Fmain\u002Fskills\u002Fwebsite-architect\u002Fui-ux-implementation-architect\u002Fdesign-system-ops-architect\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M79TSV0PWGNK3PRX9P4JDR9N","design-handoff-architect","Architect-level design handoff — what must be specified before implementation starts, tokens over raw values, responsive and content-limit contracts, state matrices, and the review loop that catches drift between design and code. Use when a design is about to become code.","https:\u002F\u002Fgithub.com\u002FSriAkhilSJ\u002FPulseAIRepo\u002Fblob\u002Fmain\u002Fskills\u002Fwebsite-architect\u002Fui-ux-implementation-architect\u002Fdesign-handoff-architect\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M79TSJS9BFXNP696FMJ9GKDA","content-microcopy-architect","Architect-level UI content — where strings live, voice and terminology consistency, error and empty-state copy as part of the interface, translation-ready authoring, and the content model a product needs before it multiplies screens. Use when the words in the interface matter as much as the pixels.","https:\u002F\u002Fgithub.com\u002FSriAkhilSJ\u002FPulseAIRepo\u002Fblob\u002Fmain\u002Fskills\u002Fwebsite-architect\u002Fui-ux-implementation-architect\u002Fcontent-microcopy-architect\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M79TSCNBST3N1M68V1KPH9HQ","ui-ux-implementation-architect","Architect-level direction for turning a design into working UI — the handoff contract, component ownership versus screen-level layout, interaction and state conventions, design QA gates, and the review habits that keep an implementation faithful without frozen pixels. Use before any specific UI implementation skill.","https:\u002F\u002Fgithub.com\u002FSriAkhilSJ\u002FPulseAIRepo\u002Fblob\u002Fmain\u002Fskills\u002Fwebsite-architect\u002Fui-ux-implementation-architect\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M79TS4N6A4D2QQ433VXS5D0R","test-strategy-architect","Architect-level test strategy — allocating assertions across unit, integration, contract and end-to-end layers, designing for testability through dependency boundaries, fixture and data strategy, and the flake and coverage policies that keep a suite trustworthy. Use when defining how a codebase is tested.","https:\u002F\u002Fgithub.com\u002FSriAkhilSJ\u002FPulseAIRepo\u002Fblob\u002Fmain\u002Fskills\u002Fwebsite-architect\u002Ftesting-and-deployment-architect\u002Ftest-strategy-architect\u002FSKILL.md",[],[]]