v2/bin/init/templates/commands/automation/auto-agent.md
Automatically spawn and manage agents based on task requirements.
npx claude-flow auto agent [options]
--task, -t <description> - Task description for agent analysis--max-agents, -m <number> - Maximum agents to spawn (default: auto)--min-agents <number> - Minimum agents required (default: 1)--strategy, -s <type> - Selection strategy: optimal, minimal, balanced--no-spawn - Analyze only, don't spawn agentsnpx claude-flow auto agent --task "Build a REST API with authentication"
npx claude-flow auto agent -t "Debug performance issue" --max-agents 3
npx claude-flow auto agent -t "Refactor codebase" --no-spawn
npx claude-flow auto agent -t "Fix bug in login" -s minimal
Task Analysis
Agent Selection
Topology Selection
Automatic Spawning
// In Claude Code after auto-spawning
mcp__claude-flow__auto_agent {
task: "Build authentication system",
strategy: "balanced",
maxAgents: 6
}
agent spawn - Manual agent creationswarm init - Initialize swarm manuallysmart spawn - Intelligent agent spawningworkflow select - Choose predefined workflows