addyosmani/agent-skills

constraint-driven-development

Establishes a project's quality bar as a written contract and stops agents quietly lowering it.

  • SKILL.md 已保存
  • 英文来源资料
  • 安装与运行未实测
先判断是否解决你的问题

constraint-driven-development 是什么?

Establishes a project's quality bar as a written contract and stops agents quietly lowering it. Interviews the user on which dimensions matter, supplies sane default thresholds when they have no number in mind, records everything in CONSTRAINTS.md, and watches the diff for a weakened bar — new @ts-ignore or eslint-disable suppressions, skipped or deleted tests, assertions stripped out, unimplemented stubs, thresholds edited down. Use when no quality bar is written down, when the user says "set up constraints" or "define our standards", when the user wants dimensions they care about — accessibility, web performance, coverage — set up as enforced constraints, when an agent keeps silencing checks or skipping tests to get to green, when you need a coverage or performance threshold and don't know what number to pick, or when an agent writes more code than anyone will read.

以上为来源原文,中文用途说明尚待整理。

按客户端选择安装入口

怎么接入你的 Agent?

  1. 定位完整 Skill 目录

    打开本项目来源,核对 SKILL.md 及其引用的脚本和资料。

  2. 交给你正在用的 Agent

    在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。

  3. 确认识别,再做具体任务

    让 Agent 回报安装目录和识别到的名称 constraint-driven-development,然后告诉 Agent 你的任务和实际输入,让它先核对触发条件。

展开并复制给 Codex 的安装指令
发送给 Codex

安装并检查 constraint-driven-development

请在 Codex 的当前工作环境中安装并检查 constraint-driven-development 这个 Skill。

项目身份:addyosmani/agent-skills / constraint-driven-development
来源:https://github.com/addyosmani/agent-skills/blob/8c99fa36d90068c82d547f7c12a9d67a3e95f4ee/skills/constraint-driven-development/SKILL.md
已定位的源文件:skills/constraint-driven-development/SKILL.md

1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。
需要核对时再展开原文

来源原文与资料状态

源文件
已保存 SKILL.md,抓取于 2026-11-21T19:32:09.269Z
中文使用说明
尚待整理,保留英文来源内容
安装与任务测试
本站未执行安装或任务测试
来源复核
已保留来源记录;当前完整用法未逐项人工复核
展开 SKILL.md 原文、章节与历史收录资料

skills/constraint-driven-development/SKILL.md · 抓取时间 2026-11-21T19:32:09.269Z

以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。

抓取成功不代表已完成安装或任务测试。

来源 description(原文)

Establishes a project's quality bar as a written contract and stops agents quietly lowering it. Interviews the user on which dimensions matter, supplies sane default thresholds when they have no number in mind, records everything in CONSTRAINTS.md, and watches the diff for a weakened bar — new @ts-ignore or eslint-disable suppressions, skipped or deleted tests, assertions stripped out, unimplemented stubs, thresholds edited down. Use when no quality bar is written down, when the user says "set up constraints" or "define our standards", when the user wants dimensions they care about — accessibility, web performance, coverage — set up as enforced constraints, when an agent keeps silencing checks or skipping tests to get to green, when you need a coverage or performance threshold and don't know what number to pick, or when an agent writes more code than anyone will read.

查看源文件章节 / Source sections
  • 原文:Constraint-Driven Development
  • 原文:Overview
  • 原文:When to Use
  • 原文:Loading Constraints
  • 原文:The Process
  • 原文:Step 1: Detect before you ask
  • 原文:Step 2: Four questions, each with a default
  • 原文:Step 3: Write CONSTRAINTS.md
  • 原文:Step 4: Install what each dimension needs
  • 原文:Step 5: Wire it to the lifecycle
  • 原文:Step 6: Guard the bar itself
  • 原文:Step 7: Ratchets, when you don't have a number
  • 原文:Sane Defaults
  • 原文:Escalation Path
  • 原文:Common Rationalizations
  • 原文:Red Flags
  • 原文:Verification
  • 原文:See Also
原文:Overview

Other skills in this pack describe what good looks like. `code-review-and-quality` gives you five axes. `test-driven-development` gives you a cycle. `security-and-hardening` gives you a threat list. All of that lives in prose the agent reads and may or may not follow, and none of it survives the end of the session. This skill produces something different: a written record of **this project's** bar, with numbers, that outlives the conversation and can be checked mechanically. The reason matters. When you wrote the code, reading it told you whether it was any good. An agent writes more in an afternoon than you will read that week, so the judgement moves out of your head and into checks that run around the loop. Those checks need to exist, they need numbers you actually chose, and they need to fire close enough to the work that the agent fixes its own output. Spec-driven development says what to build. Test-driven development proves it works. Constraint-driven development defines what "good enough to ship" means, before anyone argues about it in a pull request.

原文:When to Use

Apply this skill when: - Starting a project or a significant feature and no quality bar is written down - The user asks to "set up constraints", "add quality gates", "define our standards", or "stop the agent shipping junk" - An agent is producing volume nobody is reading line by line - CI has checks but nobody can say which ones block a merge and which ones are decoration - Coverage, performance, or accessibility numbers get argued about per-PR instead of decided once - You're about to run `/build auto` or any autonomous loop, and the only thing standing between it and main is a test suite the agent also wrote **When NOT to use:** - The project already has a `CONSTRAINTS.md` and the user isn't changing it — read it and follow it instead - One-off scripts, spikes, throwaway prototypes - The user wants a code review right now (`code-review-and-quality`) or a CI pipeline built (`ci-cd-and-automation`) - Pre-product-market-fit code with a two-week expected lifetime — the floor below is still worth it, the rest isn't

原文:Loading Constraints

The interview needs a live user. **Don't run it in non-interactive contexts** (CI, `/loop`, autonomous runs). If constraints are missing and you're in one of those, apply the Floor below, note that you did, and flag the rest for a human.

原文:Step 1: Detect before you ask

Never ask what you can read. Before the first question, gather: | What | Where to look | |------|---------------| | Language and stack | `package.json`, `pyproject.toml`, `go.mod`, `Cargo.toml` | | Test runner | dev dependencies, `test` script, existing test files | | Existing linters | `eslint.config.*`, `biome.json`, `.ruff.toml` | | Coverage today | `coverage/` output, or run the suite once | | CI | `.github/workflows/`, `.gitlab-ci.yml` | | Agent harness | `.claude/`, `.codex/`, `AGENTS.md` | Report what you found in two lines, then ask only what's left.

原文:Step 2: Four questions, each with a default

Follow the one-question-at-a-time discipline from `interview-me`, with one change: every question here has a default, so "I don't know" is a complete answer that still produces a working config. ``` Q1: Beyond the floor, which of these do you want enforced? (a) Test coverage on new code (b) Security scanning (c) Performance budgets (d) Accessibility (e) Architecture boundaries GUESS: (a) and (b) — you have a test runner already and you're handling user input. DEFAULT if unsure: (a) and (b). Say what each pick costs: (c) and (d) need a running URL, (e) needs a rules file written. ``` ``` Q2: When a check fails while the agent is mid-task, should it block or warn? GUESS: Block. You're running agents unattended and a warning nobody reads is a warning. DEFAULT if unsure: Block on the floor, warn on everything else for the first two weeks. ``` ``` Q3: Do you have target numbers in mind, or should I measure where you are today and hold that line? GUESS: Measure. Most teams don't have a number, and an invented one gets ignored. DEFAULT if unsure: Measure and hold. See "Ratchets" below. ``` ``` Q4: What's the slowest check you'll tolerate before the agent hands work back? GUESS: About 90 seconds. Longer and you'll stop running it. DEFAULT if unsure: 90 seconds at task end, unlimited in CI. ``` Stop at four. A twelve-question intake produces a config nobody understands and a user who regrets starting.

原文:Step 3: Write CONSTRAINTS.md

One file at the repo root. Any agent on any harness can read it, and a change to it shows up in review where it belongs. ```markdown # Constraints Last reviewed: 2026-08-08 by @addy ## Floor (always enforced, no setup required) - No new suppression comments: `@ts-ignore`, `eslint-disable`, `# noqa`, `# type: ignore` - No unimplemented stubs: `throw new Error("Not implemented")`, empty `catch {}` - No skipped or deleted tests without a reason in the commit message - No secrets in source - This file does not get weakened to make a change pass ## Enforced with numbers | Dimension | Rule | Checked by | Runs at | |-----------|------|-----------|---------| | Types | Zero type errors | `tsc --noEmit` | every edit | | Lint | Zero errors from our config | `biome check` | every edit | | Secrets | No secrets in source | `gitleaks dir . --redact` | every edit | | Coverage | Changed lines ≥ 80% covered | `vitest run --coverage` + git diff | task end, CI | | Security: code | Nothing at high or above | `npm run check:security` | CI | | Security: deps | Nothing at high or above | `osv-scanner scan source -r .` | CI | | Accessibility | Zero critical or serious | `npm run check:a11y` | preview deploy | | Performance | LCP ≤ 2500ms, CLS ≤ 0.1 | `lighthouse $PREVIEW_URL --output=json` | preview deploy | Every row names the command that produces the verdict. A dimension with a number and no command in this column is an aspiration, not a constraint. ## Measured, not yet enforced | Metric | Today | Direction | |--------|-------|-----------| | Project coverage | 62.4% | must not fall | | Bundle size (main) | 184 kB | must not grow | ## Exceptions | ID | Rule | Path | Reason | Owner | Expires | |----|------|------|--------|-------|---------| | W1 | `no-explicit-any` | `src/legacy/**` | Rewrite tracked in ENG-441 | @addy | 2026-11-01 | ``` Then add one line to `AGENTS.md` and `CLAUDE.md`: `Read CONSTRAINTS.md before writing code. Do not weaken it to make a change pass.`

文件 SHA256:4b8934e4026745ae663dbe80150230f2bbcdbb3dec49a6fbcaef23e07f34b22a

仓库许可证记录:MIT;repository-license-recorded-scope-unverified,查看来源。

SKILL.md原文description · 2026-11-21T19:32:09.269Z

Establishes a project's quality bar as a written contract and stops agents quietly lowering it. Interviews the user on which dimensions matter, supplies sane default thresholds when they have no number in mind, records everything in CONSTRAINTS.md, and watches the diff for a weakened bar — new @ts-ignore or eslint-disable suppressions, skipped or deleted tests, assertions stripped out, unimplemented stubs, thresholds edited down. Use when no quality bar is written down, when the user says "set up constraints" or "define our standards", when the user wants dimensions they care about — accessibility, web performance, coverage — set up as enforced constraints, when an agent keeps silencing checks or skipping tests to get to green, when you need a coverage or performance threshold and don't know what number to pick, or when an agent writes more code than anyone will read.

查看历史简介来源

历史收录数据

来源仓库addyosmani/agent-skills
Skill源路径skills/constraint-driven-development/SKILL.md

安装前请让使用的Agent先读取这个SKILL.md及其所在目录,确认依赖和所需权限。此页不生成未经来源验证的安装命令。

返回 Skills 目录,按任务继续筛选 · MCP与Skills教程与资源