aiwf-contract

Manages contract entities, validator bindings, and schema verification workflows in aiwf repositories.

Updated May 9, 2026
One-click install
npx skills add https://github.com/23min/aiwf --skill aiwf-contract-23min
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aiwf-contract
Source: https://github.com/23min/aiwf/tree/main/internal/skills/embedded/aiwf-contract
Command: npx skills add https://github.com/23min/aiwf --skill aiwf-contract-23min

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Teams keeping interface contracts (CUE schemas, JSON Schemas, protos, OpenAPI documents) in a repo often lack a mechanical way to register them, bind validators, and verify fixtures on every push. This Skill guides the AI through the aiwf contract surface so every mutation goes through the correct CLI verb instead of hand-editing aiwf.yaml. ## Core Features & Use Cases - Contract onboarding and authoring: Walks through picking a validator recipe, installing it, and building a complete contract bundle (ADR, schema, valid/invalid fixtures, worked example). - Verification and findings triage: Runs aiwf contract verify and explains each finding class (fixture-rejected, fixture-accepted, evolution-regression, environment, validator-error, contract-config) with the correct remediation verb. - Lifecycle and binding management: Promotes, deprecates, retires, or cancels contract entities and manages validator bindings via aiwf contract bind/unbind without touching config files by hand. - Use Case: A user says "add contract verification for our ops spec." The Skill installs the CUE recipe, authors the schema and fixtures, registers the contract with aiwf add contract, and runs verification before push. ## Quick Start Ask the assistant to set up contract verification for a schema in your repo, for example: "Help me add a CUE contract for the op execution spec and verify it."

Frequently Asked Questions about aiwf-contract

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

FAQPage Schema
How do I add contract verification to an aiwf repo?

Run `aiwf contract recipes` to pick a validator language, install it with `aiwf contract recipe install <name>`, author the schema plus valid and invalid fixtures, then register and bind with `aiwf add contract`. Finish by running `aiwf contract verify`.

How do I create a contract without a validator yet?

Run `aiwf add contract --title ... --body-file ... --linked-adr ADR-NNNN` without the validator, schema, or fixtures flags. The entity is created as a registry record only; add the binding later with `aiwf contract bind`.

Can I use a custom validator like Pydantic with aiwf contracts?

Yes. Write a small YAML file declaring the validator name, command, and args with {{schema}} and {{fixture}} placeholders, then install it via `aiwf contract recipe install --from <path>`. Exit code 0 means accept, non-zero means reject.

Why does aiwf report an evolution-regression finding?

An evolution-regression means a historical valid fixture no longer passes the HEAD schema, so the schema change broke an existing consumer. Either revert the schema change or add a migration ADR and bump the schema major version.

Should I edit aiwf.yaml directly to fix a contract binding?

No. Every contract mutation has a verb: use `aiwf contract bind <id> --validator ... --schema ... --fixtures ... --force` to repair a binding or `aiwf contract unbind <id>` to remove it. Hand-editing aiwf.yaml is off the supported path.

Does a retired contract still get verified on pre-push?

No. Contracts with terminal status (rejected or retired) are skipped automatically by `aiwf check` during pre-push. The binding row remains in aiwf.yaml for historical reference unless removed with `aiwf contract unbind`.