convert-to-stateful

star 0

Convert existing WireMock stubs to be stateful using the key-value state store. Use when the user wants mock API resources to persist across requests (create, retrieve, update, delete).

wiremock-inc By wiremock-inc schedule Updated 3/4/2026

name: convert-to-stateful user-invocable: false description: Convert existing WireMock stubs to be stateful using the key-value state store. Use when the user wants mock API resources to persist across requests (create, retrieve, update, delete). argument-hint: "" allowed-tools: - Read(../references/*) - mcp__wiremock__who_am_i - mcp__wiremock__search_my_mock_apis - mcp__wiremock__search_stub_mappings - mcp__wiremock__import_stubs_to_mock_api - mcp__wiremock__update_stub_mapping - mcp__wiremock__delete_stub_mapping - mcp__wiremock__search_request_journal - mcp__wiremock__reset_request_journal - mcp__wiremock__make_http_request - mcp__wiremock__pull - mcp__wiremock__push - mcp__wiremock__look_up_documentation

Prerequisites

This skill requires the WireMock Cloud MCP server to be configured and running. If it is unavailable, stop and inform the user before proceeding.

Reference Documentation

Read these references before converting stubs:

Instructions

The target mock API is: $ARGUMENTS

If $ARGUMENTS is empty, ask the user which mock API to convert.

  1. Identify the target mock API using search_my_mock_apis.
  2. Read the Stateful Stubbing and Response Template Authoring references.
  3. Pull the existing stubs using pull and review them.
  4. Ask the user which resource collections to make stateful (or all of them).
  5. Convert stubs to be stateful following the patterns in the stateful-stubbing reference:
    • Add serveEventListeners with appropriate state operations (SET, REQUEST_VAR, DELETE, DELETE_CONTEXT)
    • Enable response templating with "transformers": ["response-template"]
    • Create 404 not-found stubs with require-state and "absent": true
    • Use jsonMerge for creating and updating resources
  6. Import the new stateful stubs and delete the old non-stateful versions.
  7. Validate using the process in Validating and Fixing Stubs.
  8. Smoke test by creating and retrieving a resource to confirm the stateful flow works.
Install via CLI
npx skills add https://github.com/wiremock-inc/skills --skill convert-to-stateful
Repository Details
star Stars 0
call_split Forks 1
navigation Branch main
article Path SKILL.md
More from Creator
wiremock-inc
wiremock-inc Explore all skills →