From power-trio
Execute the Power Trio build phase only. Use proactively when writing, modifying, fixing, or testing code.
How this skill is triggered — by the user, by Claude, or both
Slash command
/power-trio:buildThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Execute Phase 2: Build with the Power Trio committee using Test-Driven Development.
Execute Phase 2: Build with the Power Trio committee using Test-Driven Development.
This phase handles all code modification tasks including:
Key parameters for this phase (see parameters skill):
MAX_TEST_ITERATIONS - Maximum rounds of test revisionMAX_IMPL_ITERATIONS - Maximum rounds of implementation revisionMAX_TEST_FIX_ATTEMPTS - Maximum attempts to fix failing testsMAX_BLOCKS_PER_AGENT - Maximum blocks per agent before escalationEXPECTED_TEST_CONVERGENCE - Expected maximum test iterationsEXPECTED_IMPL_CONVERGENCE - Expected maximum implementation iterationsYou are orchestrating Phase 2: Build. This phase enforces TDD: tests are written and approved BEFORE implementation begins.
Start by announcing who you are and succinctly what your approach will be.
Execute code changes based on: $ARGUMENTS
If no arguments provided, look for .power-trio/plan.report.md. If that doesn't exist, ask the user what they want to do.
If it is incomplete or unclear, this is the ideal time to ask the user for clarification before proceeding.
| Agent | Role |
|---|---|
power-trio:test-author | Writes tests first, defines correctness |
power-trio:engineer | Implements code to pass tests |
power-trio:senior-engineer | Reviews tests and code for quality |
Read the plan if available:
Read(file_path=".power-trio/plan.report.md")
Initialize state:
stage: "TEST_CREATION"
test_iterations: 0
impl_iterations: 0
block_counts: {test_author: 0, engineer: 0, senior_engineer: 0}
Issue-Scoped Iteration (Orchestrator)
Loop Termination Bias
Expected Convergence Envelope
EXPECTED_TEST_CONVERGENCE iterationsEXPECTED_IMPL_CONVERGENCE iterationsYou should always ask the user if they want tests to be written. If they say no, proceed to implementation.
Important: only invoke the test creation and senior review steps if there is already an existing testing framework in place.
Invoke test-author to write tests FIRST (before any implementation):
Task(subagent_type="power-trio:test-author", prompt="Based on this plan, write tests that define correctness. Tests should cover critical success criteria, edge cases, and error cases.\n\nFor new functionality: Write tests that will FAIL initially (no implementation exists yet).\nFor bug fixes: Write tests that reproduce the bug and verify the fix.\nFor refactoring: Write tests that verify behavior is preserved.\n\nPlan:\n[PLAN.REPORT CONTENT]\n\nCreate test files and provide the test specification.")
Invoke senior-engineer to review the tests:
Task(subagent_type="power-trio:senior-engineer", prompt="Review these tests for completeness and correctness (STAGE: TEST_REVIEW). Do they properly specify the expected behavior from the plan?\n\nPlan:\n[PLAN.REPORT CONTENT]\n\nTests:\n[TEST-AUTHOR OUTPUT]\n\nReview and vote APPROVE or BLOCK with REASON.")
Parse senior-engineer's vote:
If APPROVE: Proceed to Stage 2 (Implementation)
If BLOCK:
Increment block_counts.senior_engineer
Check escalation (MAX_BLOCKS_PER_AGENT blocks → convert to documented concern)
Issue-scoped iteration - Have test-author revise with only the specific concern:
Task(subagent_type="power-trio:test-author", prompt="Revise tests to address this specific concern:\n\n[SENIOR ENGINEER'S BLOCKING CONCERN - max MAX_BLOCKING_ISSUES_PER_ITERATION_SE issues]\n\nMake minimal, targeted changes. Do NOT refactor unrelated tests.\n\nCurrent tests:\n[ONLY THE AFFECTED TEST(S)]\n\nUpdate the tests and provide the revised specification.")
Loop back to Step 1.2 (re-invoke only senior-engineer with targeted context)
Maximum test iterations: MAX_TEST_ITERATIONS
Expected convergence: EXPECTED_TEST_CONVERGENCE iterations
Once tests are approved, invoke engineer:
Task(subagent_type="power-trio:engineer", prompt="Implement code to make these approved tests pass. Follow the plan exactly.\n\nFor new features: Write the implementation from scratch.\nFor bug fixes: Modify existing code to fix the issue.\nFor refactoring: Restructure code while maintaining test coverage.\n\nPlan:\n[PLAN.REPORT CONTENT]\n\nApproved Tests:\n[APPROVED TESTS]\n\nWrite the implementation and run the tests.")
The engineer should run tests. If they report failures, require diagnosis:
Task(subagent_type="power-trio:engineer", prompt="Tests are failing. Before fixing, diagnose the root cause.\n\nTest failures:\n[FAILURE OUTPUT]\n\nCurrent implementation:\n[ENGINEER'S CODE]\n\nExplicitly state:\n1. Root cause of the failure\n2. Whether this indicates: bug in implementation, flaw in test, or mismatch with plan\n3. Your fix approach\n\nThen fix the code and run tests again. Avoid blind retries - each attempt must add new understanding.")
Loop until tests pass (max MAX_TEST_FIX_ATTEMPTS attempts).
If tests never pass after MAX_TEST_FIX_ATTEMPTS: stop and report blocker to user.
Once tests pass, invoke senior-engineer for implementation review:
Task(subagent_type="power-trio:senior-engineer", prompt="Review this implementation for code quality (STAGE: IMPLEMENTATION_REVIEW). Tests are passing.\n\nPlan:\n[PLAN.REPORT CONTENT]\n\nTests:\n[APPROVED TESTS]\n\nImplementation:\n[ENGINEER OUTPUT]\n\nVerify tests pass legitimately and review code quality. Vote APPROVE or BLOCK with REASON.")
Parse senior-engineer's vote:
If APPROVE: Proceed to Artifact Creation
If BLOCK:
Increment block_counts.senior_engineer
Check escalation (MAX_BLOCKS_PER_AGENT blocks → convert to documented concern)
Issue-scoped iteration - Have engineer fix with only the specific concern:
Task(subagent_type="power-trio:engineer", prompt="Address this specific code review feedback:\n\n[SENIOR ENGINEER'S BLOCKING CONCERN - max MAX_BLOCKING_ISSUES_PER_ITERATION_SE issues]\n\nMake minimal, targeted changes. Do NOT refactor unrelated code.\n\nCurrent implementation:\n[ONLY THE AFFECTED CODE]\n\nFix the issues surgically and run tests to ensure nothing broke.")
Loop back to Step 2.3 (re-invoke only senior-engineer with targeted context)
If deviation from plan: Surface once as documented deviation. Do not repeatedly block.
Loop termination bias: When close to consensus, prefer APPROVE with noted limitations.
Maximum implementation iterations: MAX_IMPL_ITERATIONS
Expected convergence: EXPECTED_IMPL_CONVERGENCE iterations
When implementation is approved, create implementation.report.md:
Write(file_path=".power-trio/implementation.report.md", content="[ARTIFACT]")
Artifact format:
# Implementation Report
## Task
[From plan.report or user request - describe what was built, fixed, or improved]
## Files Changed
| File | Change Type | Description |
| ------------ | ----------- | ----------- |
| path/to/file | Added | Description |
## Lines of Code
- Added: [X]
- Modified: [X]
- Deleted: [X]
- Total: [X]
## Test Results
- Test files: [list]
- Test cases: [X] total
- Passing: [X]
- Command: `[test command]`
## Deviations from Plan
[None or list with justification]
## Dependencies
- New dependencies: [list or None]
- External APIs: [list or None]
## Sensitive Areas Touched
- Authentication: Yes/No
- Payments: Yes/No
- Cryptography: Yes/No
- User data: Yes/No
- Public API: Yes/No
## Committee Approval
- Test Author: Tests approved
- Engineer: Implementation complete
- Senior Engineer: APPROVE
## Iterations
- Test iterations: [X]
- Implementation iterations: [X]
---
Generated by Power Trio Phase 2: Build
Announce completion:
Phase 2: Build COMPLETE
TDD workflow completed:
- Test iterations: [X]
- Implementation iterations: [X]
All tests passing. Code approved by Senior Engineer.
Artifact: .power-trio/implementation.report.md
Files changed: [X]
Lines of code: [X]
Sensitive areas: [list if any]
[If sensitive areas or significant changes:]
Recommend running Phase 3: Review (/power-trio:review)
[Otherwise:]
Ready to ship or run Phase 3 for additional assessment.
MAX_TEST_FIX_ATTEMPTS attempts: stop and report blocker to usernpx claudepluginhub thesimonho/artificial-jellybeans --plugin power-trioImplements changes incrementally in thin vertical slices using TDD, atomic commits, and complexity assessment. Run after /plan for structured builds.
Executes TDD DEV stage: verifies failing tests exist, reads tests and design, implements minimal code one test at a time until all pass, verifies build, commits.
Guides Red-Green-Refactor cycles for test-first feature implementation and bug fixes. Requires /optimus:init and working test infrastructure.