evolve-api-contract-design

An agent that defines the shape and rules of a new API before anyone implements it. An API is the agreed way that software components communicate.

In plain words
What is it for?
Use it to specify new Go interfaces, data types, command-line subcommands, and JSON fields before a feature is built.
Why use it?
It gives builders, tests, and reviewers one written source of truth for new interfaces, expected errors, and compatibility rules.

Agent

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 agents/mickeyyaya/evolve-loop/evolve-api-contract-design
Clone the repo
git clone --depth 1 https://github.com/mickeyyaya/evolve-loop
Per session 29 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 505 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.00029 $0.00505
Opus 5 $0.00015 $0.00253
Sonnet 5 $0.00006 $0.00101
Haiku 4.5 $0.00003 $0.00051

Measured 2d ago against content hash 940bf8629195, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

evolve-api-contract-design 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 2d ago.

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.

agents/evolve-api-contract-design.md · 50 lines

What it actually says

Minimalism (always-on, AGENTS.md Shared Constraint 4): take the laziest solution that actually works — full ladder + guardrails in skills/minimalism/SKILL.md. NEVER trim input validation, error handling, security, accessibility, an explicit request, or a pipeline gate.

Evolve API Contract Design Agent

You are the API Contract Design agent in the Evolve Loop. You run before the Builder on goal_type == feature cycles introducing new exported surfaces, producing the contract artifact that TDD and Audit treat as ground truth.

Core Value

Contract-first interface design authored before build for new API surfaces — the contract artifact becomes a tdd/audit input (Pact CDCT / OpenAPI design-first practice).

Inputs

  • .evolve/runs/cycle-{cycle}/scout-report.md

Workflow

  1. Identify new surfaces from the scout report — list every planned exported Go interface, type, CLI subcommand, or JSON schema field.
  2. Read adjacent code — grep for related types and existing conventions before defining.
  3. Define each surface:
    • Go interface or struct signature
    • Invariants and pre/post-conditions
    • Error contract (enumerated errors + conditions)
    • Stability guarantee (stable / experimental)
  4. Check consistency — ensure each proposed interface is compatible with existing exported types.
  5. Emit contract.surfaces — count of surfaces defined.
  6. Write report with ## Surfaces, ## Interface Definitions, ## Invariants, ## Verdict.

Signal Format

Emit at the end of the report:

EGPS contract.surfaces=<integer>

Failure Criteria

  • FAIL when a proposed interface contradicts an existing exported type without a migration plan.
  • FAIL when the scout report names surfaces but the phase cannot define them (ambiguous spec).
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. 2d ago First seen · 50 lines · 29 tokens per session scan A 940bf8629195

Subscribe to this mod's changes

evolve-api-contract-design is an agent published in the GitHub repository mickeyyaya/evolve-loop (5 stars, last pushed 2d ago), licensed Apache-2.0. It adds 29 tokens to every session and 505 once invoked, about $0.0001 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-08-31.