Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/tomevault-io/skills-registry --skill sdk-generation명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
SOC 직업 분류 기준
| name | sdk-generation |
| description | > Use when this capability is needed. |
project.yamlproject.yaml specifies generation.tool for each SDK repoRead the source contract from the path specified in project.yaml:
# For OpenAPI:
CONTRACT_PATH=$(yq '.repos.api-server.contracts.produces[0].path' project.yaml)
# Validate:
npx @apidevtools/swagger-cli validate "$CONTRACT_PATH"
Based on project.yaml configuration and contract format:
| Contract Format | Recommended Tool | Alternatives |
|---|---|---|
| OpenAPI 3.x | Fern | Speakeasy, OpenAPI Generator |
| Protocol Buffers | Buf + protoc | grpc-tools |
| GraphQL | graphql-codegen | Apollo Codegen |
For each SDK repo specified in project.yaml:
# Using Fern (recommended for TypeScript):
cd sdk-typescript
fern generate --api ../api-server/openapi.yaml --language typescript
# Or using OpenAPI Generator:
npx @openapitools/openapi-generator-cli generate \
-i ../api-server/openapi.yaml \
-g typescript-fetch \
-o ./src/generated \
--additional-properties=supportsES6=true,npmName=@acme/api-client
Generated TypeScript SDK includes:
# Using Fern:
cd sdk-python
fern generate --api ../api-server/openapi.yaml --language python
# Or using OpenAPI Generator:
npx @openapitools/openapi-generator-cli generate \
-i ../api-server/openapi.yaml \
-g python \
-o ./src/generated \
--additional-properties=packageName=acme_api,projectName=acme-api-client
Generated Python SDK includes:
# Using Fern:
cd sdk-go
fern generate --api ../api-server/openapi.yaml --language go
# Or using OpenAPI Generator:
npx @openapitools/openapi-generator-cli generate \
-i ../api-server/openapi.yaml \
-g go \
-o ./generated \
--additional-properties=packageName=acmeapi
Generated Go SDK includes:
# Using Buf (recommended for protobuf):
cd api-server
buf generate # Generates code for all configured languages
# buf.gen.yaml configuration:
# version: v1
# plugins:
# - plugin: go
# out: ../sdk-go/proto
# opt: paths=source_relative
# - plugin: ts
# out: ../sdk-typescript/proto
# opt: target=web
# - plugin: python
# out: ../sdk-python/proto
After generation, the implementer agent customizes the SDK:
For each generated SDK:
For SDKs with publishing configured:
npm publish to npm registrytwine upload to PyPIPublishing is gated by convergence -- SDKs are only published after the full pipeline converges.
[sdk-repo]/src/generated/ -- generated SDK code[sdk-repo]/package.json or setup.py or go.mod -- package metadata[sdk-repo]/tests/ -- generated + custom tests[sdk-repo]/README.md -- usage documentation.factory-project/sdk-generation-report.md -- generation log per languageContract testing validates that implementations comply with API contracts.
The consumer (frontend, SDK) writes tests that describe what it expects from the provider (API server). These expectations are published as contracts. The provider's CI verifies it satisfies all consumer contracts.
Workflow:
Consumer repo (frontend):
1. Write Pact consumer tests defining expected API interactions
2. Run tests -> generate Pact contract files (.json)
3. Publish contracts to Pact Broker (or shared directory)
Provider repo (api-server):
4. Download all consumer contracts from Pact Broker
5. Start the API server
6. Verify each contract against the running server
7. If any verification fails -> provider has broken a consumer's expectations
Integration with Dark Factory phases:
| Pipeline Point | Contract Testing Role |
|---|---|
| During implementation | Consumer tests run as part of the test suite |
| During holdout evaluation | Contract compliance is a holdout dimension |
| During adversarial refinement | Adversary checks for contract violations |
| Feature mode (delta implementation) | Contract changes trigger consumer re-verification |
| Feature mode (scoped adversarial) | Cross-repo contract compliance validation |
Instead of consumer-driven contracts, use the OpenAPI spec itself as the contract. Specmatic auto-generates tests from the spec and validates both consumers and providers.
Workflow:
OpenAPI spec (source of truth):
1. Specmatic reads openapi.yaml
2. For consumer testing: Specmatic creates a mock provider from the spec
-> Consumer tests run against the mock
3. For provider testing: Specmatic creates synthetic requests from the spec
-> Provider must handle all spec-defined request shapes correctly
Advantage: No manual contract writing needed -- the OpenAPI spec IS the contract.
| Scenario | Pattern | Tool |
|---|---|---|
| Consumer expectations must be validated | Consumer-driven | Pact |
| OpenAPI spec is the source of truth | Specification-driven | Specmatic |
| Need to auto-discover breaking changes | Diff-based | openapi-diff, Optic |
| Property-based API testing | Generative | Schemathesis |
# Pact: Consumer test (in frontend repo)
npm test -- --reporter=pact # Generates pact contracts
# Pact: Provider verification (in api-server repo)
npx pact-verifier \
--provider-base-url=http://localhost:3000 \
--pact-urls=../frontend/pacts/frontend-api.json
# Specmatic: Auto-test from OpenAPI spec
npx specmatic test \
--contract=./openapi.yaml \
--host=http://localhost:3000
# Schemathesis: Property-based API testing
schemathesis run \
--url=http://localhost:3000 \
--schema=./openapi.yaml \
--checks all
For multi-repo projects, API contracts must be versioned, discoverable, and authoritative.
Implementation: A directory structure in the project root:
contracts/
+-- registry.yaml
+-- api-server/
| +-- openapi.yaml
| +-- openapi-v1.0.0.yaml
| +-- changelog.md
+-- events/
| +-- events.proto
| +-- changelog.md
+-- graphql/
+-- schema.graphql
+-- changelog.md
registry.yaml format:
contracts:
- name: "acme-api"
format: "openapi"
version: "2.1.0"
path: "./api-server/openapi.yaml"
producers: ["api-server"]
consumers: ["frontend", "sdk-typescript", "sdk-python"]
last_updated: "2026-03-15"
Contracts follow semantic versioning:
Changes that break existing consumers:
Protocol:
Changes that don't break consumers:
Changes that fix documentation without changing behavior:
# OpenAPI:
npx openapi-diff ./contracts/api-server/openapi-v2.0.0.yaml ./contracts/api-server/openapi.yaml
# Protocol Buffers:
buf breaking --against ./contracts/events/events-v1.0.0.proto ./contracts/events/events.proto
# GraphQL:
npx graphql-inspector diff ./contracts/graphql/schema-v1.0.0.graphql ./contracts/graphql/schema.graphql
When the same types must exist in multiple languages, the contract is the single source of truth for type generation.
The OpenAPI schema definition maps to language-specific types:
| Scenario | Pattern | Tool |
|---|---|---|
| OpenAPI-based REST API | Generate from OpenAPI | Fern, Speakeasy, OpenAPI Generator |
| gRPC services | Generate from protobuf | Buf, protoc |
| GraphQL API | Generate from schema | graphql-codegen |
| Rust -> TypeScript (no API contract) | Direct type sync | tsync |
| Any -> Any (complex migration) | Semantic porting | Semport (DF-014) |
.factory-project/sdk-generation-report.mdSource: drbothen/vsdd-factory — distributed by TomeVault.