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 tmj-90/gaffer --skill frontend-data-fetchinggit clone --depth 1 https://github.com/tmj-90/gafferWrote 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/tmj-90/gaffer/frontend-data-fetching)<a href="https://agentmods.dev/skills/tmj-90/gaffer/frontend-data-fetching"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/frontend-data-fetching/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/tmj-90/gaffer/frontend-data-fetching"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/frontend-data-fetching.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.00112 | $0.01518 |
| Opus 5.5 | $0.00045 | $0.00607 |
| Sonnet 5.5 | $0.00022 | $0.00304 |
| Haiku 4.5 | $0.00011 | $0.00152 |
Grade A, and why
frontend-data-fetching 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 16d 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 — 92 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Fetch and mutate server data from the client
Client data bugs are cache and concurrency bugs: a stale list after a save, an older response overwriting a newer one, a double-submitted order, two tabs silently overwriting each other. Use the repo's data layer (it solves dedup, caching, races and cancellation once), key every query by its inputs, invalidate precisely, and treat concurrent writers as a normal case, not an edge case.
Steps
- Find the data layer. Call
search_loreand read one existing screen: the query library (TanStack Query, SWR, RTK Query, Apollo), framework loaders/Server Components, the typed API client (theopenapi-contractskill), the query-key factory, auth handling. AfetchinuseEffectwith hand-rolledloadingflags is a defect where a layer exists. - Know the defaults you inherit. TanStack Query v5:
staleTime0 (data is stale immediately, refetched on mount/focus/reconnect),gcTime5 min, queries retry 3 times with backoff, mutations do not retry,queryFnreceives anAbortSignal. SWR: revalidate on focus and reconnect, 2 s dedupe. SetstaleTimedeliberately from how often the data changes; do not turn off refetching to hide a bug. - Key by every input. Arrays from the repo's factory, general to specific:
['tickets', 'list', { status, page, locale }],['tickets', 'detail', id]. Any value the request uses that is missing from the key serves the wrong cached data. Pass thesignaltofetchso key changes and unmounts cancel. - Render the states on purpose. Pending first load (a skeleton at the final layout's
size), empty (a message plus the next action), error (what failed plus Retry; never the
raw response body), refreshing with data shown (a subtle indicator, not a skeleton
flash), and success. With pagination or filters use
placeholderData: keepPreviousData(TanStack) so the list does not blank between pages. In v5,isPendingmeans no data yet;isFetchingmeans a request is in flight. - Mutate through the same layer. After success,
invalidateQuerieson the narrowest key prefix affected (list and detail), orsetQueryDatawith the server's response. Optimistic update recipe:onMutate→cancelQueriesfor the key → snapshot previous data → write the optimistic value → return the snapshot;onError→ restore it;onSettled→ invalidate. Block duplicate submission while pending (isPending), and send an idempotency key for non-idempotent creates if the API supports one (theidempotency-and-retriesskill). - Handle concurrent writers. If the API returns a version or
ETag, send it back (If-Matchor aversionfield). On409/412, keep the user's edit, show that the record changed, and offer reload-and-reapply — never retry blindly and overwrite. With two tabs open, the second tab refetches on focus; confirm your mutation does not depend on data the other tab changed. - Poll and stream deliberately.
refetchIntervaltied to the data's change rate, paused in background tabs (the default); SSE/WebSocket messages update the query cache (setQueryDataor invalidate), reconnect with backoff and jitter, and refetch after reconnect to fill the gap. - Fail safely. Retry only idempotent reads and transient errors (network, 5xx,
429 honouring
Retry-After); do not retry 4xx. A 401 triggers one refresh or a redirect to sign-in, not a loop. Render errors inside an error boundary with a reset. - Test each AC's behaviour (the
frontend-testingskill) with the network mocked at the fetch boundary (MSW or the repo's equivalent) and a freshQueryClientwithretry: falseper test:- each state the AC names renders (pending, empty, error with retry, success);
- the mutation updates what the user sees (assert the list, not that a function ran);
- optimistic rollback: server returns 500 → the old value is back and an error shows;
- race: respond to request A after request B → B's data is shown;
- double-click submit → exactly one request;
- stale version: server returns 409/412 → the user's input is kept and the conflict is shown.
- Evidence per AC with the
record-evidenceskill, then stop.
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.
- 16d ago Changed · +28 lines · +6 tokens per session b75e98813be7
- 19d ago First seen · 64 lines · 106 tokens per session scan A d3058fd21c9c
frontend-data-fetching is a skill published in the GitHub repository tmj-90/gaffer (2 stars, last pushed 17d ago), licensed Apache-2.0. It adds 112 tokens to every session and 1,518 once invoked, about $0.0004 per session on Opus 5.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-09-28.
Other skills, from other repositories
bulwark-brainstorm
Role-based brainstorming with dual modes: --scoped (sequential Task tool, 5 roles) and --exploratory (Agent Teams peer debate, 4 roles). Use for feasibility assessment and idea validation.
plan-creation
Create structured implementation plans via a 4-role scrum team (Product Owner, Architect, Eng/Delivery Lead, QA/Critic) with optional Agent Teams peer debate mode.
anthropic-validator
Validates Claude Code assets (skills, hooks, agents, commands, MCP servers, plugins) against official Anthropic standards. Fetches latest docs dynamically and produces structured validation reports.
create-subagent
Generates single-purpose Claude Code sub-agents for use via the Task tool. Use when creating dedicated sub-agents, scaffolding agent definitions, or generating agents with diagnostics and permissions setup.
test-audit
Audit test suites for T1-T4 violations using AST analysis, mock detection, and multi-stage synthesis. Invoke when user asks to audit tests, check test quality, find mock violations, review test effectiveness, or inspect test suites for over-mocking. Triggers automatic rewrites when quality gates fail.
code-review
Comprehensive code review with distinct aspect based sections. Use when reviewing code, checking for security issues, finding type safety problems, auditing code quality, or when user asks to review code, PRs or changes. Three-phase workflow runs static tools, LLM judgment, and writes diagnostic log.