Agent SkillsRightNow-AI/openfang › api-tester

api-tester

GitHub

API测试专家,协助使用curl等工具对REST/GraphQL API进行功能、认证及异常场景验证与调试。

crates/openfang-skills/bundled/api-tester/SKILL.md RightNow-AI/openfang

Trigger Scenarios

API接口测试 API故障排查

Install

npx skills add RightNow-AI/openfang --skill api-tester -g -y
More Options

Non-standard path

npx skills add https://github.com/RightNow-AI/openfang/tree/main/crates/openfang-skills/bundled/api-tester -g -y

Use without installing

npx skills use RightNow-AI/openfang@api-tester

指定 Agent (Claude Code)

npx skills add RightNow-AI/openfang --skill api-tester -a claude-code -g -y

安装 repo 全部 skill

npx skills add RightNow-AI/openfang --all -g -y

预览 repo 内 skill

npx skills add RightNow-AI/openfang --list

SKILL.md

Frontmatter
{
    "name": "api-tester",
    "description": "API testing expert for curl, REST, GraphQL, authentication, and debugging"
}

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 -v to 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

  1. Authentication: Verify that unauthenticated requests return 401. Verify expired tokens return 401. Verify wrong roles return 403.
  2. Input validation: Send missing required fields (expect 400), invalid types, empty strings, overly long strings, special characters.
  3. Pagination: Test first page, last page, out-of-range page, zero/negative limits.
  4. Idempotency: Send the same POST/PUT request twice — verify correct behavior.
  5. Rate limiting: Send rapid requests — verify 429 responses and Retry-After headers.
  6. CORS: Check Access-Control-Allow-Origin and preflight OPTIONS responses 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-Type or Accept headers are common issues.
  • Use curl -v or --trace to 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.

Version History

  • acf2587 Current 2026-08-20 07:37

Same Skill Collection

crates/openfang-hands/bundled/browser/SKILL.md
crates/openfang-hands/bundled/clip/SKILL.md
crates/openfang-hands/bundled/collector/SKILL.md
crates/openfang-hands/bundled/infisical-sync/SKILL.md
crates/openfang-hands/bundled/lead/SKILL.md
crates/openfang-hands/bundled/predictor/SKILL.md
crates/openfang-hands/bundled/researcher/SKILL.md
crates/openfang-hands/bundled/trader/SKILL.md
crates/openfang-hands/bundled/twitter/SKILL.md
crates/openfang-skills/bundled/ansible/SKILL.md
crates/openfang-skills/bundled/aws/SKILL.md
crates/openfang-skills/bundled/azure/SKILL.md
crates/openfang-skills/bundled/ci-cd/SKILL.md
crates/openfang-skills/bundled/code-reviewer/SKILL.md
crates/openfang-skills/bundled/compliance/SKILL.md
crates/openfang-skills/bundled/confluence/SKILL.md
crates/openfang-skills/bundled/crypto-expert/SKILL.md
crates/openfang-skills/bundled/css-expert/SKILL.md
crates/openfang-skills/bundled/data-analyst/SKILL.md
crates/openfang-skills/bundled/data-pipeline/SKILL.md
crates/openfang-skills/bundled/docker/SKILL.md
crates/openfang-skills/bundled/elasticsearch/SKILL.md
crates/openfang-skills/bundled/email-writer/SKILL.md
crates/openfang-skills/bundled/figma-expert/SKILL.md
crates/openfang-skills/bundled/gcp/SKILL.md
crates/openfang-skills/bundled/git-expert/SKILL.md
crates/openfang-skills/bundled/github/SKILL.md
crates/openfang-skills/bundled/golang-expert/SKILL.md
crates/openfang-skills/bundled/graphql-expert/SKILL.md
crates/openfang-skills/bundled/helm/SKILL.md
crates/openfang-skills/bundled/interview-prep/SKILL.md
crates/openfang-skills/bundled/jira/SKILL.md
crates/openfang-skills/bundled/kubernetes/SKILL.md
crates/openfang-skills/bundled/linear-tools/SKILL.md
crates/openfang-skills/bundled/linux-networking/SKILL.md
crates/openfang-skills/bundled/llm-finetuning/SKILL.md
crates/openfang-skills/bundled/ml-engineer/SKILL.md
crates/openfang-skills/bundled/mongodb/SKILL.md
crates/openfang-skills/bundled/nextjs-expert/SKILL.md
crates/openfang-skills/bundled/nginx/SKILL.md
crates/openfang-skills/bundled/notion/SKILL.md
crates/openfang-skills/bundled/oauth-expert/SKILL.md
crates/openfang-skills/bundled/openapi-expert/SKILL.md
crates/openfang-skills/bundled/postgres-expert/SKILL.md
crates/openfang-skills/bundled/presentation/SKILL.md
crates/openfang-skills/bundled/project-manager/SKILL.md
crates/openfang-skills/bundled/prometheus/SKILL.md
crates/openfang-skills/bundled/prompt-engineer/SKILL.md
crates/openfang-skills/bundled/python-expert/SKILL.md

Metadata

Files
0
Version
acf2587
Hash
d7dcba78
Indexed
2026-08-20 07:37

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-21 22:38
浙ICP备14020137号-1 $mapa de visitantes$