counterfactcounterfactOfficialยท11 Agent Skills Included

api-simulator

Generate stateful mock APIs from OpenAPI specifications

Generates live, stateful mock API servers directly from OpenAPI or Swagger specifications. Eliminates waiting on unfinished backends by producing working endpoints, typed handlers, and realistic seeded data in one command. Supports hot reload, an interactive REPL, failure simulation, and proxy routing so frontend teams can build and test against realistic API behavior immediately.
npx skills add counterfact/api-simulator --all -g -y
Available:

Directs the agent to load the relevant sub-skill before making changes and enforces cross-cutting rules for isolated worktrees, acceptance tests, and repository learning updates.

All Skills in This Repository (11)

Pure Emerald Level Indicators
๐Ÿ“ฆ In Repo
counterfactcounterfact

counterfact-cli-runtime

Update Counterfact CLI runtime option handling, config resolution, and startup diagnostics.

Official
Intermediate
๐Ÿ“ฆ In Repo
counterfactcounterfact

counterfact-runtime-architecture

Evolve Counterfact runtime internals while preserving module boundaries and hot reload semantics.

Official
Intermediate
๐Ÿ“ฆ In Repo
counterfactcounterfact

counterfact-maintenance

Validates contributor PRs against repository conventions for tests, docs, and changesets.

Official
Intermediate
๐Ÿ“ฆ In Repo
counterfactcounterfact

counterfact-repo-basics

Orient teams in Counterfact repositories with standard install, build, test, and lint workflows.

Official
Intermediate
๐Ÿ“ฆ In Repo
counterfactcounterfact

counterfact-generator-internals

Modify TypeScript generator internals and OpenAPI parsing while preserving regeneration guarantees.

Official
Advanced
๐Ÿ“ฆ In Repo
counterfactcounterfact

build-simulation

Generate a stateful API simulation scaffold from an OpenAPI spec.

Official
Advanced
๐Ÿ“ฆ In Repo
counterfactcounterfact

context

Define and evolve stateful context logic in _.context.ts files with enforced unit tests.

Official
Intermediate
๐Ÿ“ฆ In Repo
counterfactcounterfact

route

Update route handlers to delegate business logic to context classes.

Official
Intermediate
๐Ÿ“ฆ In Repo
counterfactcounterfact

counterfact-repl

Interact with a Counterfact mock server Admin API to manipulate context state and proxy settings.

Official
Advanced
๐Ÿ“ฆ In Repo
counterfactcounterfact

scenario

Seed and mutate Counterfact mock runtime context via reusable scenario modules.

Official
Intermediate
๐Ÿ“ฆ In Repo
counterfactcounterfact

counterfact

Modify routes, contexts, and scenarios in Counterfact API simulations.

Official
Intermediate

Frequently Asked Questions

FAQPage Schema
How to install api-simulator?โ–ผ

Run `npx skills add counterfact/api-simulator --all -g -y` in your terminal to install all skills in this suite globally.

How to create a mock API from an OpenAPI spec?โ–ผ

Counterfact turns any OpenAPI or Swagger document into a live local server with one command, generating route handlers and types automatically. Every endpoint works immediately with schema-valid responses.

Can I build a frontend before the backend is ready?โ–ผ

Yes. Counterfact serves realistic, stateful mock endpoints from your API contract, so frontend work never has to wait for backend development to finish.

How to simulate API errors and edge cases?โ–ผ

You can toggle failure flags like rate limiting or downtime through the REPL or scenario scripts, letting you test error handling without touching the real API.

Does Counterfact support hot reload and proxying?โ–ผ

Yes. Route changes apply instantly without restarting, and you can selectively proxy specific paths to the real API while mocking everything else.

Related Repositories in Software Engineering

View All in Software Engineeringโ†’