- Home
- Skills
- Frontend & Web Apps
- dsmith: keep AI agents on your design system
Works with the AI Agents you already use
dsmith: keep AI agents on your design system
Hardcoded styling values make design systems impossible to maintain.
Free
dsmith: keep AI agents on your design system
Example session with this skill installed
Audit this Next.js dashboard for hardcoded styles. How far off a design system are we, and what tokens would you create?
- Read your context and instructions
- Compiled the dsmith
- Generated the UI component
I ran dsmith detect and dsmith audit (read-only, nothing outside .dsmith/ was written).
Summary
26 files scanned (215 style usages, 33 component usages).
About 34% of style values are hardcoded, giving a design-system health score of
52 / 100. The repo is Next.js (app router) with Tailwind (72% of files) and inline styles (44%), and it has a small local UI kit in src/components/ui that most screens don't import yet.
Hardcoded colors
| Representative | Uses | Suggested token | Variants found |
|---|---|---|---|
| #3b82f6 | 12 | blue-400 | #3b82f6 ×7, #2f7bee ×3, #3a81f5 ×1, #3c83f7 ×1 |
| #111827 | 4 | gray-900 | #111827 ×4 |
| #e53e3e | 4 | red-500 | #e53e3e ×2, #ef4444 ×1, #f04545 ×1 |
| #f9fafb | 4 | gray-50 | #f9fafb ×2, #ffffff ×2 |
| #6b7280 | 3 | gray-500 | #6b7280 ×3 |
| #e5e7eb | 3 | gray-100 | #e5e7eb ×3 |
Your "brand blue" exists in four slightly different hex values.
Spacing off the 4px scale
| px | Uses |
|---|---|
| 18 | 9 |
| 10 | 3 |
| 13 | 3 |
| 22 | 3 |
Components
- Duplicates with the same name from different sources:
Button (src/components/ui/button vs src/components/Button) and
Badge (src/components/Badge vs src/components/common/StatusBadge).
- Files with the most hardcoded values:
src/components/Topbar.tsx(11),app/globals.css(7),app/products/[id]/page.tsx(5),src/components/common/StatusBadge.tsx(5).
Proposed tokens (dsmith init --dry-run, nothing written)
- 6 color, 5 spacing, 2 radius and 2 font-size tokens, merging 23 raw values, written as
design-system/tokens.json,tokens.css(--ds-*variables) andtokens.ts. - Coverage:
60 of 62 hardcoded values (96.8%) could be replaced. 31 are exact matches (migrated by default); 29 are near matches that need --close and may shift what renders slightly.
Next steps
- Say "create the tokens" and I'll run
dsmith initto write the files above. - Then I'll show the
dsmith migrateplan (exact matches only) before changing any source file. - Pick which Button and Badge to keep;
dsmith deciderecords it so imports can be migrated too.
Topbar.tsx
TSX · React component
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
Hardcoded styling values make design systems impossible to maintain. This skill automates the detection, extraction, and migration of raw CSS, Tailwind, and React Native styles into a structured design token system. It uses an AST parser to identify inconsistencies and provides a controlled path to refactor your codebase without manual search-and-replace.
What it does
- Audit codebase identifies hardcoded colors, spacing, border radii, and font sizes across multiple styling frameworks.
- Draft design tokens generates W3C-compliant JSON, CSS variables, and TypeScript modules from existing style patterns.
- Automated migration replaces raw values with token references using exact or near-match logic.
- Agent enforcement adds a design-system section to
AGENTS.mdso other AI agents use your tokens and existing components instead of raw values. - CI guarding prevents new hardcoded styles from being merged into your main branch.
How it works
- Detect scans the repository to identify the styling architecture and count hardcoded instances.
- Draft creates a proposed token set based on the most frequent raw values found in the audit.
- Plan generates a migration preview showing exactly which lines will change before any files are modified.
- Apply executes the refactor across the codebase, with the option to isolate changes in a dedicated branch.
- Install configures rules to keep future code, including AI-generated snippets, aligned with the system.
Frameworks & tools
Supports CSS, SCSS, Tailwind (v3/v4), styled-components, Emotion, MUI, and React Native (StyleSheet and Reanimated). Built on an AST parser for safe code manipulation.
Why this beats prompting it yourself
Generic prompts often hallucinate token names or miss complex CSS-in-JS patterns. This skill uses a specialized AST-based CLI to ensure every replacement is syntactically correct and tracked for easy reversal.
Use cases
- Auditing a legacy repository to quantify design system debt.
- Bootstrapping a design token library for a project that has none.
- Refactoring thousands of hardcoded hex codes into semantic CSS variables.
- Blocking PRs that introduce "magic numbers" into the UI.
Known limitations
Migration revert skips files edited after the migration was applied. Near-match migration (--close) requires manual verification as it may slightly alter the UI. CLI messages are currently in Korean; the agent summarizes them in your language.
Open source and privacy
MIT licensed: https://github.com/project-hh-org/dsmith. Everything runs locally. The only network call is npx downloading the dsmith package from npm on first run. Commands that write files (init, migrate --apply, install, guard init) only run after you agree.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Frontend & Web Apps.
Revert skips files modified after migration. Near-match migration may alter UI rendering. Requires local npx execution capability.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 6 days ago
- Free with an Agensi account
- Software
Node.js 20+
- Optional
Git (for migrate --branch and guard)
Permissions
File Scopes
Terminal: runs `npx dsmith`. Network: npx downloads the package from npm on first run; no other network calls. Read files: scans style code. Write files: only after the user agrees (tokens in design-system/, migrated source files, AGENTS.md, guard config). State is kept in .dsmith/.