Api mock
Generate a working mock server from an OpenAPI/Swagger spec or from a verbal API description. Outputs Express (Node), FastAPI (Python), or Hono (TypeScript).From its SKILL.md
npx -y skills add kasimmj/claude-skills-mega --skill api-mockAssembled 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 file declares
Copied from the file, not written here
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, 491 tokens by cl100k_base, 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:
- An OpenAPI/Swagger file (
openapi.yaml,swagger.json) - A REST description in the user's message
- A
routes.md/API.mdin the repo
If unclear, ask for the API shape.
Step 2 — Pick the framework
Detect from existing project files:
package.jsonwith Express/Fastify/Hono → match itrequirements.txtwith 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) orFaker(Python) - Honor status codes — if the spec says 201, return 201
- Add
Content-Typeheaders - 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__orapp.listen()block - A header comment with the run command
When NOT to use
- The user wants a real API — use
api-buildskill instead - The user wants contract tests — use
contract-testskill
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.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.