技能 create-subagent
🤖

create-subagent

安全 ⚙️ 外部命令🌐 網路存取📁 檔案系統存取

為 Claude Code 創建專業化的子代理

用戶需要有關創建和配置能夠處理複雜任務的專業 AI 助手的指導。此技能提供了模板、最佳實踐和構建有效子代理的逐步說明。

支援: Claude Codex Code(CC)
📊 71 充足
1

下載技能 ZIP

2

在 Claude 中上傳

前往 設定 → 功能 → 技能 → 上傳技能

3

開啟並開始使用

測試它

正在使用「create-subagent」。 Create a code reviewer agent that checks for security issues

預期結果:

  • Agent name: security-reviewer
  • Tools: Read, Glob, Grep (read-only for safety)
  • Model: opus (for thorough analysis)
  • Triggers: Use PROACTIVELY when reviewing authentication, authorization, or data handling code
  • Workflow: Threat modeling → Code review → Vulnerability search → Report

正在使用「create-subagent」。 How do I set up parallel debugging agents for different error types

預期結果:

  • Dispatch 3 parallel agents: stack-trace-analyzer, log-investigator, state-inspector
  • Each agent uses specialized prompts for their domain
  • Synthesize findings after all agents complete their analysis
  • Report combines insights from all three perspectives

正在使用「create-subagent」。 Create a research agent for API documentation

預期結果:

  • Agent name: api-researcher
  • Tools: Read, Glob, Grep, WebSearch, WebFetch (for external docs)
  • Model: opus (for complex synthesis)
  • Workflow: Plan investigation → Deep exploration → Synthesize → Report
  • Outputs comprehensive API documentation with examples

安全審計

安全
v5 • 1/16/2026

Pure documentation skill containing only markdown files. No executable code, network calls, file system access, or external command execution. Files contain guidance templates for configuring Claude Code subagents. All 157 static findings are false positives triggered by patterns inside markdown code blocks used as examples.

3
已掃描檔案
1,192
分析行數
3
發現項
5
審計總數

風險因素

⚙️ 外部命令 (94)
references/agent-templates.md:7-77 references/agent-templates.md:77-83 references/agent-templates.md:83-141 references/agent-templates.md:141-145 references/agent-templates.md:145-212 references/agent-templates.md:212-216 references/agent-templates.md:216-282 references/agent-templates.md:282-286 references/agent-templates.md:286-366 references/agent-templates.md:366-372 references/agent-templates.md:372-407 references/agent-templates.md:407-411 references/agent-templates.md:411-431 references/agent-templates.md:431-435 references/agent-templates.md:435-464 references/agent-templates.md:464-470 references/agent-templates.md:470-471 references/agent-templates.md:471-472 references/agent-templates.md:472-473 references/agent-templates.md:473-476 references/agent-templates.md:476-477 references/agent-templates.md:477-478 references/agent-templates.md:478-479 SKILL.md:50 SKILL.md:51 SKILL.md:55-74 SKILL.md:74-80 SKILL.md:80-86 SKILL.md:86-92 SKILL.md:92-93 SKILL.md:93-94 SKILL.md:94-102 SKILL.md:102-103 SKILL.md:103-109 SKILL.md:109-110 SKILL.md:110 SKILL.md:110 SKILL.md:110 SKILL.md:110 SKILL.md:110-111 SKILL.md:111-112 SKILL.md:112-118 SKILL.md:118-119 SKILL.md:119-120 SKILL.md:120-121 SKILL.md:121-122 SKILL.md:122-126 SKILL.md:126 SKILL.md:126 SKILL.md:126 SKILL.md:126 SKILL.md:126-127 SKILL.md:127 SKILL.md:127-128 SKILL.md:128 SKILL.md:128-129 SKILL.md:129 SKILL.md:129 SKILL.md:129 SKILL.md:129-158 SKILL.md:158-185 SKILL.md:185-190 SKILL.md:190-192 SKILL.md:192-195 SKILL.md:195-197 SKILL.md:197-200 SKILL.md:200-202 SKILL.md:202-216 SKILL.md:216-253 SKILL.md:253-257 SKILL.md:257-290 SKILL.md:290-294 SKILL.md:294-338 SKILL.md:338-346 SKILL.md:346-364 SKILL.md:364-370 SKILL.md:370-377 SKILL.md:377-385 SKILL.md:385-391 SKILL.md:391-397 SKILL.md:397-403 SKILL.md:403-423 SKILL.md:423-452 SKILL.md:452-461 SKILL.md:461-469 SKILL.md:469-475 SKILL.md:475-504 SKILL.md:504-507 SKILL.md:507-510 SKILL.md:510-513 SKILL.md:513-516 SKILL.md:516-518 SKILL.md:518-521 SKILL.md:521-523
🌐 網路存取 (1)
📁 檔案系統存取 (8)
審計者: claude 查看審計歷史 →

品質評分

41
架構
100
可維護性
87
內容
30
社群
100
安全
87
規範符合性

你能建構什麼

標準化代碼審查工作流程

創建專業化的審查者代理,在代碼更改後自動運行以進行一致的質量檢查。

更快地調試複雜問題

調度具有結構化工作流程的調試代理,以便在多個文件中進行根本原因分析。

並行研究和綜合

同時啟動多個研究代理,並將發現綜合成全面的架構報告。

試試這些提示

基本代理定義
幫助我在 .claude/agents/ 中創建一個用於 [任務類型] 的基於文件的代理。包括名稱、帶有 PROACTIVELY 觸發的描述,以及基本工具權限。
任務調度
向我展示如何使用 Task 工具調度一個 [模型] 代理來執行 [任務]。我需要哪些參數?
自定義代理角色
為 [角色] 創建一個完整的代理定義,包括角色定義、硬性規則、工作流程階段和輸出格式期望。
並行執行
設置並行執行 [數量] 個 [模型] 代理來分析 [組件]。包括綜合步驟以合併發現。

最佳實務

  • 在定義代理工具時使用最小權限原則 - 只授予代理真正需要的工具訪問權限
  • 在描述中包含帶有 PROACTIVELY 的特定觸發條件以實現自動調用
  • 為清晰起見,結構化代理提示為角色、約束、工作流程和輸出格式部分

避免

  • 向每個代理授予所有工具會造成不必要的安全風險
  • 沒有觸發條件的模糊描述會阻止自動調用
  • 沒有結構的過長提示會使代理行為混亂

常見問題

基於文件的代理和 Task 工具調度有什麼區別?
基於文件的代理在會話之間持久存在,可以通過版本控制共享。Task 工具調度創建用於一次性或動態工作流程的按需代理。
我應該在哪裡存儲項目代理與用戶代理?
項目代理放在項目內的 .claude/agents/ 中。用戶代理放在 ~/.claude/agents/ 中,適用於所有項目。
如何為我的代理選擇正確的模型?
對於簡單任務使用 haiku,對於大多數開發工作使用 sonnet,對於需要深度分析的複雜推理使用 opus。
使用子代理時我的數據安全嗎?
是的。代理在同一安全環境中運行。您可以控制每個代理的工具和權限。
為什麼我的代理沒有被自動調用?
檢查描述是否包含 PROACTIVELY 和清晰的觸發條件。驗證文件是否在正確的位置且具有有效的前置配置。
子代理與技能相比如何?
子代理具有隔離的上下文窗口,並且可以具有不同的工具權限。技能在沒有隔離的情況下擴展知識。

開發者詳情

檔案結構