ホーム / 全スキル / ワークフロー&基本ツール / constraint-driven-development
ワークフロー&基本ツール · addyosmani/agent-skills

constraint-driven-development

実装コードに着手する前に、性能・リソース・セキュリティ等の運用・設計境界を特定・固定する「制約駆動開発」を推進。高負荷・高信頼性が求められる堅牢なシステム設計に最適。

L2 ローカル · 作業ディレクトリ限定V1 コミット固定Dual-pass Audit
💬 チャット試行
Author addyosmaniGitHub addyosmani/agent-skills ↗Stars 113872License MITCommit 301b02b12b
管理レベルは Skill の能力と推奨統制措置を示すものであり、品質や安全性の認証、利用可否の判定ではありません。使用の可否はユーザーおよび管理者が決定します。Agent 環境によって制約が異なるため、自動保護を仮定しないでください。第三者製 Skill の著作権は原著作者に帰属し、利用リスクは利用者が負います。

1仕組みと動作原理

レイテンシ、メモリ、並行性、セキュリティに関する明示的な制約インベントリの策定。

skills/constraint-driven-development/SKILL.md
This skill produces something different: a written record of **this project's** bar, with numbers, that outlives the conversation and can be checked mechanically.
実装前の境界定義。

特定された制約に対する故障モード影響度解析(FMEA)の実施。

skills/constraint-driven-development/SKILL.md
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` |
潜在リスクの事前低減。

インターフェース定義への境界アサーション(Invariant)の直接組み込み。

skills/constraint-driven-development/SKILL.md
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.
自己検証型コントラクト。

ハードな制約に基づくアーキテクチャのトレードオフ評価マトリクスの作成。

skills/constraint-driven-development/SKILL.md
## 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
不要な最適化を排除。

実行時検証のための不変条件(Invariant)チェックリストの作成。

skills/constraint-driven-development/SKILL.md
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.
継続的な契約遵守。

提供配套的质量门禁脚本 quality-gate.mjs,严格拦截 Semgrep/Axe 的高危与严重漏洞

skills/constraint-driven-development/scripts/quality-gate.mjs
if (tool === 'semgrep') { if (!Array.isArray(report?.results) || !Array.isArray(report.errors) || report.errors.length || !Array.isArray(report.paths?.scanned) || !report.paths.scanned.length) { throw new Error('Incomplete scan'); } levels = report.results.map(finding => finding?.extra?.severity); allowed = ['INFO', 'WARNING', 'ERROR', 'LOW', 'MEDIUM', 'HIGH', 'CRITICAL']; blocking = ['ERROR', 'HIGH', 'CRITICAL'];
这里在做什么:在 scripts/ 中提供 Node.js 脚本解析工具报告,确保有高危问题或扫描残缺时 exit 1

提供差异级底线防护守卫脚本 floor-guard,基于 git diff 监控是否偷偷削弱质量标准

skills/constraint-driven-development/references/floor-guard.md
// floor-guard.mjs — diff-scoped enforcement of the CONSTRAINTS.md floor. // Usage: node floor-guard.mjs [--base <ref>] (default base: origin/main) import { execFileSync } from 'node:child_process';
这里在做什么:通过 git diff 分析变更内容,拦截新增的压制注释、删除的测试与被改小的阈值

2コア機能

01網羅的制約タクソノミーの抽出
02実装前の境界固定およびコントラクト定義
03故障モード解析と設計トレードオフの評価
04自己検証型不変条件のコード設計
05多维度门禁工具链安装与脚本映射编排(check:fast/task/full)
06配套 quality-gate.mjs 扫描报告阈值解析与阻断
07基于 git diff 的 floor-guard 守卫模式检测底线破损

4推奨統制措置と判定根拠

安全運用のための推奨統制措置
Agent 向け
自動ロード可能
管理者向け
ソースとバージョンの記録
監査ノート: 純粋な設計方法論ドキュメントであり、実行可能コードや特権要求を含みません。

5二重目の独立検証

  • [ok] quality-gate.mjs 本地脚本执行安全核验 — 阅读 46 行 quality-gate.mjs 脚本,仅包含本地 JSON 报告解析与 exit code 返回逻辑,无外部网络请求
  • [ok] floor-guard.md 参考脚本行为核验 — 脚本通过 execFileSync 执行本地 git diff,分析差异文本中的压制关键字,属于纯本地只读分析
  • [ok] CONSTRAINTS.md 契约格式核实 — SKILL.md 第 125-166 行完整展示了标准契约模板,含 Floor、Enforced with numbers、Measured 及 Exceptions
  • [ok] 4 步访谈法机制核实 — SKILL.md 第 85-120 行明确限定为 4 个带有开箱即用默认猜测的问题,控制访谈复杂度
  • [ok] 档位判定 blue 确认 — Skill 自身目录携带 scripts/quality-gate.mjs 可执行脚本并建议配置到本地工程执行,准确落入 blue 档位

6結論

  • 実装着手前に硬い境界条件を確定させることで、アーキテクチャのブレや手戻りを根本から防止
  • 設計段階で境界違反を排除するため、結合テスト以降のデバッグ工数を大幅に削減
  • 妥協できない運用要件と設計上の選択理由が明確に文書化される
  • 最適な用途: 高並行処理、分散システム、組み込み機器など、厳しい物理・運用制約下で開発を行うエンジニアやアーキテクトに最適。
    不向きな用途: 要件が未定の初期プロトタイプや、使い捨てのPoC開発には過剰。
    💬 Online Trial Chat Sandbox

    Preview this skill in an interactive chat playground. Generic LLM evaluation trial.

    💬 Open Chat Trial (Preview)
    Under construction · Generic sandbox trial
    Install Agent-Ready
    ① Accelerated Distribution dl.bestaiskill.com
    Option A · Direct Zip Download⚡ Download constraint-driven-development (Zip)
    Edge-accelerated mirror via dl.bestaiskill.com
    Option B · Copy Guide for Agent
    install.json
    Agent はこの JSON ガイドから自動的にダウンロードして検証します。
    ② Upstream GitHub
    GitHub Repo ↗
    Pinned to commit 301b02b12b.