design-constraint-validator: Agent for Claude Code

.github/agents/constraint-author.md

constraint-author is an agent for Claude Code from CseperkePapp/design-constraint-validator. It costs 58 tokens per session (1,005 once invoked), scanned A, original, MIT.

An agent for creating a new design-token constraint plugin, including its registration, configuration, fixture, and test. Design tokens are named values such as colours or spacing used across an interface.

In plain words
What is it for?
Use it to add a new kind of token checker to DCV, such as a rule for colour, contrast, ordering, thresholds, or relationships between axes.
Why use it?
It provides a defined process for adding a new rule while protecting existing colour and contrast calculations and requiring tests.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md).

This is CseperkePapp/design-constraint-validator's own configuration. It tells Claude Code how to work on design-constraint-validator itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything design-constraint-validator configures →

Reuse

Borrowing it

Nothing to install: this file belongs to CseperkePapp/design-constraint-validator. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/CseperkePapp/design-constraint-validator/main/.github/agents/constraint-author.md
Clone the repo
git clone --depth 1 https://github.com/CseperkePapp/design-constraint-validator

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for constraint-author

README.md
[![agentmods](https://agentmods.dev/badge/agents/cseperkepapp/design-constraint-validator/constraint-author.svg)](https://agentmods.dev/agents/cseperkepapp/design-constraint-validator/constraint-author)
Your own site
<a href="https://agentmods.dev/agents/cseperkepapp/design-constraint-validator/constraint-author"><img src="https://agentmods.dev/badge/agents/cseperkepapp/design-constraint-validator/constraint-author.svg" alt="Measured on agentmods" height="20"></a>
Per session 58 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,005 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.1 $0.00058 $0.01005
Opus 5 $0.00029 $0.00502
Sonnet 5 $0.00012 $0.00201
Haiku 4.5 $0.00006 $0.00101

Measured 6d ago against content hash 33b73346a444, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

constraint-author 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 6d ago.

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.

.github/agents/constraint-author.md · 72 lines

How it starts

The opening of the file, as written. The whole thing — 72 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Constraint Author

Use this agent to add a new constraint plugin to DCV. A constraint is a pure checker that reads token values and reports ConstraintIssue[]; it never mutates tokens. The five existing plugins live in core/constraints/ (wcag, monotonic, monotonic-lightness, threshold, cross-axis) — mirror the closest one.

Guardrails (do not violate)

  • Never edit core/color.ts or any other verified math (luminance, contrast, OKLCH→sRGB, alpha compositing). A new constraint consumes that math; it does not change it.
  • Additive only. Don't change existing plugins' behavior, the engine, or the ConstraintIssue shape. New rule → new plugin + new source type.
  • One task, one branch (task/NNN-...). Stage only files you touched.
  • Tests are part of the change, not a follow-up. No plugin lands without a test and a fixture.
  • If the rule can't be expressed without new color/number math, stop and ask — do not invent math.

Read first

  • core/engine.tsConstraintPlugin (line ~90) and ConstraintIssue (line ~8) types.
  • cli/constraint-registry.ts — the single source of truth: discoverConstraints, attachConstraints, setupConstraints, collectReferencedIds, and the ConstraintSource union.
  • The closest existing plugin in core/constraints/ (e.g. threshold.ts for a value check, monotonic.ts for an ordering check).
  • cli/config-schema.tsConstraintsSchema (only if the rule is config-driven).
  • docs/Extending-DCV.md and docs/Architecture.md "Plugin Contract".

Steps

  1. Plugin. Add core/constraints/<name>.ts exporting a factory that returns a ConstraintPlugin:
    • id: '<rule-id>'.
    • evaluate(engine, candidates): only check rules touching at least one candidate (keeps incremental re-validation cheap); read values with engine.get(id); return ConstraintIssue[] with involvedTokens populated and structured facts in metadata (not just a message string).
  2. Source type. Add a ConstraintSource variant in cli/constraint-registry.ts describing where the rule comes from (config block and/or a constraints-dir file).
  3. Discovery. In discoverConstraints, detect the source (config field via config.constraints, and/or <constraintsDir>/<name>.json) and push the variant.
  4. Attach. In attachConstraints, add a case that maps the source to engine.use(<YourPlugin>(...)).
  5. Coverage. In collectReferencedIds, add the token ids your rule references (so the "nothing was checked" note stays accurate). If ids can't be enumerated, set coverageKnown = false like cross-axis-file does.
  6. Config schema (if config-driven). Extend ConstraintsSchema in cli/config-schema.ts. Make your new rule's object(s) .strict() so typos in its fields are rejected. Note the ConstraintsSchema root is currently .passthrough(), so unknown top-level keys are accepted — don't claim otherwise, and don't flip the root to strict here (that's a separate, breaking change outside a new-constraint task).
  7. Fixture + test. Add test/<name>.test.ts mirroring an existing constraint test (e.g. test/cross-axis.test.ts): one passing case, one violating case, and the structured metadata/involvedTokens you emit.
  8. Verify. npm run build && npm test (or the full npm run check).

Read the full file on GitHub · 72 lines

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. 6d ago First seen · 72 lines · 58 tokens per session scan A 33b73346a444

Subscribe to this mod's changes

constraint-author is an agent published in the GitHub repository CseperkePapp/design-constraint-validator (0 stars, last pushed 2mo ago), licensed MIT. It adds 58 tokens to every session and 1,005 once invoked, about $0.0003 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-31.

Related

Other agents, from other repositories

ux-flow-auditor

Use this agent when the user mentions UX flow issues, dead-end views, dismiss traps, missing empty states, broken user journeys, or wants a UX audit of their iOS app. Automatically scans SwiftUI and UIKit code for user journey defects - detects dead ends, dismiss traps, buried CTAs, missing loading/error/empty states…

CharlesWiltgen/Axiom · 190 tokens

Design System Auditor

Design system accessibility auditor. Validates color tokens, CSS custom properties, Tailwind config, and design token files (Style Dictionary, tokens.json) for WCAG AA/AAA contrast compliance. Catches contrast failures at the token source before they reach deployed UI. Also validates focus ring tokens (WCAG 2.4.13…

Community-Access/accessibility-agents · 109 tokens

ijfw-accessibility-reviewer

Design-phase WCAG 2.1 AA review of UI artefacts: contrast, semantics, focus, ARIA. Trigger per design review pass.

FerroxLabs/ijfw · 37 tokens

slide-auditor

Visual layout auditor for RevealJS and Beamer slides. Checks for overflow, font consistency, box fatigue, and spacing issues. Use proactively after creating or modifying slides.

brycewang-stanford/Auto-Empirical-Research-Skills · 38 tokens

design

Design system generator — maps product domain to style, palette, typography, anti-patterns. Creates .rune/design-system.md. Use BEFORE any frontend code generation.

Rune-kit/rune · 35 tokens

mobile-ux-optimizer

Use this agent when you need to optimize UI/UX components or interfaces for mobile-first experiences, analyze existing design themes, or ensure mobile usability standards are met. Examples: Context: User has created a desktop-focused component and needs it optimized for mobile. user: 'I've built this navigation…

xbim08/awesome-claude-code-plugins · 0 tokens