Skip to content

Routines

Routines are periodic maintenance tasks that keep the project healthy. They audit dependencies, clean up documentation drift, validate project status, and scan for vulnerabilities — all on a defined schedule.

Routines are managed exclusively by the Tech Lead. Code agents don’t run them. This is by design — maintenance tasks require broad project context and cross-cutting awareness that only the orchestrating agent has.

Each routine has three components:

ComponentWhat it is
FrequencyHow often it should run (e.g., every 5 days, every 7 days, every 14 days)
ProcedureA concrete, step-by-step process the Tech Lead follows
Dashboard entryA row in agent/Core/routines.md tracking when it last ran and when it’s next due

Routines are opt-in. The routine-check sensor flags overdue routines at session start, but you decide when to run them. The agent never runs a routine autonomously — it waits for your approval.

  1. Detection

    At the start of every session, the routine-check sensor parses the dashboard at agent/Core/routines.md. It compares each routine’s last-ran date against its frequency and flags any that are overdue.

    Agent: OVERDUE: dependency-audit (last ran 12 days ago, due every 7)
  2. Approval

    You tell the Tech Lead to run the routine. You can be specific or broad:

    You: Run the dependency audit
    You: Run all overdue routines
  3. Execution

    The Tech Lead follows the routine’s concrete procedure step-by-step. Each routine has a detailed checklist — the agent doesn’t improvise. For example, the dependency-audit routine walks through scanning go.mod, checking for CVEs, flagging unmaintained packages, and documenting findings.

  4. Logging

    Results are appended to station/Logs/RoutineLog.md with a timestamp, the routine name, and a summary of findings.

  5. Dashboard update

    The Tech Lead updates the last_ran timestamp in agent/Core/routines.md. The next-due date is automatically calculated from the frequency.

All 8 routines in the Bonsai catalog:

RoutineFrequencyWhat it does
backlog-hygiene7 daysReview Playbook/Backlog.md — flag stale items, escalate P0s, cross-reference with Status and Roadmap
dependency-audit7 daysScan dependencies for known CVEs and unmaintained packages
doc-freshness-check7 daysDetect documentation drift — find docs that are stale relative to recent code changes
infra-drift-check7 daysCompare declared IaC state against actual cloud resources
vulnerability-scan7 daysSAST scan, secrets scan, and dependency audit — flag new, resolved, and persistent vulnerabilities
status-hygiene5 daysKeep Playbook/Status.md clean — archive old Done items, validate Pending items
memory-consolidation5 daysBridge Claude Code auto-memory into agent/Core/memory.md — validate facts, clean redundant entries
roadmap-accuracy14 daysEnsure Playbook/Roadmap.md reflects what’s actually built and what’s actually next

The dashboard lives at agent/Core/routines.md inside the Tech Lead’s workspace. It tracks each routine’s status in a structured format:

## Routines
| Routine | Frequency | Last Ran | Next Due |
|---------|-----------|----------|----------|
| backlog-hygiene | 7 days | 2025-01-15 | 2025-01-22 |
| dependency-audit | 7 days | 2025-01-10 | 2025-01-17 |
| doc-freshness-check | 7 days | 2025-01-14 | 2025-01-21 |
...

The routine-check sensor reads this dashboard at session start. If any routine’s next-due date is in the past, it flags it as overdue in the session context.

The routine-check sensor is automatically managed by Bonsai:

  • Installed when you add any routine to an agent
  • Removed when you remove the last routine from an agent

You never need to manually install or configure it. If an agent has routines, the sensor is there. If it doesn’t, the sensor is gone.

Routines depend on scaffolding files to do their work:

RoutineScaffolding dependency
backlog-hygieneReads and maintains Playbook/Backlog.md
status-hygieneReads and maintains Playbook/Status.md
roadmap-accuracyReads and maintains Playbook/Roadmap.md
doc-freshness-checkScans all project documentation
dependency-auditLogs results to Logs/RoutineLog.md
vulnerability-scanLogs results to Logs/RoutineLog.md
memory-consolidationReads and maintains agent/Core/memory.md
infra-drift-checkLogs results to Logs/RoutineLog.md

This is why scaffolding modules like Playbook and Logs are required — routines rely on them to function.

You: Hi, get started
Lead: [startup flags: "OVERDUE: dependency-audit (last ran 12 days ago, due every 7)"]
You: Run the dependency audit
Lead: [follows procedure -> logs to RoutineLog.md -> updates dashboard]

Useful prompts for working with routines:

  • “Are any routines overdue?”
  • “Run all overdue routines”
  • “Run the vulnerability scan”
  • “What did the last dependency audit find?”

Each routine has a concrete, step-by-step procedure — the agent doesn’t improvise. This makes routine execution predictable and auditable.

You can create your own routines by adding markdown files with YAML frontmatter (including a frequency field) to agent/Routines/. See Creating Custom Routines for the full guide.