home / skills / velcrafting / codex-skills / contract-update
This skill updates API contracts and client wiring to keep producers and consumers aligned, preventing schema drift and surfacing breaking changes clearly.
npx playbooks add skill velcrafting/codex-skills --skill contract-updateReview the files below or copy the command above to add this skill to your agents.
---
name: contract-update
description: Update request/response API contracts and client wiring without business logic.
metadata:
short-description: API contract evolution
layer: api
mode: write
idempotent: false
---
# Skill: api/contract-update
## Purpose
Update API request/response contracts in a controlled, explicit way so that:
- producers and consumers remain aligned
- breaking changes are intentional and visible
- schema drift is prevented
This skill owns **shape**, not behavior.
---
## Inputs
- Endpoint or event identifier
- Old vs new contract (fields added/removed/changed)
- Compatibility requirement:
- backward-compatible
- versioned
- breaking (explicit)
- Repo profile (preferred): `<repo>/REPO_PROFILE.json`
---
## Outputs
- Updated contract definition(s):
- OpenAPI / schema / types / DTOs (repo-specific)
- Client wiring updates if co-located
- Compatibility notes in code comments or docs (if repo standard)
---
## Non-goals
- Implementing backend behavior
- Implementing frontend UI logic
- Persistence changes
---
## Workflow
1) Locate canonical contract source (schema/types/spec).
2) Apply change using additive-first strategy when possible.
3) Mark deprecated fields explicitly if supported.
4) Update generated or handwritten client bindings if present.
5) Ensure no behavior assumptions leak into the contract.
6) Run schema/type validation if available.
If the contract change introduces conditional behavior or stateful flows,
recommend `system/state-machine-mapper`.
---
## Checks
- Contract compiles/validates
- Consumers still typecheck (or explicit break documented)
- No behavior encoded in schema comments
---
## Failure modes
- Breaking change without versioning → block and escalate.
- Contract ambiguity → recommend `meta/spec-sculptor`.
---
## Telemetry
Log:
- skill: `api/contract-update`
- change_type: `additive | breaking | versioned`
- endpoints_affected
- outcome
This skill updates API request/response contracts and related client wiring while keeping business logic untouched. It ensures producers and consumers remain aligned, makes breaking changes explicit, and prevents schema drift through controlled, auditable edits. The skill focuses on shape and types rather than behavior or persistence.
The skill locates the canonical contract source (schema, types, or spec) and applies changes using an additive-first strategy when possible. It marks deprecated fields explicitly, updates co-located client bindings, and runs schema/type validation to ensure the contract compiles and consumers still typecheck. Telemetry records change type, affected endpoints, and outcome for governance and auditing.
Will this skill change backend behavior?
No. It only changes shapes, schemas, and client wiring. Implementing business logic remains out of scope.
How are breaking changes handled?
Breaking changes must be explicit and versioned. The skill blocks unversioned breaking edits and logs the issue for escalation.
What validation runs after a contract update?
Schema and type compilation/validation run when available, plus optional consumer typechecks to ensure compatibility.