From enterprise
Knowledge skill for API contracts and endpoint patterns. Injected into Builder and Validator agents during engage to enforce consistent API design, error handling, and request/response schemas. Not user-invocable.
How this skill is triggered — by the user, by Claude, or both
Slash command
/enterprise:api-contractsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This knowledge skill provides context about API design patterns and contracts. Injected into Builder (Scotty) and Validator (McCoy) agents during engage.
This knowledge skill provides context about API design patterns and contracts. Injected into Builder (Scotty) and Validator (McCoy) agents during engage.
// Routes follow RESTful conventions
GET /api/{resource} -- List resources
GET /api/{resource}/:id -- Get single resource
POST /api/{resource} -- Create resource
PUT /api/{resource}/:id -- Update resource (full replace)
PATCH /api/{resource}/:id -- Update resource (partial)
DELETE /api/{resource}/:id -- Delete resource
export const handleGetResource = async (req: Request): Promise<Response> => {
// 1. Parse and validate input
const params = validateParams(req);
// 2. Execute business logic
const result = await service.getResource(params.id);
// 3. Return structured response
return Response.json({ data: result });
};
All API errors follow a consistent shape:
interface ApiError {
error: {
code: string; // Machine-readable: 'NOT_FOUND', 'VALIDATION_ERROR'
message: string; // Human-readable description
details?: unknown; // Additional context (validation errors, etc.)
};
}
// 400 - Validation error
{ "error": { "code": "VALIDATION_ERROR", "message": "Invalid input", "details": { "field": "name", "issue": "required" } } }
// 404 - Not found
{ "error": { "code": "NOT_FOUND", "message": "Resource not found" } }
// 500 - Internal error
{ "error": { "code": "INTERNAL_ERROR", "message": "An unexpected error occurred" } }
| HTTP Status | Error Code | When to Use |
|---|---|---|
| 400 | VALIDATION_ERROR | Invalid input, missing required fields |
| 401 | UNAUTHORIZED | Missing or invalid authentication |
| 403 | FORBIDDEN | Authenticated but not authorized |
| 404 | NOT_FOUND | Resource does not exist |
| 409 | CONFLICT | Resource already exists, version conflict |
| 422 | UNPROCESSABLE | Valid syntax but semantic error |
| 500 | INTERNAL_ERROR | Unexpected server error |
validateRequired, validateJson from core utilities// Success response
{ "data": T }
// List response
{ "data": T[], "meta": { "total": number, "page": number, "limit": number } }
// Error response
{ "error": { "code": string, "message": string } }
Authorization header{ data } or { error })code or message)npx claudepluginhub nathanvale/side-quest-plugins --plugin enterpriseDefines structured error contracts for APIs with machine-readable codes, human-readable messages, and actionable remediation guidance. Use when designing error response shapes or auditing inconsistent error patterns.
Designs RESTful API contracts mapping user actions to HTTP endpoints with request/response schemas, error handling, and OpenAPI specs. For new API design, endpoint documentation, and contracts.