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 pledgeandgrow/pledge-skills --skill swrgit clone --depth 1 https://github.com/pledgeandgrow/pledge-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/pledgeandgrow/pledge-skills/swr)<a href="https://agentmods.dev/skills/pledgeandgrow/pledge-skills/swr"><img src="https://agentmods.dev/badge/skills/pledgeandgrow/pledge-skills/swr/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/pledgeandgrow/pledge-skills/swr"><img src="https://agentmods.dev/badge/skills/pledgeandgrow/pledge-skills/swr.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.00029 | $0.00906 |
| Opus 5 | $0.00015 | $0.00453 |
| Sonnet 5 | $0.00006 | $0.00181 |
| Haiku 4.5 | $0.00003 | $0.00091 |
Grade A, and why
swr-docs scanned grade A with 1 finding 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 8d 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
const fetcher = (url: string) => fetch(url).then(r => r.json()) How it starts
The opening of the file, as written. The whole thing — 79 lines — stays where its author put it; the contents beside it link to each section on GitHub.
SWR — Complete Skill Reference
Quick Reference
| Topic | File |
|---|---|
| Getting Started (installation, quick start, reusable hooks) | getting-started.md |
| Core Concepts (useSWR, keys, fetchers, conditional fetching) | core-concepts.md |
| Options (all useSWR options, SWRConfig, global configuration) | options.md |
| Mutation (useSWRMutation, optimistic updates, rollback, populateCache) | mutation.md |
| Pagination (useSWRInfinite, index/cursor pagination, parallel fetching) | pagination.md |
| Prefetching (preload, fallback data, RSC prefetch, HTML preload) | prefetching.md |
| Revalidation (focus, interval, reconnect, immutable, mount) | revalidation.md |
| Cache (cache providers, mutate, global mutate, cache modifiers) | cache.md |
| Middleware (custom middleware, logger, laggy, serialize) | middleware.md |
| Suspense (suspense mode, error boundaries, SSR, conditional) | suspense.md |
| Subscription (useSWRSubscription, WebSocket, Firestore, dedup) | subscription.md |
| Error Handling (status codes, retry, global error report) | error-handling.md |
| TypeScript (type inference, generics, Fetcher, middleware types) | typescript.md |
| Next.js Integration (App Router, RSC, SSG/SSR, fallback) | nextjs.md |
| Advanced (understanding SWR, cache providers, performance, React Native) | advanced.md |
| API Reference (all hooks, functions, types) | api-reference.md |
Core Concepts
- useSWR Hook: The fundamental API — pass a key and fetcher, get data/error/isLoading
- Cache Keys: String, array, object, or function keys — automatically serialized
- Fetcher Agnostic: Works with fetch, Axios, GraphQL, or any Promise-returning function
- Automatic Revalidation: On focus, reconnect, interval — all configurable
- Request Deduplication: Identical requests within dedupingInterval are merged
- Mutation: Update cached data via bound/global mutate or useSWRMutation
- Pagination: useSWRInfinite for index-based or cursor-based pagination
- Prefetching: preload API, fallback data, or HTML
<link rel="preload"> - Middleware: Wrap SWR hooks with custom logic (logging, laggy, serialization)
- Suspense: Full React Suspense support with error boundaries
- Subscription: Real-time data via useSWRSubscription (WebSocket, Firestore)
- SSR/SSG: Pre-fill data via fallback, prefetch in Server Components
- TypeScript: Full type inference and explicit generic support
What ships with it
16 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.
- advanced.md 9.0 KB
- api-reference.md 8.1 KB
- cache.md 3.8 KB
- core-concepts.md 5.8 KB
- error-handling.md 3.6 KB
- getting-started.md 3.3 KB
- middleware.md 4.2 KB
- mutation.md 9.6 KB
- nextjs.md 5.1 KB
- options.md 5.3 KB
- pagination.md 5.7 KB
- prefetching.md 4.1 KB
- revalidation.md 3.4 KB
- subscription.md 3.6 KB
- suspense.md 3.2 KB
- typescript.md 4.2 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.
- 8d ago First seen · 79 lines · 29 tokens per session scan A d6495b66e66a
swr-docs is a skill published in the GitHub repository pledgeandgrow/pledge-skills (10 stars, last pushed 1mo ago), licensed MIT. It adds 29 tokens to every session and 906 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
nextjs-expert
Expert knowledge in Next.js framework, Server-Side Rendering, Static Site Generation, App Router, Server Components, and full-stack React applications. Use when the user mentions React, SSR, SSG, the App Router, React Server Components, or full stack, or when the task involves Next.js Fundamentals, App Router…
react-hooks-composition
Advanced React hooks composition patterns - SWR integration, debounced search, memoized contexts, state machines, and performance optimization.
fp-react
Practical patterns for using fp-ts with React - hooks, state, forms, data fetching. Works with React 18/19, Next.js 14/15.
nextjs-development
Comprehensive Next.js development skill covering App Router, Server Components, data fetching, routing patterns, API routes, middleware, and full-stack Next.js applications.
nextjs-data-fetching
Implement Fetch API, Caching, and Revalidation strategies in Next.js. Use when fetching data, configuring cache behavior, or implementing revalidation in Next.js.
Functional Programming in React
Practical patterns for using fp-ts with React - hooks, state, forms, data fetching. Works with React 18/19, Next.js 14/15.