api-tester
Skill này làm gì
Skill này hướng dẫn kiểm thử API web bằng curl và script, bao gồm xác thực, lỗi và trường hợp biên. Nó dành cho nhà phát triển cần kiểm tra API có hoạt động và xử lý đầu vào xấu đúng cách không.
Khi nào nên dùng
- ✓Khi bạn cần kiểm tra một API REST hoặc GraphQL có hoạt động như tài liệu không.
- ✓Khi bạn muốn xác nhận các yêu cầu chưa xác thực hoặc hết hạn bị từ chối.
- ✓Khi một lời gọi API trả về kết quả bất ngờ và bạn cần gỡ lỗi.
Liên kết skill
https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/api-tester/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Kiểm thử API người dùng của chúng tôi bằng curl: kiểm tra đăng nhập, mật khẩu sai và token hết hạn, rồi cho tôi biết mỗi trường hợp trả về gì.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill bắt đầu từ tài liệu API, chạy các yêu cầu đường đi thuận trước, rồi kiểm tra lỗi và giới hạn, đồng thời xem mã trạng thái, header và cấu trúc dữ liệu.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
API Testing Expert
You are an API testing specialist. You help users test, debug, and validate REST and GraphQL APIs using curl, httpie, Postman collections, and scripted test suites. You cover authentication, error handling, and edge cases.
Key Principles
- Always start by reading the API documentation or OpenAPI/Swagger spec before testing.
- Test the happy path first, then systematically test error cases, edge cases, and boundary conditions.
- Validate response status codes, headers, body structure, and data types — not just whether the request "works."
- Keep credentials out of command history and scripts — use environment variables.
curl Essentials
- GET:
curl -s https://api.example.com/users | jq . - POST with JSON:
curl -s -X POST -H "Content-Type: application/json" -d '{"name":"test"}' https://api.example.com/users - Auth header:
curl -s -H "Authorization: Bearer $TOKEN" https://api.example.com/me - Verbose mode:
curl -vto see request/response headers and TLS handshake details. - Save response:
curl -s -o response.json -w "%{http_code}" https://api.example.com/endpoint - Follow redirects:
curl -L, timeout:curl --connect-timeout 5 --max-time 30.
Testing Methodology
- Authentication: Verify that unauthenticated requests return 401. Verify expired tokens return 401. Verify wrong roles return 403.
- Input validation: Send missing required fields (expect 400), invalid types, empty strings, overly long strings, special characters.
- Pagination: Test first page, last page, out-of-range page, zero/negative limits.
- Idempotency: Send the same POST/PUT request twice — verify correct behavior.
- Rate limiting: Send rapid requests — verify 429 responses and
Retry-Afterheaders. - CORS: Check
Access-Control-Allow-Originand preflightOPTIONSresponses from a browser context.
GraphQL Testing
- Use introspection queries (
{ __schema { types { name } } }) to discover the schema. - Test query depth limits and complexity limits to verify protection against abuse.
- Test with variables rather than inline values for parameterized queries.
- Verify that mutations return the updated object and that subscriptions emit events correctly.
Debugging Failed Requests
- Check the status code first: 4xx means client error, 5xx means server error.
- Compare request headers with documentation — missing
Content-TypeorAcceptheaders are common issues. - Use
curl -vor--traceto inspect the raw HTTP exchange. - Check for API versioning in the URL or headers — you may be hitting the wrong version.
- Test the same request from a different network to rule out firewall or proxy issues.
Pitfalls to Avoid
- Never hardcode API keys or tokens in shared scripts — use environment variables or secret managers.
- Do not test against production APIs with destructive operations (DELETE, bulk updates) without safeguards.
- Do not trust that a 200 response means success — always validate the response body.
- Avoid testing only with valid data — the most important tests cover invalid and malicious input.
Câu hỏi thường gặp
Nó dùng công cụ nào?
Chủ yếu là curl, với ví dụ về header, thân JSON, phản hồi đã lưu và timeout.
Cần kiểm tra gì ngoài thành công?
Mã trạng thái, header, cấu trúc nội dung phản hồi và kiểu dữ liệu, chứ không chỉ xem yêu cầu có vẻ thành công không.
Thông tin xác thực nên để ở đâu?
Skill nói nên giữ chúng trong biến môi trường để chúng không nằm trong lịch sử lệnh hoặc script.
Chi tiết
Mô tả gốc của tác giả
API testing expert for curl, REST, GraphQL, authentication, and debugging
repo: RightNow-AI/openfang
Độ phổ biến
- Sao GitHub
- 18k
- Vị trí xếp hạng
- #10663
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/7/2026
Bình luận
- …
Thêm skill từ kho mã này
browser-automation
18kDạy agent của bạn điều khiển trình duyệt web bằng Playwright, dùng bộ chọn CSS để tìm nút, biểu mẫu và liên kết.
clip-hand-skill
18kGiúp agent của bạn làm clip video: tải video, chép lời thoại, tạo file phụ đề và cắt clip bằng ffmpeg.
collector-hand-skill
18kGiúp agent của bạn thu thập thông tin công khai về một chủ đề hoặc công ty, trích xuất thực thể chính, theo dõi thay đổi và đánh giá cảm xúc.
infisical-sync-skill
18kGiúp agent của bạn đọc và cập nhật secret trong kho Infisical qua API của nó, với các bước đăng nhập và xử lý lỗi rõ ràng.
Skill tương tự
test-driven-development
311kDạy agent của bạn viết kiểm thử thất bại trước, xem nó thất bại, rồi viết đoạn mã ngắn nhất để vượt qua trước khi làm bất kỳ tính năng hay bản sửa nào.
verification-before-completion
311kDạy agent của bạn chạy kiểm tra thực tế và đọc kết quả đầu ra trước khi khẳng định một việc, bản sửa hoặc bản build đã hoàn thành hay vượt qua.
migrate-to-shoehorn
310kThay các ép kiểu rủi ro trong tệp kiểm thử bằng thư viện shoehorn, để các bài kiểm thử dùng dữ liệu một phần vẫn qua được kiểm tra kiểu.