Subagent Creator

作者 tech-leads-club120b67676388无许可证收录于 2026年10月8日更新于 2026年10月8日

Guide for creating AI subagents with isolated context for complex multi-step workflows. Use when users want to create a subagent, specialized agent, verifier, debugger, or orchestrator that requires isolated context and deep specialization. Works with any agent that supports subagent delegation. Triggers on "create subagent", "new agent", "specialized assistant", "create verifier". Do NOT use for Cursor-specific subagents (use cursor-subagent-creator instead).

仅含说明AI & Agents
AI 生成的概览

指导创建与具体代理无关、具有隔离上下文的 AI 子代理,用于复杂的多步骤工作流。

功能
该技能提供编写 AI 子代理的指导:子代理是带有 name、description、model、readonly 等前置元数据的 markdown 文件。它说明何时应使用子代理而非技能、如何配置元数据以实现自动委派,以及如何撰写子代理提示词。它还给出验证者、调试者、安全审计者和代码审查者等可复用模式,并附最佳实践、质量检查清单和完成提示示例。
适用场景
当用户想要创建子代理、专用代理、验证者、调试者或需要隔离上下文与深度专业化的编排者时使用。它面向支持子代理委派的代理,并明确排除 Cursor 专用的子代理。
运行要求
无需脚本或软件包,仅为说明性文档。它假定目标代理平台支持子代理委派以及带前置元数据的 markdown 文件。

Subagent Creator

This skill provides guidance for creating effective, agent-agnostic subagents.

What are Subagents?

Subagents are specialized assistants that an AI agent can delegate tasks to. Characteristics:

  • Isolated context: Each subagent has its own context window
  • Parallel execution: Multiple subagents can run simultaneously
  • Specialization: Configured with specific prompts and expertise
  • Reusable: Defined once, used in multiple contexts

When to Use Subagents vs Skills

Is the task complex with multiple steps?├─ YES → Does it require isolated context?│         ├─ YES → Use SUBAGENT│         └─ NO → Use SKILL│└─ NO → Use SKILL

Use Subagents for:

  • Complex workflows requiring isolated context
  • Long-running tasks that benefit from specialization
  • Verification and auditing (independent perspective)
  • Parallel workstreams

Use Skills for:

  • Quick, one-off actions
  • Domain knowledge without context isolation
  • Reusable procedures that don't need isolation

Subagent Structure

A subagent is typically a markdown file with frontmatter metadata:

markdown
---name: agent-namedescription: Description of when to use this subagent.model: inherit # or fast, or specific model IDreadonly: false # true to restrict write permissions---
You are an [expert in X].
When invoked:
1. [Step 1]2. [Step 2]3. [Step 3]
[Detailed instructions about expected behavior]
Report [type of expected result]:
- [Output format]- [Metrics or specific information]

Subagent Creation Process

1. Define the Purpose

  • What specific responsibility does the subagent have?
  • Why does it need isolated context?
  • Does it involve multiple complex steps?
  • Does it require deep specialization?

2. Configure the Metadata

name (required)

Unique identifier. Use kebab-case.

yaml
name: security-auditor
description (critical)

CRITICAL for automatic delegation. Explains when to use this subagent.

Good descriptions:

  • "Security specialist. Use when implementing auth, payments, or handling sensitive data."
  • "Debugging specialist for errors and test failures. Use when encountering issues."
  • "Validates completed work. Use after tasks are marked done."

Phrases that encourage automatic delegation:

  • "Use proactively when..."
  • "Always use for..."
  • "Automatically delegate when..."
model (optional)
yaml
model: inherit  # Uses same model as parent (default)model: fast     # Uses fast model for quick tasks
readonly (optional)
yaml
readonly: true # Restricts write permissions

3. Write the Subagent Prompt

Define:

  1. Identity: "You are an [expert]..."
  2. When invoked: Context of use
  3. Process: Specific steps to follow
  4. Expected output: Format and content

Template:

markdown
You are an [expert in X] specialized in [Y].
When invoked:
1. [First action]2. [Second action]3. [Third action]
[Detailed instructions about approach]
Report [type of result]:
- [Specific format]- [Information to include]- [Metrics or criteria]
[Philosophy or principles to follow]

Common Subagent Patterns

1. Verification Agent

Purpose: Independently validates that completed work actually works.

markdown
---name: verifierdescription: Validates completed work. Use after tasks are marked done.model: fast---
You are a skeptical validator.
When invoked:
1. Identify what was declared as complete2. Verify the implementation exists and is functional3. Execute tests or relevant verification steps4. Look for edge cases that may have been missed
Be thorough. Report:
- What was verified and passed- What is incomplete or broken- Specific issues to address

2. Debugger

Purpose: Expert in root cause analysis.

markdown
---name: debuggerdescription: Debugging specialist. Use when encountering errors or test failures.---
You are a debugging expert.
When invoked:
1. Capture the error message and stack trace2. Identify reproduction steps3. Isolate the failure location4. Implement minimal fix5. Verify the solution works
For each issue, provide:
- Root cause explanation- Evidence supporting the diagnosis- Specific code fix- Testing approach

3. Security Auditor

Purpose: Security expert auditing code.

markdown
---name: security-auditordescription: Security specialist. Use for auth, payments, or sensitive data.---
You are a security expert.
When invoked:
1. Identify security-sensitive code paths2. Check for common vulnerabilities3. Confirm secrets are not hardcoded4. Review input validation
Report findings by severity:
- **Critical** (must fix before deploy)- **High** (fix soon)- **Medium** (address when possible)- **Low** (suggestions)

4. Code Reviewer

Purpose: Code review with focus on quality.

markdown
---name: code-reviewerdescription: Code review specialist. Use when changes are ready for review.---
You are a code review expert.
When invoked:
1. Analyze the code changes2. Check readability, performance, patterns, error handling3. Identify code smells and potential bugs4. Suggest specific improvements
Report:**✅ Approved / ⚠️ Approved with caveats / ❌ Changes needed**
**Issues Found:**
- **[Severity]** [Location]: [Issue]  - Suggestion: [How to fix]

Best Practices

✅ DO

  • Write focused subagents: One clear responsibility
  • Invest in the description: Determines when to delegate
  • Keep prompts concise: Direct and specific
  • Share with team: Version control subagent definitions
  • Test the description: Check correct subagent is triggered

❌ AVOID

  • Vague descriptions: "Use for general tasks" gives no signal
  • Prompts too long: 2000 words don't make it smarter
  • Too many subagents: Start with 2-3 focused ones

Quality Checklist

Before finalizing:

  • Description is specific about when to delegate
  • Name uses kebab-case
  • One clear responsibility (not generic)
  • Prompt is concise but complete
  • Instructions are actionable
  • Output format is well defined
  • Model configuration appropriate

Output Messages

When creating a subagent:

✅ Subagent created successfully!
📁 Location: .agent/subagents/[name].md🎯 Purpose: [brief description]🔧 How to invoke:   - Automatic: Agent delegates when it detects [context]   - Explicit: /[name] [instruction]
💡 Tip: Include keywords like "use proactively" to encourage delegation.

来源与署名

来源:tech-leads-club/agent-skills位于packages/skills-catalog/skills/(creation)/subagent-creator提交120b676

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架