contract

contract is a skill for Claude Code, Codex from Snowflake-Labs/cocoplus. It costs 38 tokens per session (2,058 once invoked), scanned A, original, MIT.

A workflow for defining what a function must achieve before an agent generates it, then checking the result against that predefined standard.

In plain words
What is it for?
Use it to declare a function’s expected result and acceptance checks before development, then require evidence before shipping.
Why use it?
It reduces the risk of judging generated code by criteria that were created after the code was written.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/snowflake-labs/cocoplus/contract
Any agent
npx skills add Snowflake-Labs/cocoplus --skill contract
Clone the repo
git clone --depth 1 https://github.com/Snowflake-Labs/cocoplus

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for contract

README.md
[![agentmods](https://agentmods.dev/badge/skills/snowflake-labs/cocoplus/contract.svg)](https://agentmods.dev/skills/snowflake-labs/cocoplus/contract)
Your own site
<a href="https://agentmods.dev/skills/snowflake-labs/cocoplus/contract"><img src="https://agentmods.dev/badge/skills/snowflake-labs/cocoplus/contract.svg" alt="Measured on agentmods" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,058 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00038 $0.02058
Opus 5 $0.00019 $0.01029
Sonnet 5 $0.00008 $0.00412
Haiku 4.5 $0.00004 $0.00206

Measured yesterday against content hash 13eddc9b2367, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

contract scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cortex/skills/cococontract/contract.skill.md · 113 lines

How it starts

The opening of the file, as written. The whole thing — 113 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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.

Validate each field inline before accepting it. Write the completed contract to outcomes/<function-name>/contract.md and commit it. This commit is what the pre-build gate (contract-gate) checks for before $spec or $build is permitted to proceed for this function.

Read the full file on GitHub · 113 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 113 lines · 38 tokens per session scan A 13eddc9b2367

Subscribe to this mod's changes

contract is a skill published in the GitHub repository Snowflake-Labs/cocoplus (720 stars, last pushed 2d ago), licensed MIT. It adds 38 tokens to every session and 2,058 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

spec-driven-development

Design and run a Spec-Driven Development (SDD) pipeline for AI software factories — where structured specifications are the input, AI agents generate the code, and quality gates enforce correctness at each phase: SPECIFY → DECOMPOSE → IMPLEMENT → VERIFY → DELIVER. Use when building or refining a spec-driven pipeline…

magnus919/agent-skills · 165 tokens

drill-tdd

Use when implementing any feature or bugfix — enforces the Red-Green-Refactor drill with no production code allowed without a failing test first.

kucherenko/gangsta · 34 tokens

the-hit

Use when the execution plan is approved and it is time for parallel execution — dispatches workers through crew leads to implement work packages with TDD enforcement, report collection, and escalation protocols.

kucherenko/gangsta · 39 tokens

test-driven-development

Rigorous TDD methodology enforcing RED-GREEN-REFACTOR discipline. Use when implementing features or fixing bugs during the implement phase. Tests must be written before production code - no exceptions.

bostonaholic/rpikit · 42 tokens

ap-policies

Attach a completion policy gate (shell check or judge-agent rubric) to a session or fan-in group so turn-end only passes when the gate is green, then optionally auto-commit pending human ack. Use when the user says "gate this session on tests passing", "attach a policy", "commit only if tests are green", "judge…

agentproto/ts · 83 tokens

evidence-calibration-review

Use when you want a per-claim evidence-tier audit on a text artifact before it ships — assign T1-T6 tiers to every load-bearing claim, surface calibration mismatches (high confidence on weak evidence, or honesty-theater under-claiming), and flag P11 (citation-as-decoration), P17 (pile-of-anecdotes-as-evidence), P54…

Avyayalaya/agent-council · 129 tokens