contract-derivation

contract-derivation is a skill for Claude Code from taniwhaai/arai. It costs 134 tokens per session (4,657 once invoked), scanned A, original, Apache-2.0.

A planning aid that turns a system design document into a separate, detailed contract for each module. Each contract describes what the module must do without relying on knowledge of the rest of the system.

In plain words
What is it for?
Use it after designing a system and before implementing its modules. It helps prepare standalone manifests that developers or agents can use to build modules in isolation.
Why use it?
Design documents often leave assumptions unstated, so developers working on one module may guess incorrectly. These contracts make expected data, behaviour, and errors explicit.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it after designing a system and before implementing its modules. It helps prepare standalone manifests that developers or agents can use to build modules in isolation.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/taniwhaai/arai/contract-derivation
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.

Any agent
npx skills add taniwhaai/arai --skill contract-derivation
Clone the repo
git clone --depth 1 https://github.com/taniwhaai/arai

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/taniwhaai/arai/contract-derivation/github.svg)](https://agentmods.dev/skills/taniwhaai/arai/contract-derivation)
Your own site
<a href="https://agentmods.dev/skills/taniwhaai/arai/contract-derivation"><img src="https://agentmods.dev/badge/skills/taniwhaai/arai/contract-derivation/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 contract-derivation

Your own site · 80×15
<a href="https://agentmods.dev/skills/taniwhaai/arai/contract-derivation"><img src="https://agentmods.dev/badge/skills/taniwhaai/arai/contract-derivation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 134 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,657 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00134 $0.04657
Opus 5 $0.00067 $0.02329
Sonnet 5 $0.00027 $0.00931
Haiku 4.5 $0.00013 $0.00466

Measured 9d ago against content hash aed79e88661e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

contract-derivation 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 9d 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.

.claude/skills/contract-derivation/SKILL.md · 258 lines

How it starts

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

Contract Derivation

Take a design document and produce a set of per-module contracts (manifests) that are complete in isolation. Each manifest must let an implementor build its module correctly without seeing any other part of the system.

Why this skill exists

A design document captures the system's structure, but its module contracts often lean on shared context — adjacent modules, the system's purpose, implicit assumptions a human reader would fill in. Compartmentalised implementation cannot rely on any of that. The implementor of one module sees only the manifest for that module, and nothing else. Anything the manifest fails to state will either be guessed (badly) or surfaced as a re-raise.

This skill's job is to take each module's contract from the design doc and harden it: make every implicit assumption explicit, name every behavioural guarantee, define every error mode, and lock down every data shape it references. The resulting manifests are the durable source of truth for the rest of the build.

Process

1. Read the design doc end to end first, and read the structural tier

Before deriving any single manifest, read the entire design doc. Each manifest will be produced in isolation, but you cannot produce them in isolation — you need the whole picture to know which assumptions are shared, which data shapes flow where, and which modules depend on which.

The design doc's "Structural tier" section shapes everything you do:

  • single_module: Produce one manifest. No vocabulary file is produced by default — the single module's contract names its own types inline. If you do produce a vocabulary file (only when the brief specifically names types as part of an external interface), every entry MUST be sharing: local; no sharing: shared entries are valid for single-module projects. No composition tree. See step 3 for the strict rule.
  • small_multi_module: Produce 2–4 manifests plus one vocabulary file. Step 3 (catalogue shared vocabulary) runs as written. The composition layer above will be a single composition; sharing markers matter for the types that flow across the module boundary.
  • full_decomposition: Produce 5+ manifests plus a full vocabulary. All steps run as written. Sharing markers are critical because the composition tree is deep.

Read the full file on GitHub · 258 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 9d ago First seen · 258 lines · 134 tokens per session scan A aed79e88661e

Subscribe to this mod's changes

contract-derivation is a skill published in the GitHub repository taniwhaai/arai (7 stars, last pushed 27d ago), licensed Apache-2.0. It adds 134 tokens to every session and 4,657 once invoked, about $0.0007 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.

Related

Other skills, from other repositories

umbra-trust-review

Verify AI-generated code before shipping. Run Umbra's Trust Score scan before committing or finishing any coding task, treat findings as blocking issues, and re-scan until clean. Use when finishing a task, before a commit, or when reviewing code written by an agent.

elberacasa/umbra · 60 tokens

rework-rate

Measure and interpret PR rework rate — the emerging 5th DORA metric.

bradygaster/squad · 20 tokens

michel-run-local-dev-stack

The canonical recipe for starting, checking, and stopping the Packmind local dev stack with Docker Compose — the single source of truth other skills and the Michel agent defer to. Covers bringing the full stack (PostgreSQL, Redis, NestJS API, React/Vite frontend on :4200, MCP server, nginx) up in the background, the…

PackmindHub/packmind · 275 tokens

michel-create-packmind-dataset

Seed a local Packmind instance with a realistic dataset — one organization populated with standards, commands, and skills — so an autonomous agent can exercise its own changes against lifelike data instead of an empty app. Use this whenever you need populated Packmind data to verify a change end-to-end: reproducing a…

PackmindHub/packmind · 0 tokens

hexagonal-architecture

Describes the hexagonal architecture (ports and adapters) used across the Packmind monorepo. This skill should be used when creating new domain packages, use cases, services, repositories, or any architectural component to follow established patterns.

PackmindHub/packmind · 52 tokens

blotato

Blotato social-media publishing and scheduling platform — REST API + MCP server. Publish and schedule posts across X/Twitter, TikTok, Instagram, LinkedIn, YouTube, Facebook, Threads, Pinterest, and more from a single integration. Use this skill whenever the user wants to schedule, publish, queue, or batch-post content…

anton-abyzov/vskill · 164 tokens