skills/subagent-teams/SKILL.md
Orchestrate complex tasks by delegating work to parallel subagent teams, preserving the main context window and preventing auto-compact. This skill should be used when users ask to apply subagent-teams, when performing complex multi-step tasks, when context window is getting large, or when independent subtasks can run in parallel.
npx skillsauth add alijilani-dev/claude subagent-teamsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Maintain optimum Claude performance by delegating heavy work to subagent teams, minimizing auto-compact of the main context window.
Gather context to ensure successful delegation:
| Source | Gather |
|--------|--------|
| User Request | Full scope of the task, constraints, preferences |
| Codebase | Project structure, key files, existing patterns |
| Skill References | Delegation patterns from references/ |
| Task Complexity | Number of independent subtasks, dependencies between them |
Only ask user for THEIR specific requirements (delegation strategy is in this skill).
WITHOUT subagent-teams:
Main Context: [Explore + Search + Read + Analyze + Plan + Implement + Test]
Result: Context fills → Auto-compact triggers → Quality degrades
WITH subagent-teams:
Main Context: [Decompose → Delegate → Synthesize → Decide]
Subagent 1: [Explore codebase] → returns summary
Subagent 2: [Run tests] → returns pass/fail
Subagent 3: [Implement feature] → returns code
Result: Main context stays lean → No auto-compact → Consistent quality
Analyze the user's request and break it into independent subtasks:
User Request
│
▼
┌─────────────────────────┐
│ Dependency Analysis │
│ - Independent tasks → parallel batch
│ - Dependent tasks → sequential order
│ - Gates → sync points │
└─────────────────────────┘
│
▼
[Parallel Batch 1] → [Gate] → [Parallel Batch 2] → [Gate] → [Final Synthesis]
For each subtask, select the optimal subagent configuration:
| Subtask Type | subagent_type | Model | Tools |
|--------------|---------------|-------|-------|
| Codebase exploration | Explore | haiku | Read, Grep, Glob |
| Architecture design | Plan | sonnet | All read tools |
| Multi-step implementation | general-purpose | sonnet/opus | All tools |
| Simple file search | Explore | haiku | Glob, Grep |
| Code review | Explore | sonnet | Read, Grep |
| Test execution | general-purpose | haiku | Bash, Read |
Launch independent subagents in a single message with multiple Task tool calls:
# CORRECT: Single message, multiple tool calls (parallel)
Message contains:
- Task tool call 1: Explore agent for codebase research
- Task tool call 2: Explore agent for pattern analysis
- Task tool call 3: General-purpose agent for test execution
# WRONG: Sequential messages (wastes time)
Message 1: Task tool call 1
[wait for result]
Message 2: Task tool call 2
[wait for result]
After subagents return:
When later tasks depend on earlier results:
| Condition | Action | |-----------|--------| | Task has 3+ independent subtasks | Use subagent-teams | | Context window already large | Delegate ALL exploration | | Task involves multiple file reads | Delegate to Explore agents | | Task requires testing + implementation | Separate into different agents | | Task is single-step and simple | Do NOT delegate (overhead not worth it) | | Tasks have strict sequential dependency | Use sequential gates, not parallel | | User explicitly requests subagent-teams | Always apply this skill |
Write clear, focused prompts for each subagent:
"[Action verb] [specific target] in [scope].
Focus on [key aspects].
Return: [structured output format].
Context: [relevant prior findings if any]."
| Anti-Pattern | Why It's Bad | Correct Approach |
|--------------|-------------|------------------|
| Reading 10+ files in main context | Fills context → auto-compact | Delegate to Explore agent |
| Long grep/search chains in main | Each result adds to context | Single Explore agent does all searching |
| Explore AND implement in same session | Double context usage | Explore agents first, then implement |
| One mega-agent for everything | No specialization, bloated context | Multiple focused agents |
| Not using run_in_background | Blocks main session | Use background for long tasks |
| Asking subagent for info you already have | Wastes subagent context | Pass known context in prompt |
| Task Complexity | Model | Cost | Use When |
|-----------------|-------|------|----------|
| Simple search/grep | haiku | Low | Finding files, simple patterns |
| Moderate analysis | sonnet | Medium | Code review, architecture design |
| Complex reasoning | opus | High | Multi-step implementation, critical decisions |
| Default (unspecified) | inherits | - | When unsure, let it inherit |
| Scenario | Recovery |
|----------|----------|
| Subagent returns incomplete results | Re-launch with more specific prompt |
| Subagent times out | Check with AgentOutputTool, adjust scope |
| Conflicting results from agents | Synthesize manually, prioritize authoritative source |
| Too many parallel agents | Limit to 3-5 concurrent, batch the rest |
| Background agent still running | Use AgentOutputTool with block=false to check status |
Before completing a subagent-teams workflow, verify:
| File | When to Read |
|------|--------------|
| references/delegation-patterns.md | Complex task decomposition examples |
| references/prompt-templates.md | Subagent prompt engineering patterns |
| references/context-management.md | Context window optimization strategies |
development
Generate new Claude Code skills with proper structure and standards. Use when the user requests skill creation, wants to generate a new skill, or mentions creating custom Claude Code functionality. Activated by phrases like "create a skill", "generate a skill", "make a new skill", or "build a skill for".
testing
Generate comprehensive educational quizzes based on Bloom's Taxonomy methodology (Remember, Understand, Apply, Analyze, Evaluate, Create). Creates structured True/False quizzes with detailed answer keys and explanations. Use when user requests quiz generation, assessment creation, test materials, practice questions, mentions Bloom's Taxonomy, or provides educational topics for quiz creation. Activates for study topics, course materials, reference files (.md, .txt, .pdf), or educational content requiring systematic assessment.
content-media
Generate comprehensive educational notes using Bloom's Taxonomy methodology. Creates structured learning materials with summaries, practice questions, and visual diagrams. Use when user requests notes generation, study materials, learning resources, mentions Bloom's Taxonomy, or provides topics for educational note-taking. Activates for .md files, study topics, course materials, or educational content creation.
data-ai
Generate comprehensive educational flashcards based on Bloom's Taxonomy methodology (Remember, Understand, Apply, Analyze, Evaluate, Create). Creates structured flashcards with difficulty ratings, detailed explanations, and practice hints. Use when user requests flashcard generation, study cards, review materials, learning flashcards, mentions Bloom's Taxonomy, or provides educational topics for flashcard creation. Activates for study topics, course materials, reference files (.md, .txt, .pdf), or educational content requiring systematic review materials.