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.

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
X (article)Source

Grok Bot + Opus 5.5: Build a 24/7 AI Engineering Team in 12 Steps

by Mori (@0xjmori) · 2026-10-12

✓ Opened via the X API (post + article text) on 2026-10-17

Read the original ↗
Part 1 · What the source did

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.

  • 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. See the original for the full context.

Part 2 · Our copy-paste version

Adapted by us from what the source described. Fill in the [BRACKETS].

The prompt

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 ruleDraft 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

⚠
What usually goes wrong
  • 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.

Related recipes