Knowledges 7 min

Claude Routines

Turn GitHub into your control center: Issues are the input, PRs are the review gates, and Claude Routines work while you sleep. But only automate PART of it, and here's why.

Also in: Tiếng Việt · 中文 · 한국어 · 日本語

Turn GitHub into your bottleneck (wait, what). Okay, "turn GitHub into your control center" is more accurate. Here's how I do it.

Preparation: this part matters!

  • CLAUDE.md: you can check out the post I wrote on Substack the other day. You've probably heard people call this file "the map", right? But it's not a map of the codebase. Agents can dig up the folder structure super fast on their own, no guidance needed. The "map" here is more like a "map of rules" (a list of DOs and DON'Ts), think of it like the "Playground Rules" sign: whenever you want to do something, you know where to read the rule for it. This file isn't a hard gate that guarantees agents will always do EXACTLY that, but it definitely improves how agents work.
  • Tests & CI/CD: to automate safely, you have to control the input and output well. The input is the prompt, the output is code. Whether the code runs correctly depends on tests; whether it does what you expected depends on the input (the prompt) and your development rules (CLAUDE.md and rules).
  • Repo structure: always have a dev branch (or beta/staging) and a main branch (for stable/production). Only automate into dev!

Claude Routines: let Claude work automatically while you sleep!

Sounds fancy, huh? But there's a reason I put "partially" in parentheses in the title. The whole flow is 3 routines chained together:

mermaidflowchart TD
  A["Small, clear issue (written with a skill)"] -->|"label ai-handle"| B["Routine 1: /ak-vibe --ship --beta --advice"]
  B --> C["PR into dev/beta branch"]
  C -->|"label ai-handle"| D["Routine 2 (2:00AM): /ak-review-pr --merge"]
  D --> E["PR merged, CI green (ai-merged)"]
  E --> F["Routine 3 (7:30AM): daily report"]
  F --> G["Human review & verify"]
Issue → PR → review → report flow with Claude Routines

Automation readiness checklist

  • Chưa xong: Small scoped issue with measurable acceptance criteria and evidence
  • Chưa xong: CLAUDE.md defines rules, tests reviewed by humans
  • Chưa xong: Concurrency protection prevents duplicate sessions
  • Chưa xong: Automated merging only to dev; watch post-merge CI
  • Chưa xong: Human reviews the daily report before production
mermaidflowchart LR
 A["GitHub Issue"] --> B["Agent implementation"]
 B --> C["PR to dev"]
 C --> D["CI and security review"]
 D --> E["Daily human verification"]
Automation readiness checklist

1/ Input: GitHub Issues = TODO list

  • Idea: Claude reads the Issues and implements them automatically, then opens a PR into dev (beta) when done.
  • Important: each issue is a VERY SMALL task. Break work down into tasks small and specific enough to raise the completion rate of the agents' output. When creating an issue, keep asking yourself: "is this enough to be sure the agent will build exactly what I want?"
  • Writing issues: don't write them by hand. Write them with a Skill, using Claude or any AI tool that can connect to your GitHub repo (via GitHub MCP/CLI). Why: in the issue-writing skill we ask the agent to scout the codebase first so it understands it, even verify whether the issue has already been addressed (someone else may have done it), scan existing issues to avoid duplicates (someone may have already filed it), always make the agent provide evidence (absolutely no guessing or assuming), and include a STOP GATE to halt when the evidence isn't strong enough (the codebase isn't ready or there's a risk that can't be automated).
  • Issue template (just put this in the issue-writing skill): Context (scout status), Requirements (yours), Expectations (yours), Purpose (the why), Risks (AI analyzes), Evidence (AI scouts).
  • Status labels: ai-handle, in-progress, beta-shipped; these keep agents from stepping on each other's toes.

Locked section: 2/ Output: GitHub PRs = the MACHINE's (AI) review gates

Locked section: 3/ Human review & verify

Locked section: ❌ Never ever

Locked section: 1/ Automate a request (issue ticket) that's too big

Locked section: 2/ Automate a brand-new project

The rest is for Knowledges members

Plus 5 more sections (about 4 min) for members

You are reading roughly the first third. Knowledges, Combo and Community plans unlock paid articles in full; the Zuey AI plan reads previews only.