From metapowers
Implement a user story or feature by coordinating a coder and tester through design, implementation with TDD, multi-area code review, and PR creation. Use when the user wants to implement a story, feature, or task from beads.
How this skill is triggered — by the user, by Claude, or both
Slash command
/metapowers:implement-storyThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Implement the beads issue `$ARGUMENTS` by coordinating a coder and tester through design collaboration, TDD implementation, code review, and PR creation.
Implement the beads issue $ARGUMENTS by coordinating a coder and tester through design collaboration, TDD implementation, code review, and PR creation.
flowchart TB
bd_show["bd show issue"]
claimable{"Claimable?"}
error["Error: not claimable"]
gather["Phase 0\nGather Context\n(Explorer Agent)"]
subgraph phase1 ["Phase 1: Design Collaboration"]
design_setup["Create team, subtasks,\nbranch & worktree"]
design_agents["Launch Coder +\nTester Agents\n(parallel)"]
design_collab["Design Feedback Loop\nCoder ↔ Tester\nvia SendMessage"]
design_pr["Create Design PR"]
design_review{"User Reviews\nDesign PR"}
design_relay["PR Feedback Relay\nAgents read comments,\nfix & reply"]
design_setup --> design_agents
design_agents --> design_collab
design_collab --> design_pr
design_pr --> design_review
design_review -- "comments" --> design_relay
design_relay --> design_review
end
subgraph phase2 ["Phase 2: TDD Implementation"]
impl_setup["Shut down design agents,\nnew branch & worktree"]
impl_agents["Launch Coder +\nTester Agents\n(parallel, TDD)"]
impl_collab["Impl Coordination\nCoder ↔ Tester\nvia SendMessage"]
impl_setup --> impl_agents
impl_agents --> impl_collab
end
code_review["Phase 3: Code Review\n3 Review Agents\n(parallel)"]
has_fixes{"MUST FIX\nissues?"}
fix_cycle["Phase 4: Fix Cycle\nDispatch fixes to\nCoder + Tester"]
impl_pr["Phase 5\nCreate Impl PR"]
impl_review{"User Reviews\nImpl PR"}
impl_relay["PR Feedback Relay\nAgents read comments,\nfix & reply"]
resolution["Phase 6: Resolution\nClose subtasks"]
cleanup["Phase 7: Cleanup\nShut down agents,\ndelete team & worktrees"]
bd_show --> claimable
claimable -- "no" --> error
claimable -- "yes" --> gather
gather --> phase1
phase1 -- "approved\n& merged" --> phase2
impl_collab --> code_review
code_review --> has_fixes
has_fixes -- "yes" --> fix_cycle
fix_cycle -- "re-review" --> code_review
has_fixes -- "no" --> impl_pr
impl_pr --> impl_review
impl_review -- "comments" --> impl_relay
impl_relay --> impl_review
impl_review -- "approved\n& merged" --> resolution
resolution --> cleanup
Run bd show $ARGUMENTS and verify the following before proceeding. If any requirement is not met, report the corresponding error (see Common Issues) and stop.
open, backlog, or todo). If the issue is already in_progress, done, closed, or otherwise not claimable, report an error.Invoke the gather-context skill in a separate Explore agent using the Agent tool:
Agent(
description: "Gather context for $ARGUMENTS",
prompt: "/gather-context $ARGUMENTS",
subagent_type: "Explore"
)
This runs in a separate Explore agent context and stores a <task_context> brief in the beads issue notes.
Confirm the agent reports that context was stored in the issue before proceeding to Phase 1.
Create a team via TeamCreate.
Create beads subtasks and link them as children of $ARGUMENTS:
bd create --title="Design: Implementation plan for <story>" --description="<details>" --type=task --priority=1
bd dep add <impl-plan-id> $ARGUMENTS --type=parent-child
bd create --title="Design: Test plan for <story>" --description="<details>" --type=task --priority=1
bd dep add <test-plan-id> $ARGUMENTS --type=parent-child
bd create --title="Design: PR for review" --description="Gate design completion on PR approval" --type=task --priority=1
bd dep add <pr-id> $ARGUMENTS --type=parent-child
bd dep add <pr-id> <impl-plan-id> --type=blocks
bd dep add <pr-id> <test-plan-id> --type=blocks
Create a design branch and worktree:
git worktree add /tmp/<story>-design -b <story>/design
cd /tmp/<story>-design && pnpm install
Launch two agents in parallel (subagent_type: "general-purpose", mode: "bypassPermissions", run_in_background: true). Both work in the same worktree since they're writing separate design docs (no conflict risk).
Do NOT shut down the design agents until the design PR has been approved and merged. They must remain available to address PR feedback from the user.
Coder Agent — writes the implementation design:
The coder's prompt MUST instruct them to:
/tmp/<story>-design.specs/<story>/implementation-design.md) covering:
Tester Agent — writes the test plan:
The tester's prompt MUST instruct them to:
/tmp/<story>-design.specs/<story>/test-plan.md) covering:
The agents should exchange feedback via SendMessage:
Once both design docs are committed:
PAUSE HERE. Notify the user that the design PR is ready for review. Wait for:
When the user leaves comments on the design PR, re-launch the coder and tester agents (if not still running) and instruct each to:
gh pr view <pr-number> --comments to read all comments on the PR. Understand what the reviewer is asking for.gh pr comment <pr-number> --body "<response>" to reply on the PR with their resolution. Each agent MUST identify themselves in their reply (e.g., "[Coder Agent] Fixed the approach section to..." or "[Tester Agent] Updated the test plan to...") so the reviewer knows which agent addressed which feedback.After both agents have addressed all comments, notify the user that the PR has been updated and is ready for re-review.
Create beads subtasks and link them as children of $ARGUMENTS:
bd create --title="Implement: <story>" --description="<details, reference design doc>" --type=task --priority=1
bd dep add <impl-id> $ARGUMENTS --type=parent-child
bd create --title="Test: <story>" --description="<details, reference test plan>" --type=task --priority=1
bd dep add <test-id> $ARGUMENTS --type=parent-child
After the design PR is merged, shut down the design agents (they are no longer needed), clean up the design worktree, and create a new implementation branch from main:
git worktree remove /tmp/<story>-design
git pull origin main
git worktree add /tmp/<story>-impl -b <story>/impl
cd /tmp/<story>-impl && pnpm install
Launch two agents in parallel. Both work in the same worktree — coordinate via SendMessage to avoid file conflicts.
Coder Agent — implements with TDD discipline:
The coder's prompt MUST instruct them to:
/tmp/<story>-impltsc --noEmit periodicallyTester Agent — develops integration and e2e tests:
The tester's prompt MUST instruct them to:
/tmp/<story>-implThe coder and tester coordinate via SendMessage:
Launch review agents in parallel for the implementation. Use subagent_type: "feature-dev:code-reviewer" with run_in_background: true.
Group the 7 review areas into 3 focused agents:
Area 1 — Coding Style:
any, good generics use)Area 5 — Debugging Cruft:
console.log not part of intentional outputArea 6 — Consistent Formatting:
Area 2 — Efficiency and Algorithm Appropriateness:
Area 4 — Robust Error Handling:
Area 3 — Error/Warning Cleanup:
tsc --noEmit and report errors@ts-ignore, @ts-expect-error, as anyArea 7 — Functional Test Coverage:
Each reviewer rates issues as:
Only MUST FIX items are reported (with file:line citations).
CRITICAL: Review Agent 3 MUST execute the test suite and include the output. Test failures are MUST FIX items that get sent back to the implementation agents.
cd /tmp/<worktree> && git push -u origin <branch>gh pr create including:
PAUSE HERE. Wait for user approval. If the user leaves PR comments, use the PR Feedback Relay process below.
When the user leaves comments on the implementation PR, re-launch the coder and tester agents (if not still running) and instruct each to:
gh pr view <pr-number> --comments to read all comments on the PR. Understand what the reviewer is asking for.gh pr comment <pr-number> --body "<response>" to reply on the PR with their resolution. Each agent MUST identify themselves in their reply (e.g., "[Coder Agent] Refactored the handler to..." or "[Tester Agent] Added missing edge case test for...") so the reviewer knows which agent addressed which feedback.After both agents have addressed all comments, notify the user that the PR has been updated and is ready for re-review.
Once the user approves and merges the PR:
git worktree remove /tmp/<story>-design and git worktree remove /tmp/<story>-implgit status shows clean, up to date with origin.bd) for task tracking — never markdown TODOs or TaskCreateisolation: "worktree"isActive flags in team config if TeamDelete failsIssue not claimable — If the issue status is in_progress, done, closed, or any other non-claimable state, report:
Error: Issue
$ARGUMENTShas status<status>and cannot be claimed. Only issues with a claimable status (e.g.,open,backlog,todo) can be implemented.
Do not proceed with the workflow.
npx claudepluginhub galexy/metapowers --plugin metapowersGenerates structured GitHub issues with TDD plans, acceptance criteria, and agent instructions for autonomous PR lifecycle management.
Initiates tasks by interviewing user for requirements, setting up git-wt worktrees or branches, checking tools like direnv/dotenvx, and creating plans for review.