| name | orchestrate-bugfix |
| description | Full bugfix pipeline: repro test → fix → verify → review. Triggers on: 'orchestrate bugfix', 'fix bug pipeline'. |
Orchestrate Bugfix
Full bugfix pipeline: repro test → fix → verify → review → PR → close.
Prerequisites
- A GitHub issue describing the bug
- Reproduction steps (or enough info to create them)
Step 1: Start Issue
gh issue edit N --add-label "status:in-progress"
git worktree add -b fix/issue-N-short-description ../project-N main
cd ../project-N
Step 2: Write Reproduction Test
This test MUST FAIL before the fix is applied.
def test_bug_N_regression():
"""Regression test for #N — [bug description]"""
result = buggy_function(trigger_input)
assert result == expected_correct_behavior
uv run pytest tests/path/test_file.py::test_bug_N_regression -v
Step 3: Fix the Bug
Use @code-developer agent:
- Make the minimal change to fix the bug
- Don't refactor unrelated code
Step 4: Verify Fix
uv run pytest tests/path/test_file.py::test_bug_N_regression -v
uv run pytest tests/ -v
uv run ruff check src/
uv run mypy src/
Step 5: Red-Green Verification
Confirm the test actually catches the bug:
git stash
uv run pytest tests/path/test_file.py::test_bug_N_regression -v
git stash pop
Step 6: Create PR
git add -A && git commit -m "fix(scope): description (fixes #N)"
git push -u origin HEAD
gh pr create --draft --title "fix(scope): description" --body "fixes #N
## What was broken
[Description]
## Root cause
[What caused it]
## Fix
[What was changed]
## Verification
- Regression test added: test_bug_N_regression
- Red-green cycle verified"
Step 7: Wait for CI
gh run list --branch $(git branch --show-current) --limit 3
⛔ Never merge without CI green.
Step 8: Merge and Close
gh pr merge --squash --delete-branch
gh issue close N --comment "Fixed in PR #M. Regression test added."
Remove status labels:
gh issue edit N --remove-label "status:in-progress"
Step 9: Cleanup
cd ..
git worktree remove project-N