AgentSkillsCN

meta-agent

指导用户创建并验证专用 AI 代理(子代理)。适用于用户希望创建新代理、验证现有代理、定义代理配置,或需要代理架构方面的指导时使用。 适用场景: - “创建代理”、“新代理”、“制作子代理”、“代理模板” - “验证代理”、“检查代理”、“整理代理”、“代理审计” 不适用场景: - 创建技能(应使用元技能) - 创建命令(应使用元命令)

SKILL.md
--- frontmatter
name: meta-agent
description: |
  Guide for creating and validating specialized AI agents (subagents). Use when users want to create
  a new agent, validate agents, define agent configurations, or need guidance on agent architecture.
  
  USE WHEN:
  - "create an agent", "new agent", "make a subagent", "agent template"
  - "validate agent", "check agent", "organize agent", "agent audit"
  
  DO NOT USE WHEN:
  - Creating skills (use meta-skill)
  - Creating commands (use meta-command)

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
Validate existing agent(s)workflows/validate-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