Commit Graph

95 Commits

Author SHA1 Message Date
Matt Van Horn 10f61c503d Restore 7 missing v1 features + add query parsing display + v1-vs-v2 test plan
Feature audit found 11 things v2 dropped from v1. Restored the 7 that affect
output quality: quality checklist for prompts, anti-pattern examples, self-check
instruction, "don't re-search" context memory, prompt format anti-pattern,
multi-prompt guidance, and emoji footer with engagement counts.

Also adds visible query parsing display (🔍 **{TOPIC}** · {QUERY_TYPE}) and
the full v1-vs-v2 comparison test plan with all 17 test queries from README.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 15:27:46 -08:00
Matt Van Horn 4b0098b754 Remove context: fork — root cause of broken skill execution
The old v1 skill worked because context: fork was SILENTLY IGNORED
due to Claude Code bug #17283. The skill ran inline in the main
conversation. Claude Code 2.1+ fixed the bug and now properly
honors fork mode, creating an isolated subagent that ignores all
instruction ordering (text output, bash-first, etc.).

Fix: remove context: fork so the skill runs inline again, matching
the behavior the user knows works. Also restored v1-style
instruction flow: parse intent first, then run script, then WebSearch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 10:28:58 -08:00
Matt Van Horn df29bbb53d Revert to bash-first execution with echo progress display
The agent in fork mode ignores text output instructions and jumps
straight to WebSearch. Reverted to the original "YOUR FIRST ACTION:
Run this command. EXECUTE." pattern that actually worked. Embedded
progress display as echo statements inside the bash command so they
can't be skipped. The agent was not running the Python script at all
when the first instruction was about text output.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 10:18:53 -08:00
Matt Van Horn a6dd0a8b0e Move progress block to very first instruction in SKILL.md
The agent was skipping the progress text because it was buried after
parsing logic at line 41. Restructured so the FIRST section is
"YOUR FIRST OUTPUT" with the progress block, BEFORE any tool call
instructions. Added explicit "DO NOT skip this" enforcement.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 10:16:49 -08:00
Matt Van Horn c3120d29a3 Show visible progress block before research starts
The ui.py spinner/color output goes to stderr which Claude Code
buffers invisibly. Instead, have the agent output a visible progress
block with emoji showing Reddit/X/Web agents deploying.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 10:13:59 -08:00
Matt Van Horn 11f9ab8519 Restore acknowledgment step before research execution
Add back the brief topic acknowledgment ("Researching X — searching
Reddit for upvotes...") and descriptive intro that the v1 skill had.
The v2 version was jumping straight into script execution with no
user-facing feedback about what was being researched.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 10:10:49 -08:00
Matt Van Horn 7c36866524 Fix v2 output quality: stats format, Reddit results, citations, summary structure
- Stats: replace BAD/GOOD examples with strict fill-in-the-blank template
- Reddit: add subreddit-targeted fallback search, soften scoring penalties
  (engagement -10→-3, date confidence -10→-5), add minimum result guarantee
- Citations: limit to 1 per insight, short format, no engagement metrics
- Summary: add bold topic headers template for structured paragraphs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 10:04:46 -08:00
Matt Van Horn 38451d44c9 Restore original description, enforce emoji stats format, require source attribution
- Reverted description to original public repo copy
- Restored H1 heading, moved imperative instruction to bold paragraph
- Added BAD/GOOD examples enforcing emoji tree stats format
- Required @handle and r/subreddit citation in ALL summary types
- Removed agent:Explore and disable-model-invocation from frontmatter

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 09:48:21 -08:00
Matt Van Horn 63de326df0 Fix skill not executing: remove agent:Explore, front-load run command
The Explore agent was treating SKILL.md as documentation to summarize
instead of instructions to follow. Removed agent:Explore from frontmatter
and restructured opening to immediately command script execution.

Also adds release plan for Bird CLI v2.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 09:38:32 -08:00
Matt Van Horn 4230fa2b69 Fix YAML parsing error in argument-hint field
Wrap value in single quotes to properly escape nested double quotes.
This fixes skills CLI installation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 07:37:17 -08:00
Matt Van Horn 4e972d009c Rename skill from last30daystest to last30days
- Update skill name and description (remove TEST markers)
- Update script path to ~/.claude/skills/last30days/
- Clean up header, keep Bird CLI features prominent

Ready for local testing as the main skill.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 16:11:21 -08:00
Matt Van Horn 17485ec797 Make RECOMMENDATIONS format flexible (table or stacked)
- Remove over-prescriptive format requirements
- Let Claude choose table vs stacked naturally based on content
- Keep critical requirement: Sources line with @handles
- Claude Code's renderer handles the responsive wrapping

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 15:55:41 -08:00
Matt Van Horn 56f9eceb9c Switch RECOMMENDATIONS to stacked card format (responsive)
- Replace ASCII table with stacked card format
- Each card: Tool/Mentions/Use Case/Sources on separate lines
- Cards separated by horizontal rule (────)
- Doesn't break when terminal window is narrow
- Still includes @handles in Sources line

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 15:12:56 -08:00
Matt Van Horn c534c3b9a5 Update RECOMMENDATIONS format to use ASCII tables with @handles
- Changed from numbered list to ASCII box-drawing table format
- Added "Key Sources" column that MUST include @handles from X posts
- Added explicit instructions to parse and display highest-engagement handles
- Matches the output quality of the original xAI version

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 15:04:41 -08:00
Matt Van Horn 3afc1213b8 Add explicit instructions to calculate engagement totals
Claude was summarizing qualitatively ('mostly casual conversation')
instead of summing actual engagement numbers from the output.

Added CRITICAL note to:
- Parse [Xlikes, Yrt] from each X post
- Sum totals for the stats display
- Show top voices with engagement (e.g., @handle (15K likes))

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 14:47:41 -08:00
Matt Van Horn e7610ddcac Fix Bird search: strip noise words + fix date parsing
1. Add _extract_core_subject() to strip noise words before X search
   - X search is literal keyword matching, not semantic
   - "best open claw usecases" → "open claw" (27 results vs 0)

2. Fix ISO date detection bug
   - Was: if "T" in created_at (matched "Tue" in "Tue Feb 03...")
   - Now: if created_at[10] == "T" (proper ISO separator check)
   - Dates now parse correctly: (2026-02-03) instead of (date unknown)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 14:38:38 -08:00
Matt Van Horn f800b5eb1b Fix Bird CLI response parsing
1. last30days.py: Check isinstance(dict) before .get() - Bird returns
   list on success, dict on error

2. bird_x.py: Update field mappings for Bird's actual response format:
   - author.username not user.screen_name
   - createdAt not created_at (camelCase)
   - likeCount, retweetCount, etc. (camelCase)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 14:00:40 -08:00
Matt Van Horn 2c398ef6cb Enable API keys: remove clean mode
Now reads from ~/.config/last30days/.env like the regular skill.
Bird CLI + API keys both work together.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 13:47:10 -08:00
Matt Van Horn bcf5c2cc3f Fix: embed date filter in query instead of --since flag
Bird CLI doesn't support --since as a CLI flag.
Use X's search syntax: 'topic since:YYYY-MM-DD'

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 13:26:51 -08:00
Matt Van Horn 89bdbae0fe Fix: restore pretty emojis and box chars in stats summary
Original format:
 All agents reported back!
├─ 🟠 Reddit: {n} threads │ {sum} upvotes │ {sum} comments
├─ 🔵 X: {n} posts │ {sum} likes │ {sum} reposts
├─ 🌐 Web: {n} pages │ {domains}
└─ Top voices: r/{sub1}, r/{sub2} │ @{handle1}, @{handle2}

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 13:09:14 -08:00
Matt Van Horn 06061884f1 Update SKILL.md: remove interactive prompt references
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 12:39:16 -08:00
Matt Van Horn 976a6e2867 Match original NUX: non-blocking Bird promotion
- Remove interactive "Install Bird CLI?" prompt
- Add Bird as FREE option in promo messages
- Auto-detect Bird silently (use if authenticated)
- Keep original flow: show promo → continue with available sources

Bird now appears in the promo alongside API keys:
  🔵 X (Twitter)
     └─ FREE: npm install -g @steipete/bird (uses browser session)
     └─ Or: Add XAI_API_KEY (paid API)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 12:38:54 -08:00
Matt Van Horn 73b42c5c89 fix: show Bird install prompt before topic validation
Move Bird CLI check to run before topic validation so users see
the install prompt even when running without a topic argument.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 11:53:04 -08:00
Matt Van Horn fe9ebb9944 feat: add clean mode for testing Bird CLI flow
- Add LAST30DAYS_CONFIG_DIR env var to override config location
- Set LAST30DAYS_CONFIG_DIR="" in test skill for clean mode
- Test skill now ignores existing API keys to show Bird install prompt

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 11:48:40 -08:00
Matt Van Horn d122210e1e rename: use last30daystest as main skill name for testing 2026-02-03 11:32:47 -08:00
Matt Van Horn 80b9fa74dd feat: add test skill (last30daystest) for Bird CLI testing
Creates SKILL-TEST.md with name "last30daystest" so the Bird CLI
integration can be tested without affecting the original /last30days
skill installed from the public repo.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 11:06:43 -08:00
Matt Van Horn ecdee52d04 feat(main): integrate Bird setup into main flow
- Move progress display initialization early to support Bird prompts
- Check Bird availability and offer install if no X source available
- Override available sources when Bird is ready
- Pass x_source parameter to run_research function

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 11:04:56 -08:00
Matt Van Horn e57b82f1ad feat(main): dispatch X search to Bird or xAI 2026-02-03 11:03:29 -08:00
Matt Van Horn 7a7e35bcf5 feat(main): add Bird setup function
Add bird_x import and setup_bird_if_needed function to main script.
The function checks Bird status and offers installation if needed,
returning 'bird' if ready, 'declined' if user declined, or None if
unavailable.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 11:02:28 -08:00
Matt Van Horn 25d58a4494 feat(lib): export bird_x module
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 11:01:46 -08:00
Matt Van Horn df849e7278 feat(env): add X source detection with Bird priority 2026-02-03 11:01:23 -08:00
Matt Van Horn 57e238cb9c feat(ui): add Bird CLI install prompts and auth help 2026-02-03 11:00:42 -08:00
Matt Van Horn 34723c70ac feat(bird): add response parser matching xai_x format 2026-02-03 10:59:39 -08:00
Matt Van Horn 2910e83552 feat(bird): add search_x function 2026-02-03 10:58:44 -08:00
Matt Van Horn 444bd6e185 feat(bird): add installation and status functions 2026-02-03 10:57:57 -08:00
Matt Van Horn a7fb951257 feat(bird): add detection functions for Bird CLI
- is_bird_installed() checks if bird command is in PATH
- is_bird_authenticated() runs bird whoami to verify auth
- check_npm_available() checks if npm can install bird

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 10:57:26 -08:00
Matt Van Horn 8ae00ea214 docs: Add Bird CLI implementation plan
12-task implementation plan for integrating Bird CLI as free X/Twitter
search alternative. Includes detection, interactive install, search
dispatch, and main flow integration.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 10:53:03 -08:00
Matt Van Horn 950810be92 docs: Add Bird CLI integration design
Adds design doc for integrating Bird CLI as an alternative X/Twitter
search source. Bird uses browser cookies (free, no API key) and
provides direct GraphQL access to X.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 10:50:59 -08:00
Matt Van Horn cc892d736b revert: restore original argument-hint format (testing) 2026-01-28 13:43:10 -08:00
Matt Van Horn 6cc7dad86e fix: YAML frontmatter and GPT-5 model fallback
- Fix invalid YAML in SKILL.md argument-hint (closes #8)
  Wrapped value in single quotes to properly escape double quotes

- Add automatic model fallback for GPT-5 access errors (closes #9)
  When OpenAI returns 400 for unverified orgs, retry with gpt-4o

- Add tests for model fallback logic

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 11:07:33 -08:00
Matt Van Horn 3a4a727f4b Run Reddit and X searches in parallel, fix timeout handling
- Refactor run_research() to use ThreadPoolExecutor for parallel execution
- Reddit timeout/crash no longer blocks X search from running
- Add catch for ConnectionResetError/OSError in http.py
- Per-item error handling in Reddit enrichment (one failure doesn't crash all)
- Increase API timeouts from 60/90/120 to 90/120/180 seconds
- Add ClawdBot setup example to README

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 13:33:41 -08:00
Matt Van Horn 86422a74af feat: Add honesty warning when results aren't from last 30 days
Adds ⚠️ LIMITED RECENT DATA warning when:
- Fewer than 5 items are confirmed from the date range
- Tells Claude to be transparent with user about data freshness

Example output for obscure topic (June Oven):
"Only 4 item(s) confirmed from 2025-12-26 to 2026-01-25.
Results below may include older/evergreen content."

Popular topics (clawdbot, nano banana) don't show the warning.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 13:00:53 -08:00
Matt Van Horn e1d3570667 feat: Add automatic retry with simpler query for sparse Reddit results
If initial search returns <5 threads, extract core subject and retry:
- "best nano banana prompting practices" → retry with "nano banana"
- Combines results from both searches, deduped by URL

Note: OpenAI's web_search still tends to find old content. This retry
helps cast a wider net but doesn't fully solve the recency issue.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 10:44:29 -08:00
Matt Van Horn 2d43571875 fix: Simplify Reddit prompt and increase search volume
OpenAI's web_search doesn't reliably find recent Reddit content.
Strategy change: request MORE threads and let server-side date
filtering handle it.

Changes:
- Increased depth config (20-30 → 30-50 default)
- Simplified prompt to search broadly and include all matches
- Let server-side date filter remove old content
- Removed aggressive pre-filtering that was limiting results

Tradeoff: Some topics have more X coverage than Reddit due to
web_search limitations. This is acceptable.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 10:35:14 -08:00
Matt Van Horn acd7a533c0 fix: Emphasize recency in Reddit search to find recent threads
The model was finding old threads (Nov-Dec 2025) that got filtered out,
leaving 0 results even for popular topics like "nano banana prompts".

Changes:
- Add explicit date filters: "after:{from_date}" and "2026"/"January 2026"
- Emphasize RECENT content is critical, old threads are filtered anyway
- Tell model to verify dates before including threads

Before: 0-2 Reddit threads for "nano banana prompting practices"
After: 16 Reddit threads from January 2026

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 10:15:43 -08:00
Matt Van Horn b77d821f8d docs: Add Top Claude Code Skills example to README
Shows /last30days as a discovery tool for finding popular resources
in rapidly evolving ecosystems - ranked by community engagement.

Includes Remotion (17.3K likes), SkillsMP marketplace, Superpowers,
and Trail of Bits security skills.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 09:50:40 -08:00
Matt Van Horn 66d7b87049 docs: Add ClawdBot use cases example to README
Shows /last30days as a product research tool - discovering real-world
use cases with engagement metrics from r/LocalLLaMA, r/selfhosted, and
X posts from @steipete, @danpeguine, @dreetje.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 09:48:35 -08:00
Matt Van Horn 7dc3e7b716 fix: Improve Reddit search prompt to find actual discussions
- Add EXTRACT CORE KEYWORDS step to search for main subject, not full phrase
  ("killer features of clawdbot" → search "clawdbot")
- Remove hardcoded subreddit list that biased results toward design/dev subs
- Simplify search strategies and URL validation rules
- Make prompt more concise - GPT-5.2 responds better to clearer instructions

Before: 0 threads found for "killer features of clawdbot"
After: 7 threads found including r/LocalLLaMA (43pts), r/selfhosted (26pts)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 09:42:31 -08:00
Matt Van Horn 6fbfbb9ccc feat: Add web-only fallback mode with API key promo
- Skill now works without any API keys using WebSearch fallback
- Shows promo banner marketing Reddit/X data when keys are missing
- Partial mode (one key) shows shorter tip for the missing source
- Updated SKILL.md to document three modes: Full, Partial, Web-Only
- Added get_missing_keys() to env.py for promo logic
- Added show_promo(), start_web_only(), show_web_only_complete() to ui.py
- Updated render_compact() to include inline promo for web-only mode

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 09:32:24 -08:00
Matt Van Horn 6831e624b8 docs: Add photorealistic aging portrait example
Shows multi-panel consistency for photorealistic people:
- JSON structure with face preservation
- Same person at ages 10, 20, 40, 80
- Heterochromia + freckles maintained across panels
- Real generated result

Also added to SKILL.md intro examples.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 16:28:15 -08:00