From ork
Generates seed configs for Vercel's emulate tool, enabling stateful API emulation of GitHub, Vercel, AWS, MongoDB Atlas, and OAuth providers for tests, CI, and offline development.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ork:emulate-seedThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate and manage seed configs for [emulate](https://github.com/vercel-labs/emulate) (Apache-2.0) — Vercel Labs' stateful API emulation tool. Each category has individual rule files in `rules/` loaded on-demand.
Generate and manage seed configs for emulate (Apache-2.0) — Vercel Labs' stateful API emulation tool. Each category has individual rule files in rules/ loaded on-demand.
Not mocks. Emulate provides full state machines with cascading deletes, cursor pagination, webhook delivery, and HMAC signature verification. Create a PR via the API and it appears in GET /repos/:owner/:repo/pulls. Delete a repo and its issues, PRs, and webhooks cascade-delete.
| Category | Rules | Impact | When to Use |
|---|---|---|---|
| Seed Config | 1 | HIGH | Setting up emulate.config.yaml for test environments |
| Service Selection | 1 | MEDIUM | Choosing GitHub/Vercel/Google for your tests |
| Webhook Setup | 1 | MEDIUM | Testing webhook delivery with HMAC verification |
| Parallel CI | 1 | HIGH | Running tests in parallel without port collisions |
| Auth Tokens | 1 | MEDIUM | Seeding tokens mapped to emulated users |
Total: 5 rules across 5 categories
# Install
npm install --save-dev emulate
# Start all services
npx emulate
# Start specific services with seed data
npx emulate --service github,slack --seed ./emulate.config.yaml
# Generate a starter config
npx emulate init --service github
| Service | Default Port | Coverage |
|---|---|---|
| GitHub | :4001 | Repos, PRs, issues, comments, reviews, Actions, webhooks, orgs, teams |
| Vercel | :4000 | Projects, deployments, domains, env vars, teams |
| Google OAuth | :4002 | OAuth 2.0 authorize, token exchange, userinfo |
| Slack | :4003 | Chat, conversations, users, reactions, OAuth v2 with consent UI |
| Apple Auth | :4004 | Sign in with Apple — OIDC discovery, JWKS (RS256), auth flow, token exchange |
| Microsoft Entra | :4005 | OAuth 2.0/OIDC v2.0, authorization code + PKCE, refresh token rotation |
| AWS | :4006 | S3 buckets, SQS queues, IAM users/roles, STS identity |
| MongoDB Atlas | :4007 | Admin API v2 + Data API v1 — query, update, aggregation pipeline |
See references/api-coverage.md for full endpoint lists.
A seed config pre-populates the emulator with tokens, users, repos, and projects so tests start from a known state.
# emulate.config.yaml
tokens:
dev_token:
login: yonatangross
scopes: [repo, workflow, admin:org]
ci_token:
login: ci-bot
scopes: [repo]
github:
users:
- login: yonatangross
name: Yonatan Gross
- login: ci-bot
name: CI Bot
repos:
- owner: yonatangross
name: my-project
private: false
default_branch: main
topics: [typescript, testing]
vercel:
users:
- username: yonatangross
email: [email protected]
projects:
- name: my-docs
framework: next
See rules/seed-config.md for full schema and best practices.
import { createEmulator } from 'emulate'
const github = await createEmulator({ service: 'github', port: 4001 })
// github.url -> 'http://localhost:4001'
// State is real — create a PR and it appears in the list
const res = await fetch(`${github.url}/repos/org/repo/pulls`, {
method: 'POST',
headers: { Authorization: 'Bearer dev_token' },
body: JSON.stringify({ title: 'Test PR', head: 'feature', base: 'main' })
})
const prs = await fetch(`${github.url}/repos/org/repo/pulls`)
// -> includes the PR we just created
// Cleanup
github.reset() // Synchronous state wipe
await github.close() // Shut down server
See references/sdk-patterns.md for advanced patterns (multi-service, lifecycle hooks).
Emulate delivers real webhooks with HMAC-SHA256 signatures when state changes:
import crypto from 'crypto'
function verifyWebhook(payload: string, signature: string, secret: string): boolean {
const expected = 'sha256=' + crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex')
return crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected))
}
See rules/webhook-setup.md for webhook receiver patterns.
# .github/workflows/test.yml
jobs:
test:
steps:
- uses: actions/checkout@v4
- name: Start emulate
run: npx emulate --service github --seed .emulate/ci.yaml &
- name: Wait for emulate
run: sleep 2
- name: Run tests
run: npm test
env:
GITHUB_API_BASE: http://localhost:4001
VERCEL_API_BASE: http://localhost:4000
Each test worker gets its own port to avoid race conditions:
// vitest.config.ts
const workerPort = 4001 + parseInt(process.env.VITEST_WORKER_ID || '0')
See rules/parallel-ci.md for full parallel isolation patterns.
| Tool | When to Use | Stateful? | Platforms |
|---|---|---|---|
| emulate (FIRST CHOICE) | GitHub/Vercel/Google API testing | YES | GitHub, Vercel, Google |
| Pact | Contract verification between services | No | Any |
| MSW | In-browser/Node HTTP mocking | No | Any |
| Nock | Node.js HTTP intercept | No | Any |
| WireMock | HTTP stub server | Partial | Any |
Use emulate when:
Use MSW/Nock when:
testing-integration — Integration test patterns (emulate as first choice for API tests)testing-e2e — End-to-end test patterns with emulated backendstesting-unit — Unit test patterns (use emulate for API-dependent units)security-patterns — Auth token patterns (emulate token seeding)See references/cli-reference.md for all CLI flags and commands.
See references/sdk-patterns.md for programmatic createEmulator() usage.
npx claudepluginhub yonatangross/orchestkit --plugin orkCreates realistic mock APIs for development, testing, and demos. Simulates real API behavior and enables parallel development.
Generates mock API servers from OpenAPI specs with Faker.js data, stateful CRUD, latency, errors, and request recording for development/testing.
Creates mock REST/GraphQL API servers from OpenAPI specs; simulates delays, errors, auth, rate limiting; uses json-server and MSW for dev/testing.