Prepare optimal context package before delegating tasks to sub-agents
Prepare optimal context package before delegating a task to a sub-agent. This skill ensures sub-agents receive precisely the information they need ā no more, no less.
/delegate command/parallel| Parameter | Required | Description |
|---|---|---|
task |
Yes | The task to delegate |
agent_type |
Yes | Target sub-agent type (from catalog) |
files |
No | Specific files to include |
constraints |
No | Time/scope/format constraints |
TASK COMPLEXITY ASSESSMENT
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā” Single file operation ā Minimal context
ā” Multi-file operation ā Include all relevant files
ā” Cross-domain task ā Include domain documentation
ā” Decision-making task ā Include decision history
ā” Creative task ā Include examples/patterns
CONTEXT SELECTION MATRIX
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Agent Type | Always Include | Optional
āāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāā
Claude-Analyst | Requirements, user stories| Existing specs
Claude-Architect | System docs, dependencies | Tech stack refs
Claude-Dev | Code files, tests | API docs
Claude-PM | Timeline, risks | Resource allocation
Claude-PO | Backlog, priorities | Stakeholder feedback
Claude-QA | Test plans, criteria | Bug history
Claude-Editor | Document, terminology std | Style guide
Claude-Consolidator| All agent outputs | Original task
MINIMIZATION RULES
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
1. Include ONLY files mentioned in task
2. If file > 500 lines, extract relevant sections only
3. Summarize history instead of full transcripts
4. Use references ("see CLAUDE.md section X") for stable docs
5. Remove internal notes not relevant to sub-agent's task
6. Apply response verbosity by audience:
- Output goes to human ā lite compression (articles kept, no fragments)
- Output goes to agent/pipe ā full compression (fragments OK, no filler)
- Output goes to CI/machine ā ultra compression (abbreviate, arrows for causality)
Output format:
## Sub-Agent Context Package
### Agent Assignment
- **Agent**: {agent_type}
- **Task ID**: {generated_uuid}
- **Parent**: {parent_agent_id}
- **Depth**: {delegation_depth}
### Task Description
{Clear, actionable task description}
### Success Criteria
- [ ] {Specific criterion 1}
- [ ] {Specific criterion 2}
- [ ] {Specific criterion N}
### Constraints
- **Scope**: {what to do / what NOT to do}
- **Format**: {expected output format}
- **Time**: {deadline if any}
### Context Files
{List of files with brief description of why included}
### Anti-Loop Check
- Chain: {Orch ā ... ā current}
- Same agent type in chain: {yes/no}
- Task similarity to parent: {low/medium/high}
### Escalation Trigger
Return control to parent if:
- Task cannot be completed with given context
- Loop detected
- Clarification needed from user
Input:
/context-prep task="Analyze PROJ-550 for inclusion in MVP" agent_type="Claude-PO"
Output:
## Sub-Agent Context Package
### Agent Assignment
- **Agent**: Claude-PO
- **Task ID**: ctx-2026-01-06-001
- **Parent**: Claude-Orch-Prime
- **Depth**: 1
### Task Description
Analyze whether PROJ-550 (Precificacao/Pricing) should be included in the MVP scope.
Provide recommendation with justification based on value, effort, and dependencies.
### Success Criteria
- [ ] Clear recommendation: Include / Exclude / Merge
- [ ] Impact analysis on timeline
- [ ] Dependency mapping
- [ ] Risk assessment
### Constraints
- **Scope**: Only PROJ-550 decision, not re-planning entire roadmap
- **Format**: Structured recommendation with pros/cons
- **Time**: Single response
### Context Files
- `02_processed_data/roadmap_macro_2027Q3.csv` ā Timeline baseline
- `03_documents/analise_critica_recursiva_2027Q3.md` ā Previous analysis (section 8)
- `01_source_data/BacklogInicialOrgSales_ALFA.md` ā PROJ-550 description
### Anti-Loop Check
- Chain: Orch-Prime ā Claude-PO
- Same agent type in chain: No
- Task similarity to parent: Low (specific sub-task)
### Escalation Trigger
Return if:
- Missing business context for decision
- Conflicting requirements discovered
- Need stakeholder input
This skill is automatically invoked by Claude-Orch-Prime before any delegation. Sub-agents receiving a context package should:
/escalate if neededSkill created by Claude-Orch-Prime | 2026-01-06