Mockapi
Create stateful TypeScript/Hono mock API servers from OpenAPI 3.0/3.1 contracts. Use for building OpenAPI-based mock APIs, creating or repairing .mockapi sidecars, validating mock profiles, generating admin state endpoints, or freeform requests such as "mockapi build a mock server for api/openapi.yaml".From its SKILL.md
npx -y skills add devctllabs/mockapi --skill mockapiAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 3 stars3 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.
- runs commandsInstructs the agent to run 7 commands, including `<python> <skill-root>/scripts/generate.py` and 6 more.
SKILL.md
6.0 KB, ~1.3k tokens by cl100k_base, as published. Nobody here has run it
mockapi
Use this skill to create stateful mock API servers from OpenAPI contracts. The
agent owns behavior analysis and sidecar authoring; bundled scripts only perform
structural validation and deterministic typed scaffolding. Generated operation
services are TODOs; the agent completes wiring and behavior from
.mockapi/behavior.md anchors.
Command Router
Route invocations:
- No argument: show a short menu with
profile,generate, and freeform examples. Ask what the user wants to do. - First word
profile: readreference/profile.mdand follow that workflow. Everything afterprofileis the target or context. - First word
generate: before any OpenAPI search or repo-wide file scan, readreference/generate.mdand run the generate sidecar preflight from that workflow. Everything aftergenerateis the target or context. After the profile and sidecars are present and validation succeeds, always run<python> <skill-root>/scripts/generate.py; do not satisfy ageneratecommand by only describing, planning, or hand-writing the scaffold. - Any other first word: treat the entire argument as a general mockapi request. Do not reject unknown first words merely because they are not commands.
General mockapi request routing:
- Mock-server creation requests such as "make", "build", "create", "generate",
"scaffold", or "use this OpenAPI" route to
reference/generate.md.generateauto-runs the profile workflow when sidecars are missing. - Profile, analyze, describe, or sidecar-only requests route to
reference/profile.md. - Validate, check, repair, or diagnose sidecar requests run
scripts/validate_profile.py, readreference/sidecars.md, and repair or report blockers as needed. The validator checksprofile.tomlandbehavior.mdunless--profile-onlyis used. - Questions about existing generated mock-server code read
reference/generated-server.md,reference/mock-server-structure.md, andreference/mock-server-examples.md, then inspect the relevant files. When finishing or reviewing LLM-owned generated server code, also readreference/mock-server-quality.md.
If the freeform intent remains ambiguous after inspecting the repository, ask one concise clarification before mutating files. Do not invent extra commands or run unbundled scripts.
Runtime Rules
- Requires Python 3.11+ for bundled scripts. Resolve
<python>to an executable whose version is 3.11+ before running script examples. If no suitable interpreter exists, stop and report the requirement to the user. Bundled CLI scripts also verify the active interpreter and fail with a clear error when it is too old. - Resolve
<skill-root>to the directory containing thisSKILL.md. Run shell command examples by replacing<skill-root>with that absolute or repository-relative skill directory. - Run only committed bundled Python scripts from
scripts/*.pyduring normal skill usage. - Treat
reference/*.mdand the target repository context as the primary contract for agent decisions. Do not read script source as a source of profiling requirements during normal profile work. - Use
reference/sidecars.mdas the authoritative sidecar schema, including validprofile.tomlfields. If a needed sidecar shape is missing from the references, stop and report the exact documentation gap instead of inferring it fromscripts/mockapi_runtime/*.py. - Inspect bundled Python source only to diagnose a validator or generator defect after running the committed scripts. Do not use script source to discover valid sidecar fields, defaults, or profile behavior policy.
- Do not run dependency installation inside the skill folder.
- For generated package dependency/script steps, use
scripts/detect_package_manager.py; do not hand-rollcommand -vpackage manager checks or rely on interactive shell startup files. - In
generateworkflows, run generated package codegen before implementing or editing LLM-owned controller wiring or feature modules. - Do not edit OpenAPI contracts unless the user explicitly requests contract changes.
- Treat
.mockapi/profile.tomland.mockapi/behavior.mdas the durable source of truth for generation. - For any
generateworkflow, runscripts/generate.py --run-codegenafter successful validation. If validation fails, repair sidecars or report blockers instead of running the generator on invalid data. - Treat
profile.tomlas the structural operation index. Implement operation behavior from the matchingbehavior.mdanchor, not from operation shape. - Use
reference/sidecars.mdfor sidecar shape and validation expectations. - Use
reference/generated-server.md,reference/mock-server-structure.md,reference/mock-server-examples.md,reference/seed-data.md,reference/testing.md, andreference/mock-server-quality.mdwhen inspecting or finishing generated server code.
Bundled Scripts
Validate sidecars:
<python> <skill-root>/scripts/validate_profile.py
Preflight sidecars for generate:
<python> <skill-root>/scripts/preflight_generate.py --root .
Profile-only validation:
<python> <skill-root>/scripts/validate_profile.py --profile-only
Generate server scaffold and run codegen:
<python> <skill-root>/scripts/generate.py --root . --profile .mockapi/profile.toml --run-codegen
Detect generated package manager for manual regeneration:
<python> <skill-root>/scripts/detect_package_manager.py --root . --profile .mockapi/profile.toml
Final quality gate after implementation only:
<python> <skill-root>/scripts/check_generated_quality.py --package-root <packageRoot> --profile .mockapi/profile.toml
What ships with it: 66 files
256.7 KB alongside SKILL.md, 43 of them executable
agents/
- openai.yaml177 B
assets/
- templates/mock-server/.gitignore24 B
- templates/mock-server/package.json959 B
- templates/mock-server/README.md647 B
- templates/mock-server/scripts/build.mjsruns542 B
- templates/mock-server/scripts/codegen-admin-openapi.tsruns7.6 KB
- templates/mock-server/scripts/lib/mockRuntimeCodegen.tsruns13.1 KB
- templates/mock-server/src/browser.tsruns539 B
- templates/mock-server/src/config.tsruns1.0 KB
- templates/mock-server/src/dependencies.tsruns313 B
- templates/mock-server/src/generated/mock-admin/state/controller.tsruns806 B
- templates/mock-server/src/generated/mock-admin/state/service.tsruns925 B
- templates/mock-server/src/lib/browserStateStore.tsruns1.4 KB
- templates/mock-server/src/lib/clone.tsruns134 B
- templates/mock-server/src/lib/errors.tsruns1.1 KB
- templates/mock-server/src/lib/honoMockRuntime.tsruns3.2 KB
- templates/mock-server/src/lib/ids.tsruns280 B
- templates/mock-server/src/lib/nodeStateStore.tsruns1.8 KB
- templates/mock-server/src/lib/requestContext.tsruns331 B
- templates/mock-server/src/lib/softDelete.tsruns235 B
- templates/mock-server/src/lib/sort.tsruns426 B
- templates/mock-server/src/server.tsruns668 B
- templates/mock-server/tsconfig.json318 B
- templates/mock-server/vitest.config.tsruns179 B
reference/
- generated-server.md8.4 KB
- generate.md11.5 KB
- mock-server-examples.md17.7 KB
- mock-server-quality.md5.5 KB
- mock-server-structure.md5.1 KB
- profile.md7.6 KB
- seed-data.md3.3 KB
- sidecars.md5.9 KB
- testing.md1.9 KB
scripts/
- check_generated_quality.pyruns1.3 KB
- detect_package_manager.pyruns1015 B
- generate.pyruns1.3 KB
- mockapi_runtime/admin_openapi.yaml2.7 KB
- mockapi_runtime/behavior_policy.pyruns1.8 KB
- mockapi_runtime/context.pyruns1.0 KB
- mockapi_runtime/diagnostics.pyruns2.1 KB
26 more files not listed here. See all 66 in the repository.