Constraint Driven Development

Use when a project needs a written, measurable quality bar that agents and CI can enforce without quietly weakening tests, security, performance, accessibility, or architecture checks.

9 stars 3 forksSoftware Development

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add sandbaseai/workbuddy-skill --skill constraint-driven-development
Manual install
git clone --depth 1 https://github.com/sandbaseai/workbuddy-skill.git /tmp/workbuddy-skill
mkdir -p ~/.claude/skills
cp -r /tmp/workbuddy-skill/skills/constraint-driven-development ~/.claude/skills/constraint-driven-development

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# 约束驱动开发

将“什么才算足够好”从对话中的隐含判断变成项目内可持续检查的书面契约。规格说明定义要做什么,测试证明它能工作,本 Skill 定义发布前不能低于什么质量线,并防止 Agent 通过删测试、降阈值或关闭检查换取绿色结果。

## 何时使用

- 新项目或大型功能没有写下质量门槛;
- 团队要定义测试、安全、性能、可访问性或架构标准;
- CI 有检查但没人知道哪些会阻塞合并;
- 自动化 Agent 频繁跳过测试、添加抑制注释或把阈值调低;
- 需要为覆盖率、性能预算或依赖漏洞设定可复现数字。

如果项目已经有 `CONSTRAINTS.md`,先读取并遵守;不要在一次性脚本、短期原型或用户只要求即时代码评审时强行建立整套约束。

## 核心边界

- 先调查仓库现状再提问:语言、测试、lint、覆盖率、CI、Agent 配置和已有文档都是证据。
- 非交互场景(CI、自动循环、无人值守批处理)不得假装完成访谈;使用下方 Floor,并把需要负责人选择的项目列为待决。
- 不擅自安装依赖、提高/降低门槛、改保护分支、跳过失败检查或编辑外部 CI;这些是独立变更,需要项目授权。
- 约束文件只记录质量契约,不放凭据、客户数据、私有提示词或内部机密。公开仓库中只发布可对外的原则和脱敏示例。
- 检查只能证明其定义的范围;不要把单元测试通过写成安全、性能或生产可用性已证明。

## Step 1:先探测,不重复提问

读取以下位置(存在才读):

| 项目 | 证据位置 |
|---|---|
| 语言与技术栈 | `package.json`、`pyproject.toml`、`go.mod`、`Cargo.toml` |
| 测试运行器 | 依赖、脚本、测试目录、覆盖率产物 |
| 现有 lint | ESLint/Biome/Ruff/静态分析配置 |
| CI | `.github/workflows/`、`.gitlab-ci.yml` |
| Agent 入口 | `AGENTS.md`、`.claude/`、`.codex/`、WorkBuddy 配置 |
| 质量现状 | 最近测试结果、基线指标、例外记录和分支保护 |

用两三句话报告发现,然后只追问没有证据覆盖的内容。记录仓库提交 SHA 和检查运行环境,避免把另一分支的结果当基线。

## Step 2:最多四个质量访谈问题

按一问一答询问,并给出默认值:

1. 除基础底线外,哪些维度需要强制:新代码覆盖率、安全扫描、性能、可访问性、架构边界?默认选择已有测试和安全扫描。
2. 检查失败时阻塞还是告警?默认底线阻塞,其余新门槛先告警再观察。
3. 已有目标数字,还是测量现状并保持不下降?默认测量现状并建立 ratchet。
4. Agent 任务结束前可接受最慢检查多久?默认约 90 秒;更慢的检查放到 CI。

停止在四个问题。回答“不知道”也要成为明确默认或 `TBD`,不能无限扩大 intake。

## Step 3:建立约束契约

在仓库根目录创建或更新 `CONSTRAINTS.md`,记录确认的项目专属标准:
Read the full skill on GitHub

Details

Skill name
constraint-driven-development
Path
skills/constraint-driven-development/SKILL.md
License
MIT
Repo updated
8 September 2026

FAQ

What does the Constraint Driven Development skill do?

Use when a project needs a written, measurable quality bar that agents and CI can enforce without quietly weakening tests, security, performance, accessibility, or architecture checks.

How do I install the Constraint Driven Development skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add sandbaseai/workbuddy-skill --skill constraint-driven-development. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Constraint Driven Development popular?

It lives in sandbaseai/workbuddy-skill, which has 9 GitHub stars and 3 forks.

Related skills

Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.