fec-data-fetching SKILL.md skillA
fec-data-fetching from bovinphang/frontend-craft is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add bovinphang/frontend-craft/fec-data-fetching@git:20260611.9d7f5e4Pins git:20260611.9d7f5e4 in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 17 of 17 checks passed
- Kind
- SKILL.md skill
- Repository
- bovinphang/frontend-craft
- Path
localized/zh-CN/skills/fec-data-fetching/SKILL.md- Versions recorded
- 1
- Latest version
- git:20260611.9d7f5e4, committed Jun 11, 2026
- Size
- 2,843 bytes
- Repository stars
- 22
- License
- MIT
用于实现或审查前端服务端状态流程:类型化查询、请求缓存、失效、mutation、乐观更新、无限查询、预取、SSR hydration 或 API 层整合。不要用于本地 UI 状态或 Service Worker 缓存;中文触发词包括 数据获取、缓存、乐观更新。.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file 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 快速开始
```tsx
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,
…Read the whole file at its exact version.
How to install
mdr add bovinphang/frontend-craft/fec-data-fetching@sha256:3c1832fa8133aeb1The line at the top of this page pins the label git:20260611.9d7f5e4, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_wdm4sinercwfti7r)
2 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 1 version of this file, committed on Jun 11, 2026.
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (2843 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
bovinphang/frontend-craft · 22 stars · license MIT · pushed 2026-09-26 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_wdm4sinercwfti7r GET https://markdownregistry.com/api/v1/resolve?ref=bovinphang/frontend-craft/fec-data-fetching GET https://markdownregistry.com/api/v1/blob/3c1832fa8133aeb10617c738c8489190e5e9f817b698de6083b322ca95523270
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.
More from bovinphang/frontend-craft
Every file in bovinphang/frontend-craft