constraints

A project-quality setup command that records the checks and standards a codebase should meet in a CONSTRAINTS.md file.

In plain words
What is it for?
Use it to inspect existing project settings, ask about the desired quality bar, choose checks, and configure whether failures block ongoing work.
Why use it?
It turns vague expectations about testing, security, performance, accessibility, or coverage into documented rules, measurements, and exceptions.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/addyosmani/agent-skills/constraints
Clone the repo
git clone --depth 1 https://github.com/addyosmani/agent-skills

Made for: Claude Code.

Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 598 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00017 $0.00598
Opus 5 $0.00009 $0.00299
Sonnet 5 $0.00003 $0.00120
Haiku 4.5 $0.00002 $0.00060

Measured yesterday against content hash f6d8fdf69be7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

constraints scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/constraints.md · 33 lines

What it actually says

Invoke the agent-skills:constraint-driven-development skill.

$ARGUMENTS

Default behaviour with no arguments: set up constraints for this repository.

  1. Detect first. Read package.json / pyproject.toml / go.mod, the test runner, existing lint configs, current coverage output, CI workflows, and the agent harness in use. Report what you found in two lines. Never ask for anything you can read.

  2. Interview, at most four questions. One at a time, each with your best guess and a usable default so "I don't know" still produces a working config:

    • Which dimensions beyond the floor (coverage, security, performance, accessibility, architecture)
    • Block or warn when a check fails mid-task
    • Target numbers, or measure today's values and hold them
    • Slowest check tolerated before handing work back
  3. Write CONSTRAINTS.md at the repo root with a Floor section, enforced numbers, measured-only metrics with today's values, and an exceptions table with owners and expiry dates. Every number needs a stated reason.

  4. Install what each picked dimension needs. A dimension with a number and no tool behind it is an aspiration. Use the de facto tool so existing config keeps working: Semgrep for code scanning, gitleaks (always --redact) for secrets, osv-scanner for dependencies, axe-core for accessibility, Lighthouse for web vitals, size-limit for bundles, dependency-cruiser for boundaries, Stryker for assertion quality. Record the exact command next to each rule in CONSTRAINTS.md. Accessibility and performance need a running URL; if the project has none, say so and drop the dimension rather than inventing a check. Add the commands to package.json as check:fast / check:task / check:full.

  5. Place each check by cost. Types, lint and secrets in the edit loop (seconds). Related tests and changed-line coverage at task end (under 90s). Everything else at review or in CI. Scope checks to the diff, not the whole repo.

  6. Point the agent at it. Add a line to CLAUDE.md telling agents to read CONSTRAINTS.md and never weaken it to make a change pass.

  7. Verify. Run the constraints against the current branch. If anything fails that the user disagrees with, fix the constraint now rather than leaving a gate people will learn to ignore.

Sub-commands:

  • /constraints check — run the current constraints against this branch and report
  • /constraints guard — inspect the diff for a weakened bar: lowered thresholds, skipped or deleted tests, new suppression comments, unfinished stubs, new exceptions
  • /constraints ratchet — record today's measured values as the floor that must not fall
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 33 lines · 17 tokens per session scan A f6d8fdf69be7

Subscribe to this mod's changes

constraints is a command published in the GitHub repository addyosmani/agent-skills (90,889 stars, last pushed 3d ago), licensed MIT. It adds 17 tokens to every session and 598 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.