From nbl.superpowers
Executes implementation plans by dispatching fresh subagents for independent tasks in the current session, with git worktree isolation and two-stage self-reviews per task plus global review.
npx claudepluginhub icefrag/nbl-superpowers --plugin nbl.superpowersThis skill uses the workspace's default tool permissions.
Execute plan by dispatching fresh subagent per task. Each implementer performs built-in two-stage self-review (spec compliance + code quality) before reporting done. After all tasks complete, perform global two-stage review on all merged code.
Executes implementation plans by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality. Use in current session without pausing between tasks.
Executes implementation plans by dispatching fresh subagents for independent tasks in the current session, with two-stage reviews: spec compliance then code quality.
Executes implementation plans by analyzing dependencies, grouping tasks by level, and dispatching parallel subagents in isolated git worktrees with TDD and reviews.
Share bugs, ideas, or general feedback.
Execute plan by dispatching fresh subagent per task. Each implementer performs built-in two-stage self-review (spec compliance + code quality) before reporting done. After all tasks complete, perform global two-stage review on all merged code.
Why subagents: You delegate tasks to specialized agents with isolated context. By precisely crafting their instructions and context, you ensure they stay focused and succeed at their task. They should never inherit your session's context or history — you construct exactly what they need. This also preserves your own context for coordination work.
Core principle: Fresh subagent per task with built-in two-stage self-review + global review after all tasks = high quality, fast iteration
digraph when_to_use {
"Have implementation plan?" [shape=diamond];
"Tasks mostly independent?" [shape=diamond];
"Stay in this session?" [shape=diamond];
"subagent-driven-development" [shape=box];
"executing-plans" [shape=box];
"Manual execution or brainstorm first" [shape=box];
"Have implementation plan?" -> "Tasks mostly independent?" [label="yes"];
"Have implementation plan?" -> "Manual execution or brainstorm first" [label="no"];
"Tasks mostly independent?" -> "Stay in this session?" [label="yes"];
"Tasks mostly independent?" -> "Manual execution or brainstorm first" [label="no - tightly coupled"];
"Stay in this session?" -> "subagent-driven-development" [label="yes"];
"Stay in this session?" -> "executing-plans" [label="no - parallel session"];
}
vs. Executing Plans (parallel session):
Before any task execution, these gates MUST pass:
GATE 1: Git Worktree Isolation
<NON_NEGOTIABLE>
CRITICAL RULE:
If you are in the primary working tree (
.gitis a directory), regardless of whether you are onmain/masteror already on a development branch, you MUST invokenbl.using-git-worktreesto create an isolated sub-worktree before dispatching any implementer. NO EXCEPTIONS.
Primary working tree is for branch management only. ALL implementation tasks run in isolated sub-worktrees. Never implement directly in primary worktree.
</NON_NEGOTIABLE>
"Error: nbl.subagent-driven-development requires a Git repository. Please run
git initto initialize a repository, then retry."
Typical Usage Pattern (our convention):
User ALWAYS starts Claude Code in the main working tree (primary worktree). The skill creates the isolated worktree, user doesn't manually cd into worktrees to start Claude Code.
FULL Check Process (execute step-by-step, NO shortcuts):
STEP 1: Pre-check - Is this a Git repository?
Execute: git rev-parse --is-inside-work-tree
If NO → STOP, prompt user to initialize Git
If YES → continue to STEP 2
STEP 2: Check if already inside an added worktree:
If .git is a file → INSIDE_ADDED_WORKTREE = YES
If .git is a directory → INSIDE_ADDED_WORKTREE = NO
STEP 3: If INSIDE_ADDED_WORKTREE = YES:
→ GATE 1 PASSED → proceed directly to GATE 2
→ STOP HERE, do NOT create another worktree
STEP 4: If INSIDE_ADDED_WORKTREE = NO (in primary working tree):
Get current branch: CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
If CURRENT_BRANCH is "main" or "master":
1. Auto-create development branch from plan name
2. Checkout new development branch in primary working tree
// CRITICAL: This step executes for BOTH main/master AND development branches!
INVOKE: `/nbl.superpowers:nbl.using-git-worktrees create <base-name-from-plan>-work --parent feature/<base-name-from-plan>`
// After invocation, you will be inside the newly created worktree
→ GATE 1 PASSED → proceed to GATE 2
MUST create isolated worktree before starting implementation, NO exceptions.
GATE 2: Test-Driven Development
GATE 3: Built-In Two-Stage Self-Review
These gates are NON-NEGOTIABLE. Skip them only if user explicitly overrides.
digraph process {
rankdir=TB;
"Read plan, extract all tasks with full text, note context, create TodoWrite" [shape=box];
"Pre-Check: Is git repository?" [shape=diamond style=filled fillcolor=yellow];
"STOP: Not a git repository" [shape=box style=filled fillcolor=red];
"STEP 2: .git is file or directory?" [shape=diamond style=filled fillcolor=yellow];
"On main/master branch?" [shape=diamond style=filled fillcolor=yellow];
"Auto-create dev branch from plan name" [shape=box];
"INVOKE nbl.using-git-worktrees (MANDATORY)" [shape=box style=filled fillcolor=lightblue];
"In sub-worktree → GATE 1 PASSED" [shape=box style=filled fillcolor=lightgreen];
"GATE 2: TDD mode enabled?" [shape=diamond style=filled fillcolor=yellow];
"More tasks remain?" [shape=diamond];
"Dispatch implementer subagent (with built-in two-stage review)" [shape=box];
"Implementer asks questions?" [shape=diamond];
"Answer questions, provide context" [shape=box];
"Implementer: implement → spec self-check → fix → quality self-check → fix → DONE" [shape=box];
"Mark task complete (TodoWrite + Plan file)" [shape=box];
"Global Stage 1: Spec review (all merged changes)" [shape=box];
"Spec review passes?" [shape=diamond];
"Dispatch fix agent for spec issues" [shape=box];
"Global Stage 2: Code quality review (all merged changes)" [shape=box];
"Quality review passes?" [shape=diamond];
"Dispatch fix agent for quality issues" [shape=box];
"Use nbl.finishing-a-development-branch" [shape=box style=filled fillcolor=lightgreen];
"Read plan, extract all tasks with full text, note context, create TodoWrite" -> "Pre-Check: Is git repository?";
"Pre-Check: Is git repository?" -> "STOP: Not a git repository" [label="no"];
"Pre-Check: Is git repository?" -> "STEP 2: .git is file or directory?" [label="yes"];
"STEP 2: .git is file or directory?" -> "In sub-worktree → GATE 1 PASSED" [label=".git is FILE (already in worktree)"];
"STEP 2: .git is file or directory?" -> "On main/master branch?" [label=".git is DIR (in primary worktree)"];
"On main/master branch?" -> "Auto-create dev branch from plan name" [label="yes → create branch, then MANDATORY invoke"];
"On main/master branch?" -> "INVOKE nbl.using-git-worktrees (MANDATORY)" [label="no → MANDATORY invoke"];
"Auto-create dev branch from plan name" -> "INVOKE nbl.using-git-worktrees (MANDATORY)";
"INVOKE nbl.using-git-worktrees (MANDATORY)" -> "In sub-worktree → GATE 1 PASSED";
"In sub-worktree → GATE 1 PASSED" -> "GATE 2: TDD mode enabled?";
"GATE 2: TDD mode enabled?" -> "More tasks remain?" [label="yes"];
"More tasks remain?" -> "Dispatch implementer subagent (with built-in two-stage review)" [label="yes"];
"Dispatch implementer subagent (with built-in two-stage review)" -> "Implementer asks questions?";
"Implementer asks questions?" -> "Answer questions, provide context" [label="yes"];
"Answer questions, provide context" -> "Dispatch implementer subagent (with built-in two-stage review)";
"Implementer asks questions?" -> "Implementer: implement → spec self-check → fix → quality self-check → fix → DONE" [label="no"];
"Implementer: implement → spec self-check → fix → quality self-check → fix → DONE" -> "Mark task complete (TodoWrite + Plan file)";
"Mark task complete (TodoWrite + Plan file)" -> "More tasks remain?";
"More tasks remain?" -> "Global Stage 1: Spec review (all merged changes)" [label="no"];
"Global Stage 1: Spec review (all merged changes)" -> "Spec review passes?";
"Spec review passes?" -> "Dispatch fix agent for spec issues" [label="no"];
"Dispatch fix agent for spec issues" -> "Global Stage 1: Spec review (all merged changes)";
"Spec review passes?" -> "Global Stage 2: Code quality review (all merged changes)" [label="yes"];
"Global Stage 2: Code quality review (all merged changes)" -> "Quality review passes?";
"Quality review passes?" -> "Dispatch fix agent for quality issues" [label="no"];
"Dispatch fix agent for quality issues" -> "Global Stage 1: Spec review (all merged changes)";
"Quality review passes?" -> "Use nbl.finishing-a-development-branch" [label="yes"];
}
After both reviews pass:
All implementation is complete in the isolated worktree. Enter nbl.finishing-a-development-branch to handle merge and cleanup.
Use the least powerful model that can handle each role to conserve cost and increase speed.
Mechanical implementation tasks (isolated functions, clear specs, 1-2 files): use a fast, cheap model. Most implementation tasks are mechanical when the plan is well-specified.
Integration and judgment tasks (multi-file coordination, pattern matching, debugging): use a standard model.
Architecture, design, and review tasks: use the most capable available model.
Task complexity signals:
Implementer subagents report one of four statuses. Handle each appropriately:
DONE: Implementer completed the work and passed built-in two-stage self-review with all issues fixed. Mark task complete in both TodoWrite and the plan file (update the checkbox from [ ] to [x]), then proceed to next task.
DONE_WITH_CONCERNS: The implementer completed the work but flagged doubts. Read the concerns before proceeding. If the concerns are about correctness or scope, address them before moving on. If they're observations (e.g., "this file is getting large"), note them and mark task complete in both TodoWrite and the plan file.
NEEDS_CONTEXT: The implementer needs information that wasn't provided. Provide the missing context and re-dispatch.
BLOCKED: The implementer cannot complete the task. Assess the blocker:
Never ignore an escalation or force the same model to retry without changes. If the implementer said it's stuck, something needs to change.
./implementer-prompt.md - Dispatch implementer subagent./spec-reviewer-prompt.md - Dispatch spec compliance reviewer subagent./code-quality-reviewer-prompt.md - Dispatch code quality reviewer subagentYou: I'm using Subagent-Driven Development to execute this plan.
[Read plan file once: docs/nbl/plans/feature-plan.md]
[Extract all 5 tasks with full text and context]
[Create TodoWrite with all tasks]
Task 1: Hook installation script
[Get Task 1 text and context (already extracted)]
[Dispatch implementation subagent with full task text + context]
Implementer: "Before I begin - should the hook be installed at user or system level?"
You: "User level (~/.config/nbl/hooks/)"
Implementer: "Got it. Implementing now..."
[Later] Implementer:
- Implemented install-hook command
- Added tests, 5/5 passing
- **Built-in Two-Stage Review Results:**
- Stage 1 (Spec Compliance): PASSED
- Stage 2 (Code Quality): PASSED
- Committed
[Mark Task 1 complete in TodoWrite, mark all statuses complete in plan file]
Task 2: Recovery modes
[Get Task 2 text and context (already extracted)]
[Dispatch implementation subagent with full task text + context]
Implementer: [No questions, proceeds]
Implementer:
- Added verify/repair modes
- 8/8 tests passing
- **Built-in Two-Stage Review Results:**
- Stage 1 (Spec Compliance): FIXED - Missing progress reporting, extra --json flag
- Stage 2 (Code Quality): FIXED - Extracted magic number 100 to PROGRESS_INTERVAL constant
- Committed
[Mark Task 2 complete in TodoWrite, mark all statuses complete in plan file]
...
[After all tasks complete]
[Get BASE_SHA and HEAD_SHA]
[Dispatch global spec reviewer on all changes]
Spec reviewer: ✅ All changes spec compliant
[Dispatch global code quality reviewer on all changes]
Code reviewer: ✅ All changes meet quality standards
[Invoke nbl.finishing-a-development-branch]
Done!
vs. Manual execution:
vs. Executing Plans:
Efficiency gains:
Quality gates:
Efficiency:
Never (NON-NEGOTIABLE):
Never:
If subagent asks questions:
If global reviewer finds issues after all tasks complete:
NON-NEGOTIABLE Requirements:
Supporting skills:
Prompt templates:
./implementer-prompt.md - Implementer with built-in two-stage self-review./spec-reviewer-prompt.md - For final global spec compliance review./code-quality-reviewer-prompt.md - For final global code quality reviewAlternative workflow: