Add @claude delegation, auto-merge, and rebase handling

Merged
DO
7mo ago
+140-13

Summary

  • When council escalates a PR in a Claude-enabled org, post a follow-up @claude comment with specific fix instructions from the council findings
  • On approval: enable auto-merge (--auto --squash), rebase if branch is behind base, remove needs-human-review label
  • Cycle guard (MAX_REVIEW_CYCLES, default 3) prevents infinite @claude delegation loops
  • New repo variables: CLAUDE_ORGS (comma-separated org list), MAX_REVIEW_CYCLES

Lifecycle

Council finds issues → @claude fix instructions → Claude pushes →
next cron re-reviews (SHA changed) → if clean → approve + auto-merge

Test plan

  • Dry-run against a PR in petry-projects org with CLAUDE_ORGS set
  • Verify @claude comment format in dry-run output
  • Verify auto-merge command in dry-run output for approved PRs
  • Verify cycle guard stops delegation after MAX_REVIEW_CYCLES

🤖 Generated with Claude Code