Scan your whole stack
From OX Research Newsroom
Are you using @rickycourtes/designrail?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.2.2
@rickycourtes/designrail was last scanned on 29 Nov 2026 at version 0.2.2. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.2.2 LATEST | 29 Nov 2026 | No rules fired |
| 0.2.1 | 28 Nov 2026 | No rules fired |
| 0.2.0 | 28 Nov 2026 | No rules fired |
| 0.0.0-stage | 28 Nov 2026 | Not shown |
Findings for v0.2.2. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.2.2; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
The design foundation for any web project. Every project installs it and builds on top of it, and one update to designrail reaches all of them.
designrail has two halves:
upgradeIt needs only Node 20 and has no dependencies. It scans a 300-file app in about 100 ms, or about 10 ms from its cache.
npm i -D @rickycourtes/designrail # the foundation and the tools
npx designrail init # config (records the foundation version) + DESIGN.md
npx designrail audit # health score and what to fix first
npx designrail extract # your theme, from the values already in use
npx designrail fix --write # hardcoded values → tokens
npx designrail check --install-hook # no new drift from here on
npx designrail specimens # a page with every token and part
On a project that already has token files, skip extract. fix and check
use the tokens that are already there, plus the foundation's.
designrail is published publicly on npm as @rickycourtes/designrail, so it
installs like any other package: no .npmrc or token needed.
npm i -D @rickycourtes/designrail saves a ^0.2.0 range. While the version
is 0.x, a caret range takes patch releases (0.2.x) automatically through
npm update. A minor release (0.3.0) may rename things, so you move to it on
purpose and run designrail upgrade.
Load the foundation first, then your theme, then your own parts:
/* app.css */
@import '@rickycourtes/designrail/foundation.css'; /* default theme, base, every part (layered) */
@import './tokens/primitives.css'; /* your raw values */
@import './tokens/semantic.css'; /* the contract pointed at them: your look */
@import './ui/index.css'; /* your own parts and variants */
import { dropdowns, toast } from '@rickycourtes/designrail/foundation.js';
dropdowns();
How the layers work:
Layers: the foundation lives in three cascade layers,
designrail.tokens, designrail.base and designrail.parts. Anything a
project writes outside a layer wins over them, whatever its specificity, so
:root { --accent: … } in your theme always beats the default.
Themes: setting the core tokens (--surface, --text, --accent,
--text-on-accent, --font-ui) is enough to take over the look. Every other
colour (fills, borders, muted text, hover, raised and sunken surfaces) is
derived from those core tokens, so it follows any theme. Set any of them
yourself to go further.
Variants, not edits: restyle a part through its knobs, on a class of your own:
.btn.ink { --btn-bg: var(--text); --btn-fg: var(--surface); }
Never .btn { background: … } where it is used: that freezes the part
against foundation updates. check reports it as part-restyle. Layout
where a part is used (margin, grid placement, width) is fine.
Ejecting: when a project truly needs its own version of a part,
designrail eject <part> copies it in. That part then stops following the
foundation, and upgrade names it whenever the foundation's copy has moved
on.
Updating: npm outdated shows when a project is behind. Bump with
npm i -D @rickycourtes/designrail@^0.3.0 (Dependabot can open that PR in
each repo), then run designrail upgrade. It
lists what changed in each version between the one you were on and the one
installed (from kit/changes.json). With --write it rewrites renamed tokens
and classes across the project and records the new version in
designrail.config.json. Run designrail check after.
Primitives are raw values, named for what they are: --blue-500: #3b82f6
or --space-12: 12px. Only token files read them. The exception is the
--space-*, --radius-* and --font-size-* steps, because a step on a scale
says all a gap needs.
Semantic tokens say what a value is for: --surface: var(--white) or
--accent: var(--blue-500). Parts and pages read these. A theme (for example
dark mode) re-points the semantic layer and leaves every part alone.
The contract is the set of semantic names that extract produces and that
every kit part reads. A project that defines them can take any kit part as is.
See The token contract.
Parts are reusable components: a button, a field, a card. The core rule is
use the part we have; never draw it again. audit finds the places a part was
drawn twice, and the foundation gives you one version to replace them with.
The foundation is the default theme plus the kit's parts, installed as a
package and layered underneath the project. Knobs are the custom properties
a part exposes (--btn-bg, --card-pad), so a project restyles it without
editing it.
Drift is anything that moves away from the system: a hardcoded colour, a
var() that resolves nowhere, a copy-pasted rule block. check reports it.
With git it reports only the drift a change adds.
designrail <command> [dir] [flags]
dir defaults to the current folder. For trace and eject, which take other
arguments, pass the folder with -C dir.
Every command takes these flags:
| Flag | Effect |
|---|---|
--json |
One line of JSON instead of text. |
--no-cache |
Reparse every file; read and write no cache. |
--all |
Every hit or item, not the first few. |
--help |
Usage. |
An unknown flag exits with code 2 and an error, rather than being guessed at.
init [dir] [--agents] [--force]Writes designrail.config.json and DESIGN.md, the project's design rules
(see Design rules). If the project already has token files
(stylesheets that are mostly custom properties on :root), init finds them
and points tokens at them. parts is set to src/ui when there is a src/
folder, else ui. A page designrail specimens wrote (wherever --out put
it) is listed under specimens. When the foundation is installed (or package.json
depends on designrail), init records its version as foundation and
prints the import lines.
--agents adds a short "Design system (designrail)" section to CLAUDE.md
or AGENTS.md (whichever exists, else a new CLAUDE.md). See
Coding agents.--force rewrites files that already exist.audit [dir] [--html file] [--limit n]A 0–100 health score in five parts:
| Part | Points | Measures |
|---|---|---|
| tokens | 40 | Design declarations (colour, spacing, radius, font size, family, shadow) that read a token instead of a literal. |
| colors | 15 | Distinct colours, and how many are near-identical (closer than colorTolerance). |
| scale | 15 | Spacing and radius values off the grid, per use. |
| duplication | 15 | Rules in identical groups, plus near-duplicate pairs. |
| reuse | 15 | Parts drawn as several class families, plus markup copied across files. |
Then the details:
#3b82f6, #3b83f6
and #3a82f7), each of which could be one token..card ≡ .panel), and pairs that share most of them (60%+), with what differs.
Like a copy-paste detector's minimum size, a block counts only at
duplicates.minDeclarations (3) declarations, and a near pair only when it
shares that many: two rules that both read font-weight: 600; color: var(--text) are a type role, and merging them would couple unrelated parts.
Near-identical colours count as equal here. Show/hide state rules
(display, opacity, pointer-events…) are left out, and so are rules
whose selectors differ only by vendor pseudo-elements
(::-webkit-slider-thumb and ::-moz-range-thumb): they can't share one
selector list, since a browser drops the whole list over a pseudo-element
it doesn't know.parts folder, each file is one part, so one family, whatever
its classes are called: .field, .input, input and textarea in
ui/field.css are the field part. The role comes from the file's name
(field.css, value-field.css). A file whose name is no role
(profile.css) is a part of its own, so its .pf-banner is not a toast..checkout .btn restyles the button part, it is not another family..btn/.btn-secondary are one family while .submit-button and .cta
are others, so the report suggests one part with variants.Pages listed under specimens in the config show parts side by side on
purpose, so they're left out of the part-family and repeated-markup checks.
--html file writes a self-contained report page to share. --limit n sets
how many items each section shows (default 6).
scan [dir]What was read and how fast: file count by type, how many came from cache, the token files found, how many design values read a token, and how many literals sit outside token files.
extract [dir] [--dry] [--force] [--out dir]Builds a token system from the values the project already uses. It writes
three files to the folder of the first tokens entry (tokens/ by default):
primitives.css--gray-200, --blue-500,
--red-100, --white, --black-a20 for a colour with alpha. A pale tint
is named for its hue, never as a grey.snap px merge onto the grid
(--space-12 merges 11px and 13px). An off-grid value used only once is
left as a value to snap, not made a step. --radius-full covers anything
at 500px and up.--font-size-15, --font-inter, --weight-600, --shadow-1,
--duration-150).semantic.css: the contract, inferred from where
each value is used:--surface is the body/html background, else the most used neutral
background.--text is the body text colour, else the most used one that reads
on the page.--text-on-accent is what the project sets on accent backgrounds.--accent is the most used colour that is not grey, red or green;
--danger, --success and --warning are the most used red, green and
amber.--radius-control and --radius-card are the most used radius on
button/field and card/dialog rules.--font-size-body is the body size; --font-display is the family
the headings use./* derived */.tokens.json: the same tokens as W3C Design Tokens (DTCG) JSON, for Figma
plugins and Style Dictionary. Semantic tokens are written as references
({primitive.blue-500}).If the project already has token files, extract stops and says so.
--out dir writes a fresh set elsewhere, and --force overwrites. --dry
prints the files instead of writing them.
Import primitives.css, then semantic.css, before your own styles. The
files are yours: edit names and values freely. fix and check read
whatever is there.
fix [dir] [--write] [--snap] [--limit n]Rewrites hardcoded values as the tokens that hold them. It shows a diff
(file, line, old → new) unless you pass --write.
Colours match within colorTolerance. When several tokens match, the
pick goes:
background gets
--surface, a color gets --text, a border gets --border)--accent)A semantic token whose job is a different property is never used, so
#1a1a1a as a background never becomes --text.
Spacing, radius, font size: an exact pixel match within the same scale
(rem converts at 16px; em is skipped). A token's scale comes from its name
when the name says it (--space-*, --gap, --radius-*; --control,
--icon-* and --*-h are sizes, which fix never writes), else from the
properties that read it. So padding: 44px never becomes --control. With --snap, anything within
snap px of a step also matches, and the diff marks it snapped. A
negative margin becomes calc(var(--space-8) * -1).
Families, shadows, durations: an exact match.
Primitives: every value lands outside token files, so with
semanticOnly on, fix never writes a primitive (the foundation's palette,
such as --gray-950, included), only semantic tokens and the
allowPrimitives steps. A colour only a primitive holds is listed as
having no token.
Where it writes: CSS/SCSS/Less, <style> blocks, style=""
attributes, styled-components and css`` templates, JSX style objects (a
number like padding: 12 becomes padding: 'var(--space-12)'), and
Tailwind arbitrary values (p-[12px] becomes p-[var(--space-12)]).
At the end it lists, by kind, the values no token holds. Add those to your
token files, or regenerate with extract --out.
check [dir] [--staged | --base REF] [--install-hook]The drift gate. It exits 1 if any rule set to error has a hit.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.