with one click
scoping-context-for-subagents
// Use when decomposing a large codebase task for parallel subagent execution, before dispatching agents, when multiple agents will work on related code that shares types, interfaces, or conventions
// Use when decomposing a large codebase task for parallel subagent execution, before dispatching agents, when multiple agents will work on related code that shares types, interfaces, or conventions
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | scoping-context-for-subagents |
| description | Use when decomposing a large codebase task for parallel subagent execution, before dispatching agents, when multiple agents will work on related code that shares types, interfaces, or conventions |
Subagent output quality depends on what context you include AND exclude. Over-including causes attention dilution (each token gets less focus). Under-including causes inconsistent results across agents. This skill sits between planning and execution -- after you know WHAT to do, before you dispatch agents to do it.
REQUIRED: Use with superpowers:dispatching-parallel-agents for execution.
Skip when: Single-agent task, or units have zero shared concerns.
List all files/modules involved. Draw the dependency graph. Identify which units are independent (parallelizable) vs coupled (must be sequential or same agent).
The context core is the minimal shared knowledge every agent needs:
The context core must be concise. Aim for ~200 lines as a starting point. If larger, try to compress first (summarize, extract only signatures, condense). If you can justify every line as essential shared knowledge, exceeding 200 is fine -- the point is to force the question, not impose a hard cap. An unbounded "migration spec" dilutes attention in every agent that receives it.
digraph granularity {
"Files in scope share internal state?" [shape=diamond];
"Per-file" [shape=box];
"Tightly coupled group (2-5 files)?" [shape=diamond];
"Per-module" [shape=box];
"Per-feature" [shape=box];
"Files in scope share internal state?" -> "Per-file" [label="no"];
"Files in scope share internal state?" -> "Tightly coupled group (2-5 files)?" [label="yes"];
"Tightly coupled group (2-5 files)?" -> "Per-module" [label="yes"];
"Tightly coupled group (2-5 files)?" -> "Per-feature" [label="no, cross-cutting"];
}
State your reasoning. "Per-service because each service's 3 files are tightly coupled but services are independent" is correct. "Per-service because there are 6 services" is not.
For each work unit, define explicitly:
| Field | What to specify |
|---|---|
| READS | Context core + unit-specific files. List them by path. |
| WRITES | Only files within this unit. |
| EXCLUDES | Other units, unrelated code. Agents that CAN read everything WILL read everything. |
| Attention estimate | Core (~N lines) + unit (~M lines) = total. Flag if >2000 lines. |
List specific properties to verify across all completed units:
"Check for inconsistencies" is not a consistency check. Name the exact things to compare.
| Step | Key question | Output |
|---|---|---|
| Map scope | What's the dependency graph? | Independent vs coupled units |
| Context core | What does every agent need? | ~200 line shared reference |
| Granularity | Per-file, per-module, or per-feature? | Unit boundaries with reasoning |
| Scope units | What does THIS agent see? | READS/WRITES/EXCLUDES per unit |
| Ordering | What must happen first? | Sequential pre-work, parallel work, sequential review |
| Consistency | What EXACTLY to verify? | Named property checklist |
| Mistake | Why it fails | Fix |
|---|---|---|
| "Each agent gets the spec" (unbounded) | Spec becomes attention-diluting blob | The spec IS the context core. Size-bound it. |
| "Flag any inconsistencies" | Reviewer doesn't know what to look for | List specific properties by name |
| Scoping writes but not reads | Agents read everything available, diluting focus | Explicit EXCLUDES per unit |
| No attention estimate | 5000-line context → degraded output quality | Estimate lines per agent, split if >2000 |
| Chose granularity without reasoning | Wrong split causes incoherent results | State WHY: coupling, independence, coherence |
| Context core includes implementations | Agents don't need internals, just the API surface | Signatures and types only, not function bodies |