Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Unified agent management from selection through completion - spawning, execution, output processing. Use when selecting agents for tasks, spawning agents with dependency validation, processing agent outputs, or tracking agent lifecycle events with audit trails.
.claude/skills/majiayu000-cfn-agent-lifecycle/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 88% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 378% | 0% |
| case-18 | ✗→✓ | ▲ Improved | 59% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 105% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 56% | 0% |
Version: 2.0.0 Purpose: Unified agent management from selection through completion Status: Production Consolidates: cfn-agent-selector, cfn-agent-selection-with-fallback, cfn-agent-spawning, cfn-agent-output-processing, cfn-agent-execution
This mega-skill provides complete agent lifecycle management:
agent-lifecycle/
├── SKILL.md # This file
├── lib/
│ ├── selection/ # Agent selection (from cfn-agent-selector + cfn-agent-selection-with-fallback)
│ │ ├── select-agents.sh # Basic agent selection
│ │ ├── select-agents-with-fallback.sh # Enhanced with fallback (recommended)
│ │ ├── task-classifier.sh # Task classification
│ │ ├── agent-mappings.json # Agent category mappings
│ │ ├── src/ # TypeScript implementation
│ │ │ ├── agent-selector.ts
│ │ │ ├── cli.ts
│ │ │ └── agent-selector.test.ts
│ │ └── dist/ # Compiled TypeScript
│ │ ├── agent-selector.cjs
│ │ └── cli.cjs
│ ├── spawning/ # Agent spawning (from cfn-agent-spawning + cfn-agent-execution)
│ │ ├── spawn-agent.sh # Main spawning script
│ │ ├── spawn-worker.sh # Worker spawning
│ │ ├── spawn-templates.sh # Template management
│ │ ├── spawn-agent-wrapper.sh # Wrapper with error handling
│ │ ├── execute-agent.sh # Agent execution
│ │ ├── check-dependencies.sh # Dependency validation
│ │ ├── parse-agent-provider.sh # Provider parsing
│ │ └── get-agent-provider-env.sh # Provider env setup
│ ├── output/ # Output processing (from cfn-agent-output-processing)
│ │ └── README.md # Output processing documentation
│ └── audit/ # Audit trail (original agent-lifecycle)
│ ├── execute-lifecycle-hook.sh # SQLite lifecycle hooks
│ └── simple-audit.sh # Simple audit script
└── cli/ # CLI wrappers for convenience
├── select-agents.sh # → lib/selection/select-agents-with-fallback.sh
├── spawn-agent.sh # → lib/spawning/spawn-agent.sh
└── lifecycle-hook.sh # → lib/audit/execute-lifecycle-hook.shbash# Recommended: Use fallback-enabled selection ./.claude/skills/agent-lifecycle/cli/select-agents.sh "Implement JWT authentication" # Output (JSON): # { # "loop3": ["backend-developer", "security-specialist"], # "loop2": ["code-reviewer", "tester", "security-specialist"], # "product_owner": "product-owner", # "category": "backend-api", # "confidence": 0.92 # }
bash./.claude/skills/agent-lifecycle/cli/spawn-agent.sh \ --task "Implement user authentication" \ --agents coder,security-specialist,tester \ --agent-id coordinator-1
bash# Register agent spawn ./.claude/skills/agent-lifecycle/cli/lifecycle-hook.sh spawn \ --agent-id "${AGENT_ID}" \ --agent-type "${AGENT_TYPE}" \ --acl-level 1 # Update confidence ./.claude/skills/agent-lifecycle/cli/lifecycle-hook.sh update \ --agent-id "${AGENT_ID}" \ --confidence 0.85 # Mark completion ./.claude/skills/agent-lifecycle/cli/lifecycle-hook.sh complete \ --agent-id "${AGENT_ID}" \ --confidence 0.90
Purpose: Task classification and agent selection
Features:
Task Categories: | Category | Loop 3 Agents | Loop 2 Agents | |----------|---------------|---------------| | backend-api | backend-developer, api-gateway-specialist | code-reviewer, tester, api-testing-specialist | | fullstack | backend-developer, react-frontend-engineer | code-reviewer, tester, integration-tester | | mobile | mobile-dev, backend-developer | code-reviewer, tester, interaction-tester | | infrastructure | devops-engineer, docker-specialist | code-reviewer, tester, chaos-engineering-specialist | | security | security-specialist, backend-developer | code-reviewer, tester, security-specialist | | frontend | react-frontend-engineer, typescript-specialist | code-reviewer, tester, playwright-tester | | database | database-architect, backend-developer | code-reviewer, tester, data-engineer | | performance | backend-developer, perf-analyzer | code-reviewer, tester, performance-benchmarker | | default | backend-developer, devops-engineer | code-reviewer, tester, code-quality-validator |
Purpose: Agent deployment and dependency management
Features:
Performance Targets:
Purpose: Structured output extraction from agents
Features:
Purpose: SQLite lifecycle tracking
Features:
bash# 1. Classify task and select agents CLASSIFICATION=$(./lib/selection/task-classifier.sh "$TASK_DESCRIPTION") AGENTS_JSON=$(./cli/select-agents.sh "$TASK_DESCRIPTION") # 2. Extract agent lists LOOP3_AGENTS=$(echo "$AGENTS_JSON" | jq -r '.loop3 | join(",")') LOOP2_AGENTS=$(echo "$AGENTS_JSON" | jq -r '.loop2 | join(",")') # 3. Spawn agents with lifecycle tracking ./cli/lifecycle-hook.sh spawn --agent-id "$AGENT_ID" --agent-type "$AGENT_TYPE" ./cli/spawn-agent.sh --task "$TASK" --agents "$LOOP3_AGENTS" --agent-id "$AGENT_ID" # 4. After completion ./cli/lifecycle-hook.sh complete --agent-id "$AGENT_ID" --confidence 0.92
| Old Path | New Path | |----------|----------| | .claude/skills/cfn-agent-selector/select-agents.sh | .claude/skills/agent-lifecycle/lib/selection/select-agents.sh | | .claude/skills/cfn-agent-selection-with-fallback/select-agents.sh | .claude/skills/agent-lifecycle/lib/selection/select-agents-with-fallback.sh | | .claude/skills/cfn-agent-spawning/spawn-agent.sh | .claude/skills/agent-lifecycle/lib/spawning/spawn-agent.sh | | .claude/skills/cfn-agent-execution/execute-agent.sh | .claude/skills/agent-lifecycle/lib/spawning/execute-agent.sh |
For easier migration, use CLI wrappers:
bash./.claude/skills/agent-lifecycle/cli/select-agents.sh # Recommended entry point ./.claude/skills/agent-lifecycle/cli/spawn-agent.sh ./.claude/skills/agent-lifecycle/cli/lifecycle-hook.sh
The selection module includes a production-ready TypeScript implementation:
bash# Use TypeScript version export USE_TYPESCRIPT=true ./lib/selection/select-agents-with-fallback.sh "Implement auth" # Or call directly node ./lib/selection/dist/cli.cjs "Implement auth"
Benefits:
bash# Test selection ./lib/selection/src/agent-selector.test.ts # Test spawning dependencies ./lib/spawning/check-dependencies.sh # Test lifecycle hooks ./lib/audit/simple-audit.sh
.claude/skills/task-classifier/) - Standalone task classification.claude/skills/cfn-docker-agent-spawning/) - Docker-specific spawning.claude/skills/cfn-product-owner-decision/) - Product owner output processingOther measured skills in the registry, with their headline benchmark lift.