http-api-mock-forge
Stand up deterministic HTTP API mocks for tests and local dev using MSW, Nock, or Prism — request matching, stateful handlers, and contract fidelity.
Skill by anton-abyzov
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/anton-abyzov-http-api-mock-forge
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: documents, backend
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/http-api-mock-forge
What's inside
- Skill name
http-api-mock-forge- Description
- Stand up deterministic HTTP API mocks for tests and local dev using MSW, Nock, or Prism — request matching, stateful handlers, and contract fidelity.
- License
- MIT
- Instructions
- 91 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# http-api-mock-forge
Replace real upstream HTTP calls with deterministic mocks so tests are fast,
offline, and repeatable — without losing contract fidelity.
## Pick the right tool
| Tool | Best for | Layer it intercepts |
|---------------|-------------------------------------------|----------------------------|
| **MSW** | browser + node app code, shared handlers | `fetch`/XHR via service worker / node interceptor |
| **Nock** | node-only, low-level HTTP assertions | node `http`/`https` module |
| **Prism** | mock straight from an OpenAPI spec | standalone HTTP server |
| **WireMock** | language-agnostic, JVM-friendly services | standalone HTTP server |
Rule of thumb: if you have an OpenAPI document, generate the mock from it
(Prism/WireMock) so the mock can never drift from the contract. Otherwise use
MSW for app-level tests.
## MSW handler example
```ts
import { http, HttpResponse } from 'msw';
import { setupServer } from 'msw/node';
const server = setupServer(
http.get('https://api.acme.example/v1/users/:id', ({ params }) => {
if (params.id === '404') {
return new HttpResponse(null, { status: 404 });
}
return HttpResponse.json({ id: params.id, name: 'Ada' });
}),
http.post('https://api.acme.example/v1/users', async ({ request }) => {
const body = await request.json();
if (!body.name) {
return HttpResponse.json({ error: 'name required' }, { status: 422 });
}
return HttpResponse.json({ id: 'usr_001', ...body }, { status: 201 });
}),
);
beforeAll(() => server.listen({ onUnhandledRequest: 'error' }));
afterEach(() => server.resetHandlers());
afterAll(() => server.close());
```
Setting `onUnhandledRequest: 'error'` is key: it fails the test the moment code
hits an un-mocked endpoint, catching accidental real network calls.
## Stateful mocks
For flows like "create then fetch", keep state inside the handler closure and
reset it per test:
```ts
let store = new Map();
afterEach(() => { store = new Map(); });
http.post('/v1/items', async ({ request }) => {
const item = { id: `itm_${store.size + 1}`, ...(await request.json()) };
store.set(item.id, item);
return HttpResponse.json(item, { status: 201 });
});
http.get('/v1/items/:id', ({ params }) =>
store.has(params.id)
? HttpResponse.json(store.get(params.id))
: new HttpResponse(null, { status: 404 }));
```
## Fidelity checklist
- Match **method + path + query + relevant headers**, not just the path.
- Mirror real **status codes and error bodies**, including 4xx/5xx, so error
handling is actually exercised.
- Reproduce **pagination, rate-limit headers, and latency** where the code
depends on them (use a small delay helper for timeouts/retries).
- Keep fixtures close to real payloads; trim only irrelevant fields.
## Anti-patterns
- Mocking your own code instead of the network boundary — mock at the HTTP edge.
- Over-broad matchers (`*`) that hide real request bugs.
- Letting mocks drift from the contract. Regenerate from OpenAPI when the spec
changes, or add a contract test that runs against the real sandbox in CI.
## Agent guidance
- Default to MSW for app tests; Prism when an OpenAPI spec exists.
- Always assert on the request the code sent, not only on the response.
- Fail on unhandled requests so silent real calls cannot slip through.From anton-abyzov/vskill-test-public-skills-826, MIT.
More from anton-abyzov/vskill-test-public-skills-826
- 0.551score
private-skill-sharing-review
anton-abyzov
Review a proposed sharing or publishing workflow for a private AI skill using supplied repository visibility and authorization details.
SkillAFreshness: AClaude Code +9 - 0.551score
skill-inventory-drift
anton-abyzov
Compare supplied AI skill inventories from two machines or agents by source identity, version, content hash and installation scope.
SkillAFreshness: AClaude Code +9 - 0.551score
release-evidence-review
anton-abyzov
Review supplied software release receipts and state exactly which source, test, deployment, installation and runtime claims they support.
SkillAFreshness: AClaude Code +9 - 0.471score
conventional-commits-gatekeeper
anton-abyzov
Enforce and author Conventional Commits messages, validate commit history, and map commit types to semantic-version bumps.
SkillCFreshness: CClaude Code +9 - 0.471score
dockerfile-hardening-guide
anton-abyzov
Harden Dockerfiles for security and size — non-root users, pinned bases, multi-stage builds, minimal layers, and supply-chain hygiene.
SkillCFreshness: CClaude Code +9 - 0.471score
git-bisect-detective
anton-abyzov
Drive git bisect to find the exact commit that introduced a regression, including automated test scripts and merge-commit handling.
SkillCFreshness: CClaude Code +9 - 0.471score
scanner-tripwire-fixture
anton-abyzov
DELIBERATE security-scanner test fixture — contains intentionally dangerous patterns (curl-pipe-bash, env-var exfiltration).
SkillCFreshness: CClaude Code +9 - 0.471score
oss-dependency-triage
anton-abyzov
Triage third-party dependencies before adoption — maintenance health, security advisories, supply-chain risk, and a go/no-go scoring rubric.
SkillCFreshness: CClaude Code +9 - 0.471score
sql-query-review-lens
anton-abyzov
Review SQL queries for correctness, performance, and safety — index usage, N+1 patterns, injection risk, and EXPLAIN-driven tuning.
SkillCFreshness: CClaude Code +9 - 0.471score
oss-license-auditor
anton-abyzov
Audit a project's dependency licenses for compatibility and obligations — copyleft detection, license allowlists, and SPDX-based reporting.
SkillCFreshness: CClaude Code +9 - 0.471score
changelog-scribe
anton-abyzov
Generate and maintain a Keep a Changelog style CHANGELOG.md from Conventional Commits, grouped by type with correct semver headings.
SkillCFreshness: CClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Jun 10, 2026 (4 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from anton-abyzov
- 0.783score
glossary
anton-abyzov
Build the shared language - interview the user term by term and write GLOSSARY.md with what each term means in the business, the data, the code and the UI.
SkillAFreshness: A★ 167Claude Code +9 - 0.783score
sw-grill-me
anton-abyzov
Interview the user relentlessly, in rounds, until every decision in a plan is settled; facts are your job, decisions are theirs.
SkillAFreshness: A★ 167Claude Code +9 - 0.783score
grill-me
anton-abyzov
Interview the user relentlessly, in rounds, until every decision in a plan is settled; facts are your job, decisions are theirs.
SkillAFreshness: A★ 167Claude Code +9 - 0.783score
sw-glossary
anton-abyzov
Build the shared language - interview the user term by term and write GLOSSARY.md with what each term means in the business, the data, the code and the UI.
SkillAFreshness: A★ 167Claude Code +9 - 0.781score
handoff
anton-abyzov
Hand work to another tool, account or machine and pick it up there, in two words.
SkillAFreshness: A★ 167Claude Code +9 - 0.781score
sw-handoff
anton-abyzov
Hand work to another tool, account or machine and pick it up there, in two words.
SkillAFreshness: A★ 167Claude Code +9
Cite this page
http-api-mock-forge skill. Agent Mart. https://agentmart.dev/skills/anton-abyzov-http-api-mock-forge (last updated 2026-10-24)