API Designer
Jeffallan/claude-skills
Designs REST and GraphQL APIs from resource modeling to an OpenAPI 3.1 contract, with versioning, pagination and RFC 7807 error handling.
分前端/后端(或多个服务)多端开发的项目,用 CONTRACT.md 指向的唯一机器契约,各端只照它各做各的,防止字段漂移导致集成时白屏。支持单会话多 agent 和多终端各自跑两种模式。只要项目有前后端/多服务、接口字段老对不上、各端联调卡住、某端改了字段忘了通知别人、或前端为渲染一个页面要调一堆接口拼数据,就用这个…
$ npx skills add qshanx/docs-governance --skill contract-first -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install qshanx/docs-governance contract-first --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/qshanx/docs-governance.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/contract-first .claude/skills/contract-first && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "contract-first" agent skill from https://github.com/qshanx/docs-governance/tree/main/skills/contract-first into .claude/skills/contract-first/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "contract-first", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/qshanx/docs-governance/tree/main/skills/contract-firstType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add qshanx/docs-governance --skill contract-first -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install qshanx/docs-governance contract-first --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/qshanx/docs-governance.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/contract-first .agents/skills/contract-first && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "contract-first" agent skill from https://github.com/qshanx/docs-governance/tree/main/skills/contract-first into .agents/skills/contract-first/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "contract-first", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add qshanx/docs-governance --skill contract-first -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install qshanx/docs-governance contract-first --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/qshanx/docs-governance.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/contract-first .cursor/skills/contract-first && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "contract-first" agent skill from https://github.com/qshanx/docs-governance/tree/main/skills/contract-first into .cursor/skills/contract-first/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "contract-first", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/qshanx/docs-governance.git --path skills/contract-first--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add qshanx/docs-governance --skill contract-first -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install qshanx/docs-governance contract-first --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/qshanx/docs-governance.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/contract-first .gemini/skills/contract-first && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "contract-first" agent skill from https://github.com/qshanx/docs-governance/tree/main/skills/contract-first into .gemini/skills/contract-first/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "contract-first", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install qshanx/docs-governance contract-firstInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add qshanx/docs-governance --skill contract-first -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/qshanx/docs-governance.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/contract-first .github/skills/contract-first && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "contract-first" agent skill from https://github.com/qshanx/docs-governance/tree/main/skills/contract-first into .github/skills/contract-first/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "contract-first", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add qshanx/docs-governance --skill contract-first -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install qshanx/docs-governance contract-first --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/qshanx/docs-governance.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/contract-first .opencode/skills/contract-first && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "contract-first" agent skill from https://github.com/qshanx/docs-governance/tree/main/skills/contract-first into .opencode/skills/contract-first/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "contract-first", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
contract-first分前端/后端(或多个服务)多端开发的项目,用 CONTRACT.md 指向的唯一机器契约,各端只照它各做各的,防止字段漂移导致集成时白屏。支持单会话多 agent 和多终端各自跑两种模式。只要项目有前后端/多服务、接口字段老对不上、各端联调卡住、某端改了字段忘了通知别人、或前端为渲染一个页面要调一堆接口拼数据,就用这个…
Contract First is an agent skill from qshanx/docs-governance. 分前端/后端(或多个服务)多端开发的项目,用 CONTRACT.md 指向的唯一机器契约,各端只照它各做各的,防止字段漂移导致集成时白屏。支持单会话多 agent 和多终端各自跑两种模式。只要项目有前后端/多服务、接口字段老对不上、各端联调卡住、某端改了字段忘了通知别人、或前端为渲染一个页面要调一堆接口拼数据,就用这个 skill,哪怕用户没明说"契约"。这套方法论的学名是消费者驱动契约(Consumer-Driven Contracts, CDC)/ 契约测试。中文触发:契约式开发、接口契约、前后端协作、多终端协作、防字段漂移、接口对不上、联调、API 契约、字段命名不一致、集成白屏、唯一真相源、契约测试、CDC。English triggers: contract-first development, consumer-driven contracts, contract testing, API contract, frontend backend collaboration, multi-terminal, prevent field drift, provider verification.
Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Backend & APIs, covering Integration testing and API design. It works with OpenAPI. The repository describes itself as: Claude Code、Codex 与 ChatGPT 的文档驱动开发治理插件:防文档腐烂、维护上下文与决策、契约协作、测试与回归证据。 The licence is MIT.
3 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 520696e. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md.
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Contract First loads about 1.2k tokens when it runs. Until then it costs about 131 tokens; SKILL.md has 258 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from qshanx/docs-governance at commit 520696e, republished under its MIT licence (© qshanx). 258 words, ~1,235 tokens.
.claude/skills/contract-first/SKILL.md (or your agent's skills folder).多端并行开发的项目(前端 + 后端,或再加多个服务),最容易炸在"连接"那一刻:
后端把
userName改成user_name,忘了通知前端。两边各自"自测通过",一集成——白屏。两份文档各自为真,合起来是假的。
契约优先把接口当成一份唯一机器契约(由 CONTRACT.md 登记入口):所有数据接口只定义一次,各端照它各做各的,谁都不许私自偏离。它和 living-docs-governance 是姊妹篇——那套防"项目文档"漂移,这套防"端与端之间的接口"漂移。
学名:这套就是 消费者驱动契约(Consumer-Driven Contracts, CDC)/ 契约测试(contract testing)。"消费方需求先行"=CDC 核心;"后端写返回符合契约的测试"=提供者验证(provider verification);标杆工具是 Pact,契约规格常用 OpenAPI/Swagger。
userName vs user_name、类型不符、枚举值不一致。不要用在只有单端、不存在跨端集成的项目上——那时退化成单层,用 living-docs-governance 即可。接口少、单人、不会漂移时也别上,过度工程化。
这套契约协作有两种落地方式,纪律一致、组织方式不同:
一个支持多 agent 的会话里,契约拥有者派出前端 / 后端(及更多服务工人)并行干活,最后由它集成对账。Claude Code 可使用 contract-director、frontend-dev、backend-dev;Codex 可由当前 agent 持有契约并使用内置 worker,任务提示中明确端别、文件所有权和“只读契约”的边界。适合一人一个会话内推进、需要实时编排时。
终端1 跑前端、终端2 跑后端、终端N 跑某个服务,各端完全独立、上下文隔离,没有一个活的主任在线派活。协调的唯一媒介就是那份 CONTRACT.md 文件:
PROJECT_LOG.md 追加一条 contract-request),由契约拥有者评估后更新契约,各端再各自重新拉取对齐。两种模式的铁律完全相同:接口只在 CONTRACT.md 指向的机器契约定义一次;各端只读不改;要改接口必须先改契约,绝不在实现里私自偏离。
宿主适配:Claude Code 的
/contract与自定义 agents 是交互适配层;Codex / ChatGPT 直接调用$contract-first并由当前 agent 执行同一流程。没有可用子 agent 时退化为顺序执行,不得因此跳过契约前置、提供方验证或集成对账。
将协作约定与机器定义分开,字段只保留一个来源:
CONTRACT.md):登记机器契约路径、版本/hash、拥有者、生成/校验命令和兼容策略;不手抄字段表。templates/openapi.example.json;方法、路径、字段、类型、错误响应只在机器契约定义,重复类型用引用复用。跨接口字段约束通过机器契约的公共 schema 或类型定义复用。所有接口只在 CONTRACT.md 指向的机器契约定义一次,各端只读;改契约的权力归契约拥有者(模式 A 是 director,模式 B 是指定的人/终端)。要改接口 → 提契约变更请求 → 拥有者改契约 → 各端再对齐。绝不在实现里单方偏离契约——这是头号集成杀手。
接口是给消费方(如前端)用的,先看消费方渲染/使用需要什么,再定接口形状,而不是照着数据库表结构透传。定契约时优先问:
string,用 number 会截零;金额用 number 保留 2 位;状态用枚举别用裸字符串)CONTRACT.md 使用 templates/CONTRACT.example.md 只登记权威入口。模式 A 由
contract-director串起全流程;模式 B 下每端在自己终端各做第 1、2、4 步,第 3 步(定契约)和第 5 步(对账)由契约拥有者做。
/clarify 思路)。然后按"消费方需求先行"更新唯一机器契约,并在 CONTRACT.md 登记入口和版本(模板见 templates/CONTRACT.example.md)。契约必须前置——绝不先写实现、再从代码事后导出契约,那样契约永远滞后、必然漂移。CONTRACT.md 及其机器契约,不是凭记忆;复杂改动先声明"我打算怎么对齐契约",审过再写代码——在偏离前就拦下来。PROJECT_LOG.md 的 contract-request),由契约拥有者裁决后更新契约。破坏性变化必须同时写明兼容期、消费者迁移顺序、回滚条件和不可逆部分;缺失时不进入实现。PROJECT_LOG.md 追加一行 ## [日期] contract | 改了什么接口、为什么(与 living-docs-governance 共用同一本流水账)。userName,后端数据库列叫 user_name。后端在接口层做映射,对外一律按契约 userName,集成对得上。CONTRACT.md,两个终端各自重新拉取对齐。contract-director(契约拥有者/对账)、frontend-dev / backend-dev(各端工人)—— 执行这套方法论的 agent,两种模式通用。living-docs-governance skill —— 防项目文档漂移的姊妹篇;两套共用一本 PROJECT_LOG.md。test-collaboration 将契约格式、消费者、提供者、真实联调四层证据关联到同一 TEST-ID 和契约版本;未跑真实联调时标缺口。tests/test_contract_template.py 只证明模板格式和响应约束,不证明用户项目已经生成类型、实现服务或完成联调。© qshanx, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/contract-first of qshanx/docs-governance.
Open the folder on GitHubat commit 520696e
Contract First next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Contract First this skillqshanx/docs-governance | 134 | — | ~1.2k | Automated safety check: Pass | MIT | |
| API DesignerJeffallan/claude-skills | 12k | 1 repos | ~2k | Automated safety check: Pass | MIT | |
| Pangolin CRUD Endpointsfosrl/pangolin | 23k | — | ~461 | Automated safety check: Pass | Custom licence | |
| Designing APIsCloudAI-X/claude-workflow-v2 | 1.4k | 1 repos | ~1.2k | Automated safety check: Pass | MIT | |
| Old Coder API DesignAmazingAng/old-coder | 749 | — | ~3.4k | Automated safety check: Pass | MIT | |
| API Surface Reviewpolarsource/polar | 10k | — | ~1.3k | Automated safety check: Pass | MIT |
Jeffallan/claude-skills
Designs REST and GraphQL APIs from resource modeling to an OpenAPI 3.1 contract, with versioning, pagination and RFC 7807 error handling.
fosrl/pangolin
Use whenever asked to add, create, or scaffold a CRUD endpoint, router, or entity in this repo's server (create/list/get/update/delete handlers, new…
CloudAI-X/claude-workflow-v2
Designs REST and GraphQL APIs including endpoints, error handling, versioning, and documentation.
AmazingAng/old-coder
Reviews or designs an HTTP/JSON API's endpoints, auth, pagination, versioning and deprecations, guarding against inventing a bespoke interface or silently breaking consumers.
polarsource/polar
Review changes to Polar's API contract — Pydantic schemas, FastAPI endpoints, OpenAPI output and the generated SDKs.
ChenyCHENYU/Robot_Admin
A skill your agent uses when: generating TypeScript API layer (type definitions + request functions) from page-spec JSON or Swagger/OpenAPI docs.
qshanx/docs-governance
根据项目事实与已确认讨论生成、精简或审查 AGENTS.md / CLAUDE.md,明确共享规则主文件、可执行约束、PRD / Spec 读取路标和验证入口。用于项目入口只有空模板、规范含糊、双入口冲突或需要设置 Agent 项目说明时。English triggers: AGENTS.md, CLAUDE.md, project instructions, agent entrypoint…
qshanx/docs-governance
大项目模块间联动回归——一份 REGRESSION.md 回归台账登记"每个模块的下游消费者 + 可执行的回归验收命令",每次改动后照台账跑回归审计,防"改一个模块悄悄弄坏其他模块"。判决靠退出码,不靠 AI 看着没问题。中文触发:模块回归、回归台账、回归审计、改A坏B、模块联动检查、影响面检查、模块牵连、下游验证、大项目改动检查。English triggers: module…
qshanx/docs-governance
作为面向长期 AI 协作项目的知识、决策与验证治理总入口,把优秀 Agent 的一次性工作沉淀为可继承、可验证、可持续演进的项目集体能力;根据用户意图把任务路由到活文档、领域上下文与 ADR、变更影响、接口契约、测试资产、模块回归或闭环设计能力,并在大型变更中组织正确顺序。用于用户只说“文档治理”“项目治理”“帮我整理项目知识”“改完怎么收尾”而未指定具体…
qshanx/docs-governance
把长期项目的文档当成一个小系统来维护,防止文档腐烂——四份各司其职的脊柱文件(CLAUDE.md 共享章程 / CLAUDEMAP.md 地图 / PROJECTSTATUS.md 健康仪表盘 / PROJECTLOG.md 流水账)+ Codex 的 AGENTS.md 入口桥接 + 固定读序,并按需连接 ARCHITECTURE、CONTEXT、ADR、契约、测试、回归和 Issue…
qshanx/docs-governance
把一个任务"写成"一个目标导向的 loop,并"检查"这个 loop 写得对不对、会不会跑飞——防止空转烧钱 / Goodhart 作弊 / 把错的干到底。两个动作:① 写 loop(先做减法判该不该建 → 定可判定目标 → 选回路类型 → 选骨架)② 体检 loop(过五个崩法 + 可判定性 + 边界 + 降级 + judge 独立 + 判断留人红线)。中文触发:写 loop、设计…
qshanx/docs-governance
在 docs 下建立或维护产品管理入口,登记材料来源,统一需求编号、状态与修订,连接需求池、单需求、版本及验收复盘,并只读审查需求演变是否可追溯。用于产品文档管理员、PRD 版本混乱、产品进展难以理解、已确认决定未回写或需要产品文档审查时。English triggers: product documentation manager, product evolution, PRD…
Works with
Categories
分前端/后端(或多个服务)多端开发的项目,用 CONTRACT.md 指向的唯一机器契约,各端只照它各做各的,防止字段漂移导致集成时白屏。支持单会话多 agent 和多终端各自跑两种模式。只要项目有前后端/多服务、接口字段老对不上、各端联调卡住、某端改了字段忘了通知别人、或前端为渲染一个页面要调一堆接口拼数据,就用这个…. Contract First is an agent skill from qshanx/docs-governance.md 指向的唯一机器契约,各端只照它各做各的,防止字段漂移导致集成时白屏。支持单会话多 agent 和多终端各自跑两种模式。只要项目有前后端/多服务、接口字段老对不上、各端联调卡住、某端改了字段忘了通知别人、或前端为渲染一个页面要调一堆接口拼数据,就用这个 skill,哪怕用户没明说"契约"。这套方法论的学名是消费者驱动契约(Consumer-Driven Contracts, CDC)/ 契约测试。中文触发:契约式开发、接口契约、前后端协作、多终端协作、防字段漂移、接口对不上、联调、API 契约、字段命名不一致、集成白屏、唯一真相源、契约测试、CDC。English triggers: contract-first development, consumer-driven contracts, contract testing, API contract, frontend backend collaboration, multi-terminal, prevent field drift, provider verification.
Contract First fits situations like: tasks that involve Integration testing; tasks that involve API design.
Run `npx skills add qshanx/docs-governance --skill contract-first -a claude-code`. Or copy the skill folder (skills/contract-first in qshanx/docs-governance) into .claude/skills/contract-first in your project. Claude Code loads it when a task matches its description.
Run `npx skills add qshanx/docs-governance --skill contract-first -a codex`. Or copy the skill folder (skills/contract-first in qshanx/docs-governance) into .agents/skills/contract-first in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add qshanx/docs-governance --skill contract-first -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/contract-first, .gemini/skills/contract-first, .github/skills/contract-first and .opencode/skills/contract-first in your project.
SKILL.md names no scripts, command-line tools or credentials: Contract First is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Contract First is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.2k tokens (SKILL.md is roughly 4.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Contract First: API Designer (Jeffallan/claude-skills, 12k stars), Pangolin CRUD Endpoints (fosrl/pangolin, 23k stars), Designing APIs (CloudAI-X/claude-workflow-v2, 1.4k stars) and Old Coder API Design (AmazingAng/old-coder, 749 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
qshanx (a GitHub user) maintains it in qshanx/docs-governance, which has 134 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on October 9, 2026.
Source: qshanx/docs-governance on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.