api-contract

api-contract is a command for Claude Code from fockus/skill-memory-bank. It costs 39 tokens per session (1,295 once invoked), scanned A, original, MIT.

A command for managing API contracts: written agreements describing how software services communicate. It covers OpenAPI, gRPC, and GraphQL APIs, and can generate, check, or test them.

In plain words
What is it for?
Generating or checking API definitions, testing API behavior, and detecting changes that could break existing users.
Why use it?
It helps detect mismatches and breaking changes before an API update disrupts clients. It also identifies the API style and relevant handlers in the project.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Generating or checking API definitions, testing API behavior, and detecting changes that could break existing users.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/fockus/skill-memory-bank/api-contract
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.

Clone the repo
git clone --depth 1 https://github.com/fockus/skill-memory-bank

Made for: Claude Code.

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 api-contract

README.md
[![agentmods](https://agentmods.dev/badge/commands/fockus/skill-memory-bank/api-contract/github.svg)](https://agentmods.dev/commands/fockus/skill-memory-bank/api-contract)
Your own site
<a href="https://agentmods.dev/commands/fockus/skill-memory-bank/api-contract"><img src="https://agentmods.dev/badge/commands/fockus/skill-memory-bank/api-contract/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for api-contract

Your own site · 80×15
<a href="https://agentmods.dev/commands/fockus/skill-memory-bank/api-contract"><img src="https://agentmods.dev/badge/commands/fockus/skill-memory-bank/api-contract.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,295 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00039 $0.01295
Opus 5.5 $0.00016 $0.00518
Sonnet 5.5 $0.00008 $0.00259
Haiku 4.5 $0.00004 $0.00129

Measured 12d ago against content hash 51e8eab97774, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

api-contract scanned grade A with 1 finding 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 12d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- **gRPC**: `buf curl` + generated client stubs
commands/api-contract.md · 126 lines

How it starts

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

API Contract: $ARGUMENTS

Skill bundle root

Every bundled helper below runs through the skill bundle root, never a bare scripts/… path (the working directory is the user's project, where scripts/ is absent or belongs to someone else):

SKILL_DIR="${MB_SKILLS_ROOT:-${SKILL_DIR:-$HOME/.claude/skills/memory-bank}}"
[ -f "$SKILL_DIR/scripts/_lib.sh" ] || { echo "mb: skill bundle not found at $SKILL_DIR — set MB_SKILLS_ROOT" >&2; exit 2; }

0. Validate arguments

If $ARGUMENTS is empty, stop and ask the user which action to perform (generate, check, test).

1. Stack detection

eval "$(bash "$SKILL_DIR"/scripts/mb-metrics.sh)"

If stack=unknown, ask the user for the framework / language in use.

2. Detect the API type

# OpenAPI / Swagger
find . -name "*.yaml" -o -name "*.yml" 2>/dev/null | xargs grep -l "openapi\|swagger" 2>/dev/null
find . -name "openapi*" -o -name "swagger*" 2>/dev/null

# gRPC / Protobuf
find . -name "*.proto" 2>/dev/null

# GraphQL
find . -name "*.graphql" -o -name "*.gql" 2>/dev/null

# Handler detection across frameworks:
# Go  (gin / echo / chi / net/http)
grep -rn "func.*Handler\|func.*http\.\|r\.GET\|r\.POST\|e\.GET\|e\.POST\|http\.HandleFunc" --include="*.go" . | head -30

# Node.js — Express / Fastify / Nest
grep -rn "app\.\(get\|post\|put\|delete\|patch\)\|router\.\(get\|post\)\|@Get\|@Post" --include="*.ts" --include="*.js" . | head -30

# Python — FastAPI / Flask / Django
grep -rn "@app\.\(get\|post\|put\|delete\)\|@router\.\(get\|post\)\|@app\.route\|path(" --include="*.py" . | head -30

# Java / Kotlin — Spring
grep -rn "@GetMapping\|@PostMapping\|@PutMapping\|@DeleteMapping\|@RequestMapping" --include="*.java" --include="*.kt" . | head -30

# .NET
grep -rn "\[HttpGet\]\|\[HttpPost\]\|\[HttpPut\]\|\[HttpDelete\]\|MapGet\|MapPost" --include="*.cs" . | head -30

# Rust — Axum / Actix / Rocket
grep -rn "\.route(\|#\[get\|#\[post\|#\[put\|#\[delete" --include="*.rs" . | head -30

# Ruby — Rails
grep -rn "resources \|get \|post \|put \|delete " --include="routes.rb" . | head -30

Read the full file on GitHub · 126 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. 12d ago Changed · +23 tokens per session 51e8eab97774
  2. 21d ago Changed · +10 lines 26e913abf077
  3. 1mo ago First seen · 116 lines · 16 tokens per session scan A 0f7a0618a809

Subscribe to this mod's changes

api-contract is a command published in the GitHub repository fockus/skill-memory-bank (26 stars, last pushed yesterday), licensed MIT. It adds 39 tokens to every session and 1,295 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.