Borrowing it
Nothing to install: this file belongs to anhtester/claude-testing-kit. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/anhtester/claude-testing-kit/main/.claude/commands/generate_api_tests_from_swagger.mdgit clone --depth 1 https://github.com/anhtester/claude-testing-kitWrote 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/commands/anhtester/claude-testing-kit/generate_api_tests_from_swagger)<a href="https://agentmods.dev/commands/anhtester/claude-testing-kit/generate_api_tests_from_swagger"><img src="https://agentmods.dev/badge/commands/anhtester/claude-testing-kit/generate_api_tests_from_swagger/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/commands/anhtester/claude-testing-kit/generate_api_tests_from_swagger"><img src="https://agentmods.dev/badge/commands/anhtester/claude-testing-kit/generate_api_tests_from_swagger.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.00036 | $0.02510 |
| Opus 5.5 | $0.00014 | $0.01004 |
| Sonnet 5.5 | $0.00007 | $0.00502 |
| Haiku 4.5 | $0.00004 | $0.00251 |
Grade A, and why
generate_api_tests_from_swagger 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 1mo 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 — 167 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Command: Sinh API Tests từ Swagger/OpenAPI
BẮT BUỘC (MANDATORY SKILL): Bạn PHẢI nạp và đọc kỹ nội dung của skill
skills-qa-automation-engineer(tại.claude/skills/skills-qa-automation-engineer/SKILL.md) trước khi bắt đầu. Ngoài ra, tham khảo thêm skillskills-test-data-generatorđể sinh test data đúng chuẩn.
Command này giúp agent phân tích Swagger/OpenAPI specification, xác định các endpoints, sinh API test cases có cấu trúc, và (tùy mode) tự động sinh automation scripts hoàn chỉnh.
⚠️ Nguyên tắc thực thi
- Tất cả output bằng Tiếng Việt
- KHÔNG đoán schema/endpoint — phải đọc spec thực tế (JSON/YAML)
- Phải chờ user xác nhận scope tại Bước 2 trước khi sinh chi tiết
- Nếu user chưa cung cấp Swagger URL/file → hỏi trước khi bắt đầu
- ⚠️ Rule E3: Khi test FAIL → tự đọc log → phân tích → sửa → chạy lại. KHÔNG hỏi user trong quá trình fix lỗi
2 Chế độ (Mode)
| Mode | Khi nào sử dụng | Output |
|---|---|---|
| SPEC (mặc định) | User cần API test cases dưới dạng tài liệu | API Test Cases (Markdown) + Test Data Matrix |
| FULL | User yêu cầu cả automation scripts | Như SPEC + Automation Scripts + Project Structure |
Nếu user nói "generate automation", "viết code test API", hoặc yêu cầu scripts → tự động chuyển sang Mode FULL.
Các bước thực hiện
Bước 1: Tiếp nhận & Phân tích Spec (Parse & Analyze)
- Thu thập Swagger/OpenAPI spec từ user:
- URL trực tiếp (VD:
https://api.example.com/swagger.json) → dùngWebFetchđể fetch - File local (JSON/YAML) → dùng
Readđể đọc - Swagger UI URL → trích xuất URL spec gốc (thường là
/v2/api-docshoặc/v3/api-docs) - Scalar API Reference URL → inspect HTML để tìm
data-configurationchứa URL spec (thường là/swagger/json,/reference/json, hoặc relative path trong attributeurl). VD:https://book.anhtester.com/swagger→ spec tạihttps://book.anhtester.com/swagger/json - Các dạng API Doc khác (Redoc, Stoplight, RapiDoc) → tìm URL spec trong page source hoặc network requests
- URL trực tiếp (VD:
- Parse spec và trích xuất thông tin:
- Base URL, API version, authentication scheme (Bearer, API Key, OAuth2, Basic)
- Danh sách tất cả endpoints:
method + path - Request parameters: path, query, header, body (schema + required fields)
- Response schemas: status codes, response body structure
- Models/Definitions: reusable data models
- Phân loại endpoints theo nhóm:
- CRUD operations — Create, Read, Update, Delete
- Authentication — Login, Register, Token refresh
- Business Logic — Các API xử lý nghiệp vụ phức tạp
- Utility — Health check, config, metadata
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.
- 1mo ago First seen · 167 lines · 36 tokens per session scan A 227f5c93612b
generate_api_tests_from_swagger is a command published in the GitHub repository anhtester/claude-testing-kit (61 stars, last pushed 2mo ago), licensed MIT. It adds 36 tokens to every session and 2,510 once invoked, about $0.0001 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.
Other commands, from other repositories
case
A command for registering and managing Testany cases. A case is a reusable package containing one automated testing step, its metadata, and its scripts.
test-reviewer
A review process for an independent test package, checking whether its tests cover the requirements, can be run, and have supporting evidence.
test-spec-writer
A process for turning approved product and technical documents into a complete set of software test cases. It produces a traceability matrix, which links requirements and risks to tests, plus instructions for running and automating them.
test-strategy-reviewer
A command that reviews a software test strategy before detailed design and test specifications begin. It checks the planned tests, environments, dependencies, automation, and release rules.
case-writing
A command that turns traditional test scenarios into Testany platform cases, including metadata, scripts, and uploadable ZIP packages. It supports API, user-interface, end-to-end, Java, and Postman-based tests.
execution
A command for observing and managing Testany executions, meaning individual pipeline runs after they have started. It can show progress and results, search run history, refresh status, and cancel runs that have not started.