使用多個角色並行分析同一對象,生成综合報告的命令。
Generates comprehensive multi-perspective analysis reports by concurrently evaluating objects from multiple expert roles.
/plugin marketplace add wasabeef/claude-code-cookbook/plugin install cook-zh-tw@claude-code-cookbook使用多個角色並行分析同一對象,生成综合報告的命令。
/multi-role <角色 1>,<角色 2> [--agent|-a] [分析對象]
/multi-role <角色 1>,<角色 2>,<角色 3> [--agent|-a] [分析對象]
security : 安全審計專家performance : 性能優化專家analyzer : 根本原因分析專家frontend : 前端·UI/UX 專家mobile : 移動開發專家backend : 後端與伺服器端專家reviewer : 程式碼審查專家architect : 系統架構師qa : 測試工程師重要:
--agent 選項需要放在角色指定之後--agent 之後/multi-role qa,architect --agent 評估計劃/multi-role qa,architect 評估計劃 --agent--agent 或 -a : 將各角色作為子代理並行執行 (推薦用于大規模分析)
# 安全和性能的雙重分析 (常規)
/multi-role security,performance
"評估這個 API 端點"
# 大規模系統的並行分析 (子代理)
/multi-role security,performance --agent
"全面分析系統的安全性和性能"
# 前端·移動·性能的综合分析
/multi-role frontend,mobile,performance
"考虑這個界面的優化方案"
# 架構設計的多角度評估 (子代理)
/multi-role architect,security,performance --agent
"評估微服務化的設計"
各角色独立分析同一對象
結構化整合結果
生成最終建議
多角色分析: Security + Performance
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
分析對象: API 端點 /api/users
Security 分析結果:
認證: JWT 驗證實施得当
授權: 基于角色的訪問控制不完整
加密: API 密鑰在日誌中以明文輸出
評估分數: 65/100
重要度: High(因為訪問敏感數據)
Performance 分析結果:
響應時間: 平均 180ms(目標 200ms 以內)
數據庫查询: 檢測到 N+1 問題
緩存: Redis 緩存未實施
評估分數: 70/100
重要度: Medium(目前在可接受範圍內)
相互關聯分析:
協同效應機會:
- 實施 Redis 緩存時同時考虑加密
- 改進日誌輸出提升安全性和性能
權衡點:
- 加強授權檢查 ↔ 對響應時間的影響
- 日誌加密 ↔ 調試效率降低
综合優先級:
Critical: 修復 API 密鑰明文輸出
High: 解決 N+1 查询
Medium: 實施 Redis 緩存 + 加密
Low: 细化授權控制
實施路線圖:
第 1 週: 實施 API 密鑰屏蔽
第 2 週: 優化數據庫查询
第 3-4 週: 設計·實施緩存層
第 2 月: 逐步加強授權控制
多角色分析: Frontend + Mobile + Performance
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
分析對象: 用戶資料界面
Frontend 分析結果:
可用性: 直觀的布局
可訪問性: WCAG 2.1 符合率 85%
響應式: 平板顯示有問題
Mobile 分析結果:
觸摸目標: 確保 44pt 以上
單手操作: 重要按钮在上方
離線支持: 未實施
Performance 分析結果:
初始顯示: LCP 2.1 秒 (良好)
圖像優化: 不支持 WebP
延遲加載: 未實施
综合建議:
1. 移動優化 (單手操作 + 離線支持)
2. 圖像優化 (WebP + 延遲加載)
3. 改進平板 UI
優先級: Mobile > Performance > Frontend
實施期間: 3-4 週
/multi-role security,architect
"認證系統的設計"
/multi-role security,frontend
"登錄界面的安全性"
/multi-role security,mobile
"移動應用的數據保護"
/multi-role performance,architect
"可擴展性設計"
/multi-role performance,frontend
"Web 页面高速化"
/multi-role performance,mobile
"應用運行優化"
/multi-role frontend,mobile
"跨平台 UI"
/multi-role frontend,performance
"UX 與性能的平衡"
/multi-role mobile,performance
"移動 UX 優化"
/multi-role architect,security,performance
"系統整體評估"
/multi-role frontend,mobile,performance
"用戶體驗综合評估"
/multi-role security,performance,mobile
"移動應用综合診斷"
# 結合文件分析
cat src/components/UserProfile.tsx
/multi-role frontend,mobile
"從多個視角評估這個組件"
# 設計文檔評估
cat architecture-design.md
/multi-role architect,security,performance
"從多個專業領域評估這個設計"
# 錯誤分析
cat performance-issues.log
/multi-role performance,analyzer
"多角度分析性能問題"
使用 --agent 選項時,各角色作為独立的子代理並行執行。
当角色文件的 description 字段包含以下短語時,使用 --agent 會啟用更积极的自動委托:
常規執行:
角色 1 → 角色 2 → 角色 3 → 综合
(顺序執行,約 3-5 分鐘)
--agent 執行:
角色 1 ─┐
角色 2 ─┼→ 综合
角色 3 ─┘
(並行執行,約 1-2 分鐘)
# 大規模系統的综合評估
/multi-role architect,security,performance,qa --agent
"新系統的全面評估"
# 多視角的詳细分析
/multi-role frontend,mobile,performance --agent
"所有界面的 UX 優化分析"
| 角色數 | 常規執行 | --agent 執行 | 縮短率 |
|---|---|---|---|
| 2 角色 | 2-3 分鐘 | 1 分鐘 | 50% |
| 3 角色 | 3-5 分鐘 | 1-2 分鐘 | 60% |
| 4 角色 | 5-8 分鐘 | 2-3 分鐘 | 65% |
.claude/agents/roles/ 目錄中/multi-roleComando que realiza análise paralela do mesmo objeto com múltiplos roles e gera relatório integrado.
/multi-roleA command that analyzes the same target in parallel with multiple roles and generates an integrated report.