agentleFS
mejbaurbaharmejbaurbahar/fagun/skills/api-testing/SKILL.md

api-testing

Skill1 starsChanged 5 months agoMITView on GitHub

Use when testing REST/GraphQL APIs directly — status codes, schema/contract validation, auth, pagination, rate limits, idempotency, and error responses. Use instead of driving the UI when the question is really about the API layer.

17 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use e2e-testing, debugging and 3 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Svenja-devSkill

    e2e-testing

    Also in 3 projects that use this

  • BlockSkill

    debugging

    Debugging guidelines and best practices

    Also in 4 projects that use this

  • MicrosoftSkill

    api-design

    Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.

    Also in 5 projects that use this

  • SentrySkill

    security-review

    Finds exploitable application security vulnerabilities in code changes. Use for Warden security scans, appsec review, OWASP-style checks, authentication or authorization bugs, injection, XSS, SSRF, path traversal, secrets, unsafe crypto, webhook verification, open redirects, or sensitive data exposure.

    Also in 4 projects that use this

  • GoogleSkill

    code-review

    Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 15 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Auth: no token → 401; wrong-role token → 403.

    line 15
  2. Distinctive:

    If an OpenAPI/GraphQL schema exists, validate responses against it programmatically rather than eyeballing JSON.

    line 22

“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

API Testing

Why test at the API layer

Faster, more deterministic, and catches issues the UI might mask (a UI can silently swallow a 500 and show stale cached data). Always cross-check UI-observed bugs against the raw API response before filing — it tells you whether the bug is frontend or backend.

Core checklist per endpoint

  • Status codes: correct code for success (200/201/204), client error (400/401/403/404/409/422), server error (500). A 200 with an error body in it is a common anti-pattern to flag.
  • Response schema: matches documented/expected shape — types, required fields present, no leaked internal fields (password hashes, internal IDs meant to be opaque).
  • Request validation: missing required fields, wrong types, extra unexpected fields, malformed JSON — server should reject cleanly, not 500.
  • Auth: no token → 401; wrong-role token → 403; expired token → 401 with clear error, not a silent empty response; token for another tenant/user → must not leak cross-tenant data (test this explicitly, it's a common critical bug).
  • Pagination: first page, last page, page beyond range, page size 0/negative/huge, consistent ordering across pages (no duplicate/skipped records from concurrent writes).
  • Idempotency: does retrying a POST (e.g. payment, order-create) create duplicates? Idempotency-key support if documented.
  • Rate limiting: does exceeding the limit return 429 with a sane Retry-After, or does it just fail unpredictably?
  • Error response consistency: same shape/format for errors across endpoints (don't want one endpoint returning {error: "..."} and another a bare string).

Contract/schema validation

  • If an OpenAPI/GraphQL schema exists, validate responses against it programmatically rather than eyeballing JSON.
  • Flag drift between documented contract and actual behavior — that's a bug even if "the API works."

Tools available in this harness

  • requests in the qa-agent venv for scripted checks; curl -i for quick one-offs (the -i shows headers, useful for auth/cache header checks).
  • Claude in Chrome / Chrome DevTools MCP list_network_requests / get_network_request to capture real requests the frontend makes, then replay/modify them directly.
  • Postman MCP tools (mcp__claude_ai_Postman__*) when a collection already exists or is worth building for the project — generate one from observed traffic when useful.

Security-adjacent checks (see [[security-testing]] for depth)

  • IDOR: increment/guess another user's resource ID, confirm access is denied.
  • Mass assignment: send extra fields in a request body (e.g. "role": "admin") and confirm the server ignores/rejects rather than applying them.
  • Injection: SQL/NoSQL/command-injection payloads in every string input, not just search boxes.

Reporting

Include the exact request (method, URL, headers if relevant, body) and full response in bug reports — see [[bug-reporting]]. "The API is broken" without the request/response pair is not actionable.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.