subagent-execution
Skill0 starsChanged 4 months agoMITView on GitHub
Use when executing an approved implementation plan by dispatching work to subagents. Enforces context isolation, two-stage review per task, and a formal status protocol. Load before orchestrating multi-task plans across subagents. DO NOT USE FOR: deciding whether to delegate (use task-routing), creating the plan itself (use concise-planning), single-task execution you can handle directly, or code review (use guardian).
2 other projects use a version of this.
Adopted by
Most recently taken up by
- mahsumaktas/agent-evolution-kittheir own version, first seen Nov 8, 2026
- cill-i-am/skillstheir own version, first seen Oct 20, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- mahsumaktas/agent-evolution-kit★ 2same name
- cill-i-am/skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository29 other files it gives its agents.
- architectSkill
- brainstormingSkill
- concise-planningSkill
- context-engineerSkill
- data-analystSkill
- data-deprecation-analysisSkill
- data-engineeringSkill
- analystSkill
- detectiveSkill
- editorSkill
- inspectorSkill
- data-narrativeSkill
- data-scienceSkill
- excalidraw-diagramSkill
- genai-securitySkill
- guardianSkill
- holdout-validationSkill
- implementerSkill
- llm-app-patternsSkill
- llm-memSkill
- opsSkill
- prompt-librarySkill
- security-boundariesSkill
- story-masterSkill
- story-plannerSkill
- systematic-debuggingSkill
- task-routingSkill
- thinkerSkill
- verification-before-completionSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 11 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 29
Every subagent delegation must explicitly choose one of two context modes.
- Distinctive: line 30
Never leave this implicit.
- Distinctive: line 66
Default ("this is how we've always done it")
- Distinctive: line 70
When constructing any subagent dispatch, include the context mode explicitly:
- Distinctive: line 90
Every subagent must return exactly one of these statuses:
- Distinctive: line 121
Before dispatching any subagent:
- Very specific: line 124
Verify the plan passes the No Placeholders check (see concise-planning skill).
- Very specific: line 130
NEEDS_CONTEXT rule: If a subagent returns NEEDS_CONTEXT: (1) identify the missing information, (2) re-dispatch once with that information …
- Very specific: line 142
After each subagent returns DONE or DONE_WITH_CONCERNS, run two sequential review stages before accepting the output:
- Distinctive: line 148
Gate: If any spec item is NOT DONE, or if any spec item was modified in a way that changes its external interface, return value, or …
- Distinctive: line 149
If scope audit passes, proceed to Stage 2.
- Distinctive: line 155
If quality review passes, accept the output and mark the task complete.
- Distinctive: line 161
After all tasks are complete:
- Very specific: line 165
If any BLOCKED tasks remain unresolved, surface them explicitly before handing off to release-manager.
- Distinctive: line 203
Primary Output: All plan tasks completed with two-stage review evidence
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Subagent Execution Skill
Version: 9.0 | Updated: 01-July-2026 | Architect: Karim Bhalwani | Deps: task-routing, guardian, verification-before-completion
Dependencies
Load the following via read_file before using this skill.
~/.copilot/skills/task-routing/SKILL.md- verify tasks are appropriate for subagent delegation before dispatching~/.copilot/skills/guardian/SKILL.md- spec compliance and quality review procedures~/.copilot/skills/verification-before-completion/SKILL.md★ - completion gate before declaring all tasks done
Context Mode: Fresh vs Inherited
Every subagent delegation must explicitly choose one of two context modes. Never leave this implicit; the choice has a direct, large impact on token cost and correctness.
Fresh Context (default - use this unless inherited is explicitly justified)
The subagent starts with a clean context window. It receives ONLY:
- The task description (what to do, what files to touch, scope in/out)
- Relevant file paths (what it may read and modify)
- Explicit acceptance criteria (what DONE looks like)
- Required output format (
DONE/DONE_WITH_CONCERNS/NEEDS_CONTEXT/BLOCKED)
Use fresh context for:
- Independent tasks that can be fully specified without session history
- Parallel branches (two subagents working different files simultaneously)
- Specialist tasks (Debug Detective investigating a single error)
- Any task where the subagent does not need to know what was tried before
Token impact: Fresh context costs only the task packet (~500-2K tokens input). Inheriting a 40K-token parent session costs 40K tokens input per child. At 3 children, that is 120K tokens vs 6K tokens for the same work.
Inherited Context (use sparingly, with explicit justification)
The subagent receives the full accumulated parent session history.
Use inherited context only when:
- The subagent is a direct continuation (e.g., Guardian reviewing code written 2 steps ago)
- The subagent needs to understand WHAT WAS ALREADY TRIED to avoid repeating it
- The task cannot be meaningfully specified without the session history
Inherited context is NOT justified by:
- Convenience ("easier to just pass everything")
- Uncertainty ("not sure what it needs, give it everything")
- Default ("this is how we've always done it")
Dispatch Template
When constructing any subagent dispatch, include the context mode explicitly:
CONTEXT MODE: fresh | inherited
TASK: [one sentence]
FILES TO READ: [list of relative paths]
FILES TO MODIFY: [list of relative paths]
SCOPE IN: [what to do]
SCOPE OUT: [what NOT to do]
ACCEPTANCE CRITERIA:
- [criterion 1]
- [criterion 2]
OUTPUT FORMAT: DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED
OUTPUT PATH: [where to write the result, if any]Subagent Status Protocol
Every subagent must return exactly one of these statuses:
| Status | Meaning | Orchestrator Action |
DONE | Task complete, tests pass, ready for review | Proceed to two-stage review |
DONE_WITH_CONCERNS | Complete but flagged issues exist | Proceed to review; concerns included in review input |
NEEDS_CONTEXT | Blocked by missing information or clarification | See NEEDS_CONTEXT rule in Workflow Step 3 |
BLOCKED | Cannot proceed due to architectural conflict or missing capability | Escalate to architect; do not re-dispatch without resolution |
Never re-dispatch a BLOCKED task with only a prompt change. BLOCKED means the task requires structural resolution, not more context.
DONE_WITH_CONCERNS + critical overlap rule: If a DONE_WITH_CONCERNS subagent report flags a concern that overlaps with a Critical finding in Stage 2 review, the combined signal is a blocking rejection. Re-dispatch with a correction brief addressing both the concern and the critical finding. Do not accept output when the same issue is flagged by both the subagent and Guardian.
Failure Taxonomy
| Failure Mode | Symptom | Immediate Recovery |
context_pollution | Subagent asks about topics from parent session it should not know | Re-dispatch with fresh context only. Parent context was leaked. |
blocked_redispatch | Same task re-dispatched with only a prompt change after BLOCKED | STOP. BLOCKED requires structural resolution, not more context. Escalate to architect. |
missing_acceptance_criteria | Subagent returns DONE but output cannot be verified | The dispatch was malformed. Redispatch with explicit acceptance criteria. |
artifact_path_unknown | Subagent produced output but orchestrator cannot find it | Require designated output paths in every dispatch. Never accept implicit output locations. |
needs_context_loop | Same subagent returns NEEDS_CONTEXT more than once for the same gap | The gap is structural, not informational. Escalate to architect. |
Workflow
Step 1: Pre-Execution Verification
Before dispatching any subagent:
- Load the approved plan (from
concise-planningorarchitectspec). - Verify the plan passes the No Placeholders check (see
concise-planningskill). If any step is vague, resolve it before dispatching. - Classify each task using the task-routing 6-check protocol. Confirm each task is appropriate for subagent execution.
- Identify which tasks are
[SEQ](sequential) and which are[PAR](parallel). Parallel tasks can be dispatched concurrently viarunSubagent.
Parallel failure rule: If any branch in a parallel batch returns BLOCKED, do not cancel already-running branches, but do not dispatch any further parallel batches until the BLOCKED task is escalated and resolved. If a parallel branch returns NEEDS_CONTEXT, re-dispatch that branch independently; other branches continue unaffected.
NEEDS_CONTEXT rule: If a subagent returns NEEDS_CONTEXT: (1) identify the missing information, (2) re-dispatch once with that information added to the context package. If the same subagent returns NEEDS_CONTEXT a second time for the same gap, stop - escalate to architect; the gap is structural.
Step 2: Dispatch
For each task (or batch of parallel tasks):
- Construct the subagent context package (spec section + file paths + acceptance criteria). Keep it minimal - only what the subagent needs.
- Dispatch via
runSubagentwith the appropriate agent (senior-developer,data-engineer,ai-engineer, etc.). - Record the dispatch: task ID, agent used, timestamp, context provided.
Step 3: Two-Stage Review (Per Task)
After each subagent returns DONE or DONE_WITH_CONCERNS, run two sequential review stages before accepting the output:
Stage 1 - Spec Compliance Review (did the subagent do the right thing?)
- Dispatch
guardianwith the task spec and the subagent's output. - Guardian produces a Scope Audit table: DONE / PARTIAL / NOT DONE / SCOPE CREEP for each spec item.
- Gate: If any spec item is NOT DONE, or if any spec item was modified in a way that changes its external interface, return value, or specified behavior, reject the output and re-dispatch to the implementer with a correction brief.
- If scope audit passes, proceed to Stage 2.
Stage 2 - Code Quality Review (did the subagent do it well?)
- Dispatch
guardianwith Phase 1 (Critical) and Phase 2 (Informational) review. - Gate: Critical findings (e.g., security vulnerabilities, data-loss bugs, broken tests, or violations of project coding standards) block acceptance. Informational findings (e.g., style suggestions, minor inefficiencies, non-blocking improvements) are logged and deferred.
- If quality review passes, accept the output and mark the task complete.
Why two stages? Reviewing code quality before confirming spec compliance wastes effort - you may be reviewing code that doesn't meet requirements at all. Spec first, quality second.
Step 4: Completion
After all tasks are complete:
- Load
verification-before-completionand complete the evidence gate. - Summarize: tasks completed, reviews passed, concerns deferred.
- If any BLOCKED tasks remain unresolved, surface them explicitly before handing off to
release-manager.
Example Dispatch Context Package
## Task: Add rate limiting to POST /api/checkout
**Spec section**: See `.copilot/specs/checkout-spec.md` Section 3.2 Rate Limiting
**Files to modify**: `src/api/checkout.py`, `tests/test_checkout.py`
**Files to read (context only)**: `src/middleware/rate_limiter.py`, `pyproject.toml`
**Acceptance criteria**:
- POST /api/checkout returns 429 after 10 requests in 60 seconds from the same IP
- 429 response includes `Retry-After` header
- Unit test covers rate limit threshold and reset behavior
- No changes to the checkout business logic
**Output required**: Return status (DONE / DONE_WITH_CONCERNS / NEEDS_CONTEXT / BLOCKED) + PR-ready diffAnti-Patterns to Avoid
| Anti-Pattern | Why | Correct Approach |
| Forwarding full session history to subagent | Context pollution; subagent reasons about your history not their task | Compile a focused context package |
| Skipping Stage 1 (spec compliance) to save tokens | Reviewing quality before confirming requirements wastes review effort | Stage 1 always runs first |
| Re-dispatching BLOCKED with only a prompt change | BLOCKED signals structural conflict, not missing info | Escalate to architect |
| Running Stage 1 and Stage 2 in the same Guardian call | Two stages serve different purposes; combined calls conflate them | Separate dispatches |
| Dispatching sequential tasks in parallel | Splits reasoning chain; errors compound | Respect [SEQ] / [PAR] classification |
Outputs & Deliverables
- Primary Output: All plan tasks completed with two-stage review evidence
- Secondary Output: Review artifacts persisted to
.copilot/artifacts/ - Quality Gate:
verification-before-completionpassed; no unresolved BLOCKED tasks
Definition of Done
- All tasks in the plan have status DONE or DONE_WITH_CONCERNS
- Every DONE task passed two-stage review (spec compliance + quality)
- All DONE_WITH_CONCERNS items are documented and acknowledged
- No unresolved BLOCKED items remain
verification-before-completiongate passed
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

