constraint-driven-development
Defines and maintains a quality standard for the project. It talks to you about what's important and ensures code quality doesn't degrade over time.
What it does
This tool creates a quality "contract" for your programming project. It defines clear rules for what is acceptable, like test coverage or absence of errors, and ensures these rules are automatically followed, preventing the code quality from being lowered without notice.
When to use it
- ✓When starting a new project or a significant feature.
- ✓When you want to ensure the AI maintains a defined quality standard.
- ✓If the volume of code generated by the AI is too large for manual review.
Example of what to ask your AI
“Set up the quality standards for this project, including test coverage and security rules.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
The tool first checks what already exists in your project (like testing and linting tools). Then, it asks a few simple questions to define the quality rules, such as which checks are important and whether failures should block work or just warn. Finally, it saves these rules in a file called CONSTRAINTS.md and monitors the code to ensure the rules are not broken.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add addyosmani/agent-skills --skill constraint-driven-developmentOr download just the file:
curl -L https://raw.githubusercontent.com/addyosmani/agent-skills/main/skills/constraint-driven-development/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from 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.
…
FAQ
What is the "floor"?
The "floor" consists of the minimum quality rules that are always enforced, even if you don't define other rules. Examples include not allowing comments that ignore errors or leaving unfinished code.
Why use numbers instead of just general rules?
Numbers (like "80% test coverage") make the rules objective and easy to check automatically. This avoids arguments and ensures everyone knows exactly what is expected.
What happens if a rule is broken?
Depending on how the rules were configured, the tool can warn about the breach or block work until the issue is fixed. This ensures the defined quality is maintained.
Details
Original description by the author
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
Popularity
- GitHub stars
- 107k
- Ranking position
- #345
- License
- MIT
- Updated
- 10/13/2026
Comments
- …
More skills from this repository
api-and-interface-design
Helps create well-defined APIs and interfaces. It's useful when designing how different parts of software will communicate.
addyosmani/agent-skills
browser-testing-with-devtools
Helps your agent test code directly in real browsers. It's useful for checking how something works in the environment where it will be used, finding errors and performance issues.
addyosmani/agent-skills
ci-cd-and-automation
Teaches your AI agent to automate repetitive tasks and ship projects and manage infrastructure.
addyosmani/agent-skills
code-review-and-quality
Performs detailed code reviews on multiple fronts. It's useful before merging new changes to ensure quality and prevent future problems.
addyosmani/agent-skills
Similar skills
benchmark-optimization-loop
Has your agent improve something's speed in a measured way. It tests multiple versions and chooses the fastest one that still works correctly.
affaan-m/ECC
change-impact
Helps your agent analyze the impact of code changes before making them. It compares the planned vs. actual results afterward, covering paths, data, tests, and documentation. Useful for risky or system-wide changes.
affaan-m/ECC
click-path-audit
Lets your agent trace all user buttons and interactions to find bugs. It finds issues where functions seem to work alone but fail together. Useful when bugs persist even after debugging.
affaan-m/ECC