| name | wiggum-niko-coderabbit-pr |
| description | Invoke with /wiggum-niko-coderabbit-pr |
| disable-model-invocation | true |
CodeRabbit PR Wiggum Loop for Niko
⚠️ HEADLESS AUTOMATION - READ THIS FIRST ⚠️
You are in a headless loop. No human is watching. No human will respond.
- NEVER ask for permission, confirmation, or input
- NEVER say "Would you like me to..." or "Should I..."
- NEVER just report status - always TAKE ACTION then exit
- IF you fixed something and tests pass → RUN /reflect → COMMIT AND PUSH IMMEDIATELY
- IF all feedback is resolved → DELETE SEMAPHORE (
rm wiggum.semaphore)
- IF something needs human decision → Write to
memory-bank/tasks.md, then exit
- IF you ask a question or just report without acting → You failed.
The Loop
flowchart TD
Start([Agent Invoked]) --> CheckRL{Rate Limit Until<br/>in future?}
CheckRL -->|Yes| ExitRL([Exit - wait for limit])
CheckRL -->|No| CheckExpired{Was RATE_LIMITED<br/>but now expired?}
CheckExpired -->|Yes| TriggerReview["gh pr comment @coderabbitai review"]
TriggerReview --> ExitTriggered([Exit - await CR response])
CheckExpired -->|No| Fetch[Fetch CodeRabbit comments]
Fetch --> CheckRLMsg{Rate limit in response?}
CheckRLMsg -->|Yes| SetRL[Set Rate Limit Until in tasks.md]
SetRL --> ExitRLNew([Exit - rate limited])
CheckRLMsg -->|No| CheckGHStatus{CodeRabbit check<br/>passing?}
CheckGHStatus -->|No| ExitWaitCheck([Exit - CR still processing])
CheckGHStatus -->|Yes| Categorize[Categorize feedback]
Categorize --> UpdateTasks["Update memory-bank/tasks.md<br/>with actionable items"]
UpdateTasks --> HasWork{Actionable items?}
HasWork -->|No| CheckComplete{All resolved?}
CheckComplete -->|Yes| DeleteSem["rm wiggum.semaphore"]
DeleteSem --> Complete([Exit - COMPLETE])
CheckComplete -->|No| ExitWait([Exit - waiting])
HasWork -->|Yes| NikoBuild["/build<br/>(fix each item)"]
NikoBuild --> Test{Tests pass?}
Test -->|No| Revert[Revert + record NEEDS_HUMAN]
Revert --> ExitFail([Exit])
Test -->|Yes| NikoReflect["/reflect<br/>(document what was fixed)"]
NikoReflect --> CommitPush["git add + commit + push"]
CommitPush --> ExitDone([Exit - await CR response])
style NikoBuild fill:#87CEEB,stroke:#4169E1,stroke-width:2px
style NikoReflect fill:#DDA0DD,stroke:#8B008B,stroke-width:2px
style CommitPush fill:#90EE90,stroke:#228B22,stroke-width:3px
style DeleteSem fill:#90EE90,stroke:#228B22,stroke-width:3px
style TriggerReview fill:#FFD700,stroke:#B8860B,stroke-width:3px
Niko Integration
This command uses Niko's memory bank and commands. Don't reinvent the wheel.
| Phase | Niko Command | Purpose |
|---|
| Track issues | Update memory-bank/tasks.md | Add CodeRabbit items as checklist |
| Fix issues | /build | Implement fixes using TDD |
| Document fixes | /reflect | Record what was learned |
Task File Format
Add CodeRabbit items to memory-bank/tasks.md:
## Current Task: CodeRabbit PR #<number> Fixes
**Status:** In Progress | RATE_LIMITED | COMPLETE
**PR URL:** <url>
**Rate Limit Until:** <ISO timestamp or empty>
### Actionable Items
- [ ] ID: <id> - <summary>
- [x] ID: <id> - <summary> - FIXED
### Requires Human Decision
- ID: <id> - <summary> - Reason: <why>
### Ignored
- ID: <id> - <summary> - Reason: <why>
Categorization
| Category | Examples | Action |
|---|
| ACTIONABLE | Code style, error handling, types, docs, imports | /build to fix |
| NEEDS_HUMAN | Architecture, API design, breaking changes, security | Record in tasks.md |
| IGNORE | False positives, already fixed, conflicts with standards | Skip |
Commands
gh pr checks <number> --json name,state --jq '.[] | select(.name | test("coderabbit"; "i")) | .state'
gh pr comment <number> --body "@coderabbitai review"
git add -A && git commit --no-gpg-sign -m "fix: address CodeRabbit feedback
<bullet points from reflection>
Generated by wiggum-niko automation" && git --no-pager push
rm wiggum.semaphore
Completion Detection
Complete when ALL true:
- CodeRabbit check passing (
SUCCESS or PASSED)
- All actionable items marked FIXED in
memory-bank/tasks.md
- No new actionable comments since last push
Action: rm wiggum.semaphore
Reminder
You are a robot using Niko's brain. Act like one.
- Issues →
/build → tests → /reflect → push
- Done → delete semaphore
- Blocked → record in
memory-bank/tasks.md
- EXIT
Do not report without acting. Do not ask. Execute.