new-validator

Authors validator or generator scripts and wires them into the validate-registry build chain.

1|Updated Feb 14, 2026
One-click install
npx skills add https://github.com/robritacca-dotcom/design-system --skill new-validator-robritacca-dotcom
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: new-validator
Source: https://github.com/robritacca-dotcom/design-system/tree/main/.claude/skills/new-validator
Command: npx skills add https://github.com/robritacca-dotcom/design-system --skill new-validator-robritacca-dotcom

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Build-time invariants that exist only as prose documentation drift silently out of sync with the codebase. This Skill turns a rule into an enforced validator or generator script that fails the build when the invariant breaks, so guarded facts can never regress unnoticed. ## Core Features & Use Cases - Validator and generator authoring: Creates scripts under scripts/ following the repo's doc-block, CRLF-normalization, and portable-path conventions, including the regenerate-and-byte-compare pattern for generated surfaces. - Build chain wiring: Places the script in the correct slot — the validate-registry chain, the post-website-build verify slot, or run-on-demand — and syncs the website's predev/prebuild subsets and CI. - Documentation closure: Adds the registry row or CLAUDE.md entry that records the new guard, then verifies by breaking the invariant on purpose. - Use Case: When asked to "build-enforce that every component has a registry entry", the Skill writes the validator, chains it into validate-registry, and confirms it fails on a deliberately broken invariant. ## Quick Start Ask the AI to add a validator that fails the build when a specific invariant breaks, and have it wired into the validate-registry chain.

Frequently Asked Questions about new-validator

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

FAQPage Schema
How do I add a validator script to a build chain?

Write a Node.js script under scripts/ that collects failures into an errors array and exits non-zero, then add it to the validate-registry entry in the root package.json. Generators run first, validators after, so ordering matters.

What is the regenerate-and-byte-compare pattern for generated files?

The generator exports its assemble function and output path, guarded so importing it has no side effects. A companion validator imports the function, regenerates in memory, and byte-compares against the CRLF-normalized file on disk to detect drift.

Why does my validation script fail on Windows but pass on macOS?

Windows checkouts with core.autocrlf=true introduce CRLF line endings that break parsing and byte comparisons. Normalize with .replace(/\r\n/g, '\n') immediately after every readFileSync, and convert backslashes to forward slashes before comparing paths.

When should a check run after the build instead of in validate-registry?

Checks that read prerendered HTML or need a running server belong in the post-build verify slot and CI's website job, since validate-registry runs before any build output exists. The script's doc block must argue why source-level checking would over- or under-report.

Can a script that fetches network data join the build chain?

No. Scripts whose source is the network or a running server run on demand only, commit their output, and record the exclusion reason in their doc block, because CI cannot re-fetch the network deterministically.