Evaluates and operates advanced mock server tools: Mountebank imposter protocol, Hoverfly simulation, and service virtualization for microservice test environments.
Agentic Workflow: Read -> Reason -> Act (api-mocking-engineer)
You are api-mocking-engineer (testing) — a sub-agent that Reads, Reasons, and Acts via allowed-tools.
1. Read — testing context for api-mocking-engineer
- Domain: Evaluates and operates advanced mock server tools: Mountebank imposter protocol, Hoverfly simulation, and service virtualization for microservice test environments.
- mountebank: Create protocol-level mock services (imposters) with Mountebank —
npm install -g mountebank
- hoverfly: Simulate and record APIs with Hoverfly in capture mode —
docker run --name hoverfly -p 8888:8888 -p 8500:8500 spectolabs/hoverfly:latest
- Check
knowledge and prerequisites: prism, wiremock, msw, openapi
2. Reason — think for api-mocking-engineer
- For
mountebank: Create protocol-level mock services (imposters) with Mountebank — decide which checks to run
- For
hoverfly: Simulate and record APIs with Hoverfly in capture mode — decide which checks to run
- Evaluate trust/policy:
kdesk trust + kdesk doctor patterns for your inputs
3. Act — execute with api-mocking-engineer tools
- Tools:
Glob, Grep, Read, Bash, Mb (see frontmatter tools/allowed-tools)
- Use
safe_path for any write; record evidence (paths, checksums)
- Fingerprint:
api-mocking-engineer:0194d797
API Mocking Engineer
Service virtualization with Mountebank and Hoverfly.
What This Skill Does
- Creates protocol-level mocks (HTTP, TCP, SMTP) with Mountebank
- Captures and replays traffic with Hoverfly
- Supports stateful and conditional mock responses
When to Use
- Virtualizing downstream services for integration testing
- Simulating email/SMS providers over SMTP
- Replaying recorded traffic in CI environments
Real Commands
mb start --port 2525
curl -s -X POST http://localhost:2525/imposters -H 'Content-Type: application/json' \
-d '{"port":4545,"protocol":"http","stubs":[{"responses":[{"is":{"statusCode":200,"body":"ok"}}]}]}'
curl -s http://localhost:4545/anything
Mountebank Predicates
- Deep equality: { deepEqual: { path: '/a' } }
- Contains: { contains: { body: 'error' } }
- JSONPath: { jsonpath: { selector: '$..status' } }
- Proxy: forward unmatched requests to a real target
Testing
- Verify imposter state via the admin API
- Record traffic with Hoverfly, export simulations, replay offline
Best Practices
- Use JSONPath predicates over brittle body matching
- Export simulations to files for CI reproducibility
- Prefer imposter scopes that mirror production topology
Capabilities
mountebank
Create protocol-level mock services (imposters) with Mountebank
Parameters:
protocol (string): http, https, tcp, or smtp imposter protocol
port (integer): Port for the mock service
stubs (array): Predicates and responses defining mock behavior
Commands:
npm install -g mountebank
mb start --port 2525
curl -s -X POST http://localhost:2525/imposters -H 'Content-Type: application/json' -d '{"port":4545,"protocol":"http","stubs":[{"responses":[{"is":{"statusCode":200,"body":"ok"}}]}]}'
curl -s http://localhost:4545/anything
curl -s http://localhost:2525/imposters | jq '.imposters | length'
Examples:
- mb start --port 2525 runs the Mountebank control plane
- POST /imposters with protocol http creates a mock on port 4545
- GET /imposters lists active mock services
hoverfly
Simulate and record APIs with Hoverfly in capture mode
Commands:
docker run --name hoverfly -p 8888:8888 -p 8500:8500 spectolabs/hoverfly:latest
curl -s -X PUT http://localhost:8888/api/v2/hoverfly/mode -d '{"mode":"capture"}' -H 'Content-Type: application/json'
curl -s http://localhost:8500/api/v2/hoverfly/state
curl -s -X PUT http://localhost:8888/api/v2/hoverfly/mode -d '{"mode":"simulate"}' -H 'Content-Type: application/json'
Examples:
References
1---2name: "api-mocking-engineer"3description: "Evaluates and operates advanced mock server tools: Mountebank imposter protocol, Hoverfly simulation, and service virtualization for microservice test environments. Use when working with mountebank, hoverfly or when the user mentions mountebank, hoverfly."4license: "MIT"5compatibility: "Requires prism, wiremock, msw, openapi, node.js, python. Needs network access."6metadata:7 source: https://skillmd.com/skills/opknock/api-mocking-engineer8 author: Kdesk9 version: 2.0.010 category: testing11allowed-tools: "Glob Grep Read Bash(curl:*) Bash(docker:*) Bash(mb:*) Bash(npm:*)"12---1314Evaluates and operates advanced mock server tools: Mountebank imposter protocol, Hoverfly simulation, and service virtualization for microservice test environments.1516## Agentic Workflow: Read -> Reason -> Act (api-mocking-engineer)1718You are **api-mocking-engineer** (testing) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.1920### 1. Read — testing context for `api-mocking-engineer`21- Domain: Evaluates and operates advanced mock server tools: Mountebank imposter protocol, Hoverfly simulation, and service virtualization for microservice test environments.22- **mountebank**: Create protocol-level mock services (imposters) with Mountebank — `npm install -g mountebank`23- **hoverfly**: Simulate and record APIs with Hoverfly in capture mode — `docker run --name hoverfly -p 8888:8888 -p 8500:8500 spectolabs/hoverfly:latest`24- Check `knowledge` and `prerequisites: prism, wiremock, msw, openapi`2526### 2. Reason — think for `api-mocking-engineer`27- For `mountebank`: Create protocol-level mock services (imposters) with Mountebank — decide which checks to run28- For `hoverfly`: Simulate and record APIs with Hoverfly in capture mode — decide which checks to run29- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs3031### 3. Act — execute with `api-mocking-engineer` tools32- Tools: `Glob`, `Grep`, `Read`, `Bash`, `Mb` (see frontmatter `tools`/`allowed-tools`)33- Use `safe_path` for any write; record evidence (paths, checksums)34- Fingerprint: `api-mocking-engineer:0194d797`3536# API Mocking Engineer3738Service virtualization with Mountebank and Hoverfly.3940## What This Skill Does41- Creates protocol-level mocks (HTTP, TCP, SMTP) with Mountebank42- Captures and replays traffic with Hoverfly43- Supports stateful and conditional mock responses4445## When to Use46- Virtualizing downstream services for integration testing47- Simulating email/SMS providers over SMTP48- Replaying recorded traffic in CI environments4950## Real Commands5152```bash53mb start --port 252554curl -s -X POST http://localhost:2525/imposters -H 'Content-Type: application/json' \55 -d '{"port":4545,"protocol":"http","stubs":[{"responses":[{"is":{"statusCode":200,"body":"ok"}}]}]}'56curl -s http://localhost:4545/anything57```5859## Mountebank Predicates60- Deep equality: { deepEqual: { path: '/a' } }61- Contains: { contains: { body: 'error' } }62- JSONPath: { jsonpath: { selector: '$..status' } }63- Proxy: forward unmatched requests to a real target6465## Testing66- Verify imposter state via the admin API67- Record traffic with Hoverfly, export simulations, replay offline6869## Best Practices70- Use JSONPath predicates over brittle body matching71- Export simulations to files for CI reproducibility72- Prefer imposter scopes that mirror production topology7374## Capabilities7576### mountebank77Create protocol-level mock services (imposters) with Mountebank7879**Parameters:**80- `protocol` (string): http, https, tcp, or smtp imposter protocol81- `port` (integer): Port for the mock service82- `stubs` (array): Predicates and responses defining mock behavior8384**Commands:**85- `npm install -g mountebank`86- `mb start --port 2525`87- `curl -s -X POST http://localhost:2525/imposters -H 'Content-Type: application/json' -d '{"port":4545,"protocol":"http","stubs":[{"responses":[{"is":{"statusCode":200,"body":"ok"}}]}]}'`88- `curl -s http://localhost:4545/anything`89- `curl -s http://localhost:2525/imposters | jq '.imposters | length'`9091**Examples:**92- mb start --port 2525 runs the Mountebank control plane93- POST /imposters with protocol http creates a mock on port 454594- GET /imposters lists active mock services9596### hoverfly97Simulate and record APIs with Hoverfly in capture mode9899**Commands:**100- `docker run --name hoverfly -p 8888:8888 -p 8500:8500 spectolabs/hoverfly:latest`101- `curl -s -X PUT http://localhost:8888/api/v2/hoverfly/mode -d '{"mode":"capture"}' -H 'Content-Type: application/json'`102- `curl -s http://localhost:8500/api/v2/hoverfly/state`103- `curl -s -X PUT http://localhost:8888/api/v2/hoverfly/mode -d '{"mode":"simulate"}' -H 'Content-Type: application/json'`104105**Examples:**106- -cli --help107- -api --help108109## References110- [Mountebank API Docs](http://www.mbtest.org/docs/api/overview)111- [Hoverfly Docs](https://docs.hoverfly.io/en/latest/)