eng-contract-codegen-coship

Coordinates atomic co-shipping of Compozy wire-contract changes across OpenAPI specs, generated clients, and docs.

2.7k|171|Updated Mar 28, 2026
One-click install
npx skills add https://github.com/compozy/compozy --skill eng-contract-codegen-coship
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: eng-contract-codegen-coship
Source: https://github.com/compozy/compozy/tree/main/.agents/skills/eng/eng-contract-codegen-coship
Command: npx skills add https://github.com/compozy/compozy --skill eng-contract-codegen-coship

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Changing a public API contract in Compozy touches many surfaces at once: Go DTOs, OpenAPI specs, generated TypeScript clients, web consumers, CLI docs, and site documentation. This Skill prevents drift and broken consumers by enforcing one atomic bundle that ships source, generated artifacts, and documentation together.

Core Features & Use Cases

  • Trigger Detection: Identifies when edits to contract files, OpenAPI specs, generated clients, or handler request/response semantics require a co-ship bundle.
  • Codegen Synchronization: Runs make codegen and make codegen-check so openapi/compozy.json and web/src/generated/compozy-openapi.d.ts stay deterministic and committed alongside source.
  • Consumer and Docs Updates: Guides updates to web systems (types, adapters, hooks, MSW fixtures, Storybook) and site docs (CLI, HTTP, configuration pages), including deleting pages for removed verbs.
  • Use Case: When renaming a field in a public handler response, use this Skill to regenerate the OpenAPI spec and TypeScript types, update affected web hooks and fixtures, refresh the endpoint docs, and verify the full bundle with make gate before opening the PR.

Quick Start

Ask the agent to apply the contract co-ship workflow for the handler response change you are about to make and verify the bundle with codegen-check and the gate.

Frequently Asked Questions about eng-contract-codegen-coship

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I update an OpenAPI contract and generated TypeScript client together?

Edit the Go contract source, then run make codegen to regenerate openapi/compozy.json and web/src/generated/compozy-openapi.d.ts. Commit the generated diffs alongside the source and confirm make codegen-check reports no drift.

When does a Compozy change require the contract co-ship workflow?

It applies when you edit internal/api/contract or internal/api/spec files, the OpenAPI JSON specs, web generated clients, or change a public handler's request, response, status, auth, or error shape. Internal Go refactors and test-only changes that leave the wire contract unchanged are excluded.

Why does make codegen-check fail after running make codegen?

A failing codegen-check after codegen indicates a non-deterministic generator. Inspect output ordering, file formatting, and JSON normalization, use semantic JSON comparison, and run the formatter before writing or checking generated files.

Should web code mirror generated DTO types or import them?

Web consumers must import the canonical generated types from @/generated/compozy-openapi or a local re-export, not mirror them. Mirrored DTOs in system types.ts files should be deleted so typecheck failures surface real contract drift.

What happens to documentation when a CLI verb or endpoint is removed?

Removed CLI verbs, endpoints, or config keys require deleting the corresponding doc pages in the same change. Deprecated markers or redirect stubs are not allowed; docs must describe only the shipped hard-cut contract.