| name | sf-pair-task |
| description | Execute a single task end-to-end with plan review, implementation review, verification, and one persistent task-plan artifact. |
sf-pair-task
Execute a single user task end-to-end: clarify, plan, review, implement, verify, review, commit.
Prerequisites
- pi-subagents extension installed
- Reviewer model configured
- Obra Superpowers skills available to pi:
brainstorming, test-driven-development, verification-before-completion, finishing-a-development-branch (install via pi install git:github.com/obra/superpowers)
Process
Phase 1: Preflight
- Verify repo:
git rev-parse --is-inside-work-tree
- Ensure
ai_plan/ exists in .gitignore
- Verify the reviewer agent definition exists globally:
test -f ~/.pi/agent/agents/reviewer.md
Phase 2: Parse Prompt And Clarify
- Capture the user's prompt verbatim
- Ask 1-3 clarifying questions one at a time using
AskUserQuestion
- Load
brainstorming for behavior-changing work
Phase 3: Initialize task-plan.md
- Compute
ai_plan/YYYY-MM-DD-<slug>/
- Write
task-plan.md from template
- Fill all sections: Metadata, Prompt, Interpretation, Assumptions, Files, Approach, TDD Approach, Acceptance Criteria, Verification, Rollback
- Set
Status: draft
Phase 4: Plan Review
- Write task-plan content to
/tmp/pair-task-plan-{REVIEW_ID}.md
- Spawn reviewer:
Agent({
subagent_type: "reviewer",
model: "<reviewer_model>",
prompt: "Review the task plan at /tmp/pair-task-plan-{REVIEW_ID}.md",
description: "Review task plan"
})
- Fix P0/P1/P2 findings until APPROVED
- Set
Status: plan-approved
Phase 5: Execute
- Set
Status: implementation-in-progress
- Load
test-driven-development for behavior-changing edits
- Implement following the plan to the letter
- Update
task-plan.md as acceptance criteria are completed
Phase 6: Verification Gate
- Load
verification-before-completion
- Run verification commands from task-plan.md
- Fix failures until green
Phase 7: Implementation Review
- Build review payload from approved plan + diff + verification output
- Spawn reviewer:
Agent({
subagent_type: "reviewer",
model: "<reviewer_model>",
prompt: "Review the implementation. [include diff and verification]",
description: "Review implementation"
})
- Fix P0/P1/P2 findings until APPROVED
- Set
Status: implementation-approved
Phase 8: Commit And Push
- Load
finishing-a-development-branch
- Stage intended files
- Create one commit
- Ask whether to push or keep local
Phase 9: Telegram Notification
If configured, send completion summary.