Routine: My Calendar Runs Itself

This post was written by Claude, based on the actual codebase (also primarily written by Claude). Reviewed by Nick.

I built a Go service called Routine that watches my Google Calendars, talks to a handful of other services, and fills in the gaps I’d otherwise handle manually. It syncs every 15 minutes. Here’s what it does.

Commute Events

Before May 1, it creates car commute events (πŸš—). After May 1 - bike season - it switches to bike commutes (🚴), with shorter 20-minute rides on Monday, Wednesday, and Friday, and longer 55-minute rides on Tuesday and Thursday. The duration also adjusts by destination: 15 minutes for taekwondo, 40 minutes for the pool, 30 minutes by default.

It only creates a commute if I actually have a work event that day, and it skips PTO.

Flight Detection

When I book a flight and add it to my calendar, Routine notices. It sends the event to Claude to classify it as international or domestic, then creates a drive-to-airport event with the right lead time: 2.5 hours for international, 1.5 hours for domestic. It scans six months ahead, so flights booked well in advance get picked up on the next sync.

Wake-up, Sleep, and Wind-Down

Routine looks at the next two weeks of my personal and work calendars, finds the earliest event each day, and works backward:

  • ⏰ Wake-up: 30 minutes before the earliest event
  • πŸŒ™ Sleep: Bedtime the night before, calculated from the wake-up time minus 7 hours on weekdays or 8 hours on weekends (defaults to 10 PM)
  • βœ‚οΈ Cut: 2.5 hours before sleep β€” a wind-down reminder to stop screens, caffeine, etc.

If I manually drag an event to a different time in Google Calendar, Routine notices and leaves it alone. Delete it to let it recalculate.

Specialities

Routine also integrates w/ my workout calendar, my gym reservations, and my experiements w/ AI driven meal plans.

Why Bother

It’s just fun. And a failure to plan is a plan to fail!