fec-data-fetching

fec-data-fetching is a skill for Claude Code from bovinphang/frontend-craft. It costs 76 tokens per session (778 once invoked), scanned A, original, MIT.

A frontend guide for handling data that comes from a server, including typed requests, caching, refreshing, pagination, and updates. Server state means data owned by an API rather than by a page’s local controls.

In plain words
What is it for?
Use it to design query keys, request hooks, cache invalidation, optimistic updates with rollback, prefetching, server rendering hydration, and API integrations.
Why use it?
It keeps loading, error, empty, cache, and update logic out of scattered page components and helps prevent stale or duplicated requests.

Skill for Claude Code

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

Part of the frontend-craft plugin — 74 skills, 11 commands, 14 agents, 5 hooks shipped together

Good fit Use it to design query keys, request hooks, cache invalidation, optimistic updates with rollback, prefetching, server rendering hydration, and API integrations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bovinphang/frontend-craft/fec-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 bovinphang/frontend-craft --skill fec-data-fetching
Clone the repo
git clone --depth 1 https://github.com/bovinphang/frontend-craft

Made for: Claude Code.

Or install frontend-craft, the plugin that ships this one along with the rest of its 74 skills, 11 commands, 14 agents, 5 hooks.

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 fec-data-fetching

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/bovinphang/frontend-craft/fec-data-fetching"><img src="https://agentmods.dev/badge/skills/bovinphang/frontend-craft/fec-data-fetching.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 76 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 778 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00076 $0.00778
Opus 5.5 $0.00030 $0.00311
Sonnet 5.5 $0.00015 $0.00156
Haiku 4.5 $0.00008 $0.00078

Measured 5d ago against content hash 597b728cf896, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

fec-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 5d 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.

localized/zh-CN/skills/fec-data-fetching/SKILL.md · 67 lines

What it actually says

Server State 数据获取

用途

为前端 server state 建立清晰的数据获取、缓存、失效和提交边界,避免请求状态散落在页面组件中。

流程

  1. 判断状态来源:来自服务端且需要缓存、去重、刷新、分页或 mutation 时使用请求缓存方案;纯本地 UI 状态用组件 state 或 store。
  2. 先沿用项目已有数据获取库;新增依赖时 React/Vue/Solid/Svelte 可考虑 TanStack Query,也可沿用 SWR、Nuxt/Nitro 数据获取或项目封装。
  3. 设计稳定 cache key/query key:结构包含实体、动作和所有影响结果的参数。
  4. API 函数保持纯请求函数,数据 hook/composable 负责缓存、select、loading/error/empty 状态。
  5. mutation 成功后 invalidation;需要即时反馈时使用 optimistic update 并在失败时回滚。

React 快速开始

import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";

export function UserList({ keyword }: { keyword: string }) {
  const query = useQuery({
    queryKey: ["users", "list", { keyword }],
    queryFn: () => getUserList({ keyword, page: 1, pageSize: 20 }),
    select: (response) => response.list,
  });

  if (query.isLoading) return <Skeleton />;
  if (query.isError) return <ErrorFallback onRetry={() => query.refetch()} />;
  if (!query.data?.length) return <EmptyState />;

  return query.data.map((user) => <UserRow key={user.id} user={user} />);
}

export function useCreateUser() {
  const queryClient = useQueryClient();
  return useMutation({
    mutationFn: createUser,
    onSuccess: () => queryClient.invalidateQueries({ queryKey: ["users"] }),
  });
}

详细参考

涉及是否需要查询库、QueryClient 默认配置、Vue adapter、乐观更新、无限滚动查询、预取、SSR 水合和 API 层整合时,加载 references/query-patterns.md。

约束

  • 相同数据必须复用相同 cache key/query key;参数缺失会造成缓存串读。
  • staleTime 过长会显示旧数据,过短会造成频繁请求。
  • 请求缓存库不管理本地 UI 状态;不要把 modal、输入框值放进 query cache。
  • 乐观更新必须保存快照并在失败时回滚。
  • SSR/SSG 场景必须使用框架支持的预取、水合或服务端数据边界。

预期输出

数据获取层具备 loading/error/empty/data 状态,重复请求自动去重,mutation 后缓存正确失效或回滚,API 层与 UI 层边界清晰。

工程实践

按当前任务读取本入口工程细则,再按链接选择公共原则。规则级别与例外以实际项目契约为准;不因产品前后端标签限制语言或职责。

Files

What ships with it

2 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. 5d ago Changed · +4 lines 597b728cf896
  2. 2mo ago First seen · 63 lines · 76 tokens per session scan A 3c1832fa8133

Subscribe to this mod's changes

fec-data-fetching is a skill published in the GitHub repository bovinphang/frontend-craft (24 stars, last pushed yesterday), licensed MIT. It adds 76 tokens to every session and 778 once invoked, about $0.0003 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-30.

Related

fec-data-fetching compared with skills from other repositories

fec-data-fetching next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
fec-data-fetchingbovinphang/frontend-craftSkill24yesterdayMITA76Claude Code
adhdszarkans/multiSkill2411d agoMITA124Claude Code
validate-apijohnkozaris/jko-claude-pluginsSkill119d agoMITA20Claude Code
backend-architecturejohnkozaris/jko-claude-pluginsSkill119d agoMITA119Claude Code
validate-wsjohnkozaris/jko-claude-pluginsSkill119d agoMITA19Claude Code
brand-designrfxlamia/pockettoSkill614d agoMITB146Claude Code
dotnet-backend-expertmathisk2095/jko-claude-pluginsSkill31mo agoMITA181Claude Code