Topics ▾
Routines ·

Run nightly code audits that leave PRs for the morning

Advanced, 30 minutes

Engineer Bots clean up the codebase overnight; you review a fresh set of pull requests with breakfast.

How this helps you

Maintenance happens every night instead of in rare clean-up sprints.

✦ Try it
Every night at [time], audit [repo] for [audit type]. For each improvement, start a cloud agent to make the change on its own branch and open a PR with proof: tests passing and [proof]. Keep each PR small and focused. Don't merge anything. In the morning, send me a list of PRs with one line each on what changed and the risk.

Fill in: [time] is a quiet hour, such as 3 a.m. [repo] is the repository. [audit type] is dead code, bundle size, security, build time, translations or parity. [proof] is what you need to trust it, such as before and after screenshots.

What they did

In the official Grok Bot for Engineering guide, Lingxi Li, who builds Grok Bot, describes nightly audits. Every night at 3 a.m. her engineer Bots clean up the codebase: improving code quality, removing dead logic, speeding up app load time and reducing bundle size. Each morning she gets a fresh set of PRs, which turned maintenance into a daily routine. Her other audit ideas: security audits, CI/CD build-time audits, internationalisation audits for features shipped in one language, parity audits between clients such as iOS and desktop, and catch-up audits that summarise PRs merged in the last 24 hours. Her Bots start Cursor cloud agents for the work and check the proof attached to each PR, and a PR is only merged automatically when the review is highly confident and the blast radius is low; otherwise she reviews it.

Who it's for: Engineers and small teams with a codebase that needs regular tidying.

Before you start

How to try it

  1. Pick one audit type to start, such as dead code or bundle size.
  2. Run it once by hand with the prompt below and review the PRs it opens.
  3. Tighten the instructions: what counts as safe, what proof each PR needs (tests, before and after screenshots).
  4. Turn it into a nightly routine at a quiet hour.
  5. Decide your merge rule. Lingxi only lets high-confidence, low blast radius PRs merge automatically; start with none.
  6. Add a second audit type only once the first runs cleanly for a week.

What to expect

A morning list of three to five small PRs, each with a one-line summary, risk note and proof attached.

Common mistakes

Related tips

Worth knowingOfficial guide on x.ai, written by an engineer on the Grok Bot team. Paraphrased by us; read the guide for her P0 urgency routine and other tips.
Next in Routines →Make your first task boring

Learn more: Grok Bot Routines Not Working? Do It by Hand, Save a Skill, Then Schedule · All Grok Bot routines tips

Related Grok Bot tips

More Routines →
Routines

A read-only usage audit across your whole Bot team

One prompt has your chief of staff check every Bot's routines, schedules and triggers, then report what to pause, slow, narrow or merge, and change nothing until you approve.

How this helps you You see exactly which routines and triggers spend your usage, with a ranked list of safe changes you approve one by one.
Spotted by @Michael_Fenech_ · 3 Nov 2026
Routines

Have a Bot watch for cancellations at a fully booked spot

Ask a Bot to check a booking page every hour and ping you the moment a slot opens, so you can grab a cancellation before anyone else.

How this helps you You stop refreshing a booking page and still catch the cancellation.
Spotted by @mattyp · 31 Oct 2026
Routines

A routine that triages your backlog with RICE and blast radius

Your Bot collects requests into a backlog, then a routine scores each item for reach, impact, confidence, effort and blast radius so the best small jobs rise to the top.

How this helps you You stop arguing about what to build next; the backlog sorts itself by value and risk.
Spotted by Rob Shocks - Switch Dimension (YouTube) · 31 Oct 2026