native-data-fetching
它能做什么
这个工具可以帮你的应用连接互联网,获取或发送信息。它涵盖的内容很广,从发起网络请求的基础知识,到处理网络问题,再到存储数据以便离线使用。
适用场景
- ✓当你需要从某个网站或服务获取数据时。
- ✓当你的应用即使在没有网络连接的情况下也需要正常工作时。
- ✓当数据加载不正常,你需要排查问题时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/native-data-fetching/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我该如何在应用中从 API 获取数据?”
每周 5 个新技能,1 分钟读完。
工作原理
它会指导你选择最佳的网络请求方式,说明如何使用常用的数据获取库,并帮你配置应用,让它在各种网络环境下都能良好运行。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Expo Networking
You MUST use this skill for ANY networking work including API requests, data fetching, caching, or network debugging.
Detailed Guide
Read the detailed guide before executing this skill. It retains the complete procedure and reference material. Treat its safety, prerequisites, and validation requirements as mandatory. For focused work, load the relevant sections; for end-to-end work, read the guide completely.
When to Use
Use this skill when:
- Implementing API requests
- Setting up data fetching (React Query, SWR)
- Using Expo Router data loaders (
useLoaderData, web SDK 55+) - Debugging network failures
- Implementing caching strategies
- Handling offline scenarios
- Authentication/token management
- Configuring API URLs and environment variables
Example Invocations
User: "How do I make API calls in React Native?" -> Use fetch, wrap with error handling
User: "Should I use React Query or SWR?" -> React Query for complex apps, SWR for simpler needs
User: "My app needs to work offline" -> Use NetInfo for status, React Query persistence for caching
User: "How do I handle authentication tokens?" -> Store in expo-secure-store, implement refresh flow
User: "API calls are slow" -> Check caching strategy, use React Query staleTime User: "How do I configure different API URLs for dev and prod?" -> Use EXPOPUBLIC env vars with .env.development and .env.production files User: "Where should I put my API key?" -> Client-safe keys: EXPOPUBLIC in .env. Secret keys: non-prefixed env vars in API routes only
User: "How do I load data for a page in Expo Router?" -> See references/expo-router-loaders.md for route-level loaders (web, SDK 55+). For native, use React Query or fetch.
Limitations
- Use this skill only when the task clearly matches its upstream product or API scope.
- Verify commands, API behavior, pricing, quotas, credentials, and deployment effects against current official documentation before making changes.
- Do not treat generated examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.
常见问题
什么是“API 请求”?
它就像你的应用向互联网上的其他服务发出的请求,用来获取或发送信息。
为什么要处理网络错误?
这样即使连接失败,你的应用也不会崩溃,或显示令人困惑的信息,从而带来更好的使用体验。
什么是“缓存”?
缓存是指临时保存已经获取过的信息,这样应用下次就能更快地访问它,而不需要再次从互联网上获取。
详情
作者的原始描述
Use when implementing or debugging ANY network request, API call, or data fetching. Covers fetch API, React Query, SWR, error handling, caching, offline support, and Expo Router data loaders (`useLoaderData`).
热度
- GitHub 星标
- 48k
- 排名
- #5280
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。