agentleFS
kasimmjkasimmj/claude-skills-mega/skills/api-mock/SKILL.md

api-mock

Skill1 starsChanged 6 months agoMITView on GitHub

Generate a working mock server from an OpenAPI/Swagger spec or from a verbal API description. Outputs Express (Node), FastAPI (Python), or Hono (TypeScript).

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. manastalukdar/ai-devstudio★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository5 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    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:

    Look for, in order:

    line 20
  2. Distinctive:

    If unclear, ask for the API shape.

    line 25
  3. Distinctive:

    Add a 200–800ms artificial latency (configurable)

    line 40
  4. Very specific:

    Always enable CORS with Access-Control-Allow-Origin: * for the mock.

    line 51

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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 Mock Skill

You are generating a mock HTTP server. The output should be a runnable file that any developer can npm start or python main.py to test against.

Step 1 — Identify the source

Look for, in order:

  1. An OpenAPI/Swagger file (openapi.yaml, swagger.json)
  2. A REST description in the user's message
  3. A routes.md / API.md in the repo

If unclear, ask for the API shape.

Step 2 — Pick the framework

Detect from existing project files:

  • package.json with Express/Fastify/Hono → match it
  • requirements.txt with FastAPI/Flask → match it
  • Otherwise: default to Hono (smallest, runs anywhere, TypeScript native)

Step 3 — Generate the mock

For each endpoint:

  • Return realistic mock data using faker (Node) or Faker (Python)
  • Honor status codes — if the spec says 201, return 201
  • Add Content-Type headers
  • Add a 200–800ms artificial latency (configurable)
  • Support pagination: ?limit=N&page=N

For errors:

  • /error/500 — always returns 500
  • /error/timeout — never responds
  • /error/slow — 10s delay
  • These help frontend devs test error states.

Step 4 — Add CORS

Always enable CORS with Access-Control-Allow-Origin: * for the mock. It's a dev tool — security doesn't apply.

Step 5 — Output

A single file with:

  • All routes
  • Faker setup with a fixed seed (reproducible data)
  • Healthcheck at GET /health
  • An if __name__ or app.listen() block
  • A header comment with the run command

When NOT to use

  • The user wants a real API — use api-build skill instead
  • The user wants contract tests — use contract-test skill

Failure modes

  • ⚠️ Don't add auth to the mock unless asked. Defeats the purpose.
  • ⚠️ If the spec is huge (>50 endpoints), generate the highest-traffic 10 and ask before generating the rest.

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.