2-extract

2-extract is a command for Claude Code from vercel-labs/design-systems-to-agent-skills. It costs 0 tokens per session (2,777 once invoked), scanned A, original, MIT.

A fact-collection step in a design-system documentation pipeline. It reads project decisions and source code to record verified details about interface components.

In plain words
What is it for?
Use it to create per-component fact files and summaries before generating documentation or other developer guidance for a design system.
Why use it?
It reduces guesswork about component names, properties, defaults, file paths, styling, and reusable design values. Unclear details are marked instead of being treated as facts.

Command for Claude Code ✓ vendor

Written for Claude Code: a Claude Code command (commands/*.md). Also seen: mentions subagents.

Good fit Use it to create per-component fact files and summaries before generating documentation or other developer guidance for a design system.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/vercel-labs/design-systems-to-agent-skills/2-extract
About the project

DS Skills Pipeline is a command-line workflow that turns a design system's source code into structured skills for coding agents. It extracts verified tokens, components, icons, assets, usage patterns, and import paths, then generates and verifies reference files that agents can use when working with the design system.

vercel-labs/design-systems-to-agent-skills · 37 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/vercel-labs/design-systems-to-agent-skills

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 2-extract

README.md
[![agentmods](https://agentmods.dev/badge/commands/vercel-labs/design-systems-to-agent-skills/2-extract/github.svg)](https://agentmods.dev/commands/vercel-labs/design-systems-to-agent-skills/2-extract)
Your own site
<a href="https://agentmods.dev/commands/vercel-labs/design-systems-to-agent-skills/2-extract"><img src="https://agentmods.dev/badge/commands/vercel-labs/design-systems-to-agent-skills/2-extract/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for 2-extract

Your own site · 80×15
<a href="https://agentmods.dev/commands/vercel-labs/design-systems-to-agent-skills/2-extract"><img src="https://agentmods.dev/badge/commands/vercel-labs/design-systems-to-agent-skills/2-extract.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,777 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00000 $0.02777
Opus 5 $0.00000 $0.01388
Sonnet 5 $0.00000 $0.00555
Haiku 4.5 $0.00000 $0.00278

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

Security

Grade A, and why

2-extract 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 11d 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.

commands/2-extract.md · 304 lines

How it starts

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

Stage 2: Fact Extraction

Required Capabilities

  • File read/write
  • Shell command execution (git, file existence checks)
  • Sub-agent spawning (recommended for parallelism; can run serially without it)

Objective

Run Stage 2 of the design system skill generation pipeline: fact extraction.

Read the decisions from Stage 1, then systematically extract verified facts from source code for every in-scope component. Write per-component fact files and summary files to disk.

Critical: Only write facts verifiable from source code. Do not infer, guess, or generate from training data. If a type, default, or path is unclear, flag it as [UNVERIFIED].

Process

Step 1: Load decisions

Read context/{ds}/01-decisions.md where {ds} is determined by scanning the context/ directory for available design systems.

Extract from decisions:

  • Source repo path
  • In-scope component list
  • Component categories
  • Styling approach (Tailwind, SCSS, CSS Modules, etc.)
  • Compound component pattern (dot-notation, separate exports, etc.)
  • Token format (CSS custom properties, SCSS variables, etc.)

If 01-decisions.md doesn't exist or Status is not "Complete", tell the user:

Stage 1 decisions not found. Run Stage 1 (interview) first.

Step 2: Prepare output structure

Ensure these directories exist:

context/{ds}/02-verified-facts/
├── components/         (one file per in-scope component)
├── imports.md          (all validated import paths)
├── tokens.md           (design token catalog)
├── compound-components.md  (nesting rules for compound components)
└── styles.md           (style import paths, if applicable)

Step 3: Validate source access

Before dispatching sub-agents, verify:

  1. The source repo path exists and is readable
  2. Component source files can be found (scan for directories matching component names)
  3. package.json is readable (for import path validation)

Report the component-to-source-directory mapping. If any components can't be located, flag them and ask the user for guidance.

Read the full file on GitHub · 304 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. 11d ago First seen · 304 lines · 0 tokens per session scan A b7b66728de17

Subscribe to this mod's changes

2-extract is a command published in the GitHub repository vercel-labs/design-systems-to-agent-skills (37 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,777 tokens. 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-30.