com um clique
contract-scaffolding
Scaffolds OpenAPI contract component with type generation.
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Menu
Scaffolds OpenAPI contract component with type generation.
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Baseado na classificação ocupacional SOC
Orchestrates SDD project initialization — version detection, environment verification, scaffolding, and git setup.
Manage project settings in sdd/sdd-settings.yaml including component settings that drive scaffolding.
Single gateway for all core↔tech-pack interactions. Reads manifests, resolves paths, loads skills/agents, routes commands.
Manage tasks and plans using the .tasks/ directory.
Standards for authoring SDD plugin agents — frontmatter, self-containment, skill references, and no-user-interaction rules.
Standards for authoring SDD plugin commands — frontmatter, user interaction, skill/agent invocation, CLI integration, and output formatting.
| name | contract-scaffolding |
| description | Scaffolds OpenAPI contract component with type generation. |
| user-invocable | false |
Creates an OpenAPI contract component that defines the API specification and generates TypeScript types for use by server and webapp components.
Use when creating a contract component. Contract components support multiple instances (e.g., contracts/customer-api/, contracts/back-office-api/).
The directory path is components/contracts/{name}/ based on the component name in sdd/sdd-settings.yaml. Delegate to the techpack-settings skill for directory path resolution — it maps component type (contract) + name to a filesystem path (e.g., type=contract, name=customer-api → components/contracts/customer-api/).
components/contracts/{name}/
├── package.json # Component package metadata and devDependencies
├── openapi.yaml # OpenAPI 3.0 specification
├── .gitignore # Ignores generated/ directory
└── generated/ # Generated types (git-ignored)
└── api-types.ts # Generated TypeScript types (from openapi.yaml)
The template openapi.yaml includes:
Note: Health check endpoints (/health, /readiness, /liveness) are NOT defined in the OpenAPI spec. They are infrastructure endpoints implemented directly in the controller.
The contract component generates TypeScript types from the OpenAPI spec via the system CLI:
<plugin-root>/fullstack-typescript/system/system-run.sh contract generate-types <component-name>
<plugin-root>/fullstack-typescript/system/system-run.sh contract validate <component-name>
This creates generated/api-types.ts inside the contract component. The contract is published as a workspace package — server and webapp components consume types by declaring a workspace dependency and importing:
import type { components } from '@project-name/contract';
type Greeting = components['schemas']['Greeting'];
| Variable | Description |
|---|---|
{{PROJECT_NAME}} | Project name (used in API info) |
{{PROJECT_DESCRIPTION}} | API description |
Generates the contract component directory with an OpenAPI spec and type generation scripts. Invoked by the scaffolding skill during project creation.
All templates are colocated in this skill's templates/ directory:
skills/components/contract/contract-scaffolding/templates/
├── package.json
└── openapi.yaml
To scaffold a contract component, build a spec and invoke the engine:
<plugin-root>/fullstack-typescript/system/system-run.sh scaffolding apply --spec spec.json
| Variable | Source |
|---|---|
PROJECT_NAME | From sdd-settings.yaml project name |
{
"target_dir": "<project-root>",
"base_dir": "<plugin-root>/skills",
"variables": { "PROJECT_NAME": "<project-name>" },
"operations": [
{
"type": "template_dir",
"source": "components/contract/contract-scaffolding/templates",
"dest": "components/contracts/<contract-name>"
},
{
"type": "write_file",
"path": "components/contracts/<contract-name>/.gitignore",
"content": "node_modules/\ngenerated/\n"
}
]
}
No conditions needed.
Schema: schemas/input.schema.json
Accepts contract name and optional project metadata for OpenAPI spec generation.
Schema: schemas/output.schema.json
Returns the scaffolding engine result: created files, directories, and scripts; skipped paths; errors; and a human-readable summary.
techpack-settings — Authoritative source for contract component settings schema and directory mappings.typescript-standards — Generated TypeScript types must follow these coding conventions. Defines strict typing, readonly patterns, and import standards. ┌─────────────────┐
│ contract/ │
│ openapi.yaml │
└────────┬────────┘
│
contract generate-types
│
┌────────▼────────┐
│ generated/ │
│ types.ts │
│ (workspace pkg) │
└────────┬────────┘
│
import type from '@project/contract'
│
┌──────────────┴──────────────┐
│ │
┌─────────▼─────────┐ ┌───────────▼───────────┐
│ server/ │ │ webapp/ │
│ "workspace:*" │ │ "workspace:*" │
└───────────────────┘ └───────────────────────┘