Recipes / Dev & code
Multi-agentFull setupDev & code

Night shift: labeled GitHub bugs → reviewed draft PRs by morning

A Chief bot and four specialists turn labeled GitHub bugs into reproduced, fixed, independently reviewed draft PRs overnight, with a morning report that separates done from attempted.

From Mori on X · Oct 2026

Setup timeHalf a day to set up
CostIncluded in plan + cloud agent usage
RunsNightly, on issues with an agent-ready label
NeedsGrok Bot, GitHub, Cursor cloud agents (or another coding agent), CI tests
Last updated2026-10-17

What the source did

  • Starts with one small workflow: take one labeled bug, reproduce it, fix it on a branch, verify, open a draft PR.
  • Creates a Chief plus Triage, Builder, Reviewer and Release bots, and a shared workspace folder (queue, issues, reviews, approved, logs).
  • Keeps a per-issue record as the source of truth: one owner, a current state, and an artifact for every state change.
  • Triage writes a failing test first; Builder hands the fix to Cursor cloud agents in separate environments; Reviewer must open the diff and run the tests, not repeat the builder's summary.
  • Caps repair rounds, saves the process as a skill, then runs it as a routine on a narrow label with a small issue limit.
  • Ends each night with a morning report: PRs ready for review, blocked issues, and failed attempts.
“Let the Bots do the work. Keep the merge button.”— Mori (@0xjmori), X (article)

Summary written by Agent Cookbook from the original post. See the original for the full context. How we source recipes

Our notes

What it takes
Grok Bot, GitHub with branch protection and CI, and a coding agent whose environment can run your tests. Half a day to set up.
Where it breaks
Two bots taking the same issue, 'tests pass' with no evidence, endless repair loops, and cloud machines losing installed tools.
Human checkpoint
Draft PRs only; merging, deploying and closing issues wait for you, enforced by branch protection.
Tools involved
Grok Bot, GitHub, Cursor cloud agents (or another coding agent), CI tests

✓ Verified Source link checked and still live. Notes by Thomas, editor. How we verify

Read their guide

Made and published by Mori. Start here; it is their original, not ours.

Our adapted version

Ours Our condensed text version of Mori's steps. His exact prompts are in the guide above. Fill in the [BRACKETS].

Set up an engineering night shift for [REPO]. Workspace: /workspace/devdesk/{queue,issues,reviews,approved,logs}. One record per issue with: id, owner, state (queued → reproduced → fixing → in-review → ready | blocked), and an artifact link for every state change. Each night at [01:00], pick at most [3] open issues labeled [agent-ready] that have no owner. For each issue: 1. Triage: reproduce it and commit a failing test on a new branch. If you can't reproduce it, mark it blocked with what you tried. 2. Build: hand the fix to a coding agent on that branch only. Never edit the test to make it pass. 3. Review: a different agent opens the diff, runs the tests, and checks the original acceptance criteria. Verdict PASS / FAIL / BLOCKED with evidence. 4. After [2] failed repair rounds, stop and mark it blocked. 5. On PASS, open a DRAFT pull request linking the issue, the test and the review notes. At [07:30], send me a report: draft PRs ready for review, blocked issues, failed attempts, and anything waiting on me. Never merge, deploy, close issues, or comment publicly without my OK. Sending, buying, posting and deleting always need a human.

Approval rule

🛡
Draft PRs only. Merging, deploying, closing issues and anything external wait for a human; enforce it with branch protection, not just the prompt.

Set it up

  1. Protect the default branch and require CI on PRs, so "never merge" is enforced outside the prompt.
  2. Connect GitHub and set up the coding agent's environment so tests run there.
  3. Run the flow by hand on one harmless bug and fix whatever was hard.
  4. Save it as a skill, run it on a second issue, then schedule the routine.
  5. Read the morning report and review the draft PRs yourself.

Common failures

⚠
  • Two bots pick the same issue; the one-owner rule in the issue record has to be checked before dispatch.
  • "Fixed, tests pass" with no evidence; require the reviewer's diff and test output as an artifact.
  • Endless repair loops burn usage; keep the round limit low.
  • The cloud machine gets rebuilt and loses installed tools; keep setup reproducible and code in git.

Variations

  • Daytime mode: trigger on a label being added instead of a nightly schedule.
  • Swap the builder for Claude Code or Codex CLI on the box.
  • Tests-only shift: the same loop, but it only adds missing tests.

Common questions

Where does this setup come from?

Mori (@0xjmori) shared it on X (article) (2026-10-12). Read the original post.

What do I need to set it up?

Grok Bot, GitHub, Cursor cloud agents (or another coding agent), CI tests. Setup time: Half a day to set up. Cost: Included in plan + cloud agent usage.

What does the agent need my approval for?

Draft PRs only. Merging, deploying, closing issues and anything external wait for a human; enforce it with branch protection, not just the prompt.

Related setups: Wire Claude Code and Codex into Grok Bot → · A Grok Bot front door to Claude Code sessions → · Codex overnight test PRs → · Claude builds, Codex reviews →

Get the 10 best agent setups. Free.

Plus new recipes every week. One email, no spam.

Unsubscribe anytime. Privacy

Related recipes

Same job: Dev & code

More Multi-agent recipes

In these guides: AI code review agents → · Parallel coding agents →

Get their template ↗