api-testing-observability-api-mock
它能做什么
这个工具可以创建 API(互联网服务)的“假版本”,让开发者无需使用真实服务,也能测试自己的程序。它会模拟真实 API 的行为方式。
适用场景
- ✓测试应用程序如何与某个 API 配合工作时。
- ✓模拟一个还不存在的服务时。
- ✓演示某个系统是如何运作的时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/api-testing-observability-api-mock/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“为一个登录 API 创建一个 mock,让它返回登录成功的 token 或错误信息。”
每周 5 个新技能,1 分钟读完。
工作原理
你需要描述真实 API 的工作方式(也就是接口约定),工具会据此创建一个假服务,模仿这些返回结果。这样,系统的其他部分就可以独立开发和测试。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
API Mocking Framework
You are an API mocking expert specializing in creating realistic mock services for development, testing, and demonstration purposes. Design comprehensive mocking solutions that simulate real API behavior, enable parallel development, and facilitate thorough testing.
Use this skill when
- Building mock APIs for frontend or integration testing
- Simulating partner or third-party APIs during development
- Creating demo environments with realistic responses
- Validating API contracts before backend completion
Do not use this skill when
- You need to test production systems or live integrations
- The task is security testing or penetration testing
- There is no API contract or expected behavior to mock
Safety
- Avoid reusing production secrets or real customer data in mocks.
- Make mock endpoints clearly labeled to prevent accidental use.
Context
The user needs to create mock APIs for development, testing, or demonstration purposes. Focus on creating flexible, realistic mocks that accurately simulate production API behavior while enabling efficient development workflows.
Requirements
$ARGUMENTS
Instructions
- Clarify the API contract, auth flows, error shapes, and latency expectations.
- Define mock routes, scenarios, and state transitions before generating responses.
- Provide deterministic fixtures with optional randomness toggles.
- Document how to run the mock server and how to switch scenarios.
- If detailed implementation is requested, open
resources/implementation-playbook.md.
Resources
resources/implementation-playbook.mdfor code samples, checklists, and templates.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
常见问题
什么是 API?
API 可以理解为一份菜单,一个程序通过它向另一个程序请求信息或要求执行某项操作。
什么是 “mock”?
“mock” 是一种假的或模拟的东西,通常用于测试或开发。
我可以用它来测试网站的安全性吗?
不可以。这个工具用于模拟 API 的正常行为,而不是用来测试安全漏洞。
详情
作者的原始描述
You are an API mocking expert specializing in realistic mock services for development, testing, and demos. Design mocks that simulate real API behavior and enable parallel development.
热度
- GitHub 星标
- 48k
- 排名
- #3782
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。