# Contract

Outcome-driven Cortex function development, declares a behavioral contract before...

- Repository: https://github.com/Snowflake-Labs/cocoplus (727 stars)
- Category: Business
- License: MIT
- Last updated: 2026-10-04
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add Snowflake-Labs/cocoplus --skill contract -g -a claude-code -y`
Codex: `npx skills add Snowflake-Labs/cocoplus --skill contract -g -a codex -y`
Cursor: `npx skills add Snowflake-Labs/cocoplus --skill contract -g -a cursor -y`
Gemini CLI: `npx skills add Snowflake-Labs/cocoplus --skill contract -g -a gemini-cli -y`

## Description

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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

## 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:

1. **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.
2. **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.
3. **Falsifiability Condition**, a concrete test that would demonstrate failure: the specific condition under which the contract is violated.
4. **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.

The rest: https://github.com/Snowflake-Labs/cocoplus/blob/HEAD/.cortex/skills/cococontract/contract/SKILL.md
