Skip to content
Development
Skill

/design-an-interface

设计接口契约 — 来自 superpowers 体系。本 skill 是桥接层,完整纪律见 <SUPERPOWERS_SKILL_ROOT>/design-an-interface/。

From plugin
analysis-to-delivery
2626 skills

Claude Code

$ npx -y skills add BlueprintOS/analysis-to-delivery --skill design-an-interface --agent claude-code

SKILL.md

design-an-interface.SKILL.md
name: design-an-interface
description: 设计接口契约 — 来自 superpowers 体系。本 skill 是桥接层,完整纪律见 <SUPERPOWERS_SKILL_ROOT>/design-an-interface/。
version: 4.0.0

Design-an-Interface(桥接到 superpowers)

Contract

  • Inputs: design spec, domain constraints, integration points
  • Outputs: interface contract document
  • Gates: interface is testable and accepted by caller/implementer
  • Required disciplines: `stage-gate`
  • Next: `/domain-modeling` or `/writing-plans`

> **本仓库不维护此 skill 的内容**。完整纪律请读: > `<SUPERPOWERS_SKILL_ROOT>/design-an-interface/SKILL.md`

何时调

  • brainstorming 之后,writing-plans 之前
  • 需要把功能拆成可测试的接口

衔接点

  • **产出**:接口契约文档
  • **下一步**:`/domain-modeling` 或 `/writing-plans`
  • **门控**:`disciplines/stage-gate` 第 2 层

降级方案(superpowers 未装时)

如果 `<SUPERPOWERS_SKILL_ROOT>/design-an-interface/` 不存在,按以下 4 步产出接口契约:

1. 列举调用方与实现方

  • **调用方**是谁?(controller / 巴枪 / 第三方系统)
  • **实现方**是谁?(哪个 service / 模块)
  • **触发场景**有哪些?(主动调用 / 事件回调 / 定时)

2. 写接口契约表

每个接口必须含 5 列:

| 列 | 含义 | 例子 | |---|---|---| | Name | 方法/路径名 | `POST /api/v1/asn/receive` | | Input | 入参 schema | `{tcAsnId, lpnList[]}` | | Output | 出参 schema | `{receivedQty, exceptionList[]}` | | Errors | 错误码字典 | `E_ASN_NOT_FOUND(40401)` | | Pre/Post | 前置/后置条件 | 前置:ASN 状态=10;后置:状态=30 |

3. 验收契约

  • **可测试性**:每个契约都对应 1 个测试用例(契约层用)
  • **错误码对齐**:与全局 `09-QA审计报告` 的错误码字典一致
  • **联调**:与调用方对齐字段名 / 类型,**字段名严禁猜测**(走 `disciplines/no-field-guessing`)

4. 输出 + 签字

写到 `docs/superpowers/specs/<topic>-interface.md`,末尾 `## Sign-off` 等用户白名单签字(4 句之一)。

最小纪律摘要

  • **契约是合同**:写下来就不准改,改了要重新签字
  • **错误码全局唯一**:不复用业务字段名当错误码
  • **Pre/Post 必须**:只写 Input/Output = 验收没边界
  • **联调不靠人脑**:调用方拿到契约文档就能写 Mock

安装提示

npx skills@latest add obra/superpowers-design-an-interface
Read more
@blueprintos
Ships withanalysis-to-delivery

通用需求分析到开发实施工作流 — 26 个独立可组合 skill、3 个完整行业示例、13 个 CI workflow、26 个自动化脚本、15 个 pytest 测试。

Stars on GitHub

Momentum

stars in total
26
Star history of BlueprintOS/analysis-to-delivery on GitHub, a chart by star-history.com

Other skills on analysis-to-delivery.

ask-delivery

ask-delivery

分析到交付的入口 — 根据你的目标(配置/澄清/BRD/PRD/合规/开发/审计/交接)路由到正确的 user-invoked skill。不确定该用哪个 analysis-to-delivery skill 时,从此入口进入。

ascii-flowchart

ascii-flowchart

**Deprecated**: 此 Skill 是 `rules/ascii-flowchart.md` 的兼容壳。 新代码 / 新文档应直接加载 `rules/ascii-flowchart.md`,不要继续依赖本 Skill。

context-pointer

context-pointer

**Deprecated**: 此 Skill 是 `rules/context-pointer.md` 的兼容壳。 新代码 / 新文档应直接加载 `rules/context-pointer.md`,不要继续依赖本 Skill。

doc-numbering

doc-numbering

**Deprecated**: 此 Skill 是 `rules/doc-numbering.md` 的兼容壳。 新代码 / 新文档应直接加载 `rules/doc-numbering.md`,不要继续依赖本 Skill。

no-field-guessing

no-field-guessing

**Deprecated**: 此 Skill 是 `rules/no-field-guessing.md` 的兼容壳。 新代码 / 新文档应直接加载 `rules/no-field-guessing.md`,不要继续依赖本 Skill。

no-self-invent

no-self-invent

**Deprecated**: 此 Skill 是 `rules/no-self-invent.md` 的兼容壳。 新代码 / 新文档应直接加载 `rules/no-self-invent.md`,不要继续依赖本 Skill。

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills11d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about design-an-interface.

Which coding agents can use design-an-interface?
design-an-interface installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.