From full-orchestration
Implement a ticket using TDD and review in a converging loop. Use when you have an approved spec and implementation plan. Spawns TddEngineer for implementation, delegates to deep-review for adversarial analysis, and auto-fixes findings in an autonomous loop (max 5 rounds) before gating user approval.
npx claudepluginhub shouenlee/ghcp-dev-plugin --plugin full-orchestrationThis skill uses the workspace's default tool permissions.
**State file**: `.claude/swe-state/{ticket-id}.json`
Executes slice-based TDD implementation from approved plan.md in deep-work sessions: loads state, parses slices, resumes partial progress, runs RED-GREEN-REFACTOR cycles.
Executes implementation tasks from approved plan.json, enforcing TDD, tracking progress via beads, and reporting in batches or autonomously. Use after spec-plan.
Executes tech plans via dependency-aware task batching, TDD, incremental commits, section code reviews, and PR creation. Use after planning phases.
Share bugs, ideas, or general feedback.
State file: .claude/swe-state/{ticket-id}.json
Unified stage: TDD implementation followed by a review-fix loop that converges before user approval. Same author→reviewer→fix loop structure as 2B↔2C, but with severity-based convergence (0 Critical + 0 Major + 0 Minor) instead of comment-based (0 OPEN).
/implement_and_review <ticket-id>
stages.spec.completed is true.feature_branch and target_branch from state. Confirm current branch matches feature branch — warn and offer to switch if not./deep_review is unavailable: stop and show /plugin install deep-review@ghcp-dev-plugin.Spawn TDD engineer to execute the approved implementation plan:
subagent_type: full-orchestration:TddEngineer
max_turns: 30
prompt: |
State file: .claude/swe-state/{ticket-id}.json
Read state to locate:
- stages.spec.spec_file (technical spec)
- stages.spec.impl_plan_file (implementation plan)
- stages.spec.context_file (codebase context)
- stages.implement.impl_summary_file (write summary here when done)
Execute the implementation plan using strict TDD (red/green/refactor).
Work on the current branch. Do NOT create or switch branches.
Commit after each passing step.
Run the full test suite when all steps are complete.
Write the implementation summary to the impl_summary_file path from state.
Read the impl summary. Extract test result (PASS/FAIL).
On PASS: update state — stages.implement.completed = true, populate test_results. Set stages.review.phase = "reviewing". Proceed to Phase 3.
On FAIL: do NOT mark completed. Report failure details to the user. User chooses:
stages.implement.completed = true with a note in test_results that suite did not fully pass. Proceed to Phase 3 — the review loop will catch remaining issues.status = "aborted", exit.Autonomous loop — no user interaction until convergence, cap, or Critical finding. Every iteration is a full-branch review (target_branch...feature_branch). Track iteration starting at 0.
Step 1 — Review: Verify changes exist: git diff {target_branch}...{feature_branch}. If empty, report error to user and go to Phase 4. Run /deep_review --base={target_branch} --head={feature_branch}. On failure, retry once. If second failure, go to Phase 4 with a warning.
Step 2 — Parse findings: Extract the <!-- structured-findings ... structured-findings --> block from deep_review output (see format reference below). Map priorities: critical → Critical, high → Major, medium → Minor, low → Suggestion. Write to review_iteration_file path from state as JSON (see format reference below). Preserve status from prior iterations — if a finding with the same file+line+summary was previously "fixed" or "dismissed", carry that status forward. New findings default to "open". Update counts from open findings only.
Step 3 — Check convergence: If counts.critical == 0 AND counts.major == 0 AND counts.minor == 0, the loop has converged. Go to Phase 4. Suggestions are non-blocking and never prevent convergence.
Step 4 — Handle Criticals: If any Critical findings exist, stop the auto-loop. Present all findings with Criticals highlighted at top. User chooses per-Critical: fix (with direction), dismiss (with rationale), or abort. On abort → Phase 4 (abort path). On dismiss → record in state findings.dismissed with {id, severity, summary, rationale}. Major + Minor findings are queued for auto-fix. If no Critical findings, proceed directly to Step 5.
Step 5 — Fix: Build the findings list from review_iteration_file. Include only "open" findings with severity Critical, Major, or Minor, formatted as: - #{id} [{severity}] {file}:{line} — {summary}. Append any user direction for Critical fixes. Spawn TddEngineer:
subagent_type: full-orchestration:TddEngineer
max_turns: 20
prompt: |
State file: .claude/swe-state/{ticket-id}.json
Read state to locate:
- stages.spec.spec_file
- stages.spec.impl_plan_file
- stages.spec.context_file
- stages.implement.impl_summary_file
- stages.review.review_iteration_file
Findings to fix:
{formatted findings list from above}
For each: write/update test, apply fix, run tests.
Commit: "review: fix {severity} — {description}"
Run full suite when done.
Write updated summary to impl_summary_file.
On TddEngineer failure: Minor findings → demote to Suggestion (non-blocking). Major findings → present to user: retry (with direction), dismiss (with rationale), or abort. Do not silently swallow failures.
Step 6 — Update state: Mark fixed findings in review_iteration_file. Update state: stages.review.iterations = iteration, update findings counts (total, fixed, auto_fixed, dismissed). Increment iteration. If iteration < 5, go back to Step 1. Otherwise set stages.review.phase = "capped" and warn: "Review did not fully converge after 5 rounds. {N} findings remain." Go to Phase 4.
The deep_review output contains a YAML block in an HTML comment:
<!-- structured-findings
findings:
- id: 1
priority: critical | high | medium | low
file: "path"
line: N or null
summary: "description"
agents: [advocate, skeptic, architect]
structured-findings -->
The review_iteration_file is written as JSON:
{
"iteration": 1,
"findings": [
{
"id": 1,
"severity": "Critical|Major|Minor|Suggestion",
"file": "path",
"line": 1,
"summary": "description",
"agents": ["advocate", "skeptic"],
"status": "open|fixed|dismissed"
}
],
"counts": {
"critical": 0, "major": 0, "minor": 0, "suggestion": 0
}
}
Present review summary:
Warn if Critical or Major findings remain unresolved.
Write summary to review_summary_file path from state.
User chooses:
iteration = min(iteration, 4) so there is always at least 1 review pass after a user-requested revision.Capture user direction verbatim.
subagent_type: full-orchestration:TddEngineer
max_turns: 20
prompt: |
State file: .claude/swe-state/{ticket-id}.json
Iterating on implementation based on code review feedback.
Read state to locate all inputs:
- stages.spec.spec_file (original spec)
- stages.spec.impl_plan_file (original plan)
- stages.spec.context_file (codebase context)
- stages.implement.impl_summary_file (previous impl summary)
- stages.review.review_iteration_file (latest review feedback)
User direction:
{verbatim user instruction}
Read the review feedback and impl summary to understand what
needs to change. Use TDD. Keep all existing tests passing.
Commit: "review: fix {severity} — {description}"
Run full suite when done.
Write updated summary to the impl_summary_file path from state.
After TddEngineer completes, return to Phase 3.
Deep-merge into state:
stages.review.completed = true, stages.review.approved = true, stages.review.phase = "complete", populate findings counts (including auto_fixed and dismissed)stages.implement.completed = true (implementation did complete), stages.review.approved = false, status = "aborted"