design-md-to-shadcn
Applies an external DESIGN.md (Google Labs design-token format) to a project's shadcn/ui theme. Activate when the user provides or references a DESIGN.md / design.md file, a designmd.app or Stitch design system, a downloaded brand design system, or asks to 'apply a design system / theme' to a shadcn project. Translates DESIGN.md tokens into shadcn CSS variables in the project's theme CSS file and turns the prose into component guidance. Inbound-only: does not extract a DESIGN.md from the project.
- License 许可
- MIT
- 最近更新
- 2026-11-12
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- design-md-to-shadcn
- metadata
- { "email": "initred@dou.so", "author": "initred", "version": "1.0.0" }
- description
- Applies an external DESIGN.md (Google Labs design-token format) to a project's shadcn/ui theme. Activate when the user provides or references a DESIGN.md / design.md file, a designmd.app or Stitch design system, a downloaded brand design system, or asks to 'apply a design system / theme' to a shadcn project. Translates DESIGN.md tokens into shadcn CSS variables in the project's theme CSS file and turns the prose into component guidance. Inbound-only: does not extract a DESIGN.md from the project.
02 资源文件 1
- 参考文档rules/token-mapping.md5.4 KB
03 SKILL.md 正文
DESIGN.md → shadcn/ui
Take an external DESIGN.md (the Google Labs design-token format, version alpha, Apache-2.0) and apply it to the project's shadcn/ui theme.
What this skill is for
The DESIGN.md format pairs machine-readable YAML front matter (design tokens) with markdown prose (rationale + guidance). It uses a Material-3-style token namespace (primary, secondary, tertiary, neutral, surface, on-surface, surface-container-*, on-primary, …) that does not map 1:1 to shadcn's fixed semantic tokens.
The official design.md export --format css-tailwind emits --color-primary etc. — single-mode, no foreground pairs — which is not usable by shadcn. This skill provides the missing mapping layer: DESIGN.md tokens → shadcn :root / .dark CSS variables, plus prose → component guidance.
- Direction: inbound only (external DESIGN.md → the project). Do not generate a DESIGN.md from the project.
- Dependencies: none. No
@google/design.mdCLI, no package installs. Pure parsing + the mapping table in rules/token-mapping.md.
Project target (locate, then verify before editing)
First find the project's shadcn theme CSS file and config — don't assume a path:
- Theme CSS file: the file holding shadcn tokens as CSS variables in
:root(light) and.dark. Common locations:app/globals.css,src/index.css,src/app.css,resources/css/app.css,styles/globals.css. Confirm by grepping for--background,--primary, or--radius. components.json(repo root): readstyle,baseColor,cssVariables,tailwind.css(points to the theme file), and thealiases. Note whether tokens are HSL/oklch()/raw and match that convention.- Composition rules (Card/Dialog/Tabs/etc.) and component install belong to the
shadcnskill — defer to it for step 5.
Re-read the theme CSS file before editing; its token blocks are the source of truth and may differ from any assumptions.
Workflow
1. Collect the input
Get the DESIGN.md as a file path, pasted text, or URL. If a URL, fetch the raw markdown (e.g. WebFetch). Confirm it has --- front matter; if it's prose-only, extract what tokens you can and note the gaps.
2. Parse
- Front matter (between the
---fences):name,colors,typography,rounded,spacing,components. - Body (
##sections, canonical order): Overview / Colors / Typography / Layout / Elevation & Depth / Shapes / Components / Do's and Don'ts. Section aliases exist (Overview≡"Brand & Style", Layout≡"Layout & Spacing", Elevation≡"Elevation & Depth"). - Resolve token references
{path.to.token}(e.g.{colors.primary},{rounded.md}) to their values before mapping.
3. Map tokens → shadcn (the core step)
Follow rules/token-mapping.md exactly:
- Color tokens → shadcn semantic variables (with foreground pairs).
rounded.md/DEFAULT→--radius.- Detect light vs dark from the background's lightness; fill the matching block, derive the opposite block (flag it for review).
- Normalize every color to the theme file's existing convention (
oklch(), HSL channels, or raw) — match what's already there; keep the original value in a trailing comment.
4. Apply to the theme CSS file
Edit only the variable lines inside :root and .dark. Preserve everything else: @imports, fonts, @theme {} (including any --color-* → var(--*) aliases and the --radius-* calc scale), and @layer base {}.
- Use targeted
Editcalls per variable block — never overwrite the whole file. - Present a concise summary of the changes (old → new per token) before/with the edit.
- Unmapped DESIGN.md tokens: keep them as extra custom vars with a comment, or report them — do not silently drop.
5. Component & layout guidance
Summarize the prose (Overview, Layout, Elevation & Depth, Shapes, Components, Do's and Don'ts) into concrete rules for any UI built next — e.g. "one primary action per screen", radius/elevation conventions, component variants. Then hand off actual component selection / install / composition to the shadcn skill.
Guardrails
- Never overwrite the theme CSS file wholesale — edit token lines only; keep imports/fonts/
@theme/@layer baseintact. - Show the token diff before applying so the user can sanity-check.
- Color conversions (to
oklch()/HSL) are approximations — recommend a visual check; do not claim exact color fidelity. - This skill maps tokens and surfaces guidance; it does not install components (that's the
shadcnskill) and does not add dependencies. - After editing, the user must rebuild/restart the dev server to see changes — use the project's own build command (e.g.
npm run build/dev,pnpm,bun, orvendor/bin/sail …for Laravel Sail setups). Checkpackage.jsonscripts if unsure.
04 同仓库更多 Skills
template-skill
Replace with description of the skill and when the agent should use it.
writing-project-readme
Use when explicitly invoked to write or fully rewrite a project README that must cover tech stack, architecture, features, and service description in a single document — readable by non-engineers (PM, design, ops, domain experts) as well as developers. Triggers on requests like "write the README", "redo README.md based on the whole project", "make a comprehensive README everyone can understand". Skip for one-section edits, badge tweaks, or generating a CHANGELOG.
ux-writing-korean
한국어로 UI/UX 문구를 작성하거나 검수할 때 사용합니다. 해요체, 능동형, 긍정형, 캐주얼 경어, 명사 조합 회피 등 5가지 핵심 원칙과 예외 규칙을 적용합니다.
token-audit
Audit a Claude Code or Codex CLI project for token waste and fix it with the user's approval. Use whenever the user wants to check, reduce, or optimize token usage, context bloat, or API/subscription costs of an agent project — phrases like "토큰 점검", "토큰 낭비 찾아줘", "토큰 최적화", "컨텍스트 최적화", "Claude Code 비용 줄여줘", "API 비용이 너무 나와", "audit token efficiency", "check my CLAUDE.md/AGENTS.md/MCP setup". Also trigger when the user complains that sessions hit context limits too fast, that costs jumped unexpectedly, or asks whether their project setup is token-efficient — even if they don't say the word "token".
release-showcase
정식 릴리스의 변경을 이전·이후 스크린샷, 클릭 흐름 녹화 영상, 비교·단계·탭·흐름도 같은 HTML 컴포넌트로 보여 주는 파일 하나짜리 릴리스 문서를 만든다. 텍스트뿐인 릴리스 노트로는 어떤 UX가 바뀌었고 새 기능을 어떻게 쓰는지 감이 안 올 때 쓴다. '릴리스 노트 문서 만들어 줘', '릴리스 쇼케이스', '이번 배포 변경사항 정리해서 공유', '릴리즈 노트 HTML', '변경사항을 화면으로 보여 주는 문서', '업데이트 소개 페이지', 'what's new 페이지', 'release notes with screenshots', 'changelog page', '배포 공지 자료'처럼 버전 태그 사이의 변경을 팀·고객에게 시각적으로 알릴 때 반드시 사용한다. git 태그로 릴리스하는 저장소라면 웹·데스크톱·모바일 어느 앱이든 쓴다. 커밋 목록만 필요한 CHANGELOG.md 갱신, 릴리스 태그·배포 자체, 마케팅 영상 제작에는 쓰지 않는다.
public-sector-rfp-authoring
Use when drafting or revising Korean government or local-government bid notices, requests for proposals, statements of work, or public-sector service/project specifications from the ordering agency's perspective.