Design Constraint Validator — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Design Constraint Validator (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Mathematical constraint validator for design systems — ensuring consistency, accessibility, and logical coherence.
Design Constraint Validator (DCV) validates design constraints across token sets and styles:
This is not a schema linter; it's a reasoning validator for values and relationships.


# Local (recommended)
npm i -D design-constraint-validator
# One-off run, no install (the bin name `dcv` belongs to an unrelated package)
npx design-constraint-validator --helpAfter a local install, the shorter dcv bin is available (e.g. npx dcv --help).
Requirements: Node.js ≥ 18.x (ESM)
DCV validates your tokens against your constraints. From an empty directory:
# 1. Your design tokens (DTCG-style "$value")
cat > tokens.json <<'JSON'
{
"color": {
"text": { "$value": "#888888" },
"bg": { "$value": "#999999" }
}
}
JSON
# 2. Your constraints — auto-discovered as dcv.config.json in the cwd
cat > dcv.config.json <<'JSON'
{
"constraints": {
"enableBuiltInWcagDefaults": false,
"enableBuiltInThreshold": false,
"wcag": [
{ "foreground": "color.text", "background": "color.bg", "ratio": 4.5, "description": "Body text on background" }
]
}
}
JSON
# 3. Validate (positional path or --tokens; exits non-zero on violations)
npx design-constraint-validator validate tokens.json --summary table
# Explain one token (the tokenId is required)
npx design-constraint-validator why color.text --tokens tokens.json --format table
# Export the dependency graph
npx design-constraint-validator graph --tokens tokens.json --format mermaid > graph.mmdThese one-offs use the full package name because the baredcvbin name on npm belongs to an unrelated package. Afternpm i -D design-constraint-validator, use the shorternpx dcv ….
Example output (validate):
validate: 1 error(s), 0 warning(s)
ERROR wcag-contrast color.text|color.bg @ Body text on background — Contrast 1.24:1 < 4.5:1
scope rules warnings errors
------ ----- -------- ------
global 1 0 1Exit code is 1 when violations are found, 0 when clean (use --fail-on off to always exit 0). The built-in WCAG/threshold defaults target the bundled example token ids, so disable them (as above) when validating your own token names.
import { validate } from 'design-constraint-validator';
// Synchronous. Point at files, or pass `tokens` / `constraints` inline.
const result = validate({
tokensPath: './tokens.json',
configPath: './dcv.config.json', // omit to auto-discover dcv.config.json in the cwd
});
if (!result.ok) {
for (const v of result.violations) {
console.log(`[${v.ruleId}] ${v.message}`);
}
process.exitCode = 1;
}See [API Reference](docs/API.md) for complete programmatic usage.
DCV ships a second binary, dcv-mcp, that exposes the validator over MCP stdio for agent clients. Add it to a Claude Desktop or generic MCP client config like this:
{
"mcpServers": {
"dcv": {
"command": "npx",
"args": ["-y", "--package", "design-constraint-validator", "dcv-mcp"]
}
}
}The server exposes six read-only, JSON-returning tools:
validate - validate inline tokens or a tokensPath against inline constraints or a config file.why - explain provenance, aliases, dependencies, dependents, and alias chain for one token id.graph - return token dependency nodes and edges.list-constraints - enumerate the active constraints (WCAG pairs, thresholds, order/lightness scales, cross-axis) for the given input.explain - turn a violation into plain-English text plus machine-readable facts.suggest-fix - compute a verified satisfying value for a violation (WCAG color, threshold/monotonic boundary) without writing anything.The three derivation tools (list-constraints, explain, suggest-fix) stay read-only — they return suggestions; applying them is up to you (dcv set / dcv patch). See [AI Guide](docs/AI-GUIDE.md) for the full agent loop.
Tool failures are returned as structured JSON: { "ok": false, "error": { "code": "...", "message": "..." } }.
Conventional linters catch schema issues ("has a value, has a type"). DCV enforces relationships that matter to users and brand integrity:
This transforms tokens from "bags of numbers" into a formal design system.

| Feature | Schema Linters | DCV |
|---|---|---|
| Validates | JSON structure, types | Mathematical relationships, accessibility |
| Catches | Missing fields, wrong types | Contrast violations, hierarchy breaks |
| Purpose | Format compliance | Design system integrity |
| Examples | DTCG schema validator | WCAG checks, monotonic scales |

DCV is not affiliated with Anima's design-tokens-validator (schema-focused).DCV accepts token JSON (flat or nested) and optional policy JSON. Adapters normalize common ecosystems:
{alias} references, $extensions passthrough; non-sRGB spaces warn rather than mis-calculate; composite types out of scope). See examples/dtcg/Full adapter documentation: [Adapters](docs/Adapters.md)
DCV is the standalone validation engine — use it for any token system.
DecisionThemes (coming 2026) is a complete design system framework built on DCV:
DCV powers DecisionThemes' validation layer — but works perfectly standalone. Preview: www.decisionthemes.com
The Design Constraint Validator engine is based on a theming and validation method published as defensive prior art.
To understand the underlying architecture (Decision Themes / Value Themes, deterministic compute, post-compute validation and receipts):
These documents keep the method openly implementable and prevent patent lock-up.
DCV generates CycloneDX-compliant SBOMs for supply chain transparency:
npx @cyclonedx/cyclonedx-npm in project rootDownload:
dcv validate --receipt already emits environment + input content hashes today; cryptographic signing is the roadmap partConstraints, not conventions.
Design systems need mathematical guarantees. This validator:
This is the core validation engine. For a complete decision-driven design system with a 5-axis framework (Tone, Emphasis, Size, Density, Shape) and theme configurator UI, see DecisionThemes (coming soon).
Contributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md)
MIT © Cseperke Papp
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.