Agent SkillsAgent Skills
kevcofett

api-contract

@kevcofett/api-contract
kevcofett
1
0 forks
Updated 4/7/2026
View on GitHub

Design and validate API contracts before implementation. Generate OpenAPI specs, mock servers, and request/response validation. Invoke with /api.

Installation

$npx agent-skills-cli install @kevcofett/api-contract
Claude Code
Cursor
Copilot
Codex
Antigravity

Details

Path.claude/skills/api-contract/SKILL.md
Branchmain
Scoped Name@kevcofett/api-contract

Usage

After installing, this skill will be available to your AI coding assistant.

Verify installation:

npx agent-skills-cli list

Skill Instructions


name: api-contract description: > Design and validate API contracts before implementation. Generate OpenAPI specs, mock servers, and request/response validation. Invoke with /api.

API Contract Designer

Commands

  • /api design — Design new API endpoints from a description
  • /api validate — Validate an existing OpenAPI spec for completeness
  • /api mock — Generate mock request/response examples
  • /api diff — Compare two API versions, highlight breaking changes

Procedure

Phase 1: Requirements

Ask the user for:

  1. What resource/domain does this API serve?
  2. What operations are needed (CRUD, search, bulk)?
  3. Authentication method (API key, OAuth, JWT, none)?
  4. Expected consumers (agents, external clients, Copilot Studio flows)?

Phase 2: Contract Design

Generate an OpenAPI 3.0 spec with paths, request/response schemas, query parameters, auth security schemes, and example values for every field.

Phase 3: Validation

CheckRule
Namingsnake_case fields, kebab-case paths
VersioningPath prefix /v1/, /v2/
PaginationCursor-based preferred
Error formatRFC 7807 Problem Details
IdempotencyPUT and DELETE must be idempotent
Content typeapplication/json default

Phase 4: Output

  • contracts/{resource}.openapi.yaml — OpenAPI spec
  • contracts/{resource}.examples.json — Request/response examples

MCMAP-Specific Patterns

  • Use Dataverse Web API conventions (OData v4) for entity endpoints
  • Connection references must be declared in solution customizations.xml
  • Agent-to-agent contracts go in contracts/INTER_AGENT_CONTRACT_v1.json
  • KB document endpoints must respect the 36K char limit