Builds stateful mock APIs with WireMock standalone: stub mappings via Admin API, request matching, record-and-playback proxying, and stateful scenarios.
Agentic Workflow: Read -> Reason -> Act (api-mock-wiremock-standalone)
You are Api Mock Wiremock Standalone (testing) — a sub-agent that Reads, Reasons, and Acts via allowed-tools.
1. Read — testing context for api-mock-wiremock-standalone
- Domain: Builds stateful mock APIs with WireMock standalone: stub mappings via Admin API, request matching, record-and-playback proxying, and stateful scenarios.
- wiremock-standalone: Run WireMock and register stub mappings dynamically —
java -jar wiremock-standalone-3.9.1.jar --port 8080
- record-playback: Record real traffic and replay it as stubs —
curl -s -X POST http://localhost:8080/__admin/recordings/start -d '{"targetBaseU
- Check
knowledge and prerequisites: prism, wiremock, msw
2. Reason — think for api-mock-wiremock-standalone
- For
wiremock-standalone: Run WireMock and register stub mappings dynamically — decide which checks to run
- For
record-playback: Record real traffic and replay it as stubs — decide which checks to run
- Evaluate trust/policy:
kdesk trust + kdesk doctor patterns for your inputs
3. Act — execute with api-mock-wiremock-standalone tools
- Tools:
Glob, Grep, Read, Java, Bash (see frontmatter tools/allowed-tools)
- Use
safe_path for any write; record evidence (paths, checksums)
- Fingerprint:
api-mock-wiremock-standalone:d9ab8e5f
API Mock v3 - WireMock
Stateful mocking with WireMock standalone.
What This Skill Does
- Registers stubs at runtime through the Admin API
- Matches requests on method, URL, headers, and bodies
- Records live traffic and replays it as stubs
- Models stateful flows with scenarios
When to Use
- Consumer-driven contract testing against a local stub
- Simulating flaky or failure modes of third-party APIs
- Recording a session of a legacy API for offline tests
Real Commands
java -jar wiremock-standalone-3.9.1.jar --port 8080
curl -s -X POST http://localhost:8080/__admin/mappings -H 'Content-Type: application/json' \
-d '{"request":{"method":"GET","url":"/hello"},"response":{"status":200,"body":"Hello"}}'
curl -s http://localhost:8080/hello
Scenario Example
{
"scenarioName": "order",
"requiredScenarioState": "Started",
"request": { "method": "POST", "url": "/orders" },
"response": { "status": 201, "jsonBody": { "id": "ord_1" } },
"newScenarioState": "Created"
}
Testing
- Assert stub hits with /__admin/requests
- Clear state between tests to avoid cross-test pollution
- Use proximity priorities for overlapping matchers
Best Practices
- Store mappings as JSON files under mappings/ for reproducibility
- Use urlPathPattern with regex for path-parameterized endpoints
- Reset state in test teardown via the Admin API
Capabilities
wiremock-standalone
Run WireMock and register stub mappings dynamically
Parameters:
port (integer): WireMock listen port
stub-json (object): request matcher + response definition JSON
admin-root (string): Base path of the Admin API (default /__admin)
Commands:
java -jar wiremock-standalone-3.9.1.jar --port 8080
curl -s -X POST http://localhost:8080/__admin/mappings -H 'Content-Type: application/json' -d '{"request":{"method":"GET","url":"/hello"},"response":{"status":200,"body":"Hello"}}'
curl -s http://localhost:8080/hello
curl -s http://localhost:8080/__admin/mappings | jq '.mappings | length'
curl -s -X DELETE http://localhost:8080/__admin/mappings
Examples:
- POST to /__admin/mappings registers a new stub at runtime
- curl localhost:8080/hello resolves against registered stubs
- GET /__admin/mappings lists all active stubs
record-playback
Record real traffic and replay it as stubs
Commands:
curl -s -X POST http://localhost:8080/__admin/recordings/start -d '{"targetBaseUrl":"http://localhost:8080"}' -H 'Content-Type: application/json'
curl -s -X POST http://localhost:8080/__admin/recordings/stop -H 'Content-Type: application/json'
curl -s http://localhost:8080/__admin/requests | jq '.requests | length'
curl -s -X DELETE http://localhost:8080/__admin/requests -o /dev/null -w '%{http_code}\n'
Examples:
References
1---2name: "api-mock-wiremock-standalone"3description: "Builds stateful mock APIs with WireMock standalone: stub mappings via Admin API, request matching, record-and-playback proxying, and stateful scenarios. Use when working with wiremock standalone, record playback or when the user mentions wiremock standalone, record playback."4license: "MIT"5compatibility: "Requires prism, wiremock, msw, node.js, python. Needs network access."6metadata:7 source: https://skillmd.com/skills/opknock/api-mock-wiremock-standalone8 author: Kdesk9 version: 2.0.010 category: testing11allowed-tools: "Glob Grep Read Bash(curl:*) Bash(java:*)"12---1314Builds stateful mock APIs with WireMock standalone: stub mappings via Admin API, request matching, record-and-playback proxying, and stateful scenarios.1516## Agentic Workflow: Read -> Reason -> Act (api-mock-wiremock-standalone)1718You are **Api Mock Wiremock Standalone** (testing) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.1920### 1. Read — testing context for `api-mock-wiremock-standalone`21- Domain: Builds stateful mock APIs with WireMock standalone: stub mappings via Admin API, request matching, record-and-playback proxying, and stateful scenarios.22- **wiremock-standalone**: Run WireMock and register stub mappings dynamically — `java -jar wiremock-standalone-3.9.1.jar --port 8080`23- **record-playback**: Record real traffic and replay it as stubs — `curl -s -X POST http://localhost:8080/__admin/recordings/start -d '{"targetBaseU`24- Check `knowledge` and `prerequisites: prism, wiremock, msw`2526### 2. Reason — think for `api-mock-wiremock-standalone`27- For `wiremock-standalone`: Run WireMock and register stub mappings dynamically — decide which checks to run28- For `record-playback`: Record real traffic and replay it as stubs — decide which checks to run29- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs3031### 3. Act — execute with `api-mock-wiremock-standalone` tools32- Tools: `Glob`, `Grep`, `Read`, `Java`, `Bash` (see frontmatter `tools`/`allowed-tools`)33- Use `safe_path` for any write; record evidence (paths, checksums)34- Fingerprint: `api-mock-wiremock-standalone:d9ab8e5f`3536# API Mock v3 - WireMock3738Stateful mocking with WireMock standalone.3940## What This Skill Does41- Registers stubs at runtime through the Admin API42- Matches requests on method, URL, headers, and bodies43- Records live traffic and replays it as stubs44- Models stateful flows with scenarios4546## When to Use47- Consumer-driven contract testing against a local stub48- Simulating flaky or failure modes of third-party APIs49- Recording a session of a legacy API for offline tests5051## Real Commands5253```bash54java -jar wiremock-standalone-3.9.1.jar --port 808055curl -s -X POST http://localhost:8080/__admin/mappings -H 'Content-Type: application/json' \56 -d '{"request":{"method":"GET","url":"/hello"},"response":{"status":200,"body":"Hello"}}'57curl -s http://localhost:8080/hello58```5960## Scenario Example6162```json63{64 "scenarioName": "order",65 "requiredScenarioState": "Started",66 "request": { "method": "POST", "url": "/orders" },67 "response": { "status": 201, "jsonBody": { "id": "ord_1" } },68 "newScenarioState": "Created"69}70```7172## Testing73- Assert stub hits with /__admin/requests74- Clear state between tests to avoid cross-test pollution75- Use proximity priorities for overlapping matchers7677## Best Practices78- Store mappings as JSON files under mappings/ for reproducibility79- Use urlPathPattern with regex for path-parameterized endpoints80- Reset state in test teardown via the Admin API8182## Capabilities8384### wiremock-standalone85Run WireMock and register stub mappings dynamically8687**Parameters:**88- `port` (integer): WireMock listen port89- `stub-json` (object): request matcher + response definition JSON90- `admin-root` (string): Base path of the Admin API (default /__admin)9192**Commands:**93- `java -jar wiremock-standalone-3.9.1.jar --port 8080`94- `curl -s -X POST http://localhost:8080/__admin/mappings -H 'Content-Type: application/json' -d '{"request":{"method":"GET","url":"/hello"},"response":{"status":200,"body":"Hello"}}'`95- `curl -s http://localhost:8080/hello`96- `curl -s http://localhost:8080/__admin/mappings | jq '.mappings | length'`97- `curl -s -X DELETE http://localhost:8080/__admin/mappings`9899**Examples:**100- POST to /__admin/mappings registers a new stub at runtime101- curl localhost:8080/hello resolves against registered stubs102- GET /__admin/mappings lists all active stubs103104### record-playback105Record real traffic and replay it as stubs106107**Commands:**108- `curl -s -X POST http://localhost:8080/__admin/recordings/start -d '{"targetBaseUrl":"http://localhost:8080"}' -H 'Content-Type: application/json'`109- `curl -s -X POST http://localhost:8080/__admin/recordings/stop -H 'Content-Type: application/json'`110- `curl -s http://localhost:8080/__admin/requests | jq '.requests | length'`111- `curl -s -X DELETE http://localhost:8080/__admin/requests -o /dev/null -w '%{http_code}\n'`112113**Examples:**114- -cli --help115- -api --help116117## References118- [WireMock Standalone](https://wiremock.org/docs/standalone/java-jar/)119- [WireMock Stubbing](https://wiremock.org/docs/stubbing/)