How-to patterns (library-wide)
Shared guidance that every template in this library follows. Templates link here instead of repeating it.
Tracker pattern: CSV or Doc table the bot creates, not in-place Sheets editing
Any bot that keeps a running list (invoices, rebates, habits, scholarships, grants, usage, prices, logs) keeps it in a tracker file the bot creates itself:
- CSV in Google Drive, rewritten whole each time. The bot reads the file, updates the rows in memory, and writes the complete file back. Drive can turn a CSV into a Google Sheet for viewing, but the bot keeps writing its own CSV.
- Or a table in a Google Doc the bot created. Good for short lists people read more than they sort.
- Not in-place Google Sheets editing. Grok Bot's Drive connection can create a file from CSV and rewrite files it created, but it can't edit cells in an existing Sheet. Don't point a bot at a spreadsheet you maintain by hand and expect it to update cells; it would have to overwrite your file.
Also:
- One tracker per bot, in a folder the bot owns. Other bots and people get a link only after the user says yes.
- Keep sensitive fields out: no full account, card, serial or ID numbers (last 4 at most), no passwords, no client amounts in run logs.
- Each tracker row carries a date, and each fact carries its source link.
- If the user wants a hand-kept spreadsheet, the bot writes a CSV the user can import, and the user does the merge.
Triggers instead of polling
Where a service can send alerts, have them sent or forwarded to the bot's tagged inbox, so an arriving email starts a run. A new email in the user's own Gmail does not start a routine, so a cheap daily search is a fallback only, and it says so in the prompt.
Private calendar items
The calendar connector emails every guest on an event. Bots create holds and reminders as private events with no guests and notifications off, unless the user approves an invite naming the attendees.