Orchestrate implementation of one phase from an implementation plan end-to-end, including PRD/ERD readiness checks, branch setup, coding, verification, code review, PR creation, and plan updates. Use when the user asks to execute or continue work from doc/**/implementation-plan.md, wants the next incomplete phase implemented, or needs pre-implementation gap analysis from prd.md and erd.md.
Implement one phase of an implementation plan with explicit quality gates before merge. Communicate in English.
Provide or infer:
doc/auth/implementation-plan.md)doc/<module>/prd.md)doc/<module>/erd.md)BAL-XX)main)If phase number is omitted, select the next incomplete phase from the plan.
Use the checklist in references/readiness-checklist.md during Step 0.
Read PRD and ERD before selecting a phase for coding. Create the readiness artifact before implementation:
doc/reviews/READINESS-BAL-XX-pY.mddoc/reviews/READINESS-BAL-XX-next.mdExtract and validate:
Produce a readiness checkpoint with:
GO or NO-GO decisionAsk focused questions to close gaps and stop before coding until answers are received. If user chooses to proceed with unresolved gaps, record assumptions explicitly in the phase notes. Pause after generating the readiness artifact and wait for user approval to continue.
Read the plan and identify the target phase. Extract:
If the phase is already completed or blocked, stop and request user confirmation before continuing.
Do not continue to Step 2 when Step 0 result is NO-GO.
Start from latest mainline branch:
git checkout <base-branch>git pull origin <base-branch><base-branch> using ticket and phaseUse BAL-XX.pY as default naming. If the environment enforces prefixed branch names, use codex/BAL-XX.pY.
Implement only the selected phase scope.
Follow project rules in .cursor/rules/implementation.mdc.
Apply these constraints:
ActiveInteraction) under app/interactions and keep the controller focused on params, flow control, and rendering/redirectsconfig/locales/pt.yml and config/locales/en.yml (including controller flash/alert messages and views)pt and enRun all relevant checks before requesting review:
up and down pathsIf any check fails, fix issues before moving forward.
When verification touches authenticated routes, run the server locally and append ?test_user_id=<id> to the target GET URL instead of going through the auth UI. The Development test users section explains how to locate a development user ID and how this bypass works in app/controllers/concerns/authentication.rb before code review.
Invoke $code-review to review the current implementation diff and produce the review artifact.
If $code-review is unavailable, run an equivalent structured review manually with the same quality bar.
Write findings to doc/reviews/CR-<context>.md and wait for user feedback before committing.
Apply requested changes, then re-run verification. After checks pass:
Invoke $create-pr to open the PR with project template and ticket context.
If $create-pr is unavailable, follow the same PR standards manually.
Share the PR link with the user.
Update the phase section in the plan:
✅ **Completed**- [x])After PR creation and user confirmation, remove temporary review artifacts in doc/reviews/ if no longer needed.
Provide a final summary with:
Require all of the following before final handoff:
doc/reviews/READINESS-BAL-XX-pY.md (or ...-next.md)