Ask your agent
What it does
This skill turns the selected AI stories into a concise email, sends it through Gmail, records the send in Google Sheets, and removes ledger entries older than 30 days. If sending fails, it creates a draft and avoids marking stories as sent.
SKILL.md
--- name: "ai-daily-brief-summarize-send" description: "Final steps of the AI Daily Brief: summarize the selected stories, email the digest via Gmail, log to the Google Sheets ledger, and prune old rows." --- # AI Daily Brief: Summarize and Send This skill covers the last part of the AI Daily Brief automation. It takes the 5-7 stories already chosen by the Select step and turns them into an emailed digest, then records what was sent in the ledger. ## Inputs - The list of selected stories from the Select step. For each: outlet name, headline, specific article URL, and enough source material to summarize. - The list of skipped or unreachable sources from the Gather step (may be empty). - Whether the ledger was unavailable earlier in the run (if so, include the ledger-unavailable note in the footer). ## Tools The Gmail and Google Sheets tools are deferred. Load them with ToolSearch before use, for example: `select:mcp__Gmail__send_message,mcp__Gmail__create_draft,mcp__Google_Sheets__append_values,mcp__Google_Sheets__get_values,mcp__Google_Sheets__update_spreadsheet`. ## Ledger (memory) Google Sheet used as memory: https://docs.google.com/spreadsheets/d/1IkdHmxwQRi1N5iJZZV2zX9-GToePOjYP_qj2tYwrnEQ/edit?gid=0#gid=0 - Spreadsheet ID: `1IkdHmxwQRi1N5iJZZV2zX9-GToePOjYP_qj2tYwrnEQ` - Tab `Stories` (sheetId 0) - Tab `Daily run status` (sheetId 1758183705) ## Step 1: Summarize For each selected story write: - A headline. - 2-3 sentences covering what happened and why it matters. - A link to the specific article (never the outlet homepage). Rules: everything must be paraphrased in your own words. Never copy sentences from articles. Keep any direct quote under 15 words. ## Step 2: Send Email the digest with Gmail `send_message`. - To: vzanini@5dvision.com - Subject: `AI Daily Brief, Oct 17` format, using the current month abbreviation and day (today's date, US Eastern). - Body: 1. A one-line intro. 2. The numbered stories, each with a bold headline, the short summary, and the link. 3. A short footer listing any skipped sources, plus the ledger-unavailable note if it applied. - If sending fails, retry once. If it still fails, create a Gmail draft with the same content (`create_draft`) so the user can find it. ## Step 3: Log to the ledger Do this AFTER the send step, so a failed send never marks stories as covered. If the email only reached the draft stage, do not log stories; only log the run status. **Stories tab** (`append_values`, range `Stories!A1`): one row per story included. - Date sent: today as YYYY-MM-DD - News Headline: the headline used in the email - Source name: outlet name - Source URL: full link to the specific article (not the homepage) - Story key: a short 3-6 word label for the underlying event (e.g. "OpenAI new model launch", "EU AI Act enforcement update") - Topic tags: up to 3, comma-separated, chosen only from: AI models, AI research, startups, AI policy, AI safety, AI tools, new tech, hardware, software, B2C, B2B **Daily run status tab** (`append_values`, range `'Daily run status'!A1`): one row. - Current date and time (US Eastern, YYYY-MM-DD HH:MM) - Number of stories included - Comma-separated list of skipped or unreachable sources (empty if none) - One of: Sent, Saved as draft, Failed If a ledger write fails, retry once. If it still fails, say so in the final response. ## Step 4: Retention (30-day moving window) After logging, delete rows older than 30 days from BOTH tabs, using Date sent (Stories column A) and the date part of Date and time sent (`Daily run status` column A). Rows are appended chronologically, so old rows form a contiguous block at the top, below the header. Delete them with `update_spreadsheet` and a `deleteDimension` request: - dimension: ROWS - startIndex: 1 - endIndex: the index after the last old row (indexes are 0-based; the row 1 header is index 0) - sheetId: 0 for Stories, 1758183705 for Daily run status If rows are not in date order, delete the old rows individually from the bottom up. Never delete the header row or any row from the last 30 days. If nothing is old, do nothing. ## Step 5: Finish End with a one-line summary: how many stories were sent, the send status, and any problems (ledger fallback, skipped sources, failed writes). ## Extending this skill Each step above is self-contained, so it can be changed independently later (for example a different email layout, extra topic tags, or a different retention window).
1 file
- SKILL.md4.4 KB