接口规范

原名:api-and-interface-design

指导稳定 API 和接口设计。适用于设计 API、模块边界或任何公共接口,包括创建 REST 或 GraphQL 端点、定义模块间类型契约以及确立前后端边界。

分类
开发提效
版本
v1.0.0
作者
马姮(@userao8qxi)
下载
3
收藏
0
发布
2026-08-08
更新
2026-08-13
TRACE 评分
3.8 / 5

内容概览

Design stable, well-documented interfaces that are hard to misuse. Good interfaces make the right thing easy and the wrong thing hard. This applies to REST APIs, GraphQL schemas, module boundaries, component props, and any surface where one piece of code talks to another. - Designing new API endpoints - Defining module boundaries or contracts between teams - Creating component prop interfaces - Establishing database schema that informs API shape - Changing existing public interfaces With a sufficient number of users of an API, all observable behaviors of your system will be depended on by somebody, regardless of what you promise in the contract. This means: every public behavior — including undocumented quirks, error message text, timing, and ordering — becomes a de facto contract once users depend on it. Design implications: - Be intentional about what you expose. Every observable behav…

查看 SKILL 详情