/design-system-to-skill:design-system-to-skillfrom Design System to Skill
Converts an extract-design-system output bundle into a self-contained, auto-triggering per-brand Claude Code agent skill for building brand-native pages.
Ships in Design System to Skill. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Turn an extract-design-system bundle into a self-contained, per-brand agent skill. A bundled
deterministic Node worker does all mechanical work (validate, copy, render, stage, scan); your only
creative act is authoring the generated skill's trigger description. Follow the steps in order.
Built for Claude Code. The worker emits a
.claude/skills/<slug>/folder and (optionally) edits a projectCLAUDE.md; the materialize step uses your agent's file-writing tool (the Write tool in Claude Code). Any agent can run the worker, but the output is a Claude Code skill package.
Hard rules (non-negotiable):
SKILL.md body; it goes only into
delimited references/ files. The worker enforces this; do not undo it..claude/skills/ with your agent's file-writing tool (in Claude Code, the Write
tool). If your agent sandboxes filesystem writes, allow writes to the destination tree rather than
disabling the sandbox wholesale.The worker lives at scripts/convert-design-system.mjs (zero deps, Node ≥18). It validates against
references/expected-contract.json and renders from references/skill-body.template.md,
references/source-protocol-banner.md, and references/must-use-directive.template.md.
Accept the bundle path the user gave. If it is a parent dir holding exactly one *-YYYYMMDD
bundle, that resolves; 0 or >1 → stop and ask which one.
Run a validating dry run, staging into a sandbox-writable temp dir (never /tmp directly — use
$TMPDIR or another session-writable temp dir):
node scripts/convert-design-system.mjs "<bundle-path>" --dry-run --json --staging "$TMPDIR/ds2s"
mustUse object (installed design-system consumer skills + any current
MUST-USE registry entry) — you'll use it in Step 2.Ask the user (default NO): "Make <slug> the MUST-USE design system — the sole, always-on
design system for all UI design and implementation in this project? Every other design system will
be off-limits for UI here."
Use the Step 1 mustUse scan to inform them:
List other installed consumer skills (installedDesignSystems where isConsumer && !isSelf)
that would become off-limits for UI — a warning, so they decide with eyes open.
State the current registry entry (mustUse.currentMustUse) if one exists.
If NO: normal path (default description mode, Step 4). If currentMustUse === <slug> (this
skill already holds MUST-USE and they now decline), offer to clear its CLAUDE.md block. Otherwise
leave CLAUDE.md untouched.
If YES: you will pass --must-use --claude-md "<governing CLAUDE.md>" to the worker in Step 3.
The governing CLAUDE.md is the one at the --out project root (<project-root>/CLAUDE.md;
override with --claude-md). Apply the single-winner rule
using the worker's mustUse.conflict.type:
none — no prior MUST-USE; proceed.already-self — this skill already holds it; idempotent, just refresh the block.replace — another skill (conflict.existingSlug) holds it. STOP and ask: replace
(demote the old, promote this one), keep existing (skip MUST-USE for this skill and continue
with the default description), or abort. Never silently overwrite another skill's MUST-USE.Re-run without --dry-run to stage the tree and emit the manifest (add --must-use --claude-md …
only if the user opted in at Step 2):
node scripts/convert-design-system.mjs "<bundle-path>" --json --staging "$TMPDIR/ds2s" [--with-screenshots] [--must-use --claude-md "<CLAUDE.md>"]
The manifest carries filesPlanned[], staleFiles[], collision{}, descriptionInputs{}, and the
mustUse object. Under --must-use, mustUse.proposedDirective holds the exact managed-block text
to write in Step 5.
descriptionAuthor from descriptionInputs. It must state what + when, be third-person and pushy, name the
brand and source domain, include ≥3 concrete trigger phrases, say what it reads (DESIGN.md
tokens, catalog, snippets), be ≤1024 bytes with no unquoted : , and lift no imperative
verbatim from the bundle. Two modes:
<Brand> pricing
page", "use the <Brand> design system")..claude/skills/ (Write tool)Destination is outDir from the manifest (default .claude/skills/<slug>-design-system/).
collision.exists / exit 3): STOP and ask — overwrite (full replace),
dated-sibling (<slug>-design-system-<YYYYMMDD>), or abort. On overwrite, first remove
each staleFiles[] path via the file-delete affordance, then re-run with --force.filesPlanned[] entry, read its stagedPath and Write
it to dest. For SKILL.md, substitute your authored description for __DESCRIPTION__. All other
files are mechanical staged→dest transfers — never re-derive them.--with-screenshots): assets/screenshots/** are binary; the text
Write tool can't carry them. Copy that subtree with a single explicit, reported cp -R (the sole
binary exception), or skip screenshots and say so.mustUse.proposedDirective verbatim
into the governing CLAUDE.md with the Edit/Write tool. It is delimited by
<!-- design-system-must-use:start --> … <!-- design-system-must-use:end -->; if a block with
those sentinels already exists, replace it wholesale (there must be exactly one block naming
exactly this slug). Append it near the end of CLAUDE.md if absent. CLAUDE.md is a normal file (not
under .claude/skills/), so Edit/Write works directly.Run the C2 self-check in references/description-checklist.md (default ON), including the MUST-USE
items when in MUST-USE mode. Fix failures mechanically. Run C1 only if the user opted in, labeled a
heuristic. In-session reasoning only — no nested agent process or external eval runner.
Report: final path, files written, variant detected, WARNs, excluded items (raw/, gallery.html,
design-system.full.md, screenshots unless --with-screenshots), the recorded extractor marker, and
the trust-boundary treatment. State the C2 result. MUST-USE status: whether it was enabled, the
CLAUDE.md path written, the single winner, and which other consumer skills were flagged off-limits.
Do not claim always/only enforcement, trigger-firing, self-containment, or protocol fidelity
beyond what the directive + description + checks actually establish — phrase unverifiable claims as
such. If a mid-write failure left the tree incomplete, say so. A newly written skill (and CLAUDE.md
directive) only takes effect at the next session.
references/description-checklist.md (opens in a new tab)references/expected-contract.json (opens in a new tab)references/must-use-directive.template.md (opens in a new tab)references/skill-body.template.md (opens in a new tab)references/source-protocol-banner.md (opens in a new tab)scripts/convert-design-system.mjs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub nathanonn/agent-skills --plugin design-system-to-skillOther plugins' skills for the same job