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.
git clone --depth 1 https://github.com/BetterTyped/hype-stackWrote 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/rules/bettertyped/hype-stack/data-fetching)<a href="https://agentmods.dev/rules/bettertyped/hype-stack/data-fetching"><img src="https://agentmods.dev/badge/rules/bettertyped/hype-stack/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/rules/bettertyped/hype-stack/data-fetching"><img src="https://agentmods.dev/badge/rules/bettertyped/hype-stack/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.00000 | $0.01339 |
| Opus 5.5 | $0.00000 | $0.00536 |
| Sonnet 5.5 | $0.00000 | $0.00268 |
| Haiku 4.5 | $0.00000 | $0.00134 |
Grade A, and why
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 1mo 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 — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.
HyperFetch Data Exchange
Applies to all client apps: apps/frontend, apps/admin, apps/mobile, and apps/extension. Each has its own sdk in src/api/sdk.ts.
All client API calls should go through the HyperFetch SDK (sdk from @/api/sdk) instead of raw fetch(), axios, or other HTTP clients.
HTTP
- Reads:
useFetch(sdk.<path>.$get)from@hyper-fetch/react. - Mutations:
useSubmit(sdk.<path>.$post | .$put | .$delete)from@hyper-fetch/react. - Use
onSubmitSuccess/onSubmitErrorcallbacks for side effects (toast, refetch, navigation). - For file uploads, pass
{ payload: formData }tosubmit()whereformDatais aFormDatainstance. - The SDK is fully typed end-to-end from Hono backend routes. Bypassing it loses type safety.
- New backend endpoints are automatically available on the SDK via the Hono-to-HyperFetch type bridge.
Responses never throw
send() and submit() always resolve. A network failure, a timeout, an abort, a 4xx or a 5xx: every one of them comes back as { data: null, error, status, success: false }. There is nothing to catch.
- Never wrap a HyperFetch call in
try/catch. It cannot throw, so thecatchonly hides bugs in the code around it, and it tempts you intothrow new Error(...)onresult.error, which turns a typed error back into an exception. - Branch on the result:
const { data, error } = await submit(...); if (error || !data) { toast.error(...); return false; }. - With hooks, read
errorfromuseFetch, and useonSubmitSuccess/onSubmitErroronuseSubmit. - A hook or helper that wraps a request returns an outcome (
boolean,{ documentId, error: null } | { documentId: null, error }). It does not throw so that a caller can catch. Callers branch too. abort()is cancellation, not failure. After an await, checksignal.abortedand return quietly instead of reporting the abort as an error.- The one place an exception is right is a
fetch-shaped adapter for a third-party library that only understands rejections (an AI SDK transport, for example). Throwresponse.errorafter theawait, still withouttry/catch.
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.
- 1mo ago Changed · +43 lines 88e4237fe8ef
- 1mo ago First seen · 37 lines · 0 tokens per session scan A 30d48c42ffc5
data-fetching is a cursor rule published in the GitHub repository BetterTyped/hype-stack (12 stars, last pushed 15d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,339 tokens. 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.
Other cursor rules, from other repositories
windsurfrules
Create detailed components with these requirements.
backend
Backend development rules for TT Studio - AI model management backend.
tanstack-start-guide
TanStack Start best practices emphasizing client-first architecture, type safety, and modern React patterns.
new-component
Workflow for creating new React components.
tanstack-react-router_routing
TanStack Router: Routing.
project-structure
Folder layout for Next.js App Router and Vite + React variants.