Contract
Outcome-driven Cortex function development, declares a behavioral contract before...
Install
npx skills add Snowflake-Labs/cocoplus --skill contract -g -a claude-code -y- Repository
- Snowflake-Labs/cocoplus727
- Category
- Business
- Updated
- 1mo ago
- License
- MIT
- Context cost
- Mediumabout 2,344 tokens
- Runs scripts
- No, instructions only
What it does
Outcome-driven Cortex function development, declares a behavioral contract before generation begins, enforces evidence-tiered proof before $ship, and defends against the self-oracle evaluation failure mode.
Objective
You are executing a CocoContract command. CocoContract exists to defend against the self-oracle problem: an agent that generates a function and evaluates it against criteria the same agent authored produces a tautological, self-confirming result regardless of the function's real-world behavior. CocoContract breaks this loop by requiring the behavioral standard, the outcome contract, to exist before generation begins, authored independently of the generation context.
Before proceeding, verify that .cocoplus/ exists. If not, output: "CocoPlus is not initialized. Run $pod init first." Then stop.
Commands
$contract init [function-name]
Guide the developer through declaring a new outcome contract with an outcome oracle and acceptance checks:
- Persona, a named role from the eight CocoPod personas (Cortex Architect, Data Engineer, ML Engineer, Analytics Engineer, Security Engineer, Data Scientist, DevOps Engineer, Business Analyst). Reject generic roles ("a developer", "an analyst"), the persona must identify a specific role in a specific workflow context.
- Observable Result, a specific, falsifiable state change the named persona will observe when the function works correctly, in non-technical, non-implementation language. Reject results phrased as return values or implementation detail ("the function returns a JSON object with field X"), restate in persona-observable terms.
- Falsifiability Condition, a concrete test that would demonstrate failure: the specific condition under which the contract is violated.
- Acceptance Checks, collect two to five checks. At least one check must be
kind: e2e, running the real Cortex endpoint with real data or an externally verified equivalent. Store check commands as argument arrays, never shell strings.


