api-endpoint-contract
OfficialEnforce API contracts from spec to runtime.
System Documentation
What problem does it solve?
The contract every new or modified API endpoint must follow so it is correct for the public OpenAPI spec, the MCP server (npm @trycompai/mcp-server), the ValidationPipe, and the docs. Triggers on "new endpoint", "add API", "new DTO", "@Body", "@RequirePermission", "MCP tool", "edit controller in apps/api", "OpenAPI", or whenever editing controllers under apps/api/src/."
Core Features & Use Cases
- The contract ensures that every API endpoint adheres to a standardized specification that supports automatic OpenAPI generation, MCP tool integration, and runtime validations.
- It enforces DTOs to be classes with validation decorators and API property metadata, ensuring accurate type information and safer runtime behavior.
- It provides clear guidelines for how endpoints should declare request bodies, naming, and documentation so tools can discover and utilize them reliably.
Quick Start
Define and validate a new endpoint by ensuring the DTO is a class with validation decorators, the endpoint uses @ApiBody to declare its body, and the OpenAPI metadata aligns with the MCP tooling requirements.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: api-endpoint-contract Download link: https://github.com/trycompai/comp/archive/main.zip#api-endpoint-contract Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 510,000+ vetted skills library on demand.