Wind ThemeDetector

From johncui9392/Aeolus · View interactive version

Wind ThemeDetector is an AI agent skill from the GitHub repository johncui9392/Aeolus. 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.

How to use this skill

Skill file

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 (early/mid/late/exhaustion), 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 (Early / Mid / Late / Exhaustion) based on duration, extremity clustering, valuation, and ETF proliferation
  3. Confidence (Low / Medium / High): Reliability of the detection, combining quantitative breadth with narrative confirmation

Key Features:


When to Use This Skill

Explicit Triggers:

Implicit Triggers:

When NOT to Use:


Workflow

Step 1: Verify Requirements

Check for required API keys and dependencies:

# Check for FINVIZ Elite API key (optional but recommended)
echo $FINVIZ_API_KEY

# Check for FMP API key (optional, used for valuation metrics)
echo $FMP_API_KEY

Requirements:

Installation:

pip install requests beautifulsoup4 lxml

Step 2: Execute Theme Detection Script

Run the main detection script:

python3 skills/theme-detector/scripts/theme_detector.py \
  --output-dir reports/

Script Options:

# 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 5 \
  --output-dir reports/

# Explicit FINVIZ mode
python3 skills/theme-detector/scripts/theme_detector.py \
  --finviz-mode public \
  --output-dir reports/

Expected Execution Time:

Step 3: Read and Parse Detection Results

The script generates two output files:

Read the JSON output to understand quantitative results:

# 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:

Update Confidence levels based on findings:

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):

For Hot Bearish Themes (Heat >= 70, Direction = Bearish):

For Emerging Themes (Heat 40-69, Lifecycle = Early):

For Exhausted Themes (Heat >= 60, Lifecycle = Exhaustion):

Step 6: Generate Final Report

Present the final report to the user using the report template structure:

# 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.


Resources

Scripts Directory (`scripts/`)

Main Scripts:

References Directory (`references/`)

Knowledge Bases:

Assets Directory (`assets/`)


Important Notes

FINVIZ Mode Differences

| Feature | Elite Mode | Public Mode |

|---------|-----------|-------------|

| Industry coverage | All ~145 industries | All ~145 industries |

| Stocks per industry | Full universe | ~20 stocks (page 1) |

| Rate limiting | 0.5s between requests | 2.0s between requests |

| Data freshness | Real-time | 15-min delayed |

| API key required | Yes ($39.99/mo) | No |

| Execution time | ~2-3 minutes | ~5-8 minutes |

Direction Detection Logic

Theme direction (bullish vs. bearish) is determined by:

  1. Weighted industry performance: Average change% across constituent industries, weighted by market cap
  2. Uptrend ratio: Percentage of stocks in each industry that are in technical uptrends (if uptrend data available)
  3. Volume confirmation: Whether volume supports the price direction (accumulation vs. distribution)

A theme is classified as:

Known Limitations

  1. Survivorship bias: Only analyzes currently listed stocks and ETFs
  2. Lag: FINVIZ data may lag intraday moves by 15 minutes (public mode)
  3. Theme boundaries: Some stocks fit multiple themes; classification uses primary industry
  4. ETF proliferation: Catalog is static and may not capture very new ETFs
  5. Narrative scoring: WebSearch-based and inherently subjective
  6. Public mode limitation: ~20 stocks per industry may miss small-cap signals

Disclaimer

This analysis is for educational and informational purposes only.


Version: 1.0

Last Updated: 2026-02-16

API Requirements: FINVIZ Elite (recommended) or public mode (free); FMP API optional

Execution Time: ~2-8 minutes depending on mode

Output Formats: JSON + Markdown

Themes Covered: 14+ cross-sector themes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.