constraint-driven-development
できること
このツールは、プログラミングプロジェクトのための品質の「契約」を作成します。テストのカバー率やエラーがないことなど、何が許容されるかの明確なルールを定め、そのルールが自動的に守られるようにします。これにより、知らないうちにコードの品質が下がることを防ぎます。
使う場面
- ✓新しいプロジェクトや大きな機能を始めるとき。
- ✓AIに定めた品質基準を守らせたいとき。
- ✓AIが生成するコードの量が多すぎて、手作業で確認しきれないとき。
スキルのリンク
https://github.com/addyosmani/agent-skills/blob/main/skills/constraint-driven-development/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“このプロジェクトの品質基準を設定してください。テストのカバー率やセキュリティのルールも含めてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
このツールはまず、プロジェクトにすでにあるもの(テストツールやLintツールなど)を確認します。次に、どのチェックが重要か、失敗時に作業を止めるべきか、警告だけにとどめるべきかなど、品質のルールを決めるための簡単な質問をします。最後に、これらのルールをCONSTRAINTS.mdというファイルに保存し、ルールが破られていないかコードを監視します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Constraint-Driven Development
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 autoor 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.mdand 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.
The Process
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.
…
よくある質問
「フロア」とは何ですか?
「フロア」とは、他のルールを定義していなくても、常に適用される最低限の品質ルールのことです。たとえば、エラーを無視するコメントを許可しないことや、未完成のコードを残さないことなどが含まれます。
なぜ一般的なルールではなく数値を使うのですか?
「80%のテストカバー率」のような数値は、ルールを客観的にし、自動でチェックしやすくします。これにより、意見の食い違いを避け、誰もが何を求められているかを正確に把握できます。
ルールを破るとどうなりますか?
ルールの設定によって、ツールは違反を警告するか、問題が解決するまで作業をブロックします。これにより、定めた品質が維持されます。
詳細
作者による元の説明
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, unimplement
repo: addyosmani/agent-skills
人気
- GitHubのスター
- 107k
- ランキング
- #766
- ライセンス
- MIT
- 更新日
- 2026/10/13
コメント
- …
このリポジトリの他のスキル
api-and-interface-design
107k明確に定義されたAPIやインターフェースの作成を支援します。ソフトウェアの異なる部分がどのように通信するかを設計する際に役立ちます。
browser-testing-with-devtools
107k実際のブラウザでコードを直接テストできるよう支援します。実際の利用環境での動作を確認し、エラーやパフォーマンスの問題を見つけるのに役立ちます。
ci-cd-and-automation
107kAIエージェントに、反復的な作業の自動化、プロジェクトのリリース、インフラの管理を教えます。
code-review-and-quality
107k複数の観点から詳細なコードレビューを行います。新しい変更をマージする前に、品質を確保し、将来の問題を防ぐのに役立ちます。
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。