build-simulation

Generate a stateful API simulation scaffold from an OpenAPI spec.

169|19|Updated Apr 8, 2022
One-click install
npx skills add https://github.com/counterfact/api-simulator --skill build-simulation
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: build-simulation
Source: https://github.com/counterfact/api-simulator/tree/main/skills/build-simulation
Command: npx skills add https://github.com/counterfact/api-simulator --skill build-simulation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Build-Simulation helps AI agents generate a complete, stateful API simulation from a bare OpenAPI spec, including scaffold creation, real-behavior research, context implementation, tests, and startup scenario setup.

Core Features & Use Cases

  • Generate a runnable scaffold (routes/ and types/) from an OpenAPI document and produce ready-to-run mock endpoints
  • Research the real API to seed realistic stateful behavior and guide context design and validation
  • Configure startup and scenario scripts so the mock server is immediately useful without manual setup

Quick Start

Run Counterfact against your OpenAPI spec to generate a ready-to-use, stateful mock API in an output directory.

Frequently Asked Questions about build-simulation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a stateful mock server from an OpenAPI spec?▼

Generating a stateful mock server from an OpenAPI spec produces a runnable scaffold with routes and types, wiring startup scenarios so the API simulation maintains state across requests without manual setup.

What is a stateful API simulation and when do I need one for testing?▼

A stateful API simulation is a mock server retaining data across calls. You need one for end-to-end testing when workflows require realistic startup data and scenario scripting to validate complex API interactions.

Can I seed startup data and scenario scripts in an API simulator?▼

Yes, you can configure startup and scenario scripts in the API simulator. This seeds realistic stateful behavior by applying research-driven context, making the mock server immediately useful without manual data setup.

Does this approach generate types and routes automatically from OpenAPI?▼

Yes, running this against your OpenAPI document automatically generates a ready-to-use directory structure. It produces runnable scaffold outputs under routes and types directories for immediate mock endpoint execution.

What's the best way to mock complex API behaviors for end-to-end testing?▼

The best way to mock complex API behaviors for end-to-end testing is generating a fully stateful API simulation from your spec, embedding research-driven context and scenario scripts to replicate real-world interactions.

Why use a stateful mock server instead of a basic static API mock?▼

You use a stateful mock server instead of a static API mock when you need to validate dynamic interactions. Stateful simulations track data changes across requests, supporting complex scenario scripts that static mocks cannot handle.