Skip to content
Agentmart
Submit a tool

api-contract

Generate OpenAPI specs from code, validate API contracts, and check for breaking changes between versions.

Skill by PatriotAgenticLLC

IndexedMIT★ 3
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/patriotagenticllc-api-contract

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Generate OpenAPI specs from code, validate API contracts, and check for breaking changes between versions.

Use cases: documents, backend

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/api-contract

What's inside

Skill name
api-contract
Description
Generate OpenAPI specs from code, validate API contracts, and check for breaking changes between versions.
License
MIT
Instructions
225 lines in SKILL.md · view on GitHub

Before installing

  • Instructions call the network

Files (2)

  • README.md
  • SKILL.md

SKILL.md (first lines)

# API Contract Manager

Generate OpenAPI specifications from code, validate API responses against contracts, and detect breaking changes.

## Supported Frameworks

Auto-detects the API framework in the current project:

| Framework | API Style | Route Discovery |
|-----------|-----------|-----------------|
| FastAPI | REST | Auto-generated OpenAPI at `/docs` and `/openapi.json` |
| Flask | REST | Blueprint / app route decorators |
| Express | REST | Manual router/app route definitions |

## Arguments

Parse `$ARGUMENTS`:

- **`--endpoints`:** List all API endpoints in the current project (default)
- **`--generate`:** Generate or update an OpenAPI spec from code
- **`--validate`:** Validate API responses against the spec
- **`--breaking`:** Check for breaking changes between current code and last tagged version
- **`--diff`:** Show API changes since last commit/tag

## Process

### Mode 1: Endpoint Discovery (`--endpoints`)

Scan the current project for all API endpoints:

**FastAPI:**
```bash
# Find all router files
grep -rn "@router\.\(get\|post\|put\|delete\|patch\)" --include="*.py" <path> | sed 's/.*@router\.//' | sed 's/(.*//' | sort
# Also check app-level routes
grep -rn "@app\.\(get\|post\|put\|delete\|patch\)" --include="*.py" <path> | head -20
# Find router registrations
grep -rn "include_router\|add_api_route" --include="*.py" <path> | head -20
```

**Flask:**
```bash
# Blueprint routes
grep -rn "@.*\.route\|@.*\.add_url_rule" --include="*.py" <path> | head -30
# Also check app-level
grep -rn "@app\.route" --include="*.py" <path> | head -20
```

**Express:**
```bash
# Router definitions
grep -rn "router\.\(get\|post\|put\|delete\|patch\)\|app\.\(get\|post\|put\|delete\|patch\)" --include="*.ts" --include="*.js" <path> | grep -v node_modules | head -30
```

Output:
```
## API Endpoints: <project-name>

| Method | Path | Handler | File |
|--------|------|---------|------|
| GET | /health | health_check | api/routers/health.py:12 |
| GET | /api/orders | list_orders | api/routers/orders.py:28 |
| POST | /api/orders | create_order | api/routers/orders.py:45 |
| GET | /api/orders/{id} | get_order | api/routers/orders.py:62 |
...

Total: X endpoints (Y GET, Z POST, W PUT, V DELETE)
```

### Mode 2: OpenAPI Spec Generation (`--generate`)

**FastAPI projects** (auto-generated):
FastAPI auto-generates OpenAPI at runtime. Extract it:
```bash
# If the app is running locally
curl -s http://localhost:8000/openapi.json 2>/dev/null | python3 -m json.tool > openapi.json

# If not running, check for existing spec
test -f <path>/openapi.json && echo "Spec exists" || echo "No spec file"
```

**Flask/Express projects** (manual generation):
Scan route definitions and generate a spec skeleton:

1. Collect all endpoints from Mode 1
2. For each endpoint, check for:
   - Request body schemas (Pydantic models, Zod schemas, JSON validation)
   - Response types (return type hints, response models)
   - Path parameters
   - Query parameters
   - Authentication requirements (decorators, middleware)
3. Generate an OpenAPI 3.0 YAML skeleton:

```yaml
openapi: "3.0.3"
info:
  title: <project-name> API
  version: <from-manifest>
paths:
  /health:
    get:
      summary: Health check
      responses:
        "200":
          description: Service healthy
  /api/orders:
    get:
      summary: List orders
      parameters: []
      responses:
        "200":
          description: Order list
```

Write to `openapi.yaml` in the project root.

### Mode 3: Contract Validation (`--validate`)

If an OpenAPI spec exists, validate the live API against it:

From PatriotAgenticLLC/better_claude_skillz, MIT.

More from PatriotAgenticLLC/better_claude_skillz

Signals

Stars
3
Forks
0
Open issues
0
Last commit (this folder)
Jul 1, 2026 (4 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from PatriotAgenticLLC

Cite this page

api-contract skill. Agent Mart. https://agentmart.dev/skills/patriotagenticllc-api-contract (last updated 2026-10-24)