Commit Graph

371 Commits

Author SHA1 Message Date
Matt Van Horn d564e482c9 Add viral dog trend example to README
Shows how /last30days discovers trends you didn't know existed:
- "Dog as human" viral phenomenon (600-900+ upvote threads)
- Renaissance portraits, noir detectives, chibi characters

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 17:25:25 -08:00
Matt Van Horn 19c44f5502 Add README with Remotion launch video example
Shows the full workflow: research → synthesis → prompt generation
Includes the actual generated prompt for a 50-second launch video

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 17:14:18 -08:00
Matt Van Horn a552314443 CRITICAL: Enforce using prompt FORMAT from research
If research says "use JSON prompts", the generated prompt MUST be JSON.
Previously the skill would learn about JSON format then ignore it and
write plain prose - defeating the purpose of the research.

- Add PROMPT FORMAT as required field to capture during research
- Add explicit anti-pattern warning about ignoring format
- Update quality checklist to verify format matches research

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 17:00:34 -08:00
Matt Van Horn 4e871a4f35 Fix spinner spam in non-TTY mode (Claude Code)
- Detect if running in real terminal vs captured output
- In TTY: show animated spinner with carriage returns
- In non-TTY: print simple static messages (no animation)
- Prevents output file from exploding with spinner frames

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 16:57:33 -08:00
Matt Van Horn 7b3150a69d Add --debug flag for verbose logging
- Add LAST30DAYS_DEBUG env var / --debug flag
- Log HTTP requests, responses, and errors
- Show API error details when debug enabled
- Helps diagnose API failures

Usage: python3 last30days.py "topic" --debug

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 16:54:31 -08:00
Matt Van Horn 9604d0ba46 Add error handling for X/xAI API calls
- Wrap xAI search in try/except like Reddit
- Show error message but continue with Reddit results
- Parse function checks for API errors before processing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 16:50:05 -08:00
Matt Van Horn 546f93fe43 Remove caching - always fetch fresh data
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 16:28:49 -08:00
Matt Van Horn 26e8d53089 Add clear cache indicators to output
- Show " CACHED RESULTS (Xh old)" in compact output header
- Add "use --refresh for fresh data" hint
- Track from_cache and cache_age_hours in Report schema
- Update UI to show cache age in stderr message

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 16:25:45 -08:00
Matt Van Horn 1e44f9d9b4 Fix Reddit search to return actual discussion threads
- Update prompt to search for "site:reddit.com/r/ {topic}"
- Add explicit filtering for /r/*/comments/* URLs
- Block garbage domains (developers.reddit.com, business.reddit.com)
- Make prompt lenient for older threads when recent ones scarce
- Require returning threads found, never empty items

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 16:22:52 -08:00
Matt Van Horn 9daf671b82 Add animated progress UI with ASCII art
- New ui.py module with colored output and animations
- Animated spinner during Reddit/X searches
- Progress tracking for enrichment phase [1/N]
- Fun random status messages per phase
- Mini ASCII banner at start
- Completion summary with timing

Makes the research feel more alive while waiting!

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 16:11:45 -08:00
Matt Van Horn 664b1cc52d Fix output order and Reddit extraction
1. Output order: What I learned → TARGET TOOL → KEY PATTERNS → Research Complete → Share vision
2. Fixed Reddit returning empty results - OpenAI was finding URLs but not extracting content
   - Updated prompt to explicitly require extraction from search results
   - Added "MUST include threads" instruction to prevent empty items

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 16:02:05 -08:00
Matt Van Horn c9d4320b9b Fix UX: research first, ask about tool after
Previously asked "What tool?" before running research, which was
backwards for exploratory queries like "iOS design mockups".

Now:
- If tool is specified in query, use it
- If tool NOT specified, run research first
- Ask about target tool AFTER showing results (with smarter options based on what research found)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 15:54:23 -08:00
Matt Van Horn e141ff07ea Fix cache loading with Report.from_dict() method
The Report.to_dict() serializes range as {from, to} but constructor
expects range_from/range_to. Added from_dict() classmethod to properly
deserialize cached data, reconstructing all nested objects (Engagement,
Comment, SubScores, RedditItem, XItem).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 15:46:09 -08:00
Matt Van Horn 101c3ad07a Fix synthesis hallucination - ground in actual research content
The skill was finding correct sources (e.g., ClawdBot content) but Claude
was synthesizing based on its pre-existing knowledge (Claude Code skills)
instead of what the research actually said.

Added strong grounding instructions:
- CRITICAL warning to base synthesis on actual research, not pre-existing knowledge
- Anti-pattern example: don't conflate "clawdbot skills" with "Claude Code skills"
- Self-check reminder before displaying summary
- Updated "What I learned" template to emphasize traceability to sources

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 15:40:36 -08:00
Matt Van Horn 40f9dc4877 Fix output order and add Reddit error handling
- SKILL.md: Move "What I learned" BEFORE "Research Complete" stats
- Add error tracking to Report schema (reddit_error, x_error fields)
- Wrap OpenAI API calls in try/catch with clear error messages
- Show explicit error or "no results" messages in compact output
- Fix false positive error detection for null error fields

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 15:26:33 -08:00
Matt Van Horn 72e4f79d65 Reorder: patterns → expert → stats → invitation
Stats near bottom so they're visible in terminal when output finishes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 13:50:40 -08:00
Matt Van Horn 4f027fe972 Reorder output: stats → patterns → expert → invitation
Show proof of work first:
1. Research stats (upvotes, likes, sources)
2. Key patterns discovered (5 bullet points)
3. "I'm now an expert in X"
4. "Share your vision..."

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 13:49:20 -08:00
Matt Van Horn f603323ca8 Add --quick and --deep flags for research depth
- quick: 8-12 sources each, faster response
- default: 20-30 sources each (unchanged behavior)
- deep: 50-70 Reddit, 40-60 X for comprehensive research

Adjusts API timeouts based on depth. Cache keys include depth
so different depths are cached separately.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 13:41:55 -08:00
Matt Van Horn 19d2c41161 Wait for user's vision before writing prompts
- After stats summary, invite user to share what they want to create
- Wait for their response instead of auto-dumping generic prompts
- Write ONE tailored prompt based on their specific vision
- Only provide multiple options if they ask for more
- Stay in expert mode for follow-up requests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 13:30:19 -08:00
Matt Van Horn c037eea15f Refocus skill on prompt-first output with stats summary
- Parse user intent for TOPIC and TARGET_TOOL upfront
- Ask follow-up if target tool unclear
- Show impressive stats summary after research (upvotes, likes, etc.)
- Primary output is now copy-paste-ready prompts for target tool
- Keep expert context for follow-up custom prompt requests
- Research is internalized, not dumped back at user

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 13:26:01 -08:00
Matt Van Horn 5ca4829be4 Initial commit: last30days skill
Research topics across Reddit + X from the last 30 days using
OpenAI and xAI APIs. Features:
- Auto model selection (GPT-5.x, Grok-3)
- Popularity-aware scoring (relevance + recency + engagement)
- Reddit thread enrichment with real metrics
- Near-duplicate detection
- Multiple emit modes (compact, json, context, path)
- 24h caching with --refresh bypass
- NUX for API key setup
- 87 passing unit tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 12:37:31 -08:00