agentleFS
rafidonerafidone/agent-skills/skills/constraint-driven-development/SKILL.md

constraint-driven-development

Skill1 starsChanged 22 days agoMITView on GitHub

Establishes a written quality bar with measurable thresholds before implementation. Use when no standards are documented, when an agent produces unverified or excessive work, or when a team needs a CONSTRAINTS.md that defines done.

30 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use accessibility-engineering, observability-and-instrumentation and 6 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • steven123397Skill

    accessibility-engineering

    Audits existing interfaces for WCAG 2.2 AA conformance and remediates the violations found. Use when auditing a page or component for accessibility, running axe-core or pa11y, triaging a11y violations, or checking screen reader and contrast issues before shipping.

    Also in 4 projects that use this

  • jaydubya818Skill

    observability-and-instrumentation

    Add or review logs, metrics, traces, and actionable alerts.

    Also in 23 projects that use this

  • LLl0k0laDSkill

    idea-refine

    Refine ideas through structured divergent and convergent thinking. Use "idea-refine" or "ideate" to trigger.

    Also in 20 projects that use this

  • jaydubya818Skill

    deprecation-and-migration

    Retire APIs or migrate consumers and persistent data across releases.

    Also in 19 projects that use this

  • LLl0k0laDSkill

    api-and-interface-design

    Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defining type contracts between modules, or establishing boundaries between frontend and backend.

    Also in 22 projects that use this

  • +3 more from LLl0k0laD

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 9 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 27 edited versions we read keep these.

  • 9

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when:

    line 29
  2. Distinctive:

    Before a large refactor, migration, or new service.

    line 35
  3. Distinctive:

    After an incident caused by an unstated assumption.

    line 36
  4. Distinctive:

    Do not use it for:

    line 38
  5. Distinctive:

    Ask about the dimensions that change design decisions.

    line 50
  6. Distinctive:

    Every constraint needs a number, a scope, and a measurement.

    line 67
  7. Distinctive:

    When the team has no preference, choose a sane default, label it as a default, and make it easy to change.

    line 71
  8. Distinctive:

    Place it at the repository root so agents read it as project context.

    line 76
  9. Distinctive:

    Exit condition: every constraint has a threshold, a measurement, an enforcement point, and an owner.

    line 137

“Common” is measured: kept by at least 6 in 10 of the 27 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Constraint-Driven Development

Overview

"Make it good" is not a requirement. Without a written quality bar, every review becomes a negotiation and every agent decides for itself what "done" means. The result is either gold-plating nobody asked for or corners cut nobody noticed.

A constraint is a measurable limit on the solution: response time, bundle size, test coverage of failure paths, accessibility level, supported versions, error budget. Constraints turn taste into checks.

This skill produces a CONSTRAINTS.md and, more importantly, wires each constraint into the cheapest place where it can be enforced.

When to Use

Use this skill when:

  • A project has no written standards, or they exist only in people's heads.
  • An agent is producing more code, more abstraction, or more output than anyone reads.
  • Reviews keep arguing about preferences instead of defects.
  • Before a large refactor, migration, or new service.
  • After an incident caused by an unstated assumption.

Do not use it for:

  • A one-off script with no maintenance expectation.
  • A repository that already has enforced constraints you can cite.

Related: use the spec-driven-development skill for the behavior contract, and the code-review-and-quality skill to enforce the result.

Core Process

1. Interview for the real limits

Ask about the dimensions that change design decisions. Skip any that do not apply, and record why.

DimensionQuestionExample threshold
PerformanceWhat latency is unacceptable?p95 under 300 ms at 100 rps
SizeWhat is the deployment budget?bundle under 200 KB gzipped
ReliabilityWhat failure rate is tolerable?99.9 percent monthly availability
SecurityWhat must never happen?no secret in the repo or logs
DataWhat must be recoverable, and how fast?restore within 1 hour, RPO 15 min
CompatibilityWhat must keep working?last two major versions
AccessibilityWhat standard applies?WCAG 2.2 AA on public pages
MaintainabilityWhat complexity is too much?functions under 40 lines, no cycles
CostWhat spend is unacceptable?under 50 USD per month at launch

2. Set thresholds, not adjectives

Every constraint needs a number, a scope, and a measurement. "Fast" becomes "p95 under 300 ms for the search endpoint, measured at the edge". "Secure" becomes "no credentials in source or logs, verified by the secret scanner".

When the team has no preference, choose a sane default, label it as a default, and make it easy to change.

3. Write CONSTRAINTS.md

Place it at the repository root so agents read it as project context.

# Constraints

## Non-negotiables
- No secret, token, or private key in the repository or logs.
- Migrations are reversible or have a tested recovery plan.
- Public API responses keep backward compatibility for two major versions.

## Budgets
- p95 latency under 300 ms at 100 rps for public read endpoints.
- Bundle under 200 KB gzipped for the initial route.
- Full CI under 10 minutes.

## Quality gates
- New behavior has a test that failed first.
- No new lint warnings.
- Failure paths cover invalid input and expected errors.

## Explicit non-goals
- Horizontal scale beyond one region before launch.
- A design system for internal tools.

## Enforcement
| Check | Where | Blocking |
| --- | --- | --- |
| Unit tests | pre-commit and CI | yes |
| Lint and types | pre-commit and CI | yes |
| Bundle budget | CI | yes |
| Latency benchmark | nightly | no, alert |

4. Place each check by cost

The cheapest check that catches the defect wins. Earlier is better, but only if it is fast and reliable.

StageUse forAvoid
Editorformatting, obvious typesanything slow or flaky
Pre-commitfast unit tests, lint, secret scanthe full suite
Pull requestfull tests, build, bundle budgetmulti-hour jobs
Nightlybenchmarks, dependency audits, fuzzingblocking every change
Releasesmoke tests, migration rehearsal, rollback drillsurprise gates

5. Enforce, do not document

A constraint with no check is a wish. Every non-negotiable must have an automated gate, or a named human owner and a review step.

6. Define the suppression policy

State who may override a gate, how, and for how long. A suppression must be scoped, justified, owned, and time-limited. Blanket disables are not allowed.

7. Review the constraints

Revisit at each release. Remove constraints that no longer matter and add the ones an incident revealed. A stale constraint file teaches agents to ignore it.

Exit condition: every constraint has a threshold, a measurement, an enforcement point, and an owner.

Common Rationalizations

RationalizationWhy it is wrongRequired action
"Our standards are in our heads."Unwritten standards cannot be enforced or inherited.Write them down; defaults are fine to start.
"Thresholds are arbitrary."An arbitrary number that is written and measured beats an adjective that is not.Set a default, label it, and revise with data.
"CI is already slow."Slow gates get bypassed, which is worse than a smaller gate.Move fast checks earlier and keep the slow ones nightly.
"We will add checks after launch."After launch is when the constraint matters most.Add the cheapest check before the risky change.
"The agent ignores the file."If it is not in the agent's context or a gate, it will.Put it at the root and enforce it in CI.
"Suppressions are pragmatic."Unscoped suppressions hide defects and spread.Require a reason, an owner, and an expiry.
"More constraints mean higher quality."Excess constraints slow work and get ignored.Keep only constraints tied to a real risk.

Red Flags

  • Constraints use adjectives with no measurement.
  • A non-negotiable has no automated check and no owner.
  • The constraint file is longer than the code it governs.
  • Gates live only in documentation.
  • Suppressions have no owner or expiry.
  • The quality bar changes depending on who is reviewing.
  • The constraints were written once and never revisited.
  • An agent is asked to "use good judgement" instead of follow a threshold.
  • A release has no rollback or recovery constraint.

Verification

  • Each constraint states a threshold, a scope, and a measurement.
  • Non-negotiables have an automated gate or a named owner.
  • Each check runs at the cheapest effective stage.
  • CONSTRAINTS.md is at the repository root and referenced by AGENTS.md.
  • The suppression policy is written and time-limited.
  • Defaults are labelled and easy to change.
  • The constraints cover performance, security, data, and compatibility.
  • The constraints were reviewed at the last release.
  • A new contributor can tell what "done" means without asking.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.