# 制約駆動開発 (constraint-driven-development)

> プロジェクトの品質基準を CONSTRAINTS.md という契約にまとめ、diff の中でこっそり下げられた基準を見つけます。

- カテゴリ: [コーディング規約](https://www.myskills.tools/ja/categories/code-standards/)
- 提供元: コミュニティ · Addy Osmani
- リポジトリ: https://github.com/addyosmani/agent-skills/tree/main/skills/constraint-driven-development (commit ba3d99e)
- SKILL.md: https://github.com/addyosmani/agent-skills/blob/main/skills/constraint-driven-development/SKILL.md
- インストールコマンド: `npx skills add addyosmani/agent-skills --skill constraint-driven-development`
- ライセンス: MIT
- 対応ツール: Claude Code, Codex, Cursor, Copilot, Gemini CLI
- 権限: read-repo ✓, write-files ✓, shell ✓, network ✓
- 状態: スキャン済み
- ルールスキャンですべてのリスクを検出できるわけではありません。インストール前にこのスキルの SKILL.md を読み、権限を確認してください。
- ⚠ インタビューにはユーザーの在席が必要で、CIや無人実行では基本ルールだけを適用します。gitleaks には --redact が必須です。

## 基本ルール

変更を通すために CONSTRAINTS.md の基準を弱めてはいけません。

## 実行フェーズ

1. **まず検出してから質問** — 既存のテスト、lint、CI設定を先に読み、読めることは質問しません。
2. **既定値付きの4つの質問** — 制約する観点、失敗時に止めるか警告か、目標値などを一つずつ尋ね、各質問に既定値を示します。
3. **記録してツールを導入** — CONSTRAINTS.md を書き、AGENTS.md と CLAUDE.md に1行追記し、各観点に対応するチェックツールを組み込みます。
4. **基準そのものを守る** — diff でしきい値の引き下げ、テストのスキップや削除、新たな @ts-ignore/eslint-disable、未実装のスタブを確認します。

## 権限の説明（SKILL.md より）

| 機能 | 必要か | 説明 |
|---|---|---|
| ファイル書き込み | 必要 | CONSTRAINTS.md、チェックスクリプト、ツール設定を書き、AGENTS.md と CLAUDE.md に1行ずつ追加します。 |
| コマンド実行 | 一部で必要 | 選んだ観点のチェックツール（gitleaks、osv-scanner、Semgrep、Lighthouse、axe など）を導入・実行し、重いチェックは diff に限定します。 |
| 外部通信 | 一部で必要 | チェックツールの導入や脆弱性データベースなど外部データの参照に使います。 |

## SKILL.md のフロントマター（YAML）

```yaml
---
name: constraint-driven-development
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.
---
```

ホーム: https://www.myskills.tools/ja/ · URL: https://www.myskills.tools/ja/skills/constraint-driven-development/
