I Finally Coded So Hard I Ralphed
How They Finally Got Me on a Cursor Ultra SubscriptionAs with almost everything, the more you use it, the more it pays to optimize it. I recently determined that re-usable workflow entry point prompts are the only real use-case for AI Coding Agent Slash Commands.
One particular kind of workflow where youâll not only be re-using the same prompt, but re-using it more than you the human ever could, is a Wiggum Loop. Thatâs actually a perfect use-case for a Slash Command!
I had been looking for an application for a Wiggum Loop for a while, but I just didnât have enough work to feed an AI coding agent in a loop. I had an epiphany while prompting to address CodeRabbit PR feedback for the second, then third timeâŚ
CodeRabbit is awesome but its reviews can take a good handful of minutes to come out (which I donât fault it for; theyâre fabulous)! On top of that the âfree for open-source projectsâ tier has a rate limit that agentic coding often runs into.
So, my high-level workflow will be
But there are actually quite a few more decision points, because when you push a commit you might hit the rate limit warning instead of getting immediate feedback, and then you have to wait out that timer and come back and make a PR comment to get the ball rolling again:
You Didnât Read That, Did You?
I submit that 2nd diagram not because I expect you to read it, but because I expect you to not read it. Itâs complex, itâs intricate, who would want to have to try to do that!? But it was necessary!
Fortunately, AI Coding Agents are really good at following flowcharts.
I had this epiphany embarrassingly-late in my CodeRabbit PR Feedback career: I explained what I had been doing manually, and asked for a Slash Command suitable for handling this kind of PR Feedback in a Wiggum Loop. Iâd invoke the loop with
touch wiggum.semaphore; \
while true; do \
cursor agent \
--stream-partial-output \
--output-format stream-json \
--print \
--approve-mcps \
--force \
--model opus-4.5-thinking \
"/local/wiggum-niko-coderabbit-pr - and if you cannot find that command, delete wiggum.semaphore and exit immediately." \
"github.com/Texarkanine/<repo>/pull/<number>"; \
[ -e wiggum.semaphore ] || break; \
sleep 300; \
done
(printed here on multiple lines for you to see, but reducible to a single line I can just alias or paste into a shell)
And thus /wiggum-niko-coderabbit-pr was born! It was scary firing it off for the first couple of times, and it did take a bit of iteration on itself to get it working right. I watched an hour-long TV show while CodeRabbit & Niko went back-and-forth iteratively improving code!
Fun things to note:
Exit Condition
Perhaps not in the pure spirit of Wiggumâ˘, I explicitly defined an exit condition of which the agent is aware - the wiggum.semaphore file - so that it can guarantee the exit when itâs done.
Safety Dance
The prompt fed into the agent is
/local/wiggum-niko-coderabbit-pr - and if you cannot find that command, delete wiggum.semaphore and exit immediately.
Turns out that it was really easy to get Command paths wrong and when running headless itâs hard to notice. Claude is so good that itâll infer a general process from the commandâs name and be basically correct, but miss things like knowledge of the semaphore - so the loop never ends!
While I canât seem to find this documented anywhere, the Cursor CLI doesnât seem to take User Commands into account. So even though ai-rizz gained the ability to install Slash Commands and to install anything to the global ~/.cursor/... directories, global installation of ~/.cursor/commands/ai-rizz/wiggum-niko-coderabbit-pr.md didnât work - the headless agent couldnât see it. It needs to be in the local repo, so prep each repo you want to try this in with:
ai-rizz add rule --local wiggum-niko-coderabbit-pr
That probably means it doesnât see User Rules, either, so⌠use the new --global mode sparingly?
IâM HELPING
Iâm sure this isnât the most-refined or efficient Way to Wiggum⢠but Iâm just happy to (finally) be here!