Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add AsyrafHussin/agent-skills --skill state-managementgit clone --depth 1 https://github.com/AsyrafHussin/agent-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/asyrafhussin/agent-skills/state-management)<a href="https://agentmods.dev/skills/asyrafhussin/agent-skills/state-management"><img src="https://agentmods.dev/badge/skills/asyrafhussin/agent-skills/state-management/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/asyrafhussin/agent-skills/state-management"><img src="https://agentmods.dev/badge/skills/asyrafhussin/agent-skills/state-management.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- Socket pass
- Snyk pass
- NVIDIA SkillSpector warn
SkillSpector: 2 findings, up to medium
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- medium Rogue Agent · line 78 Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
- medium Excessive Agency · line 448 Skill allows unbounded resource consumption (API calls, storage, compute). Without rate limits or quotas, a compromised or misbehaving agent can cause denial-of-service or cost overruns.Fix: Set explicit rate limits, timeouts, and resource quotas for API calls, file operations, and compute. Implement circuit breakers for runaway loops.
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00047 | $0.03204 |
| Opus 5 | $0.00023 | $0.01602 |
| Sonnet 5 | $0.00009 | $0.00641 |
| Haiku 4.5 | $0.00005 | $0.00320 |
Grade A, and why
state-management scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 465 lines — stays where its author put it; the contents beside it link to each section on GitHub.
State Management with React Query + Zustand
Version 1.1.0 | TanStack Query v5 | Zustand v5 | March 2026
Note: This document provides comprehensive patterns for AI agents and LLMs working with TanStack Query v5 and Zustand v5. All examples are verified against v5 APIs. Optimized for automated refactoring, code generation, and state management best practices.
v5 Breaking Changes (Quick Reference)
TanStack Query v5:
cacheTime→gcTimekeepPreviousDataoption →placeholderData: keepPreviousData(imported helper)isPreviousData→isPlaceholderDataonSuccess/onError/onSettledremoved fromuseQuery— still valid onuseMutationsuspense: trueonuseQueryremoved → useuseSuspenseQuery
Zustand v5:
shallowas 2nd arg removed →useShallowfromzustand/shallow- Selectors returning new references need
useShallowto avoid infinite loops
Security: Persist Middleware
Never persist auth tokens, passwords, or secrets to localStorage/sessionStorage. Use
partializeto persist only non-sensitive state. Manage tokens via HttpOnly cookies.
Comprehensive patterns for server state (React Query) and client state (Zustand). Contains 26+ rules for efficient data fetching and state management.
When to Apply
Reference these guidelines when:
- Fetching data from APIs
- Managing server state and caching
- Handling mutations and optimistic updates
- Creating client-side stores
- Combining React Query with Zustand
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | React Query Basics | CRITICAL | rq- |
| 2 | Zustand Store Patterns | CRITICAL | zs- |
| 3 | Caching & Invalidation | HIGH | cache- |
| 4 | Mutations & Updates | HIGH | mut- |
| 5 | Optimistic Updates | MEDIUM | opt- |
| 6 | DevTools & Debugging | MEDIUM | dev- |
| 7 | Advanced Patterns | LOW | adv- |
Quick Reference
1. React Query Basics (CRITICAL)
What ships with it
31 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- AGENTS.md 15 KB
- metadata.json 2.9 KB
- README.md 3.4 KB
- rules/_sections.md 4.7 KB
- rules/_template.md 2.4 KB
- rules/rq-cache-time.md 3.8 KB
- rules/rq-dependent-queries.md 6.4 KB
- rules/rq-enabled-option.md 4.5 KB
- rules/rq-infinite-queries.md 6.4 KB
- rules/rq-initial-data.md 5.5 KB
- rules/rq-mutation-callbacks.md 5.6 KB
- rules/rq-mutation-setup.md 4.7 KB
- rules/rq-mutation-side-effects.md 6.9 KB
- rules/rq-mutation-variables.md 5.7 KB
- rules/rq-optimistic-updates.md 6.4 KB
- rules/rq-paginated-queries.md 6.7 KB
- rules/rq-parallel-queries.md 6.4 KB
- rules/rq-placeholder-data.md 4.9 KB
- rules/rq-prefetching.md 7.4 KB
- rules/rq-query-cancellation.md 6.7 KB
- rules/rq-query-functions.md 3.9 KB
- rules/rq-query-invalidation.md 6.8 KB
- rules/rq-query-keys.md 3.0 KB
- rules/rq-refetch-options.md 4.6 KB
- rules/rq-retry-logic.md 5.5 KB
- rules/rq-select-transform.md 5.0 KB
- rules/rq-stale-time.md 3.5 KB
- rules/rq-suspense-mode.md 6.8 KB
- rules/rq-usequery.md 5.1 KB
- rules/zs-create-store.md 5.8 KB
- rules/zs-persist.md 6.4 KB
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 11d ago First seen · 465 lines · 47 tokens per session scan A 1e736c13a3b9
state-management is a skill published in the GitHub repository AsyrafHussin/agent-skills (74 stars, last pushed 14d ago), licensed MIT. It adds 47 tokens to every session and 3,204 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
recipe-front-review
Reviews completed frontend implementation for governing-source compliance, scope economy, repository quality, and security, then applies user-approved React corrections.
frontend-ai-guide
Applies React/TypeScript-specific technical decision criteria, anti-pattern detection, debugging, and frontend quality gates. Use when reviewing components, hooks, browser behavior, or frontend implementation completeness.
typescript-rules
React/TypeScript frontend development rules including type safety, component design, state management, and error handling. Use when implementing React components, TypeScript code, or frontend features.
ring:applying-composition-patterns
React composition patterns that scale. Avoid boolean prop proliferation by using compound components, lifting state, and composing internals. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or during architecture review. Skip for simple components with 1-2 props…
recipe-front-review
Reviews completed frontend implementation for governing-source compliance, scope economy, repository quality, and security, and applies user-approved React corrections.
framework-expert
Unified framework expertise bundle. Lazy-loads relevant framework patterns (React, Vue, Angular, Next.js, Node.js, Python, Laravel, Go, Flutter, React Native, TypeScript) based on detected tech stack.