theme-detector
Detect and analyze trending market themes across sectors. Use when user asks about current market themes, trending sectors, sector rotation, thematic investing, what themes are hot or cold, or wants to identify bullish and bearish market narratives with lifecycle analysis.
What this skill does
# Theme Detector ## Overview This skill detects and ranks trending market themes by analyzing cross-sector momentum, volume, and breadth signals. It identifies both bullish (upward momentum) and bearish (downward pressure) themes, assesses lifecycle maturity (Emerging/Accelerating/Trending/Mature/Exhausting), and provides a confidence score combining quantitative data with narrative analysis. **3-Dimensional Scoring Model:** 1. **Theme Heat** (0-100): Direction-neutral strength of the theme (momentum, volume, uptrend ratio, breadth) 2. **Lifecycle Maturity**: Stage classification (Emerging / Accelerating / Trending / Mature / Exhausting) based on duration, extremity clustering, valuation, and ETF proliferation 3. **Confidence** (Low / Medium / High): Reliability of the detection, combining quantitative breadth with narrative confirmation. Script output is capped at Medium; Claude's WebSearch narrative confirmation step can elevate to High. **Key Features:** - Cross-sector theme detection using FINVIZ industry data - Direction-aware scoring (bullish and bearish themes) - Lifecycle maturity assessment to identify crowded vs. emerging trades - ETF proliferation scoring (more ETFs = more mature/crowded theme) - Integration with uptrend-dashboard for 3-point evaluation - Dual-mode operation: FINVIZ Elite (fast) or public scraping (slower, limited) - WebSearch-based narrative confirmation for top themes --- ## When to Use This Skill **Explicit Triggers:** - "What market themes are trending right now?" - "Which sectors are hot/cold?" - "Detect current market themes" - "What are the strongest bullish/bearish narratives?" - "Is AI/clean energy/defense still a strong theme?" - "Where is sector rotation heading?" - "Show me thematic investing opportunities" **Implicit Triggers:** - User wants to understand broad market narrative shifts - User is looking for thematic ETF or sector allocation ideas - User asks about crowded trades or late-cycle themes - User wants to know which themes are emerging vs. exhausted **When NOT to Use:** - Individual stock analysis (use us-stock-analysis instead) - Specific sector deep-dive with chart reading (use sector-analyst instead) - Portfolio rebalancing (use portfolio-manager instead) - Dividend/income investing (use value-dividend-screener instead) --- ## Prerequisites **Required:** - Python 3.7+ with core dependencies: ```bash pip install requests beautifulsoup4 lxml pandas numpy yfinance ``` **Optional API Keys:** FINVIZ Elite (recommended for full industry coverage and speed): ```bash export FINVIZ_API_KEY=your_finviz_elite_api_key_here ``` FMP API (optional, for P/E ratio valuation data): ```bash export FMP_API_KEY=your_fmp_api_key_here ``` **Optional Python packages:** - `finvizfinance` - Required for FINVIZ Elite mode - `PyYAML` - Required for `--themes-config` custom themes Without FINVIZ Elite, the skill uses public FINVIZ scraping (limited to ~20 stocks per industry, slower rate limits). --- ## Workflow ### Step 1: Verify Environment Check that API keys are configured (see Prerequisites): ```bash # Verify FINVIZ Elite API key (optional but recommended) echo $FINVIZ_API_KEY # Verify FMP API key (optional) echo $FMP_API_KEY ``` ### Step 2: Execute Theme Detection Script Run the main detection script: ```bash python3 skills/theme-detector/scripts/theme_detector.py \ --output-dir reports/ ``` **Script Options:** ```bash # Full run (public FINVIZ mode, no API key required) python3 skills/theme-detector/scripts/theme_detector.py \ --output-dir reports/ # With FINVIZ Elite API key python3 skills/theme-detector/scripts/theme_detector.py \ --finviz-api-key $FINVIZ_API_KEY \ --output-dir reports/ # With FMP API key for enhanced stock data python3 skills/theme-detector/scripts/theme_detector.py \ --fmp-api-key $FMP_API_KEY \ --output-dir reports/ # Custom limits python3 skills/theme-detector/scripts/theme_detector.py \ --max-themes 5 \ --max-stocks-per-theme 10 \ --output-dir reports/ # Explicit FINVIZ mode python3 skills/theme-detector/scripts/theme_detector.py \ --finviz-mode public \ --output-dir reports/ ``` **Expected Execution Time:** - FINVIZ Elite mode: ~2-3 minutes (14+ themes) - Public FINVIZ mode: ~5-8 minutes (rate-limited scraping) ### Step 3: Read and Parse Detection Results The script generates two output files: - `theme_detector_YYYY-MM-DD_HHMMSS.json` - Structured data for programmatic use - `theme_detector_YYYY-MM-DD_HHMMSS.md` - Human-readable report Read the JSON output to understand quantitative results: ```bash # Find the latest report ls -lt reports/theme_detector_*.json | head -1 # Read the JSON output cat reports/theme_detector_YYYY-MM-DD_HHMMSS.json ``` ### Step 4: Perform Narrative Confirmation via WebSearch For the top 5 themes (by Theme Heat score), execute WebSearch queries to confirm narrative strength: **Search Pattern:** ``` "[theme name] stocks market [current month] [current year]" "[theme name] sector momentum [current month] [current year]" ``` **Evaluate narrative signals:** - **Strong narrative**: Multiple major outlets covering the theme, analyst upgrades, policy catalysts - **Moderate narrative**: Some coverage, mixed sentiment, no clear catalyst - **Weak narrative**: Little coverage, or predominantly contrarian/skeptical tone Update Confidence levels based on findings: - Quantitative High + Narrative Strong = **High** confidence - Quantitative High + Narrative Weak = **Medium** confidence (possible momentum divergence) - Quantitative Low + Narrative Strong = **Medium** confidence (narrative may lead price) - Quantitative Low + Narrative Weak = **Low** confidence ### Step 5: Analyze Results and Provide Recommendations Cross-reference detection results with knowledge bases: **Reference Documents to Consult:** 1. `references/cross_sector_themes.md` - Theme definitions and constituent industries 2. `references/thematic_etf_catalog.md` - ETF exposure options by theme 3. `references/theme_detection_methodology.md` - Scoring model details 4. `references/finviz_industry_codes.md` - Industry classification reference **Analysis Framework:** For **Hot Bullish Themes** (Heat >= 70, Direction = Bullish): - Identify lifecycle stage (Emerging = opportunity, Mature/Exhausting = caution) - List top-performing industries within the theme - Recommend proxy ETFs for exposure - Flag if ETF proliferation is high (crowded trade warning) For **Hot Bearish Themes** (Heat >= 70, Direction = Bearish): - Identify industries under pressure - Assess if bearish momentum is accelerating or decelerating - Recommend hedging strategies or sectors to avoid - Note potential mean-reversion opportunities if lifecycle is Mature/Exhausting For **Emerging Themes** (Heat 40-69, Lifecycle = Emerging): - These may represent early rotation signals - Recommend monitoring with watchlist - Identify catalyst events that could accelerate the theme For **Exhausted Themes** (Heat >= 60, Lifecycle = Exhausting): - Warn about crowded trade risk - High ETF count confirms excessive retail participation - Consider contrarian positioning or reducing exposure ### Step 6: Generate Final Report Present the final report to the user using the report template structure: ```markdown # Theme Detection Report **Date:** YYYY-MM-DD **Mode:** FINVIZ Elite / Public **Themes Analyzed:** N **Data Quality:** [note any limitations] ## Theme Dashboard [Top themes table with Heat, Direction, Lifecycle, Confidence] ## Bullish Themes Detail [Detailed analysis of bullish themes sorted by Heat] ## Bearish Themes Detail [Detailed analysis of bearish themes sorted by Heat] ## All Themes Summary [Complete theme ranking table] ## Industry Rankings [Top performing and worst performing industries] ## Sector Uptrend Ratios [Sector-level aggregation if uptrend data available] ## Methodology Notes [Brief explanation of scoring model] ``` Save the report to `reports/` directory. --- ##
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.