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
- manastalukdar/ai-devstudiotheir own version, first seen Oct 13, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 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.
- changelog-genSkill
- db-migrateSkill
- i18n-translateSkill
- license-checkSkill
- security-auditSkill
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
- Distinctive: line 20
Look for, in order:
- Distinctive: line 25
If unclear, ask for the API shape.
- Distinctive: line 40
Add a 200–800ms artificial latency (configurable)
- Very specific: line 51
Always enable CORS with Access-Control-Allow-Origin: * for the mock.
≈ “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.
Files
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.
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
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.

