SuperClaude 完整使用指南:打造智能開發工作流程
SuperClaude 完整使用指南:打造智能開發工作流程
目錄
系統簡介與核心概念
SuperClaude 是什麼?
SuperClaude 是一個輕量級 AI 開發協作框架,透過純配置方式將 Claude Code 轉換為專門的開發夥伴。它整合了 Context7、Sequential Thinking 等 MCP Server,支援多 Persona 思維模式與智能調度,適合系統設計、技術決策、問題診斷、產品規劃等多種場景。
核心架構
graph TD A[SuperClaude 框架] --> B[Persona 系統] A --> C[MCP Server 整合] A --> D[指令系統] B --> E[9種專業角色] C --> F[Context7] C --> G[Sequential Thinking] C --> H[Magic UI] C --> I[Puppeteer] D --> J[開發指令] D --> K[分析指令] D --> L[品質指令] D --> M[管理指令]
系統價值
- 智能工具整合:自動選擇最適合的 MCP 工具組合
- 專業角色切換:9種 Persona 提供不同視角的專業建議
- 結構化工作流程:從規劃到部署的完整開發流程
- 深度問題分析:Sequential Thinking 提供系統性思考
- 最新技術文件:Context7 確保技術資訊的準確性
環境設定與安裝
系統需求
- Node.js 16+
- Claude Code 環境
- Git(用於檢查點功能)
- Python 3.8+(推薦安裝方式)
安裝 SuperClaude
方法一:Python 安裝器(推薦)
python3 SuperClaude.py install --quick
方法二:傳統安裝
git clone https://github.com/NomenAK/SuperClaude.git
cd SuperClaude
./install.sh
安裝 MCP 伺服器
Context7 - 程式庫文件查找
claude mcp add context7 -- npx -y @upstash/context7-mcp@latest
Sequential Thinking - 複雜問題解決
claude mcp add sequential-thinking -s user -- npx -y @modelcontextprotocol/server-sequential-thinking
其他推薦 MCP 伺服器
# Magic UI - UI 組件生成
claude mcp add magic -- npx -y @magic/mcp-server
# Puppeteer - 瀏覽器自動化測試
claude mcp add puppeteer -- npx -y @puppeteer/mcp-server
驗證安裝
# 檢查 MCP 狀態
/mcp
# 檢查 SuperClaude 指令
/user:load
# 測試基本功能
/persona:mentor
"SuperClaude 安裝驗證測試"
配置檔案結構
安裝完成後,配置檔案位於:
~/.claude/
├── CLAUDE.md # 主要配置
├── RULES.md # 工程標準
├── PERSONAS.md # 認知原型
├── MCP.md # MCP 操作配置
└── commands/ # 專門指令
├── analyze.md
├── build.md
├── design.md
├── implement.md
├── improve.md
├── test.md
└── troubleshoot.md
核心工具深度解析
Context7:智能文件查找系統
核心功能
- resolve-library-id:將程式庫名稱解析為 Context7 相容 ID
- get-library-docs:獲取最新、特定版本的官方文件
- 程式碼範例:提供實際可用的程式碼範例
自動觸發條件
# 以下問題會自動觸發 Context7:
"如何使用 React hooks?"
"Express.js 認證最佳實踐"
"DaisyUI 元件文件"
"use context7" # 強制觸發
手動控制
# 強制啟用 Context7
/sc:analyze --architecture --c7
# 禁用 Context7
/sc:implement --basic-layout --no-c7
# 指定版本查詢
"使用 React 18.2 的最新文件,use context7"
Sequential Thinking:結構化思考引擎
11個核心原則
- 估計思考步數:規劃分析深度
- 進展監控:追蹤思考進度
- 動態調整:隨時修改步數和方向
- 質疑前提:挑戰既有假設
- 標記修正:明確標示思考修正
- 資訊過濾:專注當前步驟相關資訊
- 假設生成:提出解決方案假設
- 假設驗證:檢驗假設合理性
- 迭代完善:重複優化直到滿意
- 單一答案:提供明確結論
- 完成判斷:確保分析完整性
自動觸發場景
# 複雜問題會自動觸發 Sequential:
"為什麼我的應用程式載入很慢?"
"如何設計可擴展的微服務架構?"
"分析這個系統的效能瓶頸"
實際運作範例
思考步驟流程:
步驟 1: 問題分析 - 識別核心問題
步驟 2: 環境評估 - 分析技術環境和限制
步驟 3: [修正步驟 1] - 重新定義問題範圍
步驟 4: 解決方案假設 - 提出可能方案
步驟 5: 假設驗證 - 檢驗方案可行性
步驟 6: 最終建議 - 明確的行動方案
與傳統思考的差異
傳統 AI 思考 | Sequential Thinking |
---|---|
一次性輸出 | 逐步建構,可修正 |
線性推理 | 可分支、回溯 |
隱藏過程 | 透明思考鏈 |
固定結構 | 動態調整 |
假裝確定 | 誠實表達不確定性 |
難以改進 | 持續迭代完善 |
Persona 系統與工作模式
Persona 系統本質
Persona 是 SuperClaude 框架內的配置系統,而非獨立的 MCP server。它們透過改變 Claude 的回應風格、關注重點、問題分析角度來實現角色切換。
9大核心 Persona
1. 系統架構師 (/persona:architect)
專長:大局觀設計、技術選型、系統規劃
自動整合:Sequential + Context7
適用場景:系統設計、架構重構、技術債務管理
2. 前端專家 (/persona:frontend)
專長:UI/UX 完美主義、響應式設計、使用者體驗
自動整合:Context7 + Magic UI
適用場景:介面實作、元件開發、視覺設計
3. 後端專家 (/persona:backend)
專長:效能與可靠性、API 設計、資料架構
自動整合:Context7 + Sequential
適用場景:API 開發、資料庫設計、效能優化
4. 安全專家 (/persona:security)
專長:威脅建模、安全漏洞分析、合規檢查
自動整合:Sequential + 安全掃描工具
適用場景:安全審查、漏洞修復、合規驗證
5. 分析師 (/persona:analyzer)
專長:根因分析、問題診斷、資料洞察
自動整合:Sequential + 分析工具
適用場景:Bug 分析、效能瓶頸、相容性問題
6. 品質保證 (/persona:qa)
專長:測試策略、品質控制、流程改善
自動整合:Sequential + 測試工具
適用場景:測試規劃、品質審查、流程優化
7. 效能專家 (/persona:performance)
專長:速度優化、資源管理、監控分析
自動整合:Sequential + 效能分析工具
適用場景:效能調優、資源優化、監控設計
8. 重構師 (/persona:refactorer)
專長:程式碼美化、架構改善、技術債務清理
自動整合:Sequential + 程式碼分析
適用場景:程式碼重構、架構改善、最佳化
9. 導師 (/persona:mentor)
專長:耐心教學、知識傳授、技能培養
自動整合:Context7 + 教學模式
適用場景:學習新技術、技能提升、知識分享
Persona 選擇指南
任務類型 | 推薦 Persona | 自動整合的 MCP | 預期效果 |
---|---|---|---|
系統設計 | architect | Sequential + Context7 | 深度架構分析 + 最佳實踐 |
API 開發 | backend | Context7 + Sequential | 文件查找 + 系統思考 |
UI 實作 | frontend | Context7 + Magic | 技術文件 + UI 生成 |
效能問題 | performance | Sequential + 分析工具 | 深度分析 + 效能檢測 |
安全檢查 | security | Sequential + 掃描工具 | 威脅分析 + 安全掃描 |
學習新技術 | mentor | Context7 + 教學模式 | 官方文件 + 引導學習 |
指令系統完整指南
指令系統架構
SuperClaude 提供 16-19 個專門指令,分為四大類別:
開發指令 (Development Commands)
/sc:build - 專案建置
/sc:build [--react|--vue|--api|--tdd] [--c7] [--magic]
# 範例
/sc:build --react --tdd --c7 # React + 測試驅動開發 + 文件查找
/sc:build --api --microservice --seq # API + 微服務 + 深度分析
/sc:build --vue3 --composition --c7 # Vue 3 + Composition API + 文件
/sc:implement - 功能實作
/sc:implement [--feature|--fix|--enhancement] [--c7] [--seq]
# 範例
/sc:implement --feature --payment --c7 --seq # 支付功能 + 文件 + 分析
/sc:implement --fix --memory-leak --seq # 記憶體洩漏修復 + 分析
/sc:implement --enhancement --ui --magic # UI 增強 + 魔法生成
/sc:design - 設計規劃
/sc:design [--api|--ui|--database|--architecture] [--seq] [--c7]
# 範例
/sc:design --api --rest --c7 --seq # REST API 設計
/sc:design --ui --responsive --magic # 響應式 UI 設計
/sc:design --architecture --microservice # 微服務架構設計
分析指令 (Analysis Commands)
/sc:analyze - 分析診斷
/sc:analyze [--code|--architecture|--security|--performance] [--seq] [--c7]
# 範例
/sc:analyze --code --quality --seq # 程式碼品質分析
/sc:analyze --architecture --scalability # 架構可擴展性分析
/sc:analyze --security --vulnerabilities # 安全漏洞分析
/sc:analyze --performance --bottlenecks --seq # 效能瓶頸分析
/sc:troubleshoot - 問題排除
/sc:troubleshoot [--investigate|--prod|--debug] [--seq]
# 範例
/sc:troubleshoot --investigate --memory --seq # 記憶體問題調查
/sc:troubleshoot --prod --performance --seq # 生產環境效能問題
/sc:troubleshoot --debug --frontend --magic # 前端除錯
/sc:explain - 解釋說明
/sc:explain [--concept|--pattern|--technology] [--c7] [--no-mcp]
# 範例
/sc:explain --concept --microservices --c7 # 微服務概念解釋
/sc:explain --pattern --observer --c7 # 觀察者模式解釋
/sc:explain --technology --kubernetes --c7 # Kubernetes 技術解釋
品質指令 (Quality Commands)
/sc:improve - 改善優化
/sc:improve [--performance|--quality|--security|--maintainability] [--seq]
# 範例
/sc:improve --performance --frontend --seq # 前端效能改善
/sc:improve --quality --code-review --seq # 程式碼品質改善
/sc:improve --security --authentication # 認證安全改善
/sc:improve --maintainability --refactor # 可維護性改善
/sc:test - 測試驗證
/sc:test [--unit|--integration|--e2e|--performance] [--pup]
# 範例
/sc:test --unit --coverage # 單元測試 + 涵蓋率
/sc:test --e2e --pup --mobile # E2E 測試 + 行動版
/sc:test --integration --api # 整合測試 + API
/sc:test --performance --load # 效能測試 + 負載
/sc:cleanup - 清理整理
/sc:cleanup [--code|--files|--dependencies] [--all]
# 範例
/sc:cleanup --code --unused # 清理未使用程式碼
/sc:cleanup --files --temp # 清理暫存檔案
/sc:cleanup --dependencies --outdated # 清理過時依賴
/sc:cleanup --all --deep # 深度全面清理
管理指令 (Management Commands)
/sc:document - 文件管理
/sc:document [--api|--readme|--changelog|--guide] [--c7]
# 範例
/sc:document --api --swagger --c7 # API 文件 + Swagger
/sc:document --readme --comprehensive # 完整 README
/sc:document --changelog --version # 版本更新日誌
/sc:document --guide --deployment # 部署指南
/sc:git - 版本控制
/sc:git [--checkpoint|--commit|--branch|--merge]
# 範例
/sc:git --checkpoint "重構前狀態" # 建立檢查點
/sc:git --commit --feature --payment # 提交支付功能
/sc:git --branch --hotfix --security # 建立安全修復分支
/sc:git --merge --feature --review # 合併功能分支
/sc:estimate - 評估預測
/sc:estimate [--time|--complexity|--resources] [--detailed] [--seq]
# 範例
/sc:estimate --time --feature --detailed --seq # 功能開發時間評估
/sc:estimate --complexity --migration --seq # 遷移複雜度評估
/sc:estimate --resources --team --scaling # 團隊資源評估
/sc:task - 任務管理
/sc:task [--create|--status|--priority|--assign]
# 範例
/sc:task --create --epic --user-management # 建立用戶管理 Epic
/sc:task --status --sprint --current # 當前 Sprint 狀態
/sc:task --priority --critical --security # 關鍵安全任務優先級
/sc:task --assign --developer --frontend # 分配前端開發任務
MCP 控制標誌
Context7 控制
--c7 # 強制啟用 Context7
--no-c7 # 禁用 Context7
--c7-version # 指定版本查詢
Sequential 控制
--seq # 強制啟用 Sequential Thinking
--think # 啟用深度思考模式
--brief # 簡化分析模式
--max-steps # 限制思考步數
組合控制
--no-mcp # 禁用所有 MCP,僅使用原生工具
--all-mcp # 啟用所有可用的 MCP 工具
--compressed # 精簡輸出模式
--detailed # 詳細分析模式
實戰工作流程
完整專案開發流程
階段一:專案規劃與設計
# 1. 系統架構設計
/persona:architect
/sc:design --architecture --microservice --seq --c7
# 2. 技術選型分析
/sc:analyze --technology --stack --c7 --seq
# 3. 專案評估
/sc:estimate --time --complexity --detailed --seq
# 4. 建立檢查點
/sc:git --checkpoint "架構設計完成"
階段二:核心開發
# 1. 後端 API 開發
/persona:backend
/sc:implement --api --authentication --c7 --seq
# 2. 前端 UI 實作
/persona:frontend
/sc:build --react --components --magic --c7
# 3. 資料庫設計
/sc:design --database --optimization --seq
# 4. 整合測試
/sc:test --integration --api --database
階段三:品質保證
# 1. 程式碼品質檢查
/persona:qa
/sc:analyze --code --quality --security --seq
# 2. 效能優化
/persona:performance
/sc:improve --performance --frontend --backend --seq
# 3. 安全檢查
/persona:security
/sc:analyze --security --vulnerabilities --seq
# 4. 全面測試
/sc:test --e2e --unit --performance --pup
階段四:部署與維護
# 1. 部署準備
/sc:document --deployment --guide --c7
# 2. 監控設置
/sc:implement --monitoring --logging --seq
# 3. 文件完善
/sc:document --api --readme --comprehensive --c7
# 4. 最終檢查點
/sc:git --checkpoint "生產部署就緒"
專題工作流程範例
電商平台開發
# 1. 架構設計
/persona:architect
/sc:design --api --ecommerce --microservice --seq --c7
# 2. 支付系統實作
/persona:backend
/sc:implement --payment --stripe --security --c7 --seq
# 3. 購物車 UI
/persona:frontend
/sc:build --react --shopping-cart --magic --c7
# 4. 效能優化
/persona:performance
/sc:improve --performance --caching --cdn --seq
# 5. 安全檢查
/persona:security
/sc:analyze --security --payment --pci-compliance --seq
# 6. 端到端測試
/sc:test --e2e --checkout-flow --pup
複雜問題診斷
# 1. 問題分析
/persona:analyzer
/sc:troubleshoot --investigate --prod --performance --seq
# 2. 根因分析
/sc:analyze --code --memory-patterns --bottlenecks --c7 --seq
# 3. 解決方案設計
/persona:performance
/sc:design --optimization --caching --scaling --seq
# 4. 修復實作
/sc:implement --fix --performance --memory --seq
# 5. 驗證測試
/sc:test --performance --load --stress --monitoring
新技術學習
# 1. 基礎概念學習
/persona:mentor
/sc:explain --technology --kubernetes --fundamentals --c7
# 2. 實作練習
/sc:build --k8s --microservice --deployment --c7
# 3. 最佳實踐研究
/sc:analyze --patterns --k8s --production --c7 --seq
# 4. 進階應用
/sc:implement --advanced --service-mesh --monitoring --c7 --seq
進階技巧與最佳實踐
智能工作流程觸發
自動觸發機制優化
Context7 自動觸發關鍵詞:
"如何使用 [library]" # 程式庫使用指南
"[framework] 最佳實踐" # 框架最佳實踐
"use context7" # 強制觸發
"latest documentation" # 最新文件查詢
"official guide for" # 官方指南查詢
Sequential 自動觸發場景:
"為什麼..." 類型的診斷問題 # 根因分析
"如何設計..." 系統設計問題 # 架構設計
"分析..." 複雜分析需求 # 深度分析
"比較..." 技術選型問題 # 技術比較
"優化..." 改善類問題 # 系統優化
檢查點管理策略
# 重要決策前建立檢查點
/sc:git --checkpoint "開始重構前"
# 實驗性更改前
/sc:git --checkpoint "嘗試新架構前"
# 里程碑達成時
/sc:git --checkpoint "MVP 功能完成"
# 生產部署前
/sc:git --checkpoint "部署前最終狀態"
效能最佳化技巧
Token 使用最佳化
# 使用精簡模式
/persona:architect --compressed
/sc:analyze --code --minimal-output
# 批次操作
/sc:analyze --security --performance --quality --c7 --seq
# 限制分析深度
/sc:troubleshoot --seq --max-steps 5 --brief
工作流程自動化
# 建立自動化檢查流程
/sc:analyze --code --security --performance --all-mcp
# 批次測試執行
/sc:test --unit --integration --e2e --pup
# 文件自動更新
/sc:document --api --readme --auto-update --c7
團隊協作最佳實踐
多人協作工作流程
# 建立共享配置
claude mcp add context7 -s project -- npx -y @upstash/context7-mcp@latest
# 統一開發標準
/persona:qa
/sc:document --standards --team --comprehensive
# 程式碼審查流程
/sc:analyze --code --review --quality --security --seq
# 知識分享機制
/persona:mentor
/sc:document --knowledge-base --team-learning --c7
專案管理整合
# 建立開發計劃
/sc:task --create --roadmap --quarterly
# 追蹤進度
/sc:task --status --sprint --metrics
# 風險評估
/sc:estimate --risks --mitigation --detailed --seq
# 資源分配
/sc:estimate --resources --team --skills --matching
品質保證進階策略
多維度品質檢查
# 程式碼品質
/persona:qa
/sc:analyze --code --maintainability --complexity --seq
# 安全性檢查
/persona:security
/sc:analyze --security --owasp --compliance --seq
# 效能基準
/persona:performance
/sc:test --performance --baseline --monitoring
# 使用者體驗
/persona:frontend
/sc:test --ux --accessibility --responsive --pup
持續改進機制
# 定期健康檢查
/sc:analyze --health --system --comprehensive --seq
# 技術債務管理
/persona:refactorer
/sc:analyze --debt --priority --impact --seq
# 效能監控
/sc:implement --monitoring --alerting --dashboard
# 學習與成長
/persona:mentor
/sc:document --lessons-learned --best-practices --c7
故障排除與維護
常見問題診斷
MCP 伺服器問題
問題:MCP 伺服器無回應
# 檢查狀態
/mcp
# 重新啟動特定服務
claude mcp restart context7
claude mcp restart sequential-thinking
# 檢查連線
claude mcp status --verbose
問題:Context7 文件過時
# 強制更新文件快取
/sc:analyze --update-docs --c7
# 指定特定版本
"使用 React 18.2 的最新文件,use context7"
# 清除快取重新載入
claude mcp restart context7 --clear-cache
問題:Sequential 分析過於詳細
# 使用簡化模式
/sc:analyze --brief --seq
# 設定思考步數限制
/sc:troubleshoot --seq --max-steps 5
# 啟用壓縮輸出
/persona:analyzer --compressed --seq
效能問題解決
問題:指令執行緩慢
# 分析效能瓶頸
/sc:analyze --performance --mcp --bottlenecks
# 優化工具使用
/sc:improve --performance --tool-usage --efficiency
# 監控資源使用
/sc:implement --monitoring --resource --usage
問題:Token 消耗過快
# 啟用精簡模式
/persona:architect --compressed
# 批次處理請求
/sc:analyze --batch --multiple-concerns
# 使用快取策略
/sc:implement --caching --response --optimization
系統維護策略
定期維護檢查清單
每日檢查
# 檢查 MCP 服務狀態
/mcp
# 驗證核心功能
/persona:qa --health-check
# 更新工作記錄
/sc:document --daily-log --progress
每週檢查
# 更新 MCP 伺服器
claude mcp update --all
# 清理暫存檔案
/sc:cleanup --temp --cache --weekly
# 效能基準測試
/sc:test --performance --benchmark --weekly
每月檢查
# 全面系統分析
/sc:analyze --system --comprehensive --health
# 技術債務評估
/persona:refactorer
/sc:analyze --debt --accumulation --trends
# 安全性稽核
/persona:security
/sc:analyze --security --monthly-audit --compliance
備份與還原
配置備份
# 備份 SuperClaude 配置
/sc:git --backup --config --full
# 匯出 MCP 設定
claude mcp export --config --all
# 備份專案檢查點
/sc:git --backup --checkpoints --history
系統還原
# 還原配置
/sc:git --restore --config --timestamp
# 重建 MCP 環境
claude mcp restore --config --file backup.json
# 回復專案狀態
/sc:git --restore --checkpoint "stable-state"
進階除錯技巧
深度診斷工具
系統狀態診斷
# 全面系統檢查
/persona:analyzer
/sc:troubleshoot --system --comprehensive --deep --seq
# MCP 通訊診斷
/sc:analyze --mcp --communication --latency
# 記憶體使用分析
/sc:analyze --memory --usage --optimization --seq
日誌分析
# 錯誤日誌分析
/sc:analyze --logs --errors --patterns --seq
# 效能日誌檢查
/sc:analyze --logs --performance --trends
# 使用統計分析
/sc:analyze --usage --statistics --insights --seq
自動化監控設置
監控系統建立
# 設置健康監控
/sc:implement --monitoring --health --automated
# 效能警報設定
/sc:implement --alerting --performance --thresholds
# 錯誤追蹤系統
/sc:implement --tracking --errors --automated
報告自動化
# 每日狀態報告
/sc:document --report --daily --automated
# 週間效能報告
/sc:document --report --performance --weekly
# 月度改進建議
/sc:document --report --improvement --monthly --seq
結論與未來展望
SuperClaude 的核心價值
SuperClaude 透過整合 Context7 和 Sequential Thinking,提供了一個強大且智能的開發工作流程框架。關鍵成功要素包括:
- 智能角色切換:9個專業 Persona 提供不同視角的專業建議
- 自動工具整合:Context7 查文件,Sequential 做分析,自動選擇最佳組合
- 結構化工作流程:從規劃到部署的完整開發生命週期支援
- 深度問題解決:Sequential Thinking 提供系統性、可修正的思考過程
- 持續學習機制:利用 Context7 獲取最新技術文件和最佳實踐
最佳實踐總結
- 漸進式採用:從單一 Persona 開始,逐步整合 MCP 工具
- 定期檢查點:重要變更前總是建立檢查點保存狀態
- 組合使用效益:Context7 + Sequential 的組合效果最佳
- 文件驅動開發:定期更新和維護生成的技術文件
- 效能監控:注意 Token 消耗,合理使用 Sequential 深度分析
未來發展方向
工具生態系統擴展
- 設計工具整合:Figma, Sketch MCP 整合
- 測試自動化:Playwright, Cypress MCP 整合
- 部署管道:Netlify, Vercel, AWS MCP 整合
- 監控分析:Google Analytics, DataDog MCP 整合
對話模式演進
- 情境感知智能:更智能的工具選擇和組合
- 自適應複雜度:根據問題自動調整分析深度
- 多模態互動:支援圖形、圖表等多種輸出格式
- 協作功能增強:團隊協作和知識共享機制
學習與成長路徑
- 深化專業知識:持續學習新技術和最佳實踐
- 擴展應用領域:從開發拓展到產品管理、業務分析
- 提升系統思維:培養更好的架構設計和問題解決能力
- 建立個人工作流程:客製化符合個人風格的工作模式
核心理念
好的對話是好代碼的開始。SuperClaude 不僅是工具,更是一套完整的 AI 輔助開發哲學。透過結構化的對話、專業的角色扮演、智能的工具整合,它將 Claude Code 轉變為真正專業的開發夥伴,大幅提升開發效率和程式碼品質。
投資時間學習如何與 AI 工具有效溝通,將為您的開發生涯帶來長期的價值回報。SuperClaude 提供了這樣一個平台,讓您能夠充分發揮 AI 的潛力,成為更高效、更專業的開發者。