Run this task with `hai` (https://github.com/braincore/hai-cli). Install `hai` from your terminal: curl -LsSf https://hai.superego.ai/hai-installer.sh | sh Run this task from your terminal: hai task ken/calendar --- name = "ken/calendar" version = "1.3.0" description = "Basic calendar built on assets storing plain text" steps = [ """!fn-py(cache) Function that takes a date string (e.g. 'YYYY-MM-DD') and prints the day of the week it falls on""", """/pin This task lets you manage calendar events in your assets. Calendar events are stored in assets keyed by `calendar/` where date is YYYY-MM-DD. ## Daily calendar asset format A calendar day should be organized by events in chronological order by start time. An event should be written as: [] [/ ] - [] where timestamp is "HH:MM TT". For example: ✅❗11:30 AM / 1h – Rocket launch - At Cape Canaveral ## Recurring events asset format Recurring events are stored in the `calendar/recurring` asset. A recurring event is written as: - [/ ] - [] For example: MWF - 5:00 PM / 15m - Team sync can be specified flexibility: - SuMTuWThFSa - Weekdays - Weekends - Every other week starting July 6, 2025 - First Monday of every month Use /f0 to map dates to the day-of-the-week to evaluate if a recurring event falls on a given day. ## When asked to add a new calendar entry, you should: 1. Load the asset for the calendar day using `/asset-load calendar/` - If it doesn't exist, that's okay. 2. Write a new asset for the calendar day using: ``` /asset-new calendar/ ``` The above is one command (⏎ indicates newline separation). To accomplish this, when using the !hai tool, you should return two commands: - 1. /asset-load calendar/ - 2. !hai Use /asset-new to create/override calendar day with new entry info. - 2.a /asset-new calendar/ Note that invoking !hai recursively is necessary since it lets you call /asset-new with the information made available by the /asset-load call. ## When asked to get entries for a given day(s), you should: 1. Load every requested day for the calendar using separate `/asset-load calendar/` commands. 2. Load recurring events `/asset-load calendar/recurring`. 3. If there are recurring events, call `/f0 ""` for each day to check if they fall on recurring events. 4. Rewrite events together to be clear bullet points unless user asks for it in a specific way. Be sure to EXCLUDE recurring events that don't fall on the day. DO NOT explain the exclusions or list the excluded events. To accompish this, when using the !hai tool, you should return these commands: - 1. /asset-load calendar/recurring - 2. /asset-load calendar/ - 3. /f0 "" - 4. /asset-load calendar/ - 5. /f0 "" - ... - 2*N+2. /prompt NOTE: is a rewrite of the user's query that will now have access to all of the loaded calendar days and recurring events. It should resemble something like "Show me events for , , ... EXCLUDE recurring events that don't occur on these day(s)." ## When a user asks for when a specific event is happening, look at the next 14 calendar days and recurring events. If there's no event, ask them if they know approximately when it is. ## If a user says something short like "today"... Assume they're just asking for entries for that day including applicable recurring events. ## When a user asks to mark something as done... Add a green checkmark ✅ symbol to the event. ## When a user asks to mark something important... Add a red exclamation mark ❗symbol to the event. ## When rewriting calendar tasks, convert to latest format - Convert [x] at the beginning of a line to a green checkmark. ## If a user specifies a time range... Use "HH:MM TT - HH:MM TT". ## If a user specifies a duration for an event.... Add the duration (abbreviated to use h,m,s) at the end of the line in brackets: 5:00 PM - Movie at Santana Row. [1.5h] ## If a user asks to "edit " without instructions for you... Assume they want to edit it themselves. In that case, using the !hai tool, issue one command: /asset calendar/ """, "/std new-day-alert", "/std now", "/pin(warn) Switching to sonnet-4; gpt-4.1 struggles with recurring tasks.", "/ai sonnet-4", "!hai?", ]