AI agent skill that researches any topic across Reddit, X, YouTube, HN, Polymarket, and the web - then synthesizes a grounded summary
Python ai-promptsai-skillblueskyclaudeclaude-codeclawhubdeep-researchhackernewsinstagramopenclawpolymarketrecencyredditresearchsocial-mediatiktoktrendstwitterweb-searchyoutube
refactor: route 4 stderr-bypass modules through log.source_log (#439)
Ilia Alshanetskyfa0f840a894e
diff --git a/skills/last30days/scripts/lib/competitors.py b/skills/last30days/scripts/lib/competitors.pyindex ac4a393c..b45c6100 100644--- a/skills/last30days/scripts/lib/competitors.py+++ b/skills/last30days/scripts/lib/competitors.py@@ -13,11 +13,10 @@ the caller's requested count.from __future__ import annotationsimport re-import sysfrom collections import Counterfrom concurrent.futures import ThreadPoolExecutor, as_completed-from . import dates, grounding+from . import dates, grounding, logfrom .resolve import _has_backend# A "brand-shaped" token starts with uppercase OR is camelCase with an@@ -62,7 +61,7 @@ _STOPWORD_TOKENS: frozenset[str] = frozenset(def _log(msg: str) -> None:- print(f"[Competitors] {msg}", file=sys.stderr)+ log.source_log("Competitors", msg, tty_only=False)def _topic_tokens(topic: str) -> set[str]:diff --git a/skills/last30days/scripts/lib/fanout.py b/skills/last30days/scripts/lib/fanout.pyindex d594391d..945ed8ab 100644--- a/skills/last30days/scripts/lib/fanout.py+++ b/skills/last30days/scripts/lib/fanout.py@@ -13,11 +13,10 @@ config, depth, and overrides for each entity.from __future__ import annotations-import sysfrom concurrent.futures import ThreadPoolExecutor, as_completedfrom typing import Callable-from . import schema+from . import log, schema# Sub-runs hit the same upstream APIs as the main topic. Cap parallelism so a# 6-way fan-out does not stampede a single backend's rate limit.@@ -25,7 +24,7 @@ MAX_PARALLEL_SUBRUNS = 6def _log(msg: str) -> None:- print(f"[Fanout] {msg}", file=sys.stderr)+ log.source_log("Fanout", msg, tty_only=False)def run_competitor_fanout(diff --git a/skills/last30days/scripts/lib/resolve.py b/skills/last30days/scripts/lib/resolve.pyindex 4eef6fd2..e536d233 100644--- a/skills/last30days/scripts/lib/resolve.py+++ b/skills/last30days/scripts/lib/resolve.py@@ -8,18 +8,17 @@ before the planner runs. This is the engine-side equivalent of SKILL.md Stepsfrom __future__ import annotationsimport re-import sysfrom concurrent.futures import ThreadPoolExecutor, as_completedfrom datetime import datetime, timezonefrom typing import Optional-from . import categories, dates, grounding+from . import categories, dates, grounding, logMAX_SUBS = 10def _log(msg: str) -> None:- print(f"[Resolve] {msg}", file=sys.stderr)+ log.source_log("Resolve", msg, tty_only=False)def _merge_category_peers(topic: str, subreddits: list[str]) -> tuple[list[str], Optional[str]]:diff --git a/skills/last30days/scripts/lib/xurl_x.py b/skills/last30days/scripts/lib/xurl_x.pyindex c2a60ef8..e5f1f283 100644--- a/skills/last30days/scripts/lib/xurl_x.py+++ b/skills/last30days/scripts/lib/xurl_x.py@@ -13,15 +13,14 @@ Priority: xAI API > Bird/GraphQL > xurl > web-only fallbackimport jsonimport reimport subprocess-import sysfrom typing import Any, Dict, List, Optional+from . import logfrom .relevance import token_overlap_relevance as _compute_relevancedef _log(msg: str) -> None:- sys.stderr.write(f"[xurl] {msg}\n")- sys.stderr.flush()+ log.source_log("xurl", msg, tty_only=False)# Depth configurations: number of results to request