Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/christopherlouet/claude-base/api-mockingnpx skills add christopherlouet/claude-base --skill api-mockinggit clone --depth 1 https://github.com/christopherlouet/claude-baseWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/christopherlouet/claude-base/api-mocking)<a href="https://agentmods.dev/skills/christopherlouet/claude-base/api-mocking"><img src="https://agentmods.dev/badge/skills/christopherlouet/claude-base/api-mocking.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00029 | $0.00560 |
| Opus 5 | $0.00015 | $0.00280 |
| Sonnet 5 | $0.00006 | $0.00112 |
| Haiku 4.5 | $0.00003 | $0.00056 |
Grade A, and why
api-mocking scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
API Mocking (pointer)
MSW handler API, browser/node setup, install commands and request-interception internals are canonical at vendor docs and drift on each release:
- MSW — mswjs.io (recommended default; browser worker + Node server, single handler set)
- nock — github.com/nock/nock (Node-only HTTP interception)
- json-server — github.com/typicode/json-server (full REST fake server from a JSON file)
- Mirage JS — miragejs.com (browser-only, models + factories)
Tool selection (version-agnostic)
Need to mock HTTP for tests/dev?
├── Browser AND Node from one handler set → MSW
├── Node-only unit tests, low ceremony → nock
├── Need a stateful REST fake server (CRUD) → json-server
└── Browser-only with relational fixtures (factories) → Mirage JS
Foundation discipline (keep across releases)
- Type-safe mocks: derive mock payloads from the same TypeScript types as the real API (e.g. shared
types/api.ts). A mock that compiles against stale types is the #1 source of mock-prod divergence. - Reset between tests: always
resetHandlers()(MSW) orcleanAll()(nock) inafterEach— leaked state across tests is a debugging tax. - Realistic failure modes: simulate 5xx/timeouts/auth errors, not just happy paths. The mock is only useful if it exercises the same edge cases as prod.
- Unhandled = error: in tests use
onUnhandledRequest: 'error'(MSW) so a typo'd URL fails loudly instead of silently passing.
See also
dev-tdd— mocks live in test setup; this skill activates from TDD workqa-e2e— Playwright/Cypress tests often layer MSW for deterministic stubsdev-tdd(test-infrastructure setup) — wires the globalsetupServerinto vitest/jest config
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- today First seen · 47 lines · 29 tokens per session scan A d09667c2d884
api-mocking is a skill published in the GitHub repository christopherlouet/claude-base (5 stars, last pushed today), licensed MIT. It adds 29 tokens to every session and 560 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
spec-manager
Spec-driven project iteration workflow — L1 PRD → L2 Design → L3 Impl → Agent Task → Deploy, with human review gates at each layer. Pure local markdown storage, no MCP, no network. Use when the user invokes /spec-manager or asks for: new feature/PRD, technical design, implementation spec, agent task, iteration plan…
spec-manager
Spec-driven project iteration workflow — L1 PRD → L2 Design → L3 Impl → Agent Task → Deploy, with human review gates at each layer. Pure local markdown storage, no MCP, no network. Use when the user invokes /spec-manager or asks for: new feature/PRD, technical design, implementation spec, agent task, iteration plan…
zhihu-publish
Use when the task is to publish a Zhihu article from Markdown using the local browser-automation pipeline in this repo. Covers the text-only publishing chain, the multimodal chain that uploads Markdown images into the Zhihu editor, cookie-based login checks, and choosing between the stable text script and the richer…
full_unpackd_rep
Use when the task is to unpack a local reference repository into a Chinese structural topic page, update site navigation, stamp dates, and leave behind a reusable deconstruction note for the repo.
gen-zhihu-article
Generate Zhihu article in the style of 22-庖丁解牛专题页-知乎图文终版.md.
loloop
Use when a task should advance through repeated plan-driven loop cycles for an engineering project, paper, or long-running repo change. loloop wraps the official /loop idea with the repo's loop-in-loop method: read the current plan, inspect prior evolution notes, execute the current iteration, write a new evolution…