Community程式設計與開發github.com

getedgehq/shadcn-first

確保每次使用 shadcn/ui 元件庫時,都遵守「先安裝、後自訂」的原則,並提供完整的 MCP 伺服器操作指南與稽查清單。

shadcn-first 是什麼?

這是一套專為開發者與 AI 助手設計的 shadcn/ui 使用規範,強調在使用 shadcn/ui 時必須遵循固定的優先順序:優先安裝完整區塊(block),其次安裝單一元件(component),再次組合多個元件,最後才考慮手寫客製,且手寫時必須留下明確理由。文件中整合了兩個 MCP 伺服器(`shadcn-official` 與 `shadcn`)的用途與對應工具清單,讓 AI 可以自動確認專案狀態、搜尋、檢視、安裝元件,並在完成後執行稽查清單,量化檢查自訂 UI 行數、剩餘 `style={{}}` 出現次數、已安裝元件數等指標。支援 shadcn/ui、prompt-kit、TanStack 表格等生態工具,並附帶常見誤區(如手寫 sidebar、command、dialog 等)與鍵盤快速鍵約定。適合 Claude Code、Cursor、Codex 等 AI 代理工具,可大幅減少重複造輪子、維持 UI 一致性與可維護性。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/getedgehq/skills/tree/main/shadcn-first

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

shadcn-first 是做什麼的?

在你之後,會有人維護這段程式碼。每一行手寫的 div 搭配自訂 class、每一個 style={{}},都是他們必須持續維護的包袱。手刻 UI 也會不知不覺遺漏函式庫免費提供的工藝:焦點環、懸停與啟用狀態、鍵盤導航、骨架載入、空狀態、ARIA 無障礙標記。

順序。永遠不要跳過任何步驟。

  1. 區塊。 ui.shadcn.com/blocks 提供完整的側邊欄、儀表板、登入頁、資料表格。直接安裝區塊。
  2. 元件。 如果沒有適合的區塊,就從元件註冊表中安裝元件。
  3. 組合。 組合兩到三個元件。
  4. 自行手寫。 只有在前面三步都不適用時才手寫,並且 commit message 必須註明你評估了哪個區塊或元件,以及為何它不適用。

讓設計配合元件,而不是讓元件配合設計。品牌與視覺語言應透過單一佈景主題變數來達成,永遠不要在元件旁邊撰寫每個畫面專屬的 CSS。

工具,以及何時使用

已設定兩個 MCP 伺服器。它們負責不同的工作。

shadcn-official (npx shadcn@latest mcp) 能感知專案:它會讀取儲存庫中的 components.json。請用它來處理實際工作。

工具用途
get_project_registries確認專案是否已初始化
search_items_in_registries模糊搜尋適合任務的元件
list_items_in_registries列出所有可用的元件
view_items_in_registries查看元件的實際原始碼與相依套件
get_item_examples_from_registries複製真實使用範例,避免猜測 API
get_add_command_for_items取得精確的 npx shadcn add … 指令,然後執行它
get_audit_checklist在撰寫程式碼後執行。這是閘門。

shadcn (@jpisnice/shadcn-ui-mcp-server) 涵蓋整個註冊表,並支援區塊與佈景主題:list_blocks、get_block、list_themes、get_theme、get_component_demo。請在步驟 1 與主題設定時使用它。

如果專案沒有 components.json,官方工具會回報錯誤。請先執行 npx shadcn@latest init,然後再繼續。

針對 AI 對話介面,請使用 prompt-kit (prompt-kit.com,與 shadcn 相容):chat-container、message、prompt-input、scroll-button、markdown、code-block、loader。同樣規則:安裝,而非重造。

開發者經常手寫而非安裝的元件

sidebar(可收合,附底部使用者選單)、command(Cmd+K 指令面板)、table + TanStack 資料表格區塊、tabs、sheet、dialog、alert-dialog、popover、tooltip、skeleton、sonner(提示訊息)、form(react-hook-form + zod)、breadcrumb、resizable、scroll-area、avatar、badge、separator、dropdown-menu、select、collapsible、chart。

如果你發現自己在手刻以上任何元件,請停止並直接安裝。

鍵盤快速鍵

Cmd+K 開啟指令面板,這是 cmdk 慣例,也是 command 元件內建的功能。Cmd+L 被瀏覽器保留給網址列,在 Chrome 中無法可靠攔截。如果有人要求 Cmd+L,請綁定 Cmd+K,並有機會時才額外綁定 Cmd+L,同時說明原因。

完成 = 可量化,而非口頭宣稱

在回報完成之前,請執行 get_audit_checklist 並回報數字:

  • 移除的手寫 UI 行數
  • 安裝的區塊與元件數量
  • 剩餘的 style={{}} 出現次數(grep -rc 'style={{' src/)
  • 每個畫面:來自 components/ui/ 的元素 vs 手寫元素

任何仍然手寫的部分都必須明確標示原因,而非被忽略。螢幕截圖是畫面正常呈現的證明;計數則是規則被遵守的證明。兩者都必須具備,否則不算完成。

禁止事項

  • UI 中不要使用表情符號。使用真實 SVG 圖示(Lucide 已隨 shadcn 提供)。
  • 品牌 Logo 不要放在圓形文字內。請使用真實 SVG 路徑:SimpleIcons > svgl.app > gilbarbara/logos > favicon。
  • 最多使用一或兩種強調色。卡片上不要有彩色左邊框。不要在每個元素上都使用漸層。
  • 不要為了改變顏色而 fork 元件。請修改主題變數。

Individual skills in this repo

This repo contains 18 individual skills — each has its own dedicated page.

getedgehq/agent-evals

Build evals for an AI agent that already does real work. Use when someone asks "how do I know my agent is right", wants to test an agent before trusting it, compare models on cost versus quality, or turn production failures into tests. Walks from first tasks and yes/no verifiers, to isolated environments, to a trace-driven improvement loop.

getedgehq/cli-ux-review

Audit a command-line tool for user-friendliness — clear situation / next-step / options in every output, colour-highlighted runnable commands, no raw jargon, no silent hangs. Invoke for "CLI UX audit", "review my CLI", "is this CLI intuitive", or before any CLI release.

getedgehq/generate-image

Generate images with OpenAI GPT Image 2 via the Codex CLI, billed through the user's ChatGPT Plus subscription (no OpenAI API key, no per-image API cost). Use when the user asks to create, generate, or make an image, picture, illustration, icon, hero graphic, or concept art from a text prompt.

getedgehq/harness-first

Diagnose and fix an unreliable, expensive, or unsafe LLM agent by auditing its harness (golden set, judge, cost caps, data layer, action approvals, tracing) before blaming or swapping the model. Use when someone says an agent is "burning tokens", "hallucinating", "brittle", gives inconsistent answers, asks whether to switch to a cheaper/better model, or wants to ship an agent or prompt change to customers.

getedgehq/http-error-triage

Run before concluding anything from an HTTP error on a third-party API. Separates a real credential/entitlement problem from a CDN or WAF block, a wrong endpoint, or a client-signature ban. Use whenever an API returns 401/403/402/429 and you are about to say "the key is dead", "credits are exhausted", "the plan lacks access", or "we are rate limited".

getedgehq/linkedin-media-prep

Convert, crop, resize, and compress images and videos for optimal LinkedIn upload quality and file size. Use when the user wants to prepare a photo, image, or video for LinkedIn (profile picture, cover photo, post image, article featured image, post video, or video ad), optimize file size for LinkedIn, crop and resize for LinkedIn dimensions, convert HEIC/RAW/PNG/MOV to LinkedIn-ready JPEG or MP4, or mentions LinkedIn media requirements, specs, or limits.

getedgehq/monid

>-

getedgehq/opendraft

An 18-agent pipeline that turns one topic line into a drafted

getedgehq/people-search

Find and rank professional people for recruiting, partnerships, sales, or research from user-provided data, public web sources, an authenticated search session, or a connected provider. Use for people discovery, LinkedIn or Sales Navigator search design, profile-list ranking, or provider filter translation.

getedgehq/rocketlist

Turn a CV into a shortlist of live startup roles from Rocketlist's public job board, including adjacent job titles the person would never have searched for, each with its published salary, the evidence for the fit, and a direct apply link. Use for "find roles I would be a strong fit for", career pivots, remote or VC-backed job hunts, and salary-visible role discovery.

getedgehq/security-audit-checklist

Run a comprehensive security audit across application code, cloud infrastructure, containers, CI/CD pipelines, and infrastructure-as-code. Covers privacy compliance, OWASP basics, secret leakage, API security, IAM misconfigurations, storage exposure, Kubernetes hardening, and network security. Use when the user asks to audit, review, or harden app or cloud security, check for secrets, scan for XSS/SQLi, verify security headers, review Terraform/CloudFormation, audit AWS/GCP/Azure configs, or perform any security-focused review.

getedgehq/skills

Develop or review a branded long-form YouTube channel using Simon Kaiser's public creator-led approach: audience fit, recurring formats, natural brand integration, Time with Brand, and an organic, paid, and Shorts strategy. Use for channel strategy, format briefs, and pilots.

getedgehq/skills

Build a YouTube strategy, evidence-backed idea slate, and title plus thumbnail package using Paddy Galloway's public method. Use when planning a channel, choosing concepts, or preparing a video before filming.

getedgehq/skills

Build or review a buyer-centered strategic narrative using Andy Raskin's public method. Use for sales or investor deck stories, homepage positioning, keynotes, launch narratives, and why-now messaging.

getedgehq/skills

Turn a product URL, launch brief, or approved script into a production-ready launch video. Use for product reveals, feature announcements, SaaS launches, and narrated product films; not for generic explainers or editing existing footage.

getedgehq/strip-image-ai-metadata

Strip C2PA and AI-generation metadata from images (PNG, JPEG, WebP) to remove "Generated by AI" / "ChatGPT" / "DALL-E" labels that platforms like LinkedIn, Instagram, and X display. Use when the user wants to clean AI-generated images before posting, remove AI attribution from photos, strip C2PA manifests, sanitize image metadata for professional use, or verify whether an image contains C2PA data.

getedgehq/top-down-comms

>-

getedgehq/workplan

Create, update, or close work plans for multi-step tasks. Use when starting refactors, bug lists, feature work, migrations, or any task with 2+ steps. Also use after auto-compaction to re-orient. Triggers: "workplan", "work plan", "create a plan", "what's the plan", "where was I", or when Claude detects

相關技能