Skills create-contract

Create an integration contract from API documentation

install
source · Clone the upstream repo
git clone https://github.com/openclaw/skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/brunoscardoso/plan-flow/create-contract" ~/.claude/skills/openclaw-skills-create-contract && rm -rf "$T"
OpenClaw · Install into ~/.openclaw/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/brunoscardoso/plan-flow/create-contract" ~/.openclaw/skills/openclaw-skills-create-contract && rm -rf "$T"
manifest: skills/brunoscardoso/plan-flow/create-contract/SKILL.md
source content

Create Contract

Create an integration contract document from API documentation.

What It Does

  1. Fetches or reads API documentation
  2. Extracts endpoints, schemas, and authentication details
  3. Creates TypeScript interfaces for all data types
  4. Documents error handling and rate limits
  5. Provides usage examples

Usage

/create-contract <url>

Arguments:

  • url
    (required): URL to the API documentation

Output

Creates:

flow/contracts/<service>_contract.md

Contract Structure

# Contract: [Service Name]

Source: [URL]

## Overview
Brief description of the API

## Authentication
```typescript
// Authentication example
const headers = {
  'Authorization': `Bearer ${token}`,
};

Base Configuration

SettingValue
Base URLhttps://api.example.com
Rate Limit100 req/min
Timeout30s

Endpoints

GET /users

Get list of users

Request:

interface GetUsersRequest {
  page?: number;
  limit?: number;
}

Response:

interface GetUsersResponse {
  data: User[];
  meta: { total: number };
}

TypeScript Interfaces

interface User {
  id: string;
  email: string;
  name: string;
}

Error Handling

CodeMeaningAction
401UnauthorizedRefresh token
429Rate LimitedRetry with backoff

Usage Examples

// Fetch users
const users = await api.getUsers({ page: 1 });

## Example

/create-contract https://api.stripe.com/docs


**Output:**

Creating contract for: https://api.stripe.com/docs

Fetching documentation... Extracting endpoints... Generating TypeScript interfaces...

Contract created: flow/contracts/stripe_contract.md

Summary:

  • 45 endpoints documented
  • 28 TypeScript interfaces
  • Authentication: Bearer token
  • Rate limit: 100 req/sec

## What's Included

- **Overview**: Service description and version
- **Authentication**: How to authenticate requests
- **Endpoints**: All available endpoints with schemas
- **TypeScript Interfaces**: Types for all request/response data
- **Error Handling**: Error codes and recommended actions
- **Rate Limits**: Throttling information
- **Usage Examples**: Code snippets for common operations

## Use Cases

- Integrating with third-party APIs
- Documenting internal APIs
- Creating type-safe API clients
- Onboarding new developers