Advanced Agent Manager Skill
All-in-one skill covering manage, multiple, local, agents. Includes structured workflows, validation checks, and reusable patterns for ai research.
Advanced Agent Manager
Overview
A skill for running, monitoring, and managing multiple AI agent instances in parallel — spawning agents in separate terminal sessions, assigning tasks, monitoring output, and coordinating work across concurrent agent processes. Ideal for large-scale automation, parallel code generation, and multi-agent development workflows.
When to Use
- Running multiple agents working on different parts of a codebase simultaneously
- Automating recurring development tasks across a project
- Managing long-running agent processes that need monitoring
- Scaling agent work across a large codebase (e.g., updating 50 files)
- Building agent pipelines where outputs feed into other agents
Quick Start
# List running agents agent-manager list # Start an agent with a task agent-manager start --name "reviewer" --task "Review all TypeScript files in src/services/" # Monitor agent output agent-manager monitor reviewer --follow # Stop an agent agent-manager stop reviewer
Agent Lifecycle
Created → Starting → Running → Completed
→ Failed → Retrying → Running
→ Stopped (manual)
Spawning Agents
# Start a named agent agent-manager start \ --name "security-scan" \ --task "Scan all files for hardcoded credentials" \ --timeout 300 # Start multiple agents in parallel agent-manager start --name "review-auth" --task "Review src/auth/" agent-manager start --name "review-api" --task "Review src/api/" agent-manager start --name "review-db" --task "Review src/db/"
Monitoring
# View all agents and their status agent-manager list # Output: # NAME STATUS DURATION TASK # review-auth running 2m 15s Review src/auth/ # review-api running 1m 45s Review src/api/ # review-db completed 3m 02s Review src/db/ # Follow an agent's output in real-time agent-manager monitor review-auth --follow # View agent logs agent-manager logs review-auth # Get a summary of all completed work agent-manager summary
Stopping and Cleanup
# Stop a specific agent agent-manager stop review-auth # Stop all agents agent-manager stop --all # Cleanup completed agent resources agent-manager cleanup # Force kill unresponsive agent agent-manager kill review-auth
Task Assignment
Direct Assignment
# Assign a task to a running agent agent-manager assign reviewer <<'EOF' Review the following files for security vulnerabilities: - src/services/authService.ts - src/middleware/auth.ts - src/controllers/authController.ts Focus on: injection, XSS, auth bypass, and token handling EOF
Batch Assignment
# Create a task file cat > tasks.json << 'EOF' [ { "name": "lint-services", "task": "Run eslint on src/services/ and fix issues" }, { "name": "lint-controllers", "task": "Run eslint on src/controllers/ and fix issues" }, { "name": "lint-utils", "task": "Run eslint on src/utils/ and fix issues" } ] EOF # Start all tasks agent-manager batch tasks.json --parallel 3
Scheduled Tasks
# Run an agent on a cron schedule agent-manager schedule \ --name "nightly-review" \ --task "Run full security scan and generate report" \ --cron "0 2 * * *" # List scheduled tasks agent-manager schedule list # Remove a schedule agent-manager schedule remove nightly-review
Parallel Patterns
Fan-Out
Run the same type of task across many targets:
# Generate agents for each service directory for dir in src/services/*/; do name=$(basename "$dir") agent-manager start \ --name "test-$name" \ --task "Write tests for all functions in $dir" done
Pipeline
Chain agents where one's output feeds the next:
# Stage 1: Research agent-manager start --name "research" --task "Analyze current auth implementation" # Stage 2: Plan (starts when research completes) agent-manager start --name "plan" --task "Design new OAuth flow" --after "research" # Stage 3: Implement (starts when plan completes) agent-manager start --name "implement" --task "Build OAuth service" --after "plan"
Pool
Maintain a pool of agents that pull work from a queue:
# Start a worker pool agent-manager pool start --workers 4 --queue tasks.json # Add tasks to the queue agent-manager pool enqueue "Review src/models/User.ts" agent-manager pool enqueue "Review src/models/Order.ts" # Workers automatically claim and process tasks
Configuration
{ "agentManager": { "maxAgents": 8, "defaultTimeout": 600, "logDirectory": ".agent-logs/", "backend": "tmux", "retryOnFailure": true, "maxRetries": 2, "notifyOnComplete": true } }
Resource Management
Concurrency Limits
# Set maximum parallel agents agent-manager config set maxAgents 4 # Check current resource usage agent-manager status # Output: # Agents: 3/4 running # CPU: 45% # Memory: 2.1 GB used
Timeout Management
# Set global default timeout agent-manager config set defaultTimeout 300 # Override per agent agent-manager start --name "long-task" --task "..." --timeout 1800
Error Handling
Automatic Retry
{ "retryPolicy": { "enabled": true, "maxRetries": 2, "backoffMs": 5000, "retryOn": ["timeout", "crash"] } }
Failure Notifications
# Agent failures are logged and optionally notified agent-manager logs --failed # Get failure summary agent-manager report --failures-only
Best Practices
- Name agents descriptively —
review-auth-servicenotagent-1 - Set timeouts — Prevent runaway agents from consuming resources
- Monitor actively — Check agent status regularly during parallel runs
- Use task dependencies —
--afterflag ensures correct ordering - Limit concurrency — 4-6 parallel agents is usually optimal
- Clean up after runs —
agent-manager cleanupfrees resources - Log everything — Agent logs are invaluable for debugging
- Test with one before many — Run a single agent first, then scale
- Handle failures gracefully — Enable retry for transient errors
- Review outputs — Always verify agent work before committing
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Full-Stack Code Reviewer
Comprehensive code review skill that checks for security vulnerabilities, performance issues, accessibility, and best practices across frontend and backend code.
Test Suite Generator
Generates comprehensive test suites with unit tests, integration tests, and edge cases. Supports Jest, Vitest, Pytest, and Go testing.
Pro Architecture Workspace
Battle-tested skill for architectural, decision, making, framework. Includes structured workflows, validation checks, and reusable patterns for development.