用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Dev-Toolbelt/dev-team-agents --skill data-fetching-integrity命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | data-fetching-integrity |
| description | Detect and prevent duplicate/redundant API calls in SPA/SSG frontends — tool-agnostic. |
Duplicate and redundant API calls waste the user's bandwidth and put unnecessary load on the
backend. This is a behavioral discipline, not a library feature — it applies whether the
project uses TanStack Query, SWR, Apollo, RTK Query, or plain fetch/axios with no library at
all. Detection and prevention below are framework-agnostic; do not gate this skill on any specific
tool being present.
Any frontend task in a SPA (client-rendered) or SSG (static-generated, hydrated client-side) project where components fetch data from an API — implementing, reviewing, or validating.
Treat each of these as a concrete, checkable defect — not a stylistic preference:
| Symptom | How it shows up | Why it's a defect |
|---|---|---|
| Double-fire on mount | The same request fires twice when a component mounts (common under React StrictMode's double-invoke, or an effect with no guard) | Same data fetched twice for one render |
| Re-fetch on every render | A fetch call lives in the render body or in an effect with a dependency array that changes every render (inline object/array/function literal, unstable callback) | Request rate scales with render count instead of with actual data needs |
| Sibling components fetching the same resource independently | Two or more components each call the same endpoint with the same parameters, with no shared cache or lifting of the fetch to a common ancestor | N requests for 1 piece of data, and no guarantee they resolve to the same value |
| Avoidable request waterfalls | Component B's fetch depends on Component A's fetch result, but A and B are rendered sequentially instead of A's data being fetched once and passed down, or B's independent data being fetched in parallel | Total load time is the sum of round-trips instead of the max |
| No de-duplication for concurrent identical requests | Multiple call sites trigger the same in-flight request (same URL + params) before the first resolves, and each gets its own network round-trip | N-1 of the N requests are pure waste |
| Fetch on every keystroke/scroll without debouncing | Search-as-you-type, infinite scroll, or filter inputs call the API on every event instead of being debounced/throttled | Request volume scales with input events, not with intent |
| Re-fetch after navigation back to an already-fetched view | Returning to a screen re-fetches data that was already loaded moments ago, with no cache or staleness check | Redundant round-trip for data that hasn't changed |
skills/architecture/frontend-patterns/SKILL.md and the Server State &
Data Fetching rules already required of frontend-developer)Apply these regardless of stack:
Open the browser's network panel (or equivalent devtools) for the flow under test and confirm: