agentleFS
MohamedRamadanSalahMohamedRamadanSalah/claude-qa-toolkit/.claude/skills/api-test/SKILL.md

api-test

Skill0 starsChanged 17 days agoMITView on GitHub

Test REST APIs — define test suites as JSON and run them with a bundled Python runner that validates status codes, response bodies, timing, and leaked stack traces. Use when the user wants to test an API, check endpoints, or verify API responses.

5 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    no auth token → 401; wrong role → 403

    line 40
  2. Very specific:

    Never print full tokens — mask like eyJhb...

    line 57
  3. Distinctive:

    No destructive requests (DELETE, bulk updates) without the user confirming the environment and approving explicitly.

    line 58

“Common” is measured: kept by at least 6 in 10 of the 3 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 Tester

A bundled Python runner executes API tests deterministically. Your job is to WRITE the suite file well; the script does the running and checking. Follow this workflow.

Workflow (mandatory)

  1. Gather: base URL, auth (token/credentials), and either specific endpoints or a Swagger/OpenAPI spec (read it if given).
  2. Write the suite to api-tests/<name>.json:
{
  "base_url": "https://qa.example.com",
  "default_headers": {"Authorization": "Bearer <token>"},
  "tests": [
    {
      "name": "get user 1 - ok",
      "method": "GET",
      "path": "/api/users/1",
      "expect": {"status": 200, "max_time_s": 3, "json_fields": ["id", "email"], "json_equals": {"id": 1}}
    },
    {
      "name": "get user - no token - unauthorized",
      "method": "GET",
      "path": "/api/users/1",
      "headers": {"Authorization": ""},
      "expect": {"status": 401}
    }
  ]
}

For EVERY endpoint, generate this standard set (skip only what doesn't apply):

  • valid request → 200/201 + expected fields (json_fields)
  • missing/invalid required fields → 400
  • no auth token → 401; wrong role → 403
  • non-existent ID → 404
  • boundary values in body (0, -1, max length, unicode)
  1. Run it:
python .claude/skills/api-test/scripts/run_api_tests.py --suite api-tests/<name>.json --report api-tests/results.md
  • The script REFUSES to run if base_url doesn't look like a test environment (no dev/qa/test/staging/localhost in it). If blocked, ASK THE USER to confirm the environment before adding --allow-any-env. Never add that flag on your own.
  • The script also flags leaked stack traces in responses automatically — report those as security-relevant bugs.
  1. Report: show the pass/fail table. For each failure, state expected vs actual in one line. Offer to write bug reports (bug-report skill) for real defects.

Safety rules

  • Never print full tokens — mask like eyJhb...**** (the script masks automatically; you do the same in chat).
  • No destructive requests (DELETE, bulk updates) without the user confirming the environment and approving explicitly.

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.