# Contract author

> Contract author is an open-source agent skill for developer tools. Writes machine-readable API, data layer and shared type contracts before coding starts. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/ivy00johns/Skill-Madness/tree/main/skills/contracts/contract-author
- **Repository:** https://github.com/ivy00johns/skill-madness
- **GitHub stars:** 12
- **License:** MIT
- **Skill name:** contract-author
- **Collection:** https://github.com/ivy00johns/Skill-Madness
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

This skill has the agent define integration contracts before any implementation begins. It covers OpenAPI and AsyncAPI specs, Pydantic models, TypeScript interfaces, JSON Schema and data-layer interfaces, so that separate agents or developers build against the same exact endpoints, response shapes and types.

The workflow starts by extracting domain entities, relationships, actions, business rules and external integrations from a plan. Shared types are written first as one flat file, then the API and data-layer contracts reference them. The skill also requires a README with conventions, cross-cutting concern ownership, file ownership boundaries and per-agent implementation notes, plus a CHANGELOG for version history. A checklist guards against common gaps such as missing error responses, unstated trailing-slash rules and inconsistent field names.

The skill is sized to project scope, so it omits auth or event specs when they are not needed. It is designed for contract-first multi-agent builds or explicit solo contract work, and expects the target stack and system requirements as input. Scripts in Python and TypeScript are bundled with it.

## When your agent uses it

> Generate machine-readable integration contracts (API, data layer, shared types, events) before implementation starts. Use when writing OpenAPI or AsyncAPI specs, Pydantic models, TypeScript interfaces, JSON Schema or data-layer interfaces, or when the orchestrator needs contracts for a plan. Trigger on "write the API contract", "define the shared types", "spec out the endpoints".

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Runs Python and TypeScript scripts](https://github.com/ivy00johns/Skill-Madness/tree/HEAD/skills/contracts/contract-author)
- [Asks for: Read, Write, Edit, Glob, Grep](https://github.com/ivy00johns/Skill-Madness/blob/HEAD/skills/contracts/contract-author/SKILL.md)
- [No network calls found in its scripts](https://github.com/ivy00johns/Skill-Madness/tree/HEAD/skills/contracts/contract-author)
- [License: MIT](https://github.com/ivy00johns/Skill-Madness/tree/HEAD/skills/contracts/contract-author)

## Features

- **Shared type definitions:** Creates one flat types file with entities, enums, request and response shapes, and the error envelope.
- **API contract authoring:** Specifies exact methods, paths, request bodies, success and error responses for each endpoint.
- **Data layer interfaces:** Defines function signatures, storage semantics, cascade behavior, ID strategy and required indexes.
- **Event contract specs:** Describes channels, message schemas and delivery guarantees for event-driven systems.
- **Ownership and business rules:** Assigns cross-cutting concerns and file ownership to agents and documents shared domain rules.
- **Versioned contract changes:** Tracks contract versions with full rewrites and keeps history in a dedicated changelog.

## Good for

- Define the API endpoints for a new service before backend work starts
- Write shared TypeScript interfaces for a frontend and backend to use
- Create Pydantic models and an OpenAPI spec for a Python REST API
- Specify an AsyncAPI event schema for a message-driven workflow
- Document the data layer functions and storage rules for a SQLite app

## Install

### Claude Code

This skill ships in the `skill-madness` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add ivy00johns/Skill-Madness
/plugin install skill-madness@skill-madness
```

Or copy only this skill to `~/.claude/skills/contract-author`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/contract-author &&
cp -R "$tmp/skills/contracts/contract-author" ~/.claude/skills/contract-author &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/contract-author` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/contract-author` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/contract-author &&
cp -R "$tmp/skills/contracts/contract-author" ~/.agents/skills/contract-author &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/contract-author` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/contract-author` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/contract-author &&
cp -R "$tmp/skills/contracts/contract-author" ~/.cursor/skills/contract-author &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/contract-author` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/ivy00johns/Skill-Madness.git --path skills/contracts/contract-author
```

Or copy the folder to `~/.gemini/skills/contract-author` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/contract-author`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/contract-author &&
cp -R "$tmp/skills/contracts/contract-author" ~/.copilot/skills/contract-author &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/contract-author` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/ivy00johns/Skill-Madness.git
```

Then copy `Skill-Madness/skills/contracts/contract-author` into your agent's skills folder as `contract-author`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What triggers Contract author?

It loads when writing OpenAPI or AsyncAPI specs, Pydantic models, TypeScript interfaces, JSON Schema or data-layer interfaces, or when an orchestrator needs contracts for a plan. Phrases like "write the API contract" or "define the shared types" also trigger it.

### What does Contract author need as input?

It needs a plan or, for solo work, the system requirements, domain entities and target stack. It reads the project architecture to extract interfaces.

### Which languages does Contract author produce contracts for?

The bundled templates cover TypeScript, Python with Pydantic, and JSON Schema. TypeScript output requires a contracts tsconfig.json.

### Does Contract author change application code?

It writes contract files under contracts/ and schemas/ and is meant to run before application code is written, so the interfaces are frozen first.

### How do I install Contract author in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/contract-author to use it in all your projects, or to .claude/skills/contract-author in one project. Or install the skill-madness plugin, which includes it: /plugin marketplace add ivy00johns/Skill-Madness, then /plugin install skill-madness@skill-madness.

### Does Contract author run scripts?

Yes. It runs Python and TypeScript scripts. No network calls were found in its scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Contract author?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Contract author?

The closest alternatives to Contract author are Contract first, Backend agent, Docs agent, Contract auditor and API.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Contract first](https://ai-powered.com/skills/contract-first): Contract first is an open-source agent skill for developer tools.
- [Backend agent](https://ai-powered.com/skills/backend-agent): Backend agent is an open-source agent skill for developer tools.
- [Docs agent](https://ai-powered.com/skills/docs-agent): Docs agent is an open-source agent skill for developer tools.
- [Contract auditor](https://ai-powered.com/skills/contract-auditor): Contract auditor is an open-source agent skill for developer tools.
- [API](https://ai-powered.com/skills/api): API is an open-source agent skill for developer tools.
- [Contract design](https://ai-powered.com/skills/contract-design): Contract design is an open-source agent skill for developer tools.
- [API engineer](https://ai-powered.com/skills/api-engineer): API engineer is an open-source agent skill for legal and government.
- [API integration](https://ai-powered.com/skills/api-integration-ajyadav013): API integration is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/contract-author
