Api mock
π€ The ultimate curated collection of production-ready Claude Code skills with a framework to build your own.
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 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:
- 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.