fix: add guardrails to prevent bots from inventing unnecessary work (#1347)

- Add team lead pre-approval gate: teammates spawn in plan mode and must
  get approval before creating any PR (hard gate, not just prompt rules)
- Add diminishing returns rule: default posture is "code is good, shut down"
- Add dedup rule: check for existing open/closed PRs before creating new ones
- Require concrete PR justification (what breaks without this change)
- Add off-limits files list (.github/workflows, .claude/skills, CLAUDE.md)
- Use git pathspec exclusions in refactor.sh to never stage protected files
- Constrain pr-maintainer to only act on approved or feedback PRs
- Reduce refactor cron from every 5 minutes to every 2 hours

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ahmed Abushagur 2026-02-16 17:24:25 -08:00 committed by GitHub
parent 5f39b035c6
commit 3fbdf56c4c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 167 additions and 8 deletions

View file

@ -2,7 +2,7 @@ name: Trigger Refactor
on:
schedule:
- cron: '*/5 * * * *'
- cron: '0 */2 * * *'
issues:
types: [opened, reopened, labeled]
workflow_dispatch: