kalilurrahman/kr-claudiator-skills/api-mocking
Claude Code and agent skill by kalilurrahman/kr-claudiator-skills
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Mock external APIs for development and testing. Outputs mock server setup, request/response matching rules, contract-driven mocks, and CI integration.
Install
npx vskill@latest install kalilurrahman/kr-claudiator-skills/api-mockingSKILL.md
API Mocking
API mocking replaces real external services with controlled, predictable fakes during development and testing. Good mocks are fast, deterministic, and based on contracts — not implementation guesses.
Python: unittest.mock
WireMock — Mock Server for Integration Tests
MSW (Mock Service Worker) — Frontend
Contract-Driven Mocks with Pact
Anti-Patterns to Avoid
| Anti-Pattern | Problem | Fix | |
|---|---|---|---|
| Mocking internals | Tests break on refactor | Mock at integration boundaries (HTTP, DB) | |
| Tests pass on fake, fail on real | Mock diverged from real API | Contract tests; record real responses | |
| Over-specified mocks | Brittle — breaks when irrelevant details change | Match on essential fields only | |
| No error case mocks | Tests only cover happy path | Explicit tests for 4xx, 5xx, timeouts | |
| Shared mutable mock state | Tests interfere with each other | Reset mock state between tests |
10 Rules
- Mock at the integration boundary — HTTP clients, not internal functions.
- Contract tests ensure mocks match reality — run against real API periodically.
- Test error cases explicitly — 429, 500, timeouts, and network failures.
- Reset mock state between tests — shared state causes false positives.
- Record real API responses to seed mocks — don't guess the response format.
- Don't over-specify mocks — match essential fields; ignore irrelevant headers.
- Use a mock server (WireMock/MSW) for integration tests — not just unit mocks.
- Mock at the same level for all tests — consistent boundaries.
- Document which external APIs each mock represents — aids onboarding.
- Run "real API" tests in CI nightly — catches drift between mocks and reality.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking01-software-dev/api-mocking/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kalilurrahman/kr-claudiator-skills/api-mocking)