stock-analysis
gracefullight/stock-checker
Analyze stocks and cryptocurrencies with Yahoo Finance data, portfolio tracking, and multi-dimensional scoring.
What is stock-analysis?
Analyze US stocks and top 20 cryptocurrencies using 8 analysis dimensions (earnings, fundamentals, sentiment, technicals, market context, sector, momentum, and risk flags). Includes portfolio management (create, add, remove assets) and periodic performance reports. Use for stock analysis, portfolio tracking, earnings reactions, and crypto monitoring.
- Analyze individual stocks or cryptocurrencies with 8-dimension scoring (earnings surprise, fundamentals, analyst sentiment, historical patterns, market context, sector performance, momentum, sentiment analysis)
- Compare multiple tickers side-by-side in a single command
- Create and manage portfolios with mixed assets (stocks and crypto), tracking cost basis and P&L
- Generate portfolio analysis with period returns (daily/weekly/monthly/quarterly/yearly)
- Detect high-risk scenarios: pre-earnings warnings, post-earnings spikes, overbought conditions, high VIX, sector weakness, and geopolitical risks
- Scan breaking news for crisis keywords affecting specific sectors and stocks
How to install stock-analysis
npx skills add https://github.com/gracefullight/stock-checker --skill stock-analysis- uv package manager (installed via brew or other means)
How to use stock-analysis
- 1.Analyze a single stock: run `uv run {baseDir}/scripts/analyze_stock.py AAPL` (pass ticker symbol only, no extra text)
- 2.Compare multiple tickers: run `uv run {baseDir}/scripts/analyze_stock.py AAPL MSFT GOOGL` to see all three side-by-side
- 3.Analyze cryptocurrency: run `uv run {baseDir}/scripts/analyze_stock.py BTC-USD` or `uv run {baseDir}/scripts/analyze_stock.py ETH-USD SOL-USD` for multiple cryptos
- 4.Create a portfolio: run `uv run {baseDir}/scripts/portfolio.py create "My Portfolio"` to set up a new portfolio
- 5.Add assets to portfolio: run `uv run {baseDir}/scripts/portfolio.py add AAPL --quantity 100 --cost 150.00` to track holdings
- 6.Analyze your portfolio: run `uv run {baseDir}/scripts/analyze_stock.py --portfolio "My Portfolio"` to see total P&L and recommendations
- 7.Get period returns: run `uv run {baseDir}/scripts/analyze_stock.py --portfolio "My Portfolio" --period weekly` for time-based performance
- 8.Output as JSON: add `--output json` flag to any analyze command for structured data suitable for downstream processing
Use cases
- Evaluate a stock before buying: analyze AAPL to see earnings surprise, fundamentals, and analyst sentiment in one command
- Track a portfolio's performance: create a portfolio with your holdings and run weekly analysis to monitor P&L and concentration risk
- Monitor crypto exposure: analyze BTC-USD and ETH-USD to compare market cap classification, momentum, and BTC correlation
- Assess earnings reaction risk: check if a stock is pre-earnings (HOLD instead of BUY) or post-spike (gains priced in)
- Detect geopolitical impact: automatically flag semiconductor stocks during Taiwan tensions or energy stocks during Russia-Ukraine conflicts
- Individual investors managing personal portfolios
- Traders analyzing earnings reactions and technical setups
- Crypto investors monitoring top 20 assets by market cap
- Risk managers checking sector exposure and concentration warnings
- Analysts comparing multiple stocks or building watchlists
stock-analysis FAQ
Top 20 by market cap: BTC-USD, ETH-USD, BNB-USD, SOL-USD, XRP-USD, ADA-USD, DOGE-USD, AVAX-USD, DOT-USD, MATIC-USD, LINK-USD, ATOM-USD, UNI-USD, LTC-USD, BCH-USD, XLM-USD, ALGO-USD, VET-USD, FIL-USD, NEAR-USD. Use the -USD suffix in commands.
Yahoo Finance data may lag 15-20 minutes. Sentiment data (short interest, insider trades, VIX term structure) lags 2-3 days. Breaking news alerts use a 1-hour cache and may lag 15-60 minutes.
Signals are based on 8 weighted dimensions. Pre-earnings stocks get HOLD instead of BUY. Post-earnings spikes (>15% in 5 days) trigger "gains priced in" warnings. High VIX, overbought RSI, or geopolitical risks reduce confidence.
Yes. Use `portfolio.py add` with stock tickers (AAPL) or crypto tickers (BTC-USD) in the same portfolio. Portfolio analysis shows combined cost, value, and P&L.
Portfolios are saved to `~/.clawdbot/skills/stock-analysis/portfolios.json`. You can create multiple named portfolios and switch between them with the `--portfolio` flag.
Full instructions (SKILL.md)
Source of truth, from gracefullight/stock-checker.
name: stock-analysis description: Analyze stocks and cryptocurrencies using Yahoo Finance data. Supports portfolio management (create, add, remove assets), crypto analysis (Top 20 by market cap), and periodic performance reports (daily/weekly/monthly/quarterly/yearly). 8 analysis dimensions for stocks, 3 for crypto. Use for stock analysis, portfolio tracking, earnings reactions, or crypto monitoring. homepage: https://finance.yahoo.com metadata: {"clawdbot":{"emoji":"๐","requires":{"bins":["uv"],"env":[]},"install":[{"id":"uv-brew","kind":"brew","formula":"uv","bins":["uv"],"label":"Install uv (brew)"}]}}
Stock Analysis (v5.0)
Analyze US stocks and cryptocurrencies using Yahoo Finance data. Includes portfolio management, crypto support, and periodic analysis.
Quick Start
IMPORTANT: Pass ONLY the stock ticker symbol(s) as arguments. Do NOT add extra text, headers, or formatting in the command.
Analyze a single ticker:
uv run {baseDir}/scripts/analyze_stock.py AAPL
uv run {baseDir}/scripts/analyze_stock.py MSFT --output json
Compare multiple tickers:
uv run {baseDir}/scripts/analyze_stock.py AAPL MSFT GOOGL
Cryptocurrency Analysis (v5.0)
Analyze top 20 cryptocurrencies by market cap:
uv run {baseDir}/scripts/analyze_stock.py BTC-USD
uv run {baseDir}/scripts/analyze_stock.py ETH-USD SOL-USD
Supported Cryptos: BTC-USD, ETH-USD, BNB-USD, SOL-USD, XRP-USD, ADA-USD, DOGE-USD, AVAX-USD, DOT-USD, MATIC-USD, LINK-USD, ATOM-USD, UNI-USD, LTC-USD, BCH-USD, XLM-USD, ALGO-USD, VET-USD, FIL-USD, NEAR-USD
Crypto Analysis Dimensions:
- Market cap (large/mid/small classification)
- Category (Smart Contract L1, DeFi, Payment, etc.)
- BTC correlation (30-day)
- Momentum (RSI, price range)
- Market context (VIX, general market regime)
Portfolio Management (v5.0)
Create and manage portfolios with mixed assets (stocks + crypto):
# Create portfolio
uv run {baseDir}/scripts/portfolio.py create "My Portfolio"
# Add assets
uv run {baseDir}/scripts/portfolio.py add AAPL --quantity 100 --cost 150.00
uv run {baseDir}/scripts/portfolio.py add BTC-USD --quantity 0.5 --cost 40000 --portfolio "My Portfolio"
# View holdings with current P&L
uv run {baseDir}/scripts/portfolio.py show
# Update/remove assets
uv run {baseDir}/scripts/portfolio.py update AAPL --quantity 150
uv run {baseDir}/scripts/portfolio.py remove BTC-USD
# List/delete portfolios
uv run {baseDir}/scripts/portfolio.py list
uv run {baseDir}/scripts/portfolio.py delete "My Portfolio"
Portfolio Storage: ~/.clawdbot/skills/stock-analysis/portfolios.json
Portfolio Analysis (v5.0)
Analyze all assets in a portfolio with optional period returns:
# Analyze portfolio
uv run {baseDir}/scripts/analyze_stock.py --portfolio "My Portfolio"
# With period returns (daily/weekly/monthly/quarterly/yearly)
uv run {baseDir}/scripts/analyze_stock.py --portfolio "My Portfolio" --period weekly
uv run {baseDir}/scripts/analyze_stock.py -p "My Portfolio" --period monthly
Portfolio Summary includes:
- Total cost, current value, P&L
- Period return (if specified)
- Concentration warnings (>30% in single asset)
- Recommendation summary (BUY/HOLD/SELL counts)
Examples:
- โ
CORRECT:
uv run {baseDir}/scripts/analyze_stock.py BAC - โ
CORRECT:
uv run {baseDir}/scripts/analyze_stock.py BTC-USD - โ WRONG:
uv run {baseDir}/scripts/analyze_stock.py === BANK OF AMERICA (BAC) - Q4 2025 EARNINGS === - โ WRONG:
uv run {baseDir}/scripts/analyze_stock.py "Bank of America"
Use the ticker symbol only (e.g., BAC, not "Bank of America"). For crypto, use the -USD suffix (e.g., BTC-USD).
Analysis Components
The script evaluates eight key dimensions:
- Earnings Surprise (30% weight): Actual vs expected EPS, revenue beats/misses
- Fundamentals (20% weight): P/E ratio, profit margins, revenue growth, debt levels
- Analyst Sentiment (20% weight): Consensus ratings, price target vs current price
- Historical Patterns (10% weight): Past earnings reactions, volatility
- Market Context (10% weight): VIX, SPY/QQQ trends, market regime
- Sector Performance (15% weight): Stock vs sector comparison, sector trends
- Momentum (15% weight): RSI, 52-week range, volume, relative strength
- Sentiment Analysis (10% weight): Fear/Greed Index, short interest, VIX term structure, insider trading, put/call ratio
Sentiment Sub-Indicators:
- Fear & Greed Index (CNN): Contrarian signal (extreme fear = buy opportunity, extreme greed = caution)
- Short Interest: High shorts + squeeze potential = bullish; justified shorts = bearish
- VIX Term Structure: Contango = complacency/bullish; backwardation = stress/bearish
- Insider Activity: Net buying/selling from SEC Form 4 filings (90-day window)
- Put/Call Ratio: High ratio = excessive fear/bullish; low ratio = complacency/bearish
Weights auto-normalize if some components unavailable.
Special Timing Checks:
- Pre-earnings warning (< 14 days): Recommends HOLD instead of BUY
- Post-earnings spike detection (> 15% in 5 days): Flags "gains priced in"
- Overbought conditions (RSI > 70 + near 52w high): Reduces confidence
Timing Warnings & Risk Flags
The script detects high-risk scenarios:
Earnings Timing
- Pre-Earnings Period: If earnings < 14 days away, BUY signals become HOLD
- Post-Earnings Spike: If stock up > 15% in 5 days after earnings, warns "gains may be priced in"
Technical Risk
- Overbought Conditions: RSI > 70 + near 52-week high = high-risk entry
Market Risk
- High VIX: Market fear (VIX > 30) reduces confidence in BUY signals
- Risk-Off Mode (v4.0.0): When safe-havens (GLD, TLT, UUP) rise together, reduces BUY confidence by 30%
- Detects flight to safety across gold, treasuries, and USD
- Triggers when GLD โฅ +2%, TLT โฅ +1%, UUP โฅ +1% (5-day change)
Sector Risk
- Sector Weakness: Stock may look good but sector is rotating out
Geopolitical Risk (v4.0.0)
The script now scans breaking news (last 24h) for crisis keywords and automatically flags affected stocks:
- Taiwan Conflict: Semiconductors (NVDA, AMD, TSM, INTC, etc.) โ 30% confidence penalty
- China Tensions: Tech/Consumer (AAPL, QCOM, NKE, SBUX, etc.) โ 30% confidence penalty
- Russia-Ukraine: Energy/Materials (XOM, CVX, MOS, CF, etc.) โ 30% confidence penalty
- Middle East: Oil/Defense (XOM, LMT, RTX, etc.) โ 30% confidence penalty
- Banking Crisis: Financials (JPM, BAC, WFC, C, etc.) โ 30% confidence penalty
If a ticker is not in the affected list but its sector is exposed, applies a 15% confidence penalty.
Example Alert:
โ ๏ธ SECTOR RISK: Tech supply chain and consumer market exposure (detected: china, tariff)
Breaking News Alerts (v4.0.0)
- Scans Google News RSS for crisis keywords (war, recession, sanctions, disasters, etc.)
- Displays up to 2 breaking news alerts in caveats (last 24 hours)
- Uses 1-hour cache to avoid excessive API calls
Output Format
Default (text): Concise buy/hold/sell signal with 3-5 bullet points and caveats
JSON: Structured data with scores, metrics, and raw data for further analysis
Limitations
- Data freshness: Yahoo Finance may lag 15-20 minutes
- Sentiment data staleness:
- Short interest data lags ~2 weeks (FINRA reporting schedule)
- Insider trades may lag filing by 2-3 days
- VIX term structure only updates during futures trading hours
- Breaking news limitations (v4.0.0):
- Google News RSS may lag by 15-60 minutes
- Keyword matching may have false positives/negatives
- Does not analyze sentiment, only detects keywords
- 1-hour cache means alerts may be slightly stale
- Missing data: Not all stocks have analyst coverage, options chains, or complete fundamentals
- Execution time: 3-5s per stock with async parallel fetching and caching (shared indicators cached for 1h)
- Disclaimer: All outputs include prominent "not financial advice" warning
- US markets only: Non-US tickers may have incomplete data
Error Handling
The script gracefully handles:
- Invalid tickers โ Clear error message
- Missing analyst data โ Signal based on available metrics only
- API failures โ Retry with exponential backoff, fail after 3 attempts
Related skills
More from gracefullight/stock-checker and the wider catalog.
yahoo-finance
Get stock prices, quotes, fundamentals, earnings, options, dividends, and analyst ratings using Yahoo Finance. Uses yfinance library - no API key required.
trading-analysis
Agent skill from gracefullight/stock-checker.
backtesting-trading-strategies
|