agentsclimarketplace

Api mock

Skill kasimmj/claude-skills-mega/skills/api-mock

πŸ€– The ultimate curated collection of production-ready Claude Code skills with a framework to build your own.

Install
npx -y skills add kasimmj/claude-skills-mega --skill api-mock

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

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

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

2.1 KB, as published. Nobody here has run it

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.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.