This skill should be used when analyzing market breadth charts, specifically the S&P 500 Breadth Index (200-Day MA based) and the US Stock Market Uptrend Stock Ratio charts. Use this skill when the user provides breadth chart images for analysis, requests market breadth assessment, positioning strategy recommendations, or wants to understand medium-term strategic and short-term tactical market outlook based on breadth indicators. Also works WITHOUT chart images by fetching CSV data directly from public sources. All analysis and output are conducted in English.
npx skills add https://github.com/BaggaT236/AI-Trading-Skills --skill breadth-chart-analyst
This skill enables specialized analysis of two complementary market breadth charts that provide strategic (medium to long-term) and tactical (short-term) market perspectives. Analyze breadth chart images to assess market health, identify trading signals based on backtested strategies, and develop positioning recommendations. All thinking and output are conducted exclusively in English.
Use this skill when:
Do NOT use this skill when:
us-stock-analysis skill instead)sector-analyst skill instead)market-news-analyst skill instead)This skill generates markdown analysis reports saved to the reports/ directory:
breadth_200ma_analysis_[YYYY-MM-DD].mduptrend_ratio_analysis_[YYYY-MM-DD].mdbreadth_combined_analysis_[YYYY-MM-DD].mdReports include executive summaries, current readings, signal identification, scenario analysis with probabilities, and actionable positioning recommendations for different trader types.
Purpose: Medium to long-term strategic market positioning
Key Elements:
Backtested Strategy:
Purpose: Short-term tactical timing and swing trading
Key Elements:
Swing Trading Strategy:
CRITICAL: CSV data is the PRIMARY source for all Breadth values. This step MUST be executed BEFORE any image analysis.
python3 skills/breadth-chart-analyst/scripts/fetch_breadth_csv.py
Why CSV is PRIMARY:
Data Sources:
tradermonty.github.io/market-breadth-analysis/market_breadth_data.csvtradermonty/uptrend-dashboard/data/uptrend_ratio_timeseries.csvtradermonty/uptrend-dashboard/data/sector_summary.csvData Source Priority:
| Priority | Source | Use For | Reliability |
|----------|--------|---------|-------------|
| 1 (PRIMARY) | CSV Data | All numerical values, dead cross status, color | HIGH |
| 2 (SUPPLEMENTARY) | Chart Image | Visual trend context, pattern confirmation | MEDIUM |
| 3 (DEPRECATED) | ~~OpenCV detect_breadth_values.py~~ | ~~Breadth detection~~ | UNRELIABLE |
| 4 (LAST RESORT) | ~~LLM visual reading~~ | ~~Emergency only~~ | LOW |
Expected Output:
============================================================
Breadth Data (CSV) - 2026-02-13
============================================================
--- Market Breadth (S&P 500) ---
200-Day MA: 62.26% (healthy (>=60%))
8-Day MA: 67.56% (healthy_bullish (60-73%))
8MA vs 200MA: +5.30pt (8MA ABOVE -- NO dead cross)
Trend: UPTREND
--- Uptrend Ratio (All Markets) ---
Current: 33.03% GREEN (neutral_bullish)
10MA: 32.65%, Slope: +0.0055, Trend: UP
--- Sector Summary ---
...
============================================================
Validation: After running CSV fetch, verify:
When the user provides breadth chart images for analysis:
If NO chart images are provided: Skip Steps 1, 1.5, and image-based analysis. Use CSV data from Step 0 as the sole data source and proceed directly to the analysis and report generation steps.
Language Note: All subsequent thinking, analysis, and output will be in English.
CRITICAL: Use a two-stage analysis approach to prevent misreading historical data as current values.
First, analyze the FULL chart image to understand:
Then, extract and analyze the rightmost 25% of the chart to accurately determine CURRENT values.
Execute the Python script to extract the right edge:
python3 skills/breadth-chart-analyst/scripts/extract_chart_right_edge.py <image_path> --percent 25
| Stage | Purpose | What to Extract |
|-------|---------|-----------------|
| Stage 1 (Full) | Historical context, trend cycles | Overall patterns, past troughs/peaks |
| Stage 2 (Right Edge) | Current values (CRITICAL) | 8MA value, 200MA value, current color, current slope |
Common Error This Prevents:
Before beginning analysis, read the comprehensive breadth chart methodology:
Read: references/breadth_chart_methodology.md
This reference contains detailed guidance on:
To understand the chart format and visual elements, review the sample charts included in this skill:
View: assets/SP500_Breadth_Index_200MA_8MA.jpeg
View: assets/US_Stock_Market_Uptrend_Ratio.jpeg
These samples demonstrate:
If Chart 1 is provided, conduct systematic analysis:
From the chart image, identify:
This step is MANDATORY to avoid misreading recent trend changes.
CRITICAL WARNING: Charts can be deceptive. The MAJORITY of analysis errors occur because the analyst:
BEFORE analyzing trend direction, FIRST confirm line colors:
Focus intensively on the rightmost 3-5 data points of the chart (most recent weeks):
For 8MA (Orange Line) - Analyze the very latest trajectory:
Critical Questions to Answer:
For 200MA (Green Line) - Analyze the very latest trajectory:
Failed Reversal Detection (CRITICAL):
If an 8MA trough (purple ▼) was recently identified:
Example Analysis Format:
Latest 8MA Data Points (rightmost to left):
- Current (Week 0): 48%
- 1 week ago: 52%
- 2 weeks ago: 55%
- 3 weeks ago: 50%
Analysis: 8MA is FALLING. It rose from 50% to 55% (weeks 3-2), but has since declined to 48%.
This shows a failed reversal pattern - bounce was temporary, downtrend has resumed.
SLOPE: Falling (not rising!)
MANDATORY CROSS-CHECK (to catch misreadings):
After determining the trend, ask yourself:
Look for and document:
Based on readings and patterns, classify the current market as:
Support the classification with specific evidence from the chart.
Apply the backtested strategy rules with STRICT confirmation requirements:
Check for BUY signal (ALL criteria must be met):
BUY Signal Status:
Check for SELL signal:
Current position determination:
Create 2-3 scenarios with probability estimates:
If Chart 2 is provided, conduct systematic analysis:
NOTE (Issue #7): This OpenCV detection step is DEPRECATED. Use CSV data from Step 0 as the PRIMARY source. The OpenCV script may be run for supplementary validation only, but CSV values take precedence in all cases.
python3 skills/breadth-chart-analyst/scripts/detect_uptrend_ratio.py <image_path> [--debug]
From the chart image, identify:
Look for and document:
Based on current ratio and color, classify as:
Support the classification with specific evidence from the chart.
Apply the swing trading strategy rules:
Check for ENTER LONG signal:
Check for EXIT LONG signal:
Current position: Long, Flat, Preparing to Enter, or Preparing to Exit
Create 2-3 scenarios with probability estimates:
If both charts are provided, integrate the strategic and tactical perspectives:
Create a positioning matrix:
Determine which of the four scenarios applies:
Scenario 1: Both Bullish
Scenario 2: Strategic Bullish, Tactical Bearish
Scenario 3: Strategic Bearish, Tactical Bullish
Scenario 4: Both Bearish
Provide integrated positioning guidance for:
Address any conflicts between charts and explain resolution.
Create a comprehensive markdown report using the template structure:
Read and use as template: assets/breadth_analysis_template.md
IMPORTANT: All analysis and output must be in English.
The report structure varies based on which chart(s) are analyzed:
If Chart 1 only:
If Chart 2 only:
If Both Charts:
File Naming Convention: Save each analysis as:
breadth_200ma_analysis_[YYYY-MM-DD].mduptrend_ratio_analysis_[YYYY-MM-DD].mdbreadth_combined_analysis_[YYYY-MM-DD].mdBefore finalizing the report, verify:
10. ✓ Strategy Alignment: Recommendations align with backtested strategies and confirmation requirements
11. ✓ Probabilities: Scenario probabilities sum to 100%
12. ✓ Actionable: Clear positioning recommendations for different trader types
13. ✓ Context: Historical comparison and reference to similar past situations
14. ✓ Risk Management: Invalidation levels and risk factors clearly stated
FINAL SANITY CHECK:
Symptom: Report claims 8MA is rising when it's actually the 200MA that's rising
Prevention:
Symptom: Report describes what happened 1-2 months ago, not what's happening NOW
Prevention:
Symptom: Report is bullish when 8MA and 200MA are about to death cross (bearish)
Prevention:
Symptom: Report claims bullish setup when chart shows pink downtrend background
Prevention:
Symptom: Report says "BUY signal confirmed" after only 1 week of increase
Prevention:
User: "breadth分析して" (Analyze breadth)
[No chart images provided]
Breadth Analyst:
1. Executes fetch_breadth_csv.py to get latest CSV data
2. Reads breadth_chart_methodology.md
3. Analyzes CSV data:
- 200MA: 62.26% (healthy)
- 8MA: 67.56% (healthy_bullish)
- 8MA vs 200MA: +5.30pt (NO dead cross)
- Uptrend Ratio: 33.03% GREEN (neutral_bullish)
- Sector summary with overbought/oversold sectors
4. Assesses market regime based on CSV values
5. Generates report: breadth_combined_analysis_2026-03-16.md
User: "Please analyze this S&P 500 breadth chart and tell me where we are in the market cycle."
[Provides Chart 1 image: 200MA Breadth Index]
Breadth Analyst (thinking in English):
1. Executes CSV fetch for authoritative numerical values
2. Confirms receipt of Chart 1 (200MA-based breadth index)
3. Reads breadth_chart_methodology.md for Chart 1 guidance
4. Two-stage analysis: full chart → right edge extraction
5. Cross-checks CSV values with chart readings
6. Generates comprehensive report in English
User: "Analyze both of these breadth charts and give me your overall market view."
[Provides both Chart 1 and Chart 2 images]
Breadth Analyst (thinking in English):
1. Executes CSV fetch as PRIMARY source
2. Confirms receipt of both charts
3. Reads full breadth_chart_methodology.md
4. Two-stage analysis for each chart
5. Cross-checks all values against CSV data
6. Combined assessment and unified recommendation
7. Generates comprehensive combined report
This skill includes the following bundled resources:
Comprehensive methodology covering:
Usage: Read this file before conducting any breadth chart analysis to ensure systematic, accurate interpretation.
Structured template for breadth analysis reports in English.
Usage: Use this template structure for every analysis report.
Sample Chart 1 image for format reference.
Sample Chart 2 image for format reference.
PRIMARY data source. Fetches market breadth, uptrend ratio, and sector summary data from public CSV sources. Uses only stdlib (urllib + csv) -- no external dependencies.
python3 skills/breadth-chart-analyst/scripts/fetch_breadth_csv.py # Human-readable
python3 skills/breadth-chart-analyst/scripts/fetch_breadth_csv.py --json # JSON output
Extracts the rightmost portion of chart images to help focus on latest data points. Requires PIL/Pillow.
python3 skills/breadth-chart-analyst/scripts/extract_chart_right_edge.py <image_path> --percent 25
OpenCV-based uptrend ratio detection. Superseded by CSV fetch. Requires opencv-python + numpy.
OpenCV-based breadth value detection. Superseded by CSV fetch. Requires opencv-python + numpy.
CRITICAL: All analysis, thinking, and output MUST be in English. This includes:
Do not translate or use any other language. The user expects English output exclusively.
This skill emphasizes backtested, systematic strategies rather than discretionary interpretation. Always:
The goal is actionable intelligence. Every analysis should answer:
Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like \"the xlsx in my downloads\") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.
Picks random winners from lists, spreadsheets, or Google Sheets for giveaways, raffles, and contests. Ensures fair, unbiased selection with transparency.
Query openFDA API for drugs, devices, adverse events, recalls, regulatory submissions (510k, PMA), substance identification (UNII), for FDA regulatory data analysis and safety research.
MATLAB and GNU Octave numerical computing for matrix operations, data analysis, visualization, and scientific computing. Use when writing MATLAB/Octave scripts for linear algebra, signal processing, image processing, differential equations, optimization, statistics, or creating scientific visualizations. Also use when the user needs help with MATLAB syntax, functions, or wants to convert between MATLAB and Python code. Scripts can be executed with MATLAB or the open-source GNU Octave interpreter.
UMAP dimensionality reduction. Fast nonlinear manifold learning for 2D/3D visualization, clustering preprocessing (HDBSCAN), supervised/parametric UMAP, for high-dimensional data.
Creating interactive data visualisations using d3.js. This skill should be used when creating custom charts, graphs, network diagrams, geographic visualisations, or any complex SVG-based data visualisation that requires fine-grained control over visual elements, transitions, or interactions. Use this for bespoke visualisations beyond standard charting libraries, whether in React, Vue, Svelte, vanilla JavaScript, or any other environment.
Access AlphaFold 200M+ AI-predicted protein structures. Retrieve structures by UniProt ID, download PDB/mmCIF files, analyze confidence metrics (pLDDT, PAE), for drug discovery and structural biology.
Take baggat236/breadth-chart-analyst from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.