Home / All Skills / Workflow & Core Tools / constraint-driven-development
Workflow & Core Tools · addyosmani/agent-skills

constraint-driven-development

Enforces constraint-driven software development by identifying and locking operational, architectural, and runtime boundaries before writing implementation code. Use when designing robust systems under tight performance, resource, or security constraints.

L2 Local · Restricted workspaceV1 Commit-PinnedDual-pass Audit
💬 Chat Trial
Author addyosmaniGitHub addyosmani/agent-skills ↗Stars 113872License MITCommit 301b02b12b
Control levels describe skill capabilities and suggested control measures; they do not represent quality or safety certifications, nor do they dictate usability. Usage decisions rest entirely with users and administrators. Different agent hosts apply varying constraints; do not assume hosts provide automatic protection. Third-party skill copyrights belong to their original authors. Use at your own risk.

1How It Works & Mechanism

Explicit constraint inventory creation covering latency, memory, concurrency, and security bounds.

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.
Boundary definition before coding.

Failure mode and effects analysis (FMEA) for identified constraints.

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` |
Proactive risk mitigation.

Automated boundary assertions embedded directly into interface definitions.

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.
Self-enforcing invariants.

Strict trade-off evaluation matrix comparing architectural options against hard constraints.

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
Eliminates premature optimization.

Invariant verification checklists for runtime validation.

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.
Continuous contract enforcement.

提供配套的质量门禁脚本 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 分析变更内容,拦截新增的压制注释、删除的测试与被改小的阈值

2Core Capabilities

01Comprehensive constraint taxonomy extraction
02Pre-implementation boundary locking and contract definition
03Failure mode and architectural trade-off analysis
04Self-enforcing invariant design in code
05多维度门禁工具链安装与脚本映射编排(check:fast/task/full)
06配套 quality-gate.mjs 扫描报告阈值解析与阻断
07基于 git diff 的 floor-guard 守卫模式检测底线破损

4Recommended Governance & Evidence

Suggested Controls for Safe Operation
For Agent Runtime
Can be auto-loaded
For Administrators
Register source and version
Audit Notes: Pure methodology documentation without executable code or host access.

5Second-Pass Verification

  • [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 档位

6Verdict & Scenarios

  • Prevents architectural drift by codifying hard boundaries before implementation begins
  • Significantly reduces debugging cycles by catching boundary violations at design time
  • Clear documentation of design trade-offs and non-negotiable operational requirements
  • Best for: Ideal for system architects, backend engineers, and teams building distributed systems, high-concurrency services, or embedded applications.
    Not for: Not suitable for throwaway prototypes or rapid exploratory proof-of-concepts where boundaries are unknown.
    💬 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
    Agents automatically download and verify mirrors from this JSON guide.
    ② Upstream GitHub
    GitHub Repo ↗
    Pinned to commit 301b02b12b.