Complete 3-phase automation: implement → review → merge for GitHub issues
Automates the complete GitHub issue lifecycle: implement → review → merge. Use this to fully resolve issues end-to-end without manual intervention between phases.
/plugin marketplace add Andre-Mygentic/andre-engineering-system/plugin install mygentic-eng@andres-local-marketplaceissue numberYou are orchestrating the complete implementation → review → merge pipeline for issue $ARGUMENTS.
Execute this workflow autonomously without stopping between phases unless errors occur:
Do NOT stop between phases to ask the user. Only stop if:
Launch the issue-implementer agent with issue number $ARGUMENTS:
Use the Task tool with:
- subagent_type: issue-implementer
- description: "Implement issue $ARGUMENTS"
- prompt: "Implement issue $ARGUMENTS following the 8-step workflow."
If API returns 500 "Overloaded" error:
After agent completes, verify actual implementation:
# Check manifest exists
if [ -f ".agent-state/issue-$ARGUMENTS-implementation.yaml" ]; then
STATUS=$(grep "status:" .agent-state/issue-$ARGUMENTS-implementation.yaml | cut -d: -f2 | tr -d ' ')
# Verify implementation artifacts
BRANCH=$(grep "branch:" .agent-state/issue-$ARGUMENTS-implementation.yaml | cut -d: -f2 | tr -d ' "')
# Check branch exists
if ! git rev-parse --verify "$BRANCH" >/dev/null 2>&1; then
echo "⚠️ Warning: Branch $BRANCH not found, but status is $STATUS"
echo "This may indicate implementation succeeded despite error messages"
fi
# For AWS operations, verify resources exist (if applicable)
# This will be handled in implementation verification section below
else
echo "❌ ERROR: Implementation manifest not found"
echo "Agent may have failed before completion"
exit 1
fi
Verify Implementation Success: Check actual state, not just manifest:
git rev-parse --verify feature/issue-$ARGUMENTSgit log origin/feature/issue-$ARGUMENTSgh issue view $ARGUMENTS --json labels | grep ready_for_reviewUsing the verification helper script:
# Verify branch exists
~/.claude/scripts/verify-github-operation.sh branch-exists $ARGUMENTS feature/issue-$ARGUMENTS
# Verify label updated
~/.claude/scripts/verify-github-operation.sh label-updated $ARGUMENTS ready_for_review
The verification script provides color-coded output and clear success/failure indicators.
If status is "ready_for_review" and verification passes, print:
✅ Phase 1 Complete: Implementation
📋 Files changed: [list from manifest]
📊 Status: ready_for_review
⏭️ Continuing to review phase...
Then proceed to Phase 2 immediately.
Launch the review-orchestrator agent:
Use the Task tool with:
- subagent_type: review-orchestrator
- description: "Review issue $ARGUMENTS"
- prompt: "Orchestrate code review for issue $ARGUMENTS. Coordinate security, quality, and documentation checks in parallel. Create PR if approved."
Wait for completion, then check:
cat .agent-state/issue-$ARGUMENTS-review.yaml | grep "decision:"
If decision is "APPROVE", verify and report:
Verify Review Completion:
# Verify PR was created
~/.claude/scripts/verify-github-operation.sh pr-created $ARGUMENTS
# Verify label updated to ready_for_merge
~/.claude/scripts/verify-github-operation.sh label-updated $ARGUMENTS ready_for_merge
If verification passes, print:
✅ Phase 2 Complete: Review
🔒 Security: PASS (0 issues)
⚡ Quality: PASS
📚 Documentation: PASS
🎯 Decision: APPROVE
📝 PR created and label updated
⏭️ Continuing to merge phase...
Then proceed to Phase 3 immediately.
If decision is "REQUEST_CHANGES", print:
❌ Phase 2: Changes Requested
📝 Feedback: [show blocking issues from manifest]
🔄 Issue returned to "To Do" status
Workflow stopped. Address the feedback and re-run /implement-issue $ARGUMENTS
Stop here and report to user.
Launch the issue-merger agent:
Use the Task tool with:
- subagent_type: issue-merger
- description: "Merge PR for issue $ARGUMENTS"
- prompt: "Merge the approved pull request for issue $ARGUMENTS. Handle conflict resolution if needed, update all tracking systems, and cleanup worktrees."
Wait for completion, then verify and report:
Verify Merge Completion:
# Verify PR was merged
~/.claude/scripts/verify-github-operation.sh pr-merged $ARGUMENTS
# Verify issue was closed
~/.claude/scripts/verify-github-operation.sh issue-closed $ARGUMENTS
If verification passes, print:
✅ Phase 3 Complete: Merge
🔗 PR merged and verified
📦 Commit: [SHA from merger output]
🏁 Issue #$ARGUMENTS closed and verified
✨ Workflow complete
Error Recovery Protocol:
Check actual state before failing:
For API 500 "Overloaded" errors specifically:
For "operation failed" but state shows success:
For actual failures:
Common errors:
gh issue edit NUMBER --add-label LABELAfter each phase completion, use this format:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Phase [N]: [Phase Name]
✅ Status: [Complete/Failed]
📊 Details: [Key information]
⏭️ Next: [What happens next]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
After Phase 3 completes successfully, provide:
🎉 Issue #$ARGUMENTS Implementation Complete
📊 Summary:
• Implementation: [files changed]
• Review: [decision + check results]
• Merge: [PR number + commit SHA]
🔗 Links:
• Issue: https://github.com/Mygentic-AI/mygentic-personal-assistant/issues/$ARGUMENTS
• PR: [PR URL from merger output]
• Commit: [commit URL]
✅ All tracking systems updated
✅ Worktree cleaned up
✅ Branches deleted
Start now with issue $ARGUMENTS. Do not ask for confirmation between phases.