Hi - I answer from the OpenSmartRoute documentation: routing, the API, plans and quotas, self-hosting. Ask away, or open a support ticket if you need a person.
Grounded in the docs - follow a source before acting on it.
Contract testing for TypeScript microservices and frontends: consumer-driven contracts (Pact), OpenAPI schema validation, request/response fixtures, and CI provider verification. Use for owned service
Imported from bedkillerspacex-boop/codex-skill-library (typescript-contract-tests/SKILL.md). Install upstream with npx skills add bedkillerspacex-boop/codex-skill-library --skill typescript-contract-tests. Copyright stays with the author.
TypeScript Contract Tests
Scope And Authorization
In scope: Defining and verifying contracts between services/frontends your org owns.
Out of scope: Scraping or burdening external APIs without permission.
Prefer test environments and stubbed providers; protect broker if used.
Redact PII from example payloads.
Pair with typescript-contract-security for auth invariants and code-quality-standards.
When To Use
Multiple teams shipping TS services that must not break each other.
Frontend (React/Next) depending on BFF/OpenAPI.
Migrating from only E2E to faster consumer-driven tests.
Versioning breaking API changes with explicit contract negotiation.
Generating types from OpenAPI and ensuring runtime still matches.
Do Not Use As Primary
Need
Skill instead
Security-focused contract invariants
typescript-contract-security
End-to-end UI testing only
frontend e2e skills
Load testing
performance skills
Data model design
typescript-data-model
Implementation quality baseline
code-quality-standards
Domain Focus
Area
Guidance
Topic
CDC, schema contracts, provider states, CI
Tooling
Pact, OpenAPI, openapi-typescript, supertest, MSW
Verify
Provider verify green; consumers can integrate without full stack
Pitfalls
Over-specific matchers; no provider states; contracts without CI
Contract styles
Style
Best for
Consumer-driven (Pact)
Multi-team services with broker
Schema-first (OpenAPI)
Public/partner APIs, codegen
Snapshot fixtures
Stable internal JSON blobs (use carefully)
Workflow
1. Confirm scope and success criteria
Record consumer/provider pairs, auth mode, broker, CI.
Success: breaking field removal fails provider verify before deploy.
Define versioning policy (URL version vs headers).
2. Inventory interactions
rg -n "fetch\(|axios\.|@openapi" src --glob '*.ts*' | head# List routes the consumer actually calls - not the entire OpenAPI
3. Write consumer tests
// Conceptual - keep payloads minimaltype Order = { id: string; status: "pending" | "paid" };export async function getOrder( http: { get: (url: string) => Promise<{ status: number; data: Order }> }, id: string,): Promise<Order> { const res = await http.get(`/orders/${id}`); if (res.status !== 200) throw new Error(`order_fetch_failed:${res.status}`); return res.data;}
Matchers: prefer type+regex over exact timestamps; avoid matching unused fields strictly if evolution needed (team policy).
pnpm vitest run tests/contracts/consumerpnpm vitest run tests/contracts/provider-verify
5. OpenAPI path (schema-first)
# Generate typespnpm openapi-typescript ./openapi.yaml -o src/gen/api.ts# Validate responses in tests against schema (e.g. ajv)
6. CI integration
Consumer PR: run consumer tests; publish contract version.
Provider PR: verify all deployed consumer contracts.
Can-i-deploy style gate before production.
7. Hand off
Document who owns each interaction.
Add security negatives via typescript-contract-security.
Keep E2E thin smoke only.
Good / Bad
Topic
Good
Bad
Scope
Actual consumer paths
Entire unused OpenAPI
Data
Synthetic fixtures
Prod dumps
Evolution
Expand/contract patterns
Big-bang field rename
CI
Verify on both sides
Local-only pact files
Flakes
Deterministic states
Time-dependent without matchers
Secrets
Test tokens
Real API keys in broker
Output Checklist
Consumer/provider matrix documented
Core interactions under contract
Provider states implemented
CI publish + verify + deploy gate
OpenAPI/types aligned if schema-first
PII/secrets redacted from fixtures
Security contracts linked
code-quality-standards applied
Residual risk noted
Rules
Authorized services only.
Contract tests complement, not replace, unit and selected E2E.
Minimize fixtures; avoid brittle over-matching.
Version breaking changes explicitly.
Route security-specific invariants to the security contract skill.
Use it
Copy one of these into your project. Installing also returns the manifest and these snippets.
# after Install: the listing is in your workspace's routing pool - a plan picks it for its slot
curl -s -X POST https://api.opensmartroute.ai/api/v1/route -H 'Authorization: Bearer $OSR_API_KEY' -H 'Content-Type: application/json' -d '{"text": "...", "plan": true}'
Manifest
An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.
{
"ocm": "1",
"id": "bedkillerspacex-boop-codex-skill-library-typescript-cont-bbe322",
"kind": "skill",
"name": "typescript-contract-tests",
"description": "Contract testing for TypeScript microservices and frontends: consumer-driven contracts (Pact), OpenAPI schema validation, request/response fixtures, and CI provider verification. Use for owned service boundaries - not to reverse-engineer third-party APIs against their ToS.",
"publisher": "bedkillerspacex-boop",
"version": "1.0.0",
"capabilities": {
"domains": [
"coding",
"legal"
],
"tags": [
"skill-md",
"github"
],
"languages": [
"en"
]
},
"quality_prior": 0.6,
"examples": [
"Contract testing for TypeScript microservices and frontends: consumer-driven contracts (Pact), OpenAPI schema validation, request/response fixtures, and CI provider verification. Use for owned service boundaries - not to reverse-engineer third-party APIs against their ToS."
],
"primary": false,
"metadata": {
"source": {
"provider": "github",
"repository": "https://github.com/bedkillerspacex-boop/codex-skill-library",
"path": "typescript-contract-tests/SKILL.md",
"ref": "eed9fd05579890130b25214473a7970a5b4d776a",
"url": "https://github.com/bedkillerspacex-boop/codex-skill-library/blob/eed9fd05579890130b25214473a7970a5b4d776a/typescript-contract-tests/SKILL.md",
"key": "bedkillerspacex-boop/codex-skill-library/typescript-contract-tests/SKILL.md"
}
},
"instructions": "# TypeScript Contract Tests\n\n## Scope And Authorization\n\n- **In scope:** Defining and verifying contracts between services/frontends your org owns.\n- **Out of scope:** Scraping or burdening external APIs without permission.\n- Prefer test environments and stubbed providers; protect broker if used.\n- Redact PII from example payloads.\n- Pair with `typescript-contract-security` for auth invariants and `code-quality-standards`.\n\n## When To Use\n\n- Multiple teams shipping TS services that must not break each other.\n- Frontend (React/Next) depending on BFF/OpenAPI.\n- Migrating from only E2E to faster ",
"cost": {
"context_tokens": 1104
}
}
Fetch it by URL: GET /api/v1/registry/bedkillerspacex-boop-codex-skill-library-typescript-cont-bbe322/manifest?version=1.0.0
Reviews
Star ratings from people who tried it. One review per account; edit yours any time.
No reviews yet. Install it, try it, and be the first to rate it.