AgentSkillsCN

api-contract-enforcer

当请求需要明确 API 合约,并通过验证与契约测试以及客户端类型检查来加以强制执行时,应选用此技能。

SKILL.md
--- frontmatter
name: api-contract-enforcer
description: Use when the request requires define API contracts and enforce via validation/contract tests and client typing.

API Contract Enforcer

Do not use when

  • The request is unrelated to this domain or requires a different specialized skill.
  • The user asks only for high-level discussion without applying this workflow.
  • Another skill has a tighter, more specific trigger for the same request.

Example user requests

  • "Apply api contract enforcer to improve this feature."
  • "Use api contract enforcer and give me the concrete deliverables."
  • "Can you run a full api contract enforcer pass on this repo?"
  • "I need step-by-step execution using api contract enforcer."

Goal

Prevent unstable integrations by defining and validating API contracts early.

When to use

  • Any API work.
  • Webhooks/integrations.

Minimal inputs (ask only if missing)

  • REST/OpenAPI vs GraphQL.
  • Core resources/ops.

Procedure (MUST)

  1. Define contract.
  2. Add examples.
  3. Generate types.
  4. Add contract validation.
  5. Document versioning.

Outputs (MUST produce)

  • docs/api_contract.*.
  • Contract validation/tests.
  • Client typing notes.