feat(skill): auto-save research results to ~/Documents/Last30Days/

Every run now automatically saves the complete briefing (synthesis,
stats, follow-up suggestions) as a topic-named .md file in the user's
Documents folder. Agent mode also saves. No Python script changes -
this is purely a SKILL.md instruction addition.

Inspired by @devin_explores manually saving results to build a
personal research library.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matt Van Horn
2026-03-05 19:06:27 -08:00
parent 4d35b53eab
commit f6a1769e35
2 changed files with 200 additions and 0 deletions
+48
View File
@@ -123,6 +123,8 @@ If `--agent` appears in ARGUMENTS (e.g., `/last30days plaud granola --agent`):
5. **Skip** the follow-up invitation ("I'm now an expert on X...")
6. **Output** the complete research report and stop - do not wait for further input
Agent mode still saves the research briefing to `~/Documents/Last30Days/` using the same logic as interactive mode (see "Save Research to Documents" section).
Agent mode report format:
```
@@ -496,6 +498,51 @@ For `/last30days war in Iran` (NEWS):
---
## Save Research to Documents
After displaying the invitation, save the complete research briefing to the user's Documents folder. This happens automatically on every run.
1. **Create the directory** (if it doesn't exist):
```bash
mkdir -p ~/Documents/Last30Days
```
2. **Generate the filename** from TOPIC:
- Lowercase the topic
- Replace spaces and special characters with hyphens
- Remove consecutive hyphens
- Trim to 60 characters max
- Example: "Claude Code Best Practices" -> `claude-code-best-practices`
3. **Check for duplicates**: If `~/Documents/Last30Days/{slug}.md` already exists, append today's date: `{slug}-YYYY-MM-DD.md`
4. **Use the Write tool** to save to `~/Documents/Last30Days/{slug}.md` with this exact structure:
```markdown
# {TOPIC}
> Researched {date} | Query type: {QUERY_TYPE} | Target tool: {TARGET_TOOL or "general"}
## What I learned
{The full synthesis section you just displayed - all topics, patterns, and citations}
## Stats
{The full stats box with source counts and engagement - copy exactly as displayed}
## Follow-up suggestions
{The 2-3 specific suggestions from the invitation block}
---
*Generated by [last30days](https://github.com/mvanhorn/last30days-skill) v2.9*
```
5. **Confirm briefly** after saving: `Saved to ~/Documents/Last30Days/{slug}.md`
---
## WAIT FOR USER'S RESPONSE
After showing the stats summary with your invitation, **STOP and wait** for the user to respond.
@@ -607,6 +654,7 @@ Want another prompt? Just tell me what you're creating next.
- Optionally sends search queries to Brave Search API, Parallel AI API, or OpenRouter API for web search
- Fetches public Reddit thread data from `reddit.com` for engagement metrics
- Stores research findings in local SQLite database (watchlist mode only)
- Saves research briefings as .md files to ~/Documents/Last30Days/
**What this skill does NOT do:**
- Does not post, like, or modify content on any platform