AgentSkillsCN

meta-agent

为创建专业化的 AI 智能体(子智能体)提供指南。当用户希望创建新智能体、定义智能体配置,或需要智能体架构方面的指导时,可使用此技能。 触发条件:“创建智能体”“新智能体”“打造子智能体”“智能体模板”。

SKILL.md
--- frontmatter
name: meta-agent
description: |
  Guide for creating specialized AI agents (subagents). Use when users want to create
  a new agent, define agent configurations, or need guidance on agent architecture.
  Triggers: "create an agent", "new agent", "make a subagent", "agent template"

Meta-Agent Creator

A meta-skill that helps create new specialized agents for multi-agent orchestration systems. Supports Claude Code and OpenCode platforms.

Output Language: All generated agent content (prompts, descriptions) will be in English.

Workflow Routing

IntentWorkflow
Create a new agent (full process)workflows/create-agent.md

Core Resources

ResourcePurpose
Agent PatternsArchitecture guidance, interfaces
Agent TemplatesReady-to-use agent examples

Quick Start

Create a New Agent

bash
# Initialize a new agent
bun scripts/init-agent.ts <agent-name> --path <output-directory> --platform <platform>

# Examples
bun scripts/init-agent.ts security-auditor --path src/agents --platform opencode
bun scripts/init-agent.ts data-analyst --path .claude/agents --platform claude-code

Validate Agent

bash
bun scripts/validate-agent.ts <agent-file>

# Examples
bun scripts/validate-agent.ts src/agents/my-agent.ts
bun scripts/validate-agent.ts .claude/agents/my-agent.ts

Agent Categories

Choose the appropriate category based on agent purpose:

CategoryPurposeModel TierExamples
explorationFast search, codebase discoveryLOW (haiku/fast)explore, searcher
specialistDomain-specific implementationMEDIUM (sonnet)frontend, backend
advisorRead-only consultationHIGH (opus)oracle, architect
utilityGeneral helpersLOW (haiku/fast)writer, formatter
orchestrationMulti-agent coordinationMEDIUM (sonnet)orchestrator

Agent Creation Workflow (5 Phases)

For the complete step-by-step guide, see workflows/create-agent.md.

PhaseGoalKey Output
1. DEFINEClarify purposeRole definition
2. CLASSIFYSelect category/modelCategory + tier
3. DESIGNWrite promptSystem prompt
4. CONFIGURECreate configAgent file
5. REGISTERAdd & testWorking agent

Platform Configurations

OpenCode / Claude Code Agent Fields

FieldRequiredDescription
nameYesAgent identifier (kebab-case)
descriptionYesSelection guide for orchestrator
modeYesAlways "subagent"
modelYesModel string
temperatureNoDefaults to 0.1
toolsNoTool whitelist/blacklist
promptYesSystem prompt

Example Configuration

typescript
export function createMyAgent(model: string): AgentConfig {
  return {
    name: "my-agent",
    description: "Agent description...",
    mode: "subagent",
    model,
    temperature: 0.1,
    tools: { include: ["read", "glob", "grep"] },
    prompt: `System prompt...`
  };
}

Anti-Patterns to Avoid

Anti-PatternProblemSolution
Vague descriptionOrchestrator can't decideInclude specific triggers
Too many toolsSecurity riskMinimal tool set
Long promptsSlower, harder to maintainKeep under 500 words
Generic "helper"No clear purposeSingle responsibility
Missing readonlySecurity for advisorsSet readonly: true
Wrong model tierCost or quality issuesMatch tier to complexity