contract-first
通过唯一权威、可机器检查的契约(OpenAPI、AsyncAPI、Protocol Buffers 或 JSON Schema)协调前后端或服务间工作,并生成消费方类型、开展契约验证的集成。消费方和提供方需并行演进 API 或事件结构,且要避免字段漂移、mock/生产结构不一致或一方悄悄重定义接口时使用。
译文已校对查看英文原文
Coordinate frontend/backend or service-to-service work through one authoritative machine-checkable contract (OpenAPI, AsyncAPI, Protocol Buffers, or JSON Schema), with generated consumer types and contract-verified integration. Use when parallel consumer and provider work must evolve an API or event schema without field drift, mock/production shape mismatch, or one side silently redefining the interface.
适用对象:软件开发与测试。自动收录 · 待核查。
原作者说明节选
从固定版本的 SKILL.md 提取,保留原文语言。以下内容属于作者说明,本站尚未验证安装、兼容或运行结果。
查看英文原文
原文涵盖的主题
- Contract-First Collaboration
- When to Activate
- The Boundary Artifact
- Consumer-First Workflow
- 1. Identify Consumers and Owners
- 2. Describe Consumer Jobs
- 3. Define the Smallest Useful Contract
- 4. Generate or Derive Consumer Types
Coordinate frontend/backend or service-to-service work through one authoritative, machine-checkable contract. Consumers state what they need, providers implement that shape, and both sides verify against the same artifact before integration. This skill governs how teams change a boundary. It complements api-design, which governs what a good API looks like, and ai-regression-testing, which guards fixed bugs from returning. Frontend and backend work will proceed in parallel. Two or more services exchange API payloads, events, or commands. Field names, nullability, enums, or error shapes regularly drift. One consumer needs several calls because the provider exposed storage models instead of a task-oriented response. A provider change can break consumers maintained by another person or agent. Mock responses and production responses no longer have the same shape. Do not add contract machinery to a single-module boundary that changes in one atomic commit and has no independent consumer. A shared type may be enough. Choose one canonical, version-controlled artifact for each boundary: OpenAPI for HTTP APIs AsyncAPI for event-driven APIs Protocol Buffers for RPC or message schemas JSON Sche
这里只展示节选,请以完整原文和当前要求为准。
- 来源仓库
- affaan-m/ECC
- 源文件
- pi/core/skills/contract-first/SKILL.md
- 固定版本
- d2ef2680594f9a17526a6e1a2e18b3d242c5d17b
来源与内容状态
本条为自动发现的元数据,尚未完成人工文档核查;适用性与运行结果待核查。
原作者:affaan-m/ECC · 原作者仓库元数据。文档核查:未核查。最近来源检查:2026-11-09T15:01:42.904Z。
分类由名称、说明与路径规则生成,分类不代表已核实适配。
许可与权利归属
MIT。第三方内容及版权归原作者,使用条件以原文为准。
许可原文 ↗本站没有因同步、复制或用户自报成功而将资源标为运行验证通过。
限制与注意事项
- 元数据收录不代表本站已经安装、适配、实测或进行安全审查。