Ask your agent
What it does
Collects recent AI and tech stories from the specified sources, checks them against the last 30 days of the ledger, and returns deduplicated candidates for selection. It also logs fetched, snippet-only, and skipped sources in the spreadsheet.
SKILL.md
--- name: "ai-daily-brief-gather" description: Gather step of the AI Daily Brief email automation. Gets the current time, reads the Google Sheets ledger of stories already sent (last 30 days), then runs targeted web searches across the named AI and tech news sources for stories from the last 24 hours, removes candidates already covered (exact URL match or same event, keeping significant new developments as "Update:" stories with a new Story key), saves the list of web sources used (fetched, snippet-only, skipped) to the ledger spreadsheet, and returns a de-duplicated candidate pool plus an "already covered" list for the Select step. Use this whenever the AI Daily Brief, daily AI news digest, or daily tech email brief task needs to collect news, check what was already covered, or find the last 24 hours of AI and tech stories, even if the user only says "gather", "collect the news" or "run the first step". --- # AI Daily Brief: Gather This is step 1 of the AI Daily Brief pipeline (Gather, Select, Summarize, Send). Its job is to produce two things for the next step: a pool of fresh candidate stories with repeats already removed, and a list of what has already been sent recently. It also logs the web sources it used to the ledger spreadsheet. It does not rank, summarize, or send anything. Keeping it narrow means this step can be extended later (more sources, better search strategy) without touching the others. ## Ledger reference - Spreadsheet: "Ledger - Daily Tech Email Brief" - spreadsheetId: `1IkdHmxwQRi1N5iJZZV2zX9-GToePOjYP_qj2tYwrnEQ` - URL: https://docs.google.com/spreadsheets/d/1IkdHmxwQRi1N5iJZZV2zX9-GToePOjYP_qj2tYwrnEQ/edit - Tab "Stories" (sheetId 0): one row per story sent. Columns A-F in this order: Date sent (YYYY-MM-DD) | News Headline | Source name | Source URL | Story key | Topic tags. Row 1 is a header row. - Tab "Daily run status" (sheetId 1758183705): one row per run. Columns A-D: Date and time sent (YYYY-MM-DD HH:MM, US Eastern) | Stories included (count) | Sources skipped or unreachable (list) | Send status (Sent, Saved as draft, or Failed). - Tab "Fetched sources" (written by this step): one row per web source used in a run. Columns A-E: Run date and time (YYYY-MM-DD HH:MM, US Eastern) | Source name | URL | Page title or headline | Status (Fetched, Search snippet only, or Skipped). Row 1 is a header row. If the tab does not exist yet, create it in step 5. - Always use column positions, never header text, because headers may be renamed. - Sheets tools (`get_values`, `append_values`, `update_values`, `update_spreadsheet`) may be deferred. If a call fails with a schema error, load them with ToolSearch (`select:mcp__Google_Sheets__get_values`, and so on) and retry. ## Steps ### 1. Get the current date and time Call the `current_time` tool. Do not rely on any other clock. This value drives three things downstream: the subject line, the ledger rows, and the cutoff for "last 24 hours" (now minus 24 hours). Pass the timestamp on to the later steps. ### 2. Read the ledger and build the "already covered" list 1. Call `get_values` on `Stories!A2:F` and on `'Daily run status'!A2:D`. 2. Keep every Stories row whose Date sent falls within the last 30 days. Compare as dates, not strings, because the sheet may return dates as text (`2026-10-15`) or as formatted dates. This is the "already covered" list: headline, source, URL, story key, and topic tags for each row. 3. Use the run-status rows to see how recent runs went (for example a recent Failed run means the stories listed for that day may never have reached the inbox). Note anything unusual for the Select step. 4. If the read fails, retry once. If it still fails, use the fallback below. **Fallback (ledger unreadable):** Use Gmail `search_threads` for subject "AI Daily Brief", read the 2-3 most recent digests, and extract the stories they covered into the same "already covered" shape (headline, source, URL where available). Set `ledger_status: unavailable` in the output so the Send step can say in the digest footer that the ledger was unavailable. The duplicate check is never skipped. Sending the same story two days running is the failure this step exists to prevent, so if both the ledger and Gmail fail, say so clearly in the output and let the orchestrating task decide how to proceed rather than silently continuing with an empty list. ### 3. Gather candidate stories from the web Search for AI and tech news published in the last 24 hours. **Sources:** TechCrunch, The Verge, Ars Technica, MIT Technology Review, Wired, VentureBeat, Reuters tech, and the official blogs of OpenAI, Anthropic, Google DeepMind, Meta AI, and Microsoft. **How to search** - Run several targeted `WebSearch` queries, one per source or small source group, not one broad query. A broad query returns surface-level results dominated by a few outlets, and targeted ones surface what each source actually published. - Include the current date or "today" in queries so results skew recent. Use short queries (1-6 words plus the source name or domain). - Use `mode: "standard"` by default. Switch to `"extended"` only if a result comes back thin or stale for an important source. - Use `WebFetch` on promising articles when search snippets are too thin to tell what happened or when it was published. - Only keep stories whose publication time falls within the 24-hour window. Drop anything older, even if it appears in the results. **Limits (hard)** - At most 10 web searches and 20 page fetches in total. - Close the web gathering within 4 minutes of starting it. Do not loop. When a limit is hit, stop and work with what has been collected. **Blocked or unreachable sites:** If a site cannot be searched or fetched, skip it and record the source name. Do not work around it with curl, mirrors, caches, or other routes. The skipped list is passed on so the digest and the "Daily run status" tab can report it. **Copyright:** Gather only facts and your own short notes about each story. Do not paste article text into the output; later steps paraphrase. **Order of the next steps:** the moment web gathering ends (or a limit is hit), do the source logging in step 5 first, then the repeat check in step 4. The log records what was looked at, which does not depend on which stories turn out to be repeats, and writing it first means it is saved even if the repeat check runs into trouble. ### 4. Avoid repeats Check every candidate against the "already covered" list from step 2 before handing anything on. Readers notice when the same story shows up two days running, and a candidate list that still contains repeats pushes the problem onto the next step. Run both checks below on each candidate, exact match first. **a. Exact match (URL).** Normalize the candidate's article URL and compare it with the normalized Source URL (column D) of every already-covered row: - lowercase the host (the scheme and host are case-insensitive, the path is not), - strip the query string and tracking parameters (`utm_*`, `ref`, `fbclid`, and anything after `?`), - strip any `#fragment`, - strip a trailing slash. A match is a duplicate: drop the candidate. **b. Event match (Story key).** Compare the underlying event of the candidate with the Story key values (column E) of the already-covered rows. Story keys are short event labels, for example "Meta Muse Spark Open release" or "Anthropic METR evaluator access". Judge by the event, not the wording: the same event reported by a different outlet, with a different URL and headline, is a duplicate. Drop it. The one exception is a significant new development in an event already covered, such as a new launch phase, a ruling or decision, a major reversal, new figures that change the picture, or a reaction that changes the story. In that case keep the candidate and: - mark it as an update (`Update: yes`) and tell the next step to start its summary with "Update:", - say in one line what is new compared with the earlier story, - give it a new, more specific Story key that distinguishes it from the original (for example "Meta Muse Spark Open release" becomes "Meta Muse Spark Open license change"), so tomorrow's check does not treat it as a repeat of either. A follow-up that only repeats the original facts, adds commentary, or covers the same event from another angle is not a significant development; drop it. When unsure, drop it: a missed update costs less than a repeat. For each kept candidate, set a Story key in the same short style as the ledger (new events get one too, because the Send step writes it to the ledger). Record every dropped candidate with the reason (`exact URL match` or `same event as: <story key>`), so a human can audit the check later. When the ledger was unavailable and the Gmail fallback was used, there are no story keys to compare, so apply the URL check where URLs are available and judge the event match against the digest headlines. ### 5. Save the web sources to the ledger spreadsheet Run this immediately after step 3 ends (or a limit is hit), before the repeat check in step 4. Saving it at this point means the record exists even if a later step fails, and it gives you an audit trail of what each run actually looked at. It is numbered 5 only so that "Avoid repeats" stays step 4. 1. Check whether the "Fetched sources" tab exists (`get_spreadsheet` on the spreadsheetId). If it is missing, create it with `update_spreadsheet` (an addSheet request titled "Fetched sources") and write a header row in A1:E1 with `update_values`: Run date and time | Source name | URL | Page title or headline | Status. 2. Build one row per web source: every page successfully fetched (Status "Fetched"), every candidate taken only from a search result without a fetch (Status "Search snippet only"), and every source that was skipped or unreachable (Status "Skipped", URL blank if there is none). Use the run time from step 1, formatted as YYYY-MM-DD HH:MM in US Eastern, in column A of every row. 3. Add all rows in a single `append_values` call to `'Fetched sources'!A:E`. Appending, not overwriting, keeps earlier runs' history intact. 4. If the write fails, retry once. If it still fails, set `sources_log_status: failed` in the output and continue. A logging problem should not stop the digest, but the failure has to be visible to the orchestrating task so it can be reported. Never write to the "Stories" tab here. That tab means "story was sent" and is written only after a digest actually goes out. ## Output (hand-off to Select) Return this structure in the conversation (and as a file if the orchestrating task asks for one): ``` Run time: <current_time value> Window start: <now minus 24h> Ledger status: ok | unavailable (fallback used) Sources log status: saved to "Fetched sources" tab (<n> rows) | failed Already covered (last 30 days): - <date> | <headline> | <source> | <url> | <story key> | <tags> Candidates (repeat check applied): 1. Headline: <working headline in your own words> Source: <source name> URL: <link> Published: <timestamp or "within window, time unknown"> Story key: <short event label, same style as the ledger> Update: no | yes (summary must start with "Update:"; what is new: <one line>) Notes: <1-2 sentences on what happened and why it may matter> Dropped as repeats: - <headline> | <url> | exact URL match | same event as: <story key> Sources skipped or unreachable: <list, or "none"> Budget used: <n> searches, <n> fetches ``` Gather roughly 12-20 candidates before the repeat check, so that enough remain afterwards for the Select step to reach 5-7. Where several outlets cover the same story within this run, list it once and put the extra links in Notes. Repeats of the ledger are removed here, not left for Select, so Select can treat every candidate as new or as an explicit update. Select still owns ranking and the final choice of 5-7. If fewer than 5 candidates survive the repeat check, say so plainly in the output instead of padding the list with repeats.
1 file
- SKILL.md11.8 KB