constraint-driven-development

Establishes enforceable project quality constraints in a CONSTRAINTS.md file with thresholds and diff-scoped guards.

1|Updated Mar 2, 2025
One-click install
npx skills add https://github.com/marjorg/setup --skill constraint-driven-development-marjorg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: constraint-driven-development
Source: https://github.com/marjorg/setup/tree/main/home/.agents/skills/constraint-driven-development
Command: npx skills add https://github.com/marjorg/setup --skill constraint-driven-development-marjorg

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? AI agents produce code faster than anyone can review it, and quality standards that live only in conversation get quietly lowered — tests skipped, checks suppressed, thresholds edited down. This Skill turns a project's quality bar into a written, versioned contract with real numbers and tooling, then watches diffs for attempts to weaken it. ## Core Features & Use Cases - Constraint Interview & Defaults: Runs a four-question intake with sane defaults (coverage, security scanning, performance budgets, accessibility) so even "I don't know" answers produce a working configuration. - CONSTRAINTS.md Generation: Writes a single repo-root contract with an always-enforced floor (no new suppressions, stubs, or skipped tests), numbered enforced dimensions with named tools and commands, measured-only ratchets, and expiring exceptions. - Floor Guard Reference: Ships a diff-scoped reference implementation that detects weakened thresholds, removed assertions, new suppression comments, and unimplemented stubs, exiting 0/1/2 for CI integration. - Use Case: Before running an autonomous build loop on a TypeScript project, use this Skill to record an 80% changed-line coverage gate, gitleaks and Semgrep security checks, and a Lighthouse LCP budget, then block any diff that lowers those bars. ## Quick Start Ask the agent to set up quality constraints for this project and write them into a CONSTRAINTS.md file with enforced thresholds.

Frequently Asked Questions about constraint-driven-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up enforceable code quality constraints for AI coding agents?

Run a short interview covering which dimensions matter (coverage, security, performance, accessibility), then record the decisions in a CONSTRAINTS.md file at the repo root. Each constraint names the tool and command that checks it, and AGENTS.md or CLAUDE.md points agents at the file.

What coverage threshold should I set for a project with low existing coverage?

Use a ratchet instead of a fixed number: record today's measured coverage in a 'Measured, not yet enforced' table with a 'must not fall' direction. Setting 80% on a 62% codebase produces a permanently red build that teams learn to ignore.

How do I stop an AI agent from adding eslint-disable or skipping tests?

Enforce the floor: a diff-scoped guard that flags new suppression comments (@ts-ignore, eslint-disable, noqa), added .skip calls, removed assertions, and unimplemented stubs. The skill ships a reference implementation with exit codes 0, 1, and 2 for CI use.

Which tools should enforce security and performance constraints?

Use de facto tools rather than custom checkers: Semgrep for code findings, gitleaks with --redact for secrets, osv-scanner for dependencies, Lighthouse for LCP and CLS budgets, and axe-core for WCAG accessibility violations. Each maps to a row in the constraints table.

When should I not use constraint-driven development?

Skip it for one-off scripts, spikes, throwaway prototypes, and short-lived pre-product-market-fit code beyond the basic floor. Also skip the interview if a CONSTRAINTS.md already exists and is not changing — just read and follow it.