スキル一覧に戻る
majtom2grndctrl

add-shadcn-component

by majtom2grndctrl

Integrated Design Environment for designers who ship software. The missing middle option between no-code website builders and pure vibe coding, using visual interfaces to provide support and structure around code.

1🍴 0📅 2026年1月25日
GitHubで見るManusで実行

SKILL.md


name: add-shadcn-component description: Add shadcn/ui components via pnpm dlx, then normalize generated Tailwind color classes to Scaffa theme tokens

Add shadcn Component

Add one or more shadcn/ui components, then replace any generated “design system” color utility classes with Scaffa’s Tailwind theme tokens.

Usage

/add-shadcn-component <component...>

Example:

/add-shadcn-component button dropdown-menu dialog

Prerequisites (assumed)

  1. shadcn is initialized for the renderer and src/renderer/components.json exists (assume true; do not check).
  2. The renderer theme tokens are defined in src/renderer/styles.css (Tailwind v4 @theme tokens).

If shadcn is not initialized yet, STOP and ask the user to run init first.

What This Skill Does

  1. Adds shadcn components using pnpm dlx … add <componentList>
  2. Identifies the files that were created/modified
  3. Rewrites generated Tailwind color classes to Scaffa theme tokens (surfaces/fg/border/focus/selected/etc.)
  4. Runs a build to verify TypeScript + CSS compilation
  5. Lands the change (commit + bd sync + push), respecting the repo workflow

Instructions

You MUST follow these steps in order.

Phase 1: Add the component(s)

  1. Run shadcn from the same folder as src/renderer/components.json:

    pushd src/renderer
    
  2. While still in src/renderer, add the requested components.

    Preferred (explicit) command:

    pnpm dlx shadcn@latest add <component...>
    

    If this repo’s shadcn init documented a shorter alias (e.g. pnpm dlx add ...), use the repo’s convention instead, but keep the semantics identical: “run shadcn add for these components”.

  3. Return to the repo root:

    popd
    
  4. Capture what changed:

    git status --porcelain
    

Phase 2: Normalize generated colors to Scaffa theme tokens

Scaffa’s renderer uses Tailwind v4 theme tokens defined in src/renderer/styles.css (e.g. bg-surface-panel, bg-surface-card, bg-surface-overlay, text-fg-muted, border-default, ring-focus, bg-selected, etc).

The shadcn generator commonly emits palette tokens like bg-background, text-foreground, border-border, ring-ring, bg-primary, text-muted-foreground, etc. Those MUST be replaced with Scaffa tokens.

Prefer Scaffa’s surface role tokens over numeric surface levels:

  • bg-surface-app, bg-surface-panel, bg-surface-pane (reserved; currently aliases panel), bg-surface-card, bg-surface-overlay, bg-surface-inset
  • For text/borders/rings, keep using text-fg*, border-*, ring-focus, etc.

2.1 Required mapping (default)

Use this mapping as the baseline. Adjust only if the component semantics demand it.

  • Backgrounds

    • bg-backgroundbg-surface-app
    • bg-cardbg-surface-card
    • bg-popoverbg-surface-overlay
    • bg-mutedbg-surface-inset
    • bg-accentbg-hover
    • bg-primarybg-selected
    • bg-secondarybg-surface-card
    • bg-destructivebg-danger
  • Text

    • text-foregroundtext-fg
    • text-muted-foregroundtext-fg-muted
    • text-popover-foregroundtext-fg
    • text-card-foregroundtext-fg
    • text-primary-foregroundtext-selected-fg
    • text-secondary-foregroundtext-fg
    • text-accent-foregroundtext-fg
    • text-destructive-foregroundtext-fg-inverse
    • text-destructivetext-danger
  • Borders

    • border-borderborder-default
    • border-inputborder-default
    • border-ringborder-focus
    • border-destructiveborder-danger
  • Rings / focus

    • ring-ringring-focus
    • outline-ringoutline-focus

    For common shadcn focus patterns:

    • focus-visible:ring-ringfocus-visible:ring-focus
    • focus-visible:ring-offset-backgroundfocus-visible:ring-offset-surface-app

If you encounter shadcn tokens not covered above (e.g. bg-input, text-primary, etc.), prefer mapping them to the closest Scaffa semantic token from src/renderer/styles.css rather than introducing a new color.

2.2 How to apply the mapping safely

  1. Find newly added/modified component files (from git status).
  2. Search within those files for shadcn palette tokens:
    rg -n \"bg-(background|card|popover|muted|accent|primary|secondary|destructive)|text-(foreground|muted-foreground|popover-foreground|card-foreground|primary-foreground|secondary-foreground|accent-foreground|destructive(-foreground)?)|border-(border|input|ring|destructive)|ring-ring|ring-offset-background|outline-ring\" <file-or-folder>
    
  3. Replace only the color tokens. Do not “re-style” spacing, sizing, or layout unless necessary for compile or obvious correctness.
  4. After edits, re-run the search to ensure no shadcn palette tokens remain in the touched files.

Phase 3: Verify

Run a production build:

pnpm build

Phase 4: Landing protocol

  1. Stage changes:

    git add <files>
    
  2. Commit code changes (do NOT include .beads/issues.jsonl):

    git commit -m \"feat(ui): add shadcn <components> (Scaffa theme)\"
    
  3. Persist beads updates (if any) and push:

    git pull --rebase
    # If this session is explicitly "no beads", skip `bd sync`.
    bd sync
    git push
    git status  # MUST show up to date
    

Notes / Gotchas

  • This repo uses Tailwind v4 @theme tokens; prefer bg-surface-*, text-fg*, border-*, ring-focus, bg-selected, etc over shadcn’s palette tokens.
  • Prefer surface roles (bg-surface-app/panel/card/overlay/inset) over numeric surface levels (bg-surface-0..3) when choosing container backgrounds.
  • If a generated component requires additional tokens not in the Scaffa theme, file a ticket instead of inventing new one-off colors inside components.

スコア

総合スコア

70/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です