agent-orchestration

Route tasks to subagents and Claude model tiers based on task type, scope, and cost.

Updated May 5, 2026
One-click install
npx skills add https://github.com/josippapez/ai-setup --skill agent-orchestration-josippapez
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: agent-orchestration
Source: https://github.com/josippapez/ai-setup/tree/main/claude/plugins/dev-core/skills/agent-orchestration
Command: npx skills add https://github.com/josippapez/ai-setup --skill agent-orchestration-josippapez

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Deciding whether to delegate work to a subagent, which subagent to pick, and which Claude model tier to assign is error-prone and inconsistent. This Skill gives the main agent explicit routing rules so delegation decisions are deliberate, cost-aware, and bounded, while the main agent stays the orchestrator and prompt-loop owner. ## Core Features & Use Cases - Model-tier routing: Assign cheaper tiers (haiku) to mechanical implementation and stronger tiers (opus) to planning, architecture, and safety-critical work, escalating only when needed. - Subagent selection: Map tasks to generic subagents (Explore, Plan, general-purpose, claude-code-guide) or repo custom agents such as tier/coder agents and domain specialists like test-specialist or docs-maintainer. - Bounded retry and background execution: Enforce follow-up-before-relaunch limits, ban recursive re-spawning loops, and run independent work via background subagents with a structured prompt template. - Use Case: When facing a multi-file refactor, dispatch a mid-tier coder subagent with a full context pack (objective, scope, constraints, validation commands), then review its output and own the final handoff instead of grinding through the change inline. ## Quick Start Ask the agent to decide whether this task should be delegated to a subagent and which model tier fits, then have it dispatch the work with a complete context pack.

Frequently Asked Questions about agent-orchestration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I decide which Claude model tier to use for a subagent?

Choose the model tier by task complexity and cost: cheaper tiers like haiku for mechanical implementation, file generation, and lint fixes, and stronger tiers like opus for planning, architecture, ambiguity, and safety-critical work. Prefer the lowest tier that can do the job and escalate only on failure or complexity.

When should I delegate a task to a subagent instead of doing it directly?

Delegate when the delegation gate is open (user request, workflow dispatch, or read-heavy fan-out) and a mapped domain or clearly delegable chunk exists. Do it directly when the change is trivial and takes under about 30 seconds, or when no suitable subagent fits the domain.

Can a subagent spawn its own subagents in Claude Code?

Nested spawning is off by default: a subagent only receives the Agent tool when CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH is set, with nesting capped at depth 5. Without it, the subagent must relay work back to the orchestrator rather than retry spawning.

What should a delegation prompt include for a subagent?

Include a full context pack in one message: objective, scope, constraints, validation commands, and handoff format. Subagents run in separate sessions and do not inherit the main session's context, so forward relevant doc paths and exact test commands explicitly.

When should I use background subagents with run_in_background?

Use background subagents for independent research, long-running audits, parallel investigation, or user-requested background review that can run while the main loop continues. Avoid them for blocking work, tiny checks, or multiple agents touching overlapping files.

What happens when a subagent fails or returns empty output?

Follow up with the same agent first by continuing it via its agent ID, then relaunch at most one new agent for the same unresolved objective. If no progress remains after those attempts, stop delegating, execute directly, validate, and report why.