/xpowers:subagent-driven-developmentfrom xpowers
Defines a stateless dispatch protocol for orchestrating complex tasks via fresh subagents, preventing context drift. Use for multi-task epics or when token exhaustion is detected.
Ships in xpowers. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
<skill_overview> Stateless dispatch prevents context drift and hallucination by isolating each task execution in a fresh subagent with zero history. This ensures that every task is implemented against the immutable requirements of the epic and the specific design of the task, rather than being influenced by the accumulation of previous turns or unrelated context. This protocol is the standard for autonomous execution in XPowers. </skill_overview>
<rigidity_level> STRICT - Follow the 5-step verification process exactly. Never skip SHA drift checks for implementation tasks. </rigidity_level>
<quick_reference>
| Step | Action | Deliverable |
|---|---|---|
| 1 | Load Context | tm show [epic-id] + tm show [task-id] |
| 2 | Record State | PRE_SHA=$(git rev-parse HEAD) |
| 3 | Dispatch | invoke_agent with Stateless Handoff |
| 4 | Verify | SHA change (git) + Status check (tm) |
| 5 | Soft Gate | Remediation prompt if no-drift on feature task |
Verification: tm show [task-id] --json status == 'closed' + git rev-parse HEAD drift.
</quick_reference>
<when_to_use>
<the_process>
The orchestrator must first load the source of truth for the entire epic and the specific task.
tm show [epic-id] and capture the "DESIGN" section (Requirements).tm show [task-id] and capture the "DESIGN" section (Task Specification).PRE_SHA=$(git rev-parse HEAD).Construct a prompt that provides the subagent with everything it needs to work in isolation.
Role: Senior Implementation Engineer. Context: You are working in a fresh, stateless environment. Your goal is to implement bd-[N] in the project root. Project Root: [root path]
Immutable Epic Requirements: <epic_contract> [Insert requirements from tm show epic-id] </epic_contract>
Epic Summary (Current Progress): <epic_summary> [Insert summary of completed/remaining tasks] </epic_summary>
Task Specification (bd-[N]): <task_spec> [Insert design from tm show task-id] </task_spec>
Mandatory Workflow (RED-GREEN-REFACTOR):
sre-task-refinement on the task design BEFORE implementation. Write a failing test.test-runner for all verifications.Completion:
test-runner.git add [relevant files] && git commit -m 'Complete bd-[N]: [Task Title]'tm close bd-[N]Run the subagent using the constructed prompt:
invoke_agent(agent_name='generalist', prompt='[Constructed Prompt]')
After the subagent returns, the orchestrator MUST perform independent verification:
POST_SHA=$(git rev-parse HEAD)
JSON_OUTPUT=$(tm show [task-id] --json)
STATUS=$(echo "$JSON_OUTPUT" | jq -r .status 2>/dev/null)
TASK_TYPE=$(echo "$JSON_OUTPUT" | jq -r .type 2>/dev/null)
if [ "$STATUS" != "closed" ]; then
if [ "$POST_SHA" != "$PRE_SHA" ]; then
echo "TURN LIMIT HIT: Subagent made commits but didn't close task. Resume."
else
echo "FAILURE: Task not closed and no changes detected."
fi
exit 1
fi
if [ "$PRE_SHA" == "$POST_SHA" ] && [[ "$TASK_TYPE" =~ ^(feature|bug|task|chore)$ ]]; then
echo "SOFT GATE TRIGGERED: Hallucinated completion detected."
# Trigger Soft Gate Remediation Prompt:
# "Warning: Task marked 'closed' but no Git SHA drift detected. Did you forget to commit? If this was a no-op, please confirm. Otherwise, re-verify and commit."
fi
Once verified, trigger review:
mcp_agents_agent_autonomous_reviewer()
</the_process>
Orchestrator: Record PRE_SHA=a1b2c3d
Orchestrator: Dispatch subagent for feature bd-2.
Subagent: [TDD logic + Commit + Close]
Orchestrator: POST_SHA=e5f6g7h (DRIFT DETECTED)
Orchestrator: STATUS=closed (SUCCESS)
<critical_rules>
<verification_checklist>
<verification_logic>
# Before Dispatch
PRE_SHA=$(git rev-parse HEAD)
# After Dispatch
# 1. Status Check (Priority)
JSON_OUTPUT=$(tm show [task-id] --json)
STATUS=$(echo "$JSON_OUTPUT" | jq -r .status 2>/dev/null)
TASK_TYPE=$(echo "$JSON_OUTPUT" | jq -r .type 2>/dev/null)
if [ "$STATUS" != "closed" ]; then
echo "FAILURE: Task status is '$STATUS', expected 'closed'."
exit 1
fi
# 2. SHA Check (Enforce Drift for Implementation Tasks)
POST_SHA=$(git rev-parse HEAD)
if [ "$PRE_SHA" == "$POST_SHA" ]; then
if [[ "$TASK_TYPE" =~ ^(feature|bug|task|chore)$ ]]; then
echo "FAILURE: SHA drift not detected for implementation task type '$TASK_TYPE'."
exit 1
fi
# Else: Analytical Tasks: Accept success even if POST_SHA == PRE_SHA
fi
</verification_logic>
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub dpolishuk/xpowers --plugin xpowers27 skills in this plugin
/analyzing-test-effectivenessUse to audit test quality with Google Fellow SRE scrutiny - identifies tautological tests, coverage gaming, weak assertions, missing corner cases. Creates bd epic with tasks for improvements, then runs SRE task refinement on each./brainstormingUse when creating or developing anything, before writing code - refines rough ideas into bd epics with immutable requirements/building-hooksUse when creating Claude Code hooks - covers hook patterns, composition, testing, progressive enhancement from simple to advanced/debugging-with-toolsUse when encountering bugs or test failures - systematic debugging using debuggers, internet research, and agents to find root cause before fixing/dispatching-parallel-agentsUse when facing 3+ independent failures that can be investigated without shared state or dependencies - dispatches multiple Claude agents to investigate and fix independent problems concurrently/execute-ralphExecute entire bd epic autonomously via subagent-per-task dispatch loop. Setup, dispatch subagent per task, end-of-epic review, branch completion.Other plugins' skills for the same job