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.
npx skills add laolaoshiren/claude-code-skills-zh --skill api-testergit clone --depth 1 https://github.com/laolaoshiren/claude-code-skills-zhWrote 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.
[](https://agentmods.dev/skills/laolaoshiren/claude-code-skills-zh/api-tester)<a href="https://agentmods.dev/skills/laolaoshiren/claude-code-skills-zh/api-tester"><img src="https://agentmods.dev/badge/skills/laolaoshiren/claude-code-skills-zh/api-tester/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.
<a href="https://agentmods.dev/skills/laolaoshiren/claude-code-skills-zh/api-tester"><img src="https://agentmods.dev/badge/skills/laolaoshiren/claude-code-skills-zh/api-tester.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00086 | $0.01424 |
| Opus 5 | $0.00043 | $0.00712 |
| Sonnet 5 | $0.00017 | $0.00285 |
| Haiku 4.5 | $0.00009 | $0.00142 |
Grade A, and why
api-tester 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 11d 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.
How it starts
The opening of the file, as written. The whole thing — 119 lines — stays where its author put it; the contents beside it link to each section on GitHub.
API 测试助手
核心原则
- 只把可核验的 OpenAPI、代码、类型、调用方或现有测试当作契约证据。
- 生成测试不等于执行测试;读取接口定义不等于可以访问真实服务。
- 保护现有数据、凭据和用户修改,优先使用隔离且可清理的测试环境。
工作流程
1. 读取项目与接口证据
先读取适用的仓库规则、测试说明、Git 状态和项目脚本,再按实际存在情况检查:
- OpenAPI / Swagger 文件及其引用的 Schema。
- 路由、controller、handler、DTO、验证器和错误处理中间件。
- 客户端类型、调用方、公开文档和现有 API 测试。
- 测试配置、fixture、认证方式、环境变量模板和数据清理机制。
记录规范、实现与现有测试之间的不一致。无法确定哪个行为才是期望契约时,列出证据并请求确认,不用新测试固化猜测。
2. 建立契约矩阵
为目标 endpoint 记录:
| 项目 | 证据 |
|---|---|
| method 与 path | OpenAPI 或路由位置 |
| 认证与权限 | security scheme、中间件或调用方 |
| 请求参数与约束 | Schema、DTO 或验证器 |
| 已声明响应 | 状态码、响应结构与 header |
| 副作用与幂等性 | 实现、文档或调用链 |
| 测试环境与清理 | fixture、事务或 teardown |
不要默认每个接口都应返回 400、401、403、404、422 或 500。只有契约已声明或代码路径真实可达时才生成对应断言。
3. 明确环境与授权
在执行任何请求前确认:
- Base URL、环境归属以及是否为 local、test、staging 或 production。
- 测试账号、权限范围和凭据来源。
- 是否允许执行 POST、PUT、PATCH、DELETE、上传、支付、通知等有副作用操作。
- 测试数据隔离、唯一标识、清理或事务回滚方案。
用户只要求“生成测试”时只产出代码。生产环境、共享 staging、第三方服务及任何可能改变真实数据的执行都必须获得明确授权。GET 也不能仅凭 method 判定无副作用。
4. 选择项目锁定的工具
- 优先运行仓库已有的 test、OpenAPI lint 或 contract test script。
- 读取 package manager、lockfile 和已安装版本后再选择命令。
- 不用裸
npx、全局工具或临时下载的最新版解析规范。 - 缺少依赖时先报告;安装工具、更新 lockfile 或修改测试配置需要单独授权。
- 使用真正的 YAML / JSON / OpenAPI 解析器,不用
grep推断嵌套 Schema。
5. 设计有依据的用例
按目标契约选择必要场景:
- 成功路径:使用最小合法输入验证状态、结构和关键语义。
- 边界路径:只测试 Schema 或实现中真实存在的长度、范围、枚举、格式和必填约束。
- 认证与权限:只覆盖已声明的身份、角色和资源归属规则。
- 失败与回归:覆盖可达错误路径、已知缺陷或兼容性要求。
- 幂等、分页、并发、重试与超时:仅在接口契约包含这些语义时测试。
断言外部可观察行为,避免绑定内部函数调用。随机数据应固定 seed,并避免真实个人信息、客户数据和生产标识。
6. 实现最小测试
- 沿用项目现有框架、目录、fixture、命名和断言风格。
- 单元测试可隔离网络、时间和第三方服务;集成测试使用受控服务或临时资源。
- 对写操作使用唯一数据,并在成功、失败和中断路径都执行清理。
- 不为让测试通过而擅自修改生产代码、接口规范或认证配置。
- 使用跨平台路径和项目脚本;平台专属命令需说明 Windows / Linux 适用范围。
7. 执行与复验
- 先检查命令是否会下载依赖、访问外部服务或改变共享状态。
- 运行最小目标测试,记录命令、环境、退出状态和真实响应摘要。
- 按风险运行相关测试、类型检查或完整测试。
- 检查 Git diff 和环境状态,确认没有残留测试数据、快照、日志、Token 或无关生成物。
- 将基线已有失败与本轮新增失败分开报告。
没有实际运行时,只能说明“已生成、未验证”。没有明确 SLA 和受控测量条件时,不添加固定耗时断言或声称性能达标。
安全边界
- 不在命令、日志、fixture 或报告中写入真实 Token、Cookie、密码和个人数据。
- 未经明确授权,不访问生产环境、真实客户账号、付费 API 或受监管系统。
- 压测、模糊测试、大批量数据生成和安全探测需要单独授权及限流方案。
- 遇到权限不足、环境不明、清理方案缺失或响应可能含敏感信息时停止执行并报告。
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.
- 11d ago First seen · 119 lines · 86 tokens per session scan A b1f537163db7
api-tester is a skill published in the GitHub repository laolaoshiren/claude-code-skills-zh (832 stars, last pushed today), licensed MIT. It adds 86 tokens to every session and 1,424 once invoked, about $0.0004 per session on Opus 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.
Other skills, from other repositories
api-testing-observability-api-mock
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.
smoke-test
Launch the app and hands-on verify that it works by interacting with it. Falls back to an existing integration test suite when there is no interactive surface in scope. Use when the user asks to "smoke test", "test it manually", "verify it works", "try it out", "run a smoke test", "check it in the browser", or "does…
endpoint-probe
Probes each major Agent Monitor API route — /api/stats, /api/analytics, /api/sessions, /api/pricing/cost, /api/workflows/runs, /api/cc-config/overview — and reports each one's HTTP status, latency, and response shape, flagging which are reachable. Use to verify a dashboard install is wired up correctly.
devlab-integration-fullstack
A guide to testing complete business flows across a frontend, backend services, databases, and other connected systems. It uses tools such as Playwright, Jest, SuperTest, Testcontainers, and mock servers to test multi-service setups.
web-e2e
Full end-to-end browser testing for local web apps with a persistent logged-in session. Log in once into a named Chrome profile, then drive real flows with trace evidence against your locally served app - Laravel/Herd, docker compose, FastAPI+SPA, Vite. Adds per-project orchestration via .e2e/config.json - boot +…
dev-ship
Fechamento de feature — verificação goal-backward antes de declarar pronto. Roda Must-Haves do PLAN.md, executa o demo script, revisa o diff completo procurando bugs e restos (debug logs, TODOs, código morto), passa lente de segurança nos arquivos tocados, escreve SUMMARY.md e arquiva o plano. Use quando o usuário…