# Constraint-Driven Development (constraint-driven-development)

> Writes a project's quality bar down as a CONSTRAINTS.md contract and watches diffs for a quietly weakened bar.

- Category: [Code Standards](https://www.myskills.tools/en/categories/code-standards/)
- Source: Community · Addy Osmani
- Repository: 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
- Install command: `npx skills add addyosmani/agent-skills --skill constraint-driven-development`
- License: MIT
- Compatible with: Claude Code, Codex, Cursor, Copilot, Gemini CLI
- Permissions: read-repo ✓, write-files ✓, shell ✓, network ✓
- Status: Scan passed
- A rule scan cannot catch every risk. Read this skill's SKILL.md and check its permissions before installing.
- ⚠ The interview needs a live user; in CI or unattended runs only the floor applies, and gitleaks must run with --redact.

## Core rule

Never weaken CONSTRAINTS.md to make a change pass.

## Execution Phases

1. **Detect before asking** — Read the existing tests, lint and CI config first; never ask what can be read.
2. **Four questions with defaults** — Ask one at a time which dimensions to enforce, block or warn, and target numbers, each with a default.
3. **Write and install** — Write CONSTRAINTS.md, add one line to AGENTS.md and CLAUDE.md, and wire in the checker each dimension needs.
4. **Guard the bar** — Check the diff for lowered thresholds, skipped or deleted tests, new @ts-ignore or eslint-disable, and unfinished stubs.

## Permissions (summarised from SKILL.md)

| Capability | Needed | Details |
|---|---|---|
| File writes | Required | Writes CONSTRAINTS.md, check scripts and tool config, and adds one line each to AGENTS.md and CLAUDE.md. |
| Command execution | Limited | Installs and runs the checkers for chosen dimensions (such as gitleaks, osv-scanner, Semgrep, Lighthouse, axe), scoping expensive ones to the diff. |
| Network outbound | Limited | Used to install checkers and read external sources such as vulnerability databases. |

## SKILL.md frontmatter (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.
---
```

Home: https://www.myskills.tools/en/ · URL: https://www.myskills.tools/en/skills/constraint-driven-development/
