rn-data-fetching

rn-data-fetching is a skill for Claude Code from lukedj78/dev-flow. It costs 141 tokens per session (775 once invoked), scanned A, original, MIT.

A set of rules for fetching data from web APIs in React Native and Expo apps. It covers TanStack Query, a library that manages network data, including queries, updates, caching, and lists.

In plain words
What is it for?
Use it when building screens that load, change, cache, refresh, or paginate data from an API in a React Native app.
Why use it?
It helps avoid repeated setup and common data-sync mistakes, such as creating multiple clients or failing to refresh cached data after a change.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the dev-flow plugin — 57 skills shipped together

Good fit Use it when building screens that load, change, cache, refresh, or paginate data from an API in a React Native app.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lukedj78/dev-flow/rn-data-fetching
Install

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.

Any agent
npx skills add lukedj78/dev-flow --skill rn-data-fetching
Clone the repo
git clone --depth 1 https://github.com/lukedj78/dev-flow

Made for: Claude Code.

Or install dev-flow, the plugin that ships this one along with the rest of its 57 skills.

Wrote 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.

agentmods badge for rn-data-fetching

README.md
[![agentmods](https://agentmods.dev/badge/skills/lukedj78/dev-flow/rn-data-fetching/github.svg)](https://agentmods.dev/skills/lukedj78/dev-flow/rn-data-fetching)
Your own site
<a href="https://agentmods.dev/skills/lukedj78/dev-flow/rn-data-fetching"><img src="https://agentmods.dev/badge/skills/lukedj78/dev-flow/rn-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.

agentmods 80×15 button for rn-data-fetching

Your own site · 80×15
<a href="https://agentmods.dev/skills/lukedj78/dev-flow/rn-data-fetching"><img src="https://agentmods.dev/badge/skills/lukedj78/dev-flow/rn-data-fetching.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 141 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 775 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00141 $0.00775
Opus 5.5 $0.00056 $0.00310
Sonnet 5.5 $0.00028 $0.00155
Haiku 4.5 $0.00014 $0.00077

Measured 3mo ago against content hash 581fc0fc9f6e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

rn-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 3mo 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.

rn-data-fetching/SKILL.md · 41 lines

How it starts

The opening of the file, as written. The whole thing — 41 lines — stays where its author put it; the contents beside it link to each section on GitHub.

rn-data-fetching — guardrail for data fetching in React Native + Expo

For the current Expo API and per-version details, verify against the Expo docs / MCP mcp.expo.dev / expo/skills (see rn-fundamentals → Source of truth).

The 5 rules (non-negotiable)

  1. TanStack Query is the default for any data that comes from the network. fetch + useEffect is acceptable ONLY in didactic examples or for one-off bootstrap calls (e.g. reading a config at app start).
  2. One QueryClient per app, mounted at the root layout. Never instantiate per-screen.
  3. Query keys are arrays, hierarchical, with the most specific filter last: ["posts", "list", { filter }]. NEVER stringly-typed keys.
  4. Every mutation invalidates the queries it affects. Use queryClient.invalidateQueries({ queryKey: [...] }) in onSuccess. Optimistic updates use onMutate + onError rollback.
  5. staleTime ≥ 60_000 ms is the default to avoid refetch-on-focus storms. Tune per query based on freshness need.

Quick decision tree

  • "Should I use fetch or TanStack Query?" → references/decision-tree.md
  • "How do I set up TanStack Query in a fresh Expo app?" → references/tanstack-query-rn.md
  • "What's the right query key shape, the right cancel pattern, the right loading state?" → references/patterns.md
  • "Show me a working query / mutation / infinite scroll example" → references/examples/
  • "Why does my fetch race on unmount?" → references/concepts.md

Common anti-patterns (NEVER do)

  • ❌ useEffect(() => { fetch(...).then(setData) }, []) for production data — no retry, no dedup, no cancel.
  • ❌ useState<Data | null>(null) + useState<boolean>(false) for loading — let TanStack Query own server state.
  • ❌ queryKey: "posts" as a string — must be an array.
  • ❌ Calling setData after the component unmounts — TanStack Query handles cancel automatically.
  • ❌ Mutation that updates the server but does NOT invalidateQueries — UI shows stale data.
  • ❌ Refetching on every navigation — set staleTime per query.

Read the full file on GitHub · 41 lines

Files

What ships with it

8 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.

Changes

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.

  1. 3mo ago First seen · 41 lines · 141 tokens per session scan A 581fc0fc9f6e

Subscribe to this mod's changes

rn-data-fetching is a skill published in the GitHub repository lukedj78/dev-flow (5 stars, last pushed 2d ago), licensed MIT. It adds 141 tokens to every session and 775 once invoked, about $0.0006 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-08-31.

Related

rn-data-fetching compared with skills from other repositories

rn-data-fetching next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
rn-data-fetchinglukedj78/dev-flowSkill52d agoMITA141Claude Code
sinch-in-app-callingsinch/skillsSkill114d agoApache-2.0A71Claude Code, Codex
supabase-mobile-authAnilBurcu/claude-code-react-nativeSkill225d agoMITA48Claude Code
push-notificationsAmpli-Group/agentic-mobile-blueprintSkill43mo agoMITA47Claude Code, Codex
agent-crdt-synchronizerruvnet/rufloSkill83ktodayMITA25Claude Code
build-zoom-contact-center-appanthropics/knowledge-work-pluginsSkill37kyesterdayApache-2.0A48Claude Code
build-teaql-appteaql/teaql-agent-kitSkill2.8k21d agoMITA112Codex