refactor: comprehensive skill rewrite with professional analyst perspective
All checks were successful
continuous-integration/drone/push Build is passing

Coverage: 19% → 67% of API endpoints (88/131)

market-analysis: 5 → 15 endpoints (all 14 technical indicators + historical)
- Added: ADX, Stochastic, Keltner, Donchian, Aroon, CCI, Fib, A/D, Cones, VWAP
- Added confluence/divergence analysis guidance

fundamental-analysis: 5 → 12 endpoints
- Added: summary (all-in-one), CAPM, Sortino, Omega, estimates,
  share-statistics, institutional, dividends, calendar/earnings
- Added institutional ownership and earnings catalyst flagging

sentiment-analysis: 5 → 16 endpoints
- Added: reddit-sentiment, social-sentiment, shorts/ftd, darkpool/otc,
  share-statistics, institutional, congress/trades
- Restructured as smart money vs retail noise hierarchy

macro-analysis: 6 → 23 endpoints
- Added: treasury-rates, effr, sofr, spreads, hqm, tips-yields,
  pce, gdp, unemployment, money-measures, cli, sloos,
  nonfarm-payrolls, empire-state, central-bank-holdings,
  fomc-documents, sp500-multiples
- Added business cycle positioning framework

trade-analyze: updated data collection to use /summary endpoint

AGENTS.md (all 4 debate agents): updated for sessions_spawn protocol
SOUL.md (all 4): removed unavailable memory_search, REPLY_SKIP refs
deploy.sh: fixed nvm loading for SSH
This commit is contained in:
Yaojia Wang
2026-03-21 19:11:33 +01:00
parent 5be9385c9f
commit 880f830741
5 changed files with 393 additions and 165 deletions

View File

@@ -1,35 +1,54 @@
---
name: fundamental-analysis
description: Fundamental analysis report — valuation, growth, analyst consensus, financial health via openbb-invest-api
description: Professional fundamental analysis — valuation, growth quality, financial health, risk metrics, institutional positioning via openbb-invest-api
user-invocable: true
metadata: { "openclaw": { "emoji": "📋", "requires": { "bins": ["curl"] } } }
---
# Fundamental Analysis
Generate a structured fundamental analysis report for a given stock ticker.
Generate a professional-grade fundamental analysis. Think like a buy-side equity analyst.
## Data Collection
Fetch the following endpoints using `exec` tool:
```bash
BASE=https://invest-api.k8s.home
# 1. Key metrics (PE, PB, ROE, EPS, beta, dividend yield)
curl -sk "$BASE/api/v1/stock/{TICKER}/metrics"
# Company overview (quote + profile + metrics + financials in one call)
curl -sk "$BASE/api/v1/stock/{TICKER}/summary"
# 2. Financial statements (income, balance sheet, cash flow)
curl -sk "$BASE/api/v1/stock/{TICKER}/financials"
# Analyst consensus estimates
curl -sk "$BASE/api/v1/stock/{TICKER}/estimates"
# 3. Analyst price targets (consensus, high, low)
# Analyst upgrades/downgrades with price targets
curl -sk "$BASE/api/v1/stock/{TICKER}/upgrades"
# 4. Analyst recommendations (buy/hold/sell counts)
# Analyst buy/hold/sell counts
curl -sk "$BASE/api/v1/stock/{TICKER}/recommendations"
# 5. Risk metrics (Sharpe, volatility, max drawdown)
# Quantitative risk: Sharpe, volatility, max drawdown
curl -sk "$BASE/api/v1/stock/{TICKER}/performance?days=365"
# CAPM: beta, alpha, systematic vs idiosyncratic risk
curl -sk "$BASE/api/v1/stock/{TICKER}/capm"
# Sortino ratio (downside risk — better than Sharpe for asymmetric returns)
curl -sk "$BASE/api/v1/stock/{TICKER}/sortino?days=365"
# Omega ratio (full distribution gain/loss)
curl -sk "$BASE/api/v1/stock/{TICKER}/omega?days=365"
# Share statistics (float, shares outstanding, short % of float)
curl -sk "$BASE/api/v1/stock/{TICKER}/share-statistics"
# Institutional holders (13F — who's buying/selling)
curl -sk "$BASE/api/v1/stock/{TICKER}/institutional"
# Dividend history (if applicable)
curl -sk "$BASE/api/v1/stock/{TICKER}/dividends"
# Upcoming earnings date
curl -sk "$BASE/api/v1/calendar/earnings?start_date=$(date +%Y-%m-%d)&end_date=$(date -d '+30 days' +%Y-%m-%d 2>/dev/null || date -v+30d +%Y-%m-%d)"
```
## Report Structure
@@ -38,41 +57,60 @@ curl -sk "$BASE/api/v1/stock/{TICKER}/performance?days=365"
## {TICKER} Fundamental Analysis — {date}
### Valuation
- P/E: {value} vs sector average — [cheap / fair / expensive]
- P/E: {value} vs S&P 500 avg (~22) — [cheap / fair / rich]
- P/B: {value}
- PEG: {value if available}
- Current price vs analyst consensus target: {price} vs {target} ({upside/downside}%)
- EV/EBITDA: {if available}
- Price vs consensus target: ${current} vs ${target} ({upside/downside}%)
- Price target range: ${low} — ${high}
### Growth & Profitability
- Revenue YoY growth: {%}
- EPS YoY growth: {%}
- ROE: {%} — [strong >15% / moderate / weak <5%]
- Net margin: {%}
### Growth Quality
- Revenue YoY: {%} — trend [accelerating / decelerating / stable]
- EPS YoY: {%}
- ROE: {%} — [excellent >20% / strong >15% / moderate >10% / weak <10%]
- ROA: {%}
- Net margin: {%} — [expanding / compressing]
- Forward estimates: {consensus EPS for next quarter/year}
### Financial Health
- Debt-to-Equity: {ratio}
- Current Ratio: {ratio}
- Free Cash Flow trend: [positive/negative/declining]
### Analyst Consensus
- Ratings: {buy} buy / {hold} hold / {sell} sell
- Recent upgrades/downgrades: {summary}
- Price target range: ${low} — ${high} (consensus ${target})
- Debt-to-Equity: {ratio} — [conservative <0.5 / moderate / leveraged >1.5]
- Current Ratio: {ratio} — [healthy >1.5 / tight <1.0]
- Free Cash Flow: {trend and magnitude}
- Cash position: {if available}
### Risk Profile
- Beta: {value} — [low <0.8 / market ~1.0 / high >1.2]
- Sharpe ratio (1Y): {value}
- Beta: {value} — [defensive <0.8 / market ~1.0 / aggressive >1.2]
- CAPM alpha: {%} — [outperforming / underperforming vs market]
- Sharpe (1Y): {value} — [poor <0.5 / good >1.0 / excellent >2.0]
- Sortino (1Y): {value} — [context vs Sharpe]
- Max drawdown (1Y): {%}
- Dividend yield: {%} (if applicable)
- Omega ratio: {value}
### Institutional & Ownership
- Float: {shares} ({% of total})
- Short % of float: {%} — [low <5% / moderate / high >15%]
- Top institutional holders: {names if available}
- Recent institutional activity: [net buying / net selling / stable]
### Analyst Consensus
- Ratings: {strong buy} strong buy / {buy} buy / {hold} hold / {sell} sell
- Recent actions: {last 2-3 upgrades/downgrades with firm names}
- Upcoming earnings: {date if within 30 days — FLAG if within 7 days}
### Dividend (if applicable)
- Yield: {%}
- Payout ratio: {%}
- Growth streak: {years}
### Signal: [BULLISH / BEARISH / NEUTRAL]
### Confidence: {1-10}
### Key Risk: {one-line risk factor}
### Key Risk: {one-line}
```
## Rules
- Use ONLY data from the API responses — never fabricate financial figures
- If an endpoint returns an error, note "Data unavailable" for that section
- Keep the report under 400 words
- Compare metrics to reasonable benchmarks (S&P 500 average PE ~22, ROE ~15%)
- Use ONLY data from API responses
- Compare metrics to sector peers, not just absolute thresholds
- Flag **earnings within 7 days** as a major catalyst/risk
- Sortino > Sharpe for stocks with asymmetric return profiles
- High short interest + upcoming catalyst = potential squeeze
- Keep under 500 words

View File

@@ -1,37 +1,84 @@
---
name: macro-analysis
description: Macro environment analysis — rates, inflation, economic indicators, short pressure via openbb-invest-api
description: Professional macro environment analysis — rates, inflation, labor, leading indicators, credit conditions, sector implications via openbb-invest-api
user-invocable: true
metadata: { "openclaw": { "emoji": "🌍", "requires": { "bins": ["curl"] } } }
---
# Macro Analysis
Generate a structured macro environment report relevant to a given stock ticker.
Generate a professional-grade macro environment report. Think like a macro strategist at a multi-asset fund.
## Data Collection
Fetch the following endpoints using `exec` tool:
```bash
BASE=https://invest-api.k8s.home
# 1. Macro overview (Fed rate, yields, CPI, unemployment, GDP, VIX)
# Headline indicators (Fed rate, yields, CPI, unemployment, GDP, VIX)
curl -sk "$BASE/api/v1/macro/overview"
# 2. Yield curve (rate environment and inversion signal)
# Yield curve (rate environment, inversion = recession signal)
curl -sk "$BASE/api/v1/fixed-income/yield-curve"
# 3. CPI (inflation trend)
# Full treasury rates (4W to 30Y)
curl -sk "$BASE/api/v1/fixed-income/treasury-rates"
# Effective Federal Funds Rate with percentiles
curl -sk "$BASE/api/v1/fixed-income/effr"
# SOFR (key benchmark rate)
curl -sk "$BASE/api/v1/fixed-income/sofr"
# Credit spreads (stress indicator)
curl -sk "$BASE/api/v1/fixed-income/spreads?series=tcm"
# Corporate bond yields (credit quality)
curl -sk "$BASE/api/v1/fixed-income/hqm"
# TIPS real yields (inflation expectations)
curl -sk "$BASE/api/v1/fixed-income/tips-yields"
# CPI inflation
curl -sk "$BASE/api/v1/macro/cpi?country=united_states"
# 4. Consumer sentiment (recession predictor)
# PCE (Fed's preferred inflation measure)
curl -sk "$BASE/api/v1/macro/pce"
# GDP
curl -sk "$BASE/api/v1/macro/gdp?gdp_type=real"
# Unemployment
curl -sk "$BASE/api/v1/macro/unemployment?country=united_states"
# Money supply
curl -sk "$BASE/api/v1/macro/money-measures"
# Composite Leading Indicator (recession predictor)
curl -sk "$BASE/api/v1/macro/cli?country=united_states"
# Consumer sentiment (recession leading indicator)
curl -sk "$BASE/api/v1/economy/surveys/michigan"
# 5. Short selling pressure on the specific stock
curl -sk "$BASE/api/v1/stock/{TICKER}/shorts/volume"
# Lending conditions (strongest recession signal)
curl -sk "$BASE/api/v1/economy/surveys/sloos"
# 6. Short interest and days to cover
# Employment detail
curl -sk "$BASE/api/v1/economy/surveys/nonfarm-payrolls"
# Manufacturing outlook
curl -sk "$BASE/api/v1/economy/surveys/empire-state"
# Fed balance sheet
curl -sk "$BASE/api/v1/economy/central-bank-holdings"
# FOMC documents (policy direction)
curl -sk "$BASE/api/v1/economy/fomc-documents?year=2026"
# S&P 500 valuation context
curl -sk "$BASE/api/v1/index/sp500-multiples?series=pe_ratio"
# Short pressure on the specific stock
curl -sk "$BASE/api/v1/stock/{TICKER}/shorts/volume"
curl -sk "$BASE/api/v1/stock/{TICKER}/shorts/interest"
```
@@ -40,41 +87,57 @@ curl -sk "$BASE/api/v1/stock/{TICKER}/shorts/interest"
```
## Macro Environment for {TICKER} — {date}
### Interest Rate Environment
- Fed Funds Rate: {rate}%
- 10Y Treasury: {rate}% | 2Y Treasury: {rate}%
- Yield curve: [normal / flat / inverted] — {spread}bps
- Rate outlook: [hawkish / dovish / neutral]
### Rate Environment
- Fed Funds Rate: {rate}% | EFFR: {rate}%
- SOFR: {rate}%
- 2Y: {rate}% | 10Y: {rate}% | 30Y: {rate}%
- Yield curve (10Y-2Y): {spread}bps — [normal / flat / inverted]
- Credit spreads: [tight = risk-on / widening = stress]
- TIPS real yield: {rate}% — [positive = tight policy / negative = accommodative]
- Rate outlook: [hawkish / dovish / neutral] based on FOMC tone
### Inflation
- CPI YoY: {%} — trend [rising / falling / stable]
- PCE (if available): {%}
- Implication: [Fed likely to cut / hold / raise]
- PCE YoY: {%} — Fed target 2%, current gap: {bps}
- Money supply (M2): [growing / contracting]
- Implication: Fed likely to [cut / hold / raise]
### Economic Health
- GDP growth: {%}
- Unemployment: {%}
- VIX: {level} — [low fear <15 / moderate 15-25 / high fear >25]
- Consumer sentiment (Michigan): {value} — [strong / weak / deteriorating]
### Labor Market
- Unemployment: {%} — [tight <4% / balanced / loosening >5%]
- Nonfarm payrolls: {latest change}
- Avg hourly earnings: {YoY %} — wage inflation [hot / moderate / cooling]
### Short Pressure on {TICKER}
- Short volume: {%} of total volume — [low <20% / moderate / high >40%]
- Short interest: {shares} ({days_to_cover} days to cover)
- Signal: [short squeeze potential / bears in control / neutral]
### Business Cycle Position
- GDP growth: {%} — [expansion / slowing / contraction]
- CLI: {value} — [above 100 = expansion / below 100 = contraction / direction?]
- Michigan sentiment: {value} — [confident / cautious / pessimistic]
- Empire State: {value} — [expanding >0 / contracting <0]
- SLOOS: lending standards [tightening = recession risk / easing = expansion]
### Market Implications for {TICKER}
- Sector sensitivity to rates: [high / moderate / low]
- Macro headwinds: {key risk}
- Macro tailwinds: {key opportunity}
### Liquidity & Central Bank
- Fed balance sheet: [expanding (QE) / shrinking (QT) / stable]
- Corporate bond yields (HQM): AAA {%}, A {%} — credit stress level
### Market Valuation Context
- S&P 500 P/E: {value} vs historical avg (~18) — [cheap / fair / expensive]
- VIX: {level} — [complacent <15 / normal 15-20 / fearful 20-30 / panic >30]
### Implications for {TICKER}
- Sector rate sensitivity: [high / moderate / low] (e.g., REITs, banks, tech duration)
- Macro headwinds: {1-2 specific risks}
- Macro tailwinds: {1-2 specific opportunities}
- Short pressure: volume {%}, interest {days to cover}
### Signal: [FAVORABLE / UNFAVORABLE / MIXED]
### Confidence: {1-10}
### Key Risk: {one-line macro risk}
### Key Risk: {one-line macro risk for this stock}
```
## Rules
- Use ONLY data from the API responses — never fabricate economic figures
- If an endpoint returns an error, note "Data unavailable" for that section
- Keep the report under 400 words
- Contextualize macro data for the specific stock's sector (e.g., rate-sensitive sectors like REITs, banks)
- **Yield curve inversion is the strongest recession predictor** — flag it prominently
- **SLOOS tightening precedes recessions by 6-12 months** — critical leading indicator
- **CLI below 100 and falling = recession warning**
- **VIX > 30 = fear** — contrarian buy signal for quality stocks
- Contextualize for the specific stock's sector sensitivity
- Keep under 600 words (macro requires more context than other analyses)

View File

@@ -1,69 +1,102 @@
---
name: market-analysis
description: Technical analysis report for a stock — trend, momentum, volatility, volume signals via openbb-invest-api
description: Professional technical analysis — trend structure, momentum, volatility regime, volume profile, support/resistance via openbb-invest-api
user-invocable: true
metadata: { "openclaw": { "emoji": "📊", "requires": { "bins": ["curl"] } } }
---
# Market Analysis
# Market Analysis (Technical)
Generate a structured technical analysis report for a given stock ticker.
Generate a professional-grade technical analysis report. Think like a prop desk trader.
## Data Collection
Fetch the following endpoints using `exec` tool (all require `-sk` flag for self-signed TLS):
Fetch ALL of the following using `exec` tool. Run them in a single command joined by `&&`:
```bash
BASE=https://invest-api.k8s.home
# 1. Composite technical indicators (RSI, MACD, SMA, EMA, Bollinger Bands)
# Core technicals (RSI, MACD, SMA, EMA, Bollinger)
curl -sk "$BASE/api/v1/stock/{TICKER}/technical"
# 2. Ichimoku Cloud (trend system)
# Trend system
curl -sk "$BASE/api/v1/stock/{TICKER}/technical/ichimoku"
# 3. Historical prices (6 months for trend context)
curl -sk "$BASE/api/v1/stock/{TICKER}/historical?days=180"
# Trend strength
curl -sk "$BASE/api/v1/stock/{TICKER}/technical/adx"
# 4. ATR (volatility measure)
# Overbought/oversold oscillator
curl -sk "$BASE/api/v1/stock/{TICKER}/technical/stoch"
# Volatility
curl -sk "$BASE/api/v1/stock/{TICKER}/technical/atr"
curl -sk "$BASE/api/v1/stock/{TICKER}/technical/kc"
curl -sk "$BASE/api/v1/stock/{TICKER}/technical/cones"
# 5. OBV (volume confirmation)
# Volume analysis
curl -sk "$BASE/api/v1/stock/{TICKER}/technical/obv"
curl -sk "$BASE/api/v1/stock/{TICKER}/technical/ad"
curl -sk "$BASE/api/v1/stock/{TICKER}/technical/vwap"
# Support/resistance
curl -sk "$BASE/api/v1/stock/{TICKER}/technical/fib"
curl -sk "$BASE/api/v1/stock/{TICKER}/technical/donchian"
# Trend direction change
curl -sk "$BASE/api/v1/stock/{TICKER}/technical/aroon"
# Cyclical analysis
curl -sk "$BASE/api/v1/stock/{TICKER}/technical/cci"
# Price history for context
curl -sk "$BASE/api/v1/stock/{TICKER}/historical?days=180"
```
## Report Structure
Produce a concise report in this format:
```
## {TICKER} Technical Analysis — {date}
### Price Trend
- SMA 20/50/200 alignment: [golden cross / death cross / neutral]
- Price position: [above/below] 50-day SMA
- Ichimoku: price [above/below] cloud, [bullish/bearish] TK cross
### Trend Structure
- Primary trend: [uptrend / downtrend / range-bound]
- SMA 20/50/200 alignment: [bullish stacking / bearish stacking / tangled]
- Ichimoku: price vs cloud, TK cross, Chikou confirmation
- ADX: {value} — trend strength [no trend <20 / trending 20-40 / strong >40]
- Aroon: up {value} / down {value} — [new uptrend / new downtrend / consolidation]
### Momentum
- RSI(14): {value} — [overbought >70 / oversold <30 / neutral]
- MACD: signal line [bullish/bearish] crossover, histogram [expanding/contracting]
- RSI(14): {value} — [overbought >70 / oversold <30 / divergence?]
- MACD: histogram {value}, signal cross [bullish/bearish], momentum [accelerating/decelerating]
- Stochastic: %K {value}, %D {value} — [overbought >80 / oversold <20 / cross?]
- CCI: {value} — [overbought >100 / oversold <-100 / neutral]
### Volatility
- Bollinger Bands: price at [upper/middle/lower] band, bandwidth [wide/narrow]
- ATR(14): {value} — trend [expanding/contracting] vs 20-day average
### Volatility Regime
- ATR(14): {value} — vs 20-day avg [expanding/contracting]
- Bollinger bandwidth: [squeeze / normal / expansion]
- Keltner Channels: price position [above upper / within / below lower]
- Volatility Cones: current IV vs historical quantiles [cheap / fair / expensive]
### Volume
- OBV: [confirming/diverging] from price trend
- Recent volume vs 20-day average: [above/below] by {%}
### Volume Profile
- OBV trend: [confirming price / bearish divergence / bullish divergence]
- A/D Line: [accumulation / distribution / neutral]
- VWAP: price vs VWAP [above = bullish bias / below = bearish bias]
### Key Levels
- Fibonacci retracements: 23.6% ${}, 38.2% ${}, 50% ${}, 61.8% ${}
- Donchian: upper ${}, lower ${}, midline ${}
- Nearest support: ${}
- Nearest resistance: ${}
### Signal: [BULLISH / BEARISH / NEUTRAL]
### Confidence: {1-10}
### Key Risk: {one-line risk factor}
### Timeframe: [intraday / swing / position]
### Key Risk: {one-line, e.g. "bearish divergence on RSI + volume declining"}
```
## Rules
- Use ONLY data from the API responses — never fabricate indicator values
- If an endpoint returns an error or empty data, note "Data unavailable" for that section
- Keep the report under 400 words
- End with a clear directional signal and confidence score
- Use ONLY data from API responses — never fabricate indicator values
- If an endpoint fails, note "Data unavailable" and continue
- Look for **confluence** — multiple indicators agreeing strengthens the signal
- Look for **divergences** — price vs RSI, price vs OBV, price vs A/D
- Keep under 500 words

View File

@@ -1,35 +1,59 @@
---
name: sentiment-analysis
description: Sentiment analysis report — news sentiment, insider activity, social media, analyst actions via openbb-invest-api
description: Professional sentiment analysis — multi-source sentiment scoring, insider flow, smart money tracking, social signals via openbb-invest-api
user-invocable: true
metadata: { "openclaw": { "emoji": "🎭", "requires": { "bins": ["curl"] } } }
---
# Sentiment Analysis
Generate a structured sentiment analysis report for a given stock ticker.
Generate a professional-grade sentiment report. Think like a sentiment quant — track smart money, not retail noise.
## Data Collection
Fetch the following endpoints using `exec` tool:
```bash
BASE=https://invest-api.k8s.home
# 1. Composite sentiment score (aggregated from multiple sources)
# Composite sentiment score (aggregated multi-source)
curl -sk "$BASE/api/v1/stock/{TICKER}/sentiment"
# 2. Per-article news sentiment scores (bullish/bearish)
curl -sk "$BASE/api/v1/stock/{TICKER}/news-sentiment?limit=20"
# Per-article news sentiment (Alpha Vantage)
curl -sk "$BASE/api/v1/stock/{TICKER}/news-sentiment?limit=30"
# 3. Insider trades (SEC Form 4 — buys vs sells)
# Insider trades (SEC Form 4 — CEO/CFO buys and sells)
curl -sk "$BASE/api/v1/stock/{TICKER}/insider-trades"
# 4. SEC insider filings
# SEC insider filings (detailed Form 4)
curl -sk "$BASE/api/v1/stock/{TICKER}/sec-insider"
# 5. Recent upgrades/downgrades
# Recent upgrades/downgrades
curl -sk "$BASE/api/v1/stock/{TICKER}/upgrades"
# Analyst recommendations count
curl -sk "$BASE/api/v1/stock/{TICKER}/recommendations"
# Reddit sentiment and mentions
curl -sk "$BASE/api/v1/stock/{TICKER}/reddit-sentiment"
# Social sentiment (Finnhub — Reddit + Twitter)
curl -sk "$BASE/api/v1/stock/{TICKER}/social-sentiment"
# Institutional holders (13F — smart money positions)
curl -sk "$BASE/api/v1/stock/{TICKER}/institutional"
# Short selling pressure
curl -sk "$BASE/api/v1/stock/{TICKER}/shorts/volume"
curl -sk "$BASE/api/v1/stock/{TICKER}/shorts/interest"
curl -sk "$BASE/api/v1/stock/{TICKER}/shorts/ftd"
# Dark pool activity (institutional block trades)
curl -sk "$BASE/api/v1/darkpool/{TICKER}/otc"
# Share statistics (float, short % of float)
curl -sk "$BASE/api/v1/stock/{TICKER}/share-statistics"
# Congress trades (political insider trading)
curl -sk "$BASE/api/v1/regulators/congress/trades"
```
## Report Structure
@@ -37,32 +61,58 @@ curl -sk "$BASE/api/v1/stock/{TICKER}/upgrades"
```
## {TICKER} Sentiment Analysis — {date}
### Overall Sentiment Score
- Composite: {score} (-1.0 to +1.0) — [strongly bearish / bearish / neutral / bullish / strongly bullish]
- Source breakdown: news {score}, analyst {score}, social {score}
### Composite Sentiment
- Score: {value} (-1.0 to +1.0) — [strongly bearish / bearish / neutral / bullish / strongly bullish]
- Breakdown: news {score}, analysts {score}, upgrades {score}, social {score}
### News Sentiment
### News Flow
- Articles analyzed: {count}
- Bullish: {count} ({%}) | Neutral: {count} ({%}) | Bearish: {count} ({%})
- Key headlines: {top 2-3 relevant headlines with sentiment}
- Sentiment distribution: {bullish}% bullish / {neutral}% neutral / {bearish}% bearish
- Dominant themes: {top 2-3 topics}
- Notable headlines: {1-2 most impactful}
### Insider Activity (last 90 days)
- Net insider transactions: {net buy/sell}
- Notable trades: {largest insider buy or sell with name and title}
- Signal: [insiders buying = bullish / insiders selling = bearish / mixed]
### Smart Money Signals
#### Insider Activity (last 90 days)
- Net insider transactions: {count buys} buys / {count sells} sells = {net}
- Notable: {largest trade with name, title, amount}
- Signal: [strong buy signal / selling for diversification / red flag]
#### Institutional Flow
- Major holders: {top 3 names if available}
- Recent 13F activity: [net accumulation / net distribution / stable]
#### Congress Trades
- Any recent trades in {TICKER}: [yes — details / none found]
### Short Selling Intelligence
- Short volume: {%} of daily volume — [normal <25% / elevated 25-40% / extreme >40%]
- Short interest: {shares} ({days_to_cover} days to cover)
- Short % of float: {%} — [low <5% / moderate / crowded >15%]
- Fails-to-deliver: {trend} — [rising = naked shorting concern / stable / declining]
- Dark pool volume: {%} of total — [normal / elevated institutional activity]
- Squeeze potential: [low / moderate / high] based on short interest + days to cover + catalyst
### Analyst Actions (last 30 days)
- Upgrades: {count} | Downgrades: {count}
- Notable: {most recent significant upgrade/downgrade with firm name}
- Most significant: {firm, action, price target}
- Consensus shift: [improving / deteriorating / stable]
### Social & Retail
- Reddit mentions rank: #{rank} in WSB/stocks
- Reddit sentiment: {bullish/bearish/mixed}
- Social media buzz: [trending up / stable / fading]
- ⚠️ Note: Social sentiment is a contrarian indicator at extremes
### Signal: [BULLISH / BEARISH / NEUTRAL]
### Confidence: {1-10}
### Key Risk: {one-line sentiment risk}
### Key Insight: {the single most actionable sentiment finding}
```
## Rules
- Use ONLY data from the API responses — never fabricate sentiment scores
- If an endpoint returns an error, note "Data unavailable" for that section
- Keep the report under 400 words
- Insider buying is a stronger signal than insider selling (insiders sell for many reasons, but buy for one)
- **Smart money > retail noise**: Weight insider buys and institutional flow higher than Reddit
- Insider buying is a strong signal (insiders buy for one reason: they expect the price to go up)
- Insider selling is a weak signal (insiders sell for many reasons: taxes, diversification, estate planning)
- High short interest alone is not bearish — combine with catalyst for squeeze assessment
- Congress trades within 30 days of legislation = potential MNPI concern
- Keep under 500 words

View File

@@ -1,6 +1,6 @@
---
name: trade-analyze
description: "Deep trading analysis with multi-agent debate. Use sessions_spawn to delegate to invest-bull, invest-bear, invest-hawk, invest-dove. Triggered by /trade-analyze or deep analysis requests."
description: "Deep trading analysis with multi-agent debate. Collects comprehensive data, spawns Bull/Bear/Hawk/Dove agents for debate, outputs final verdict. Use when user says /trade-analyze or wants deep analysis."
user-invocable: true
metadata: { "openclaw": { "emoji": "⚖️", "requires": { "bins": ["curl"] } } }
---
@@ -9,68 +9,93 @@ metadata: { "openclaw": { "emoji": "⚖️", "requires": { "bins": ["curl"] } }
**You are the judge. Debate agents work in the background via sessions_spawn. Only YOU post to Discord.**
**IMPORTANT: Use `sessions_spawn` (NOT sessions_send). sessions_send will timeout due to gateway architecture.**
**IMPORTANT: Use `sessions_spawn` (NOT sessions_send — it will timeout).**
## Step 1: Collect Data
Run these curl commands using the `exec` tool:
Run these curl commands using `exec`. Combine into one command for speed:
```bash
curl -sk "https://invest-api.k8s.home/api/v1/stock/{TICKER}/technical"
curl -sk "https://invest-api.k8s.home/api/v1/stock/{TICKER}/metrics"
curl -sk "https://invest-api.k8s.home/api/v1/stock/{TICKER}/sentiment"
curl -sk "https://invest-api.k8s.home/api/v1/macro/overview"
BASE=https://invest-api.k8s.home
# All-in-one summary (quote + profile + metrics + financials)
curl -sk "$BASE/api/v1/stock/{TICKER}/summary"
# Technical composite (RSI, MACD, SMA, EMA, Bollinger + signals)
curl -sk "$BASE/api/v1/stock/{TICKER}/technical"
# Composite sentiment (news + analysts + reddit + upgrades)
curl -sk "$BASE/api/v1/stock/{TICKER}/sentiment"
# Macro overview (Fed rate, yields, CPI, unemployment, GDP, VIX)
curl -sk "$BASE/api/v1/macro/overview"
# Analyst price targets and recent upgrades/downgrades
curl -sk "$BASE/api/v1/stock/{TICKER}/upgrades"
# Short selling pressure
curl -sk "$BASE/api/v1/stock/{TICKER}/shorts/volume"
# CAPM risk decomposition
curl -sk "$BASE/api/v1/stock/{TICKER}/capm"
# Sortino ratio (downside risk)
curl -sk "$BASE/api/v1/stock/{TICKER}/sortino?days=365"
```
Summarize key data points (under 500 words).
Summarize key data points into a concise data package (under 600 words) covering:
- Price, PE, ROE, revenue growth, beta
- RSI, MACD, SMA alignment, Bollinger position
- Sentiment score, insider activity, analyst consensus
- Fed rate, yield curve, VIX
- Short interest, CAPM alpha
- Sortino ratio
## Step 2: Bull Case
Use the `sessions_spawn` tool:
Use `sessions_spawn`:
```json
{
"task": "You are the Bull Researcher. Based on the following data for {TICKER}, build your bullish investment thesis with 3-5 specific data-backed arguments. Keep under 400 words.\n\nData:\n{data summary}",
"task": "You are the Bull Researcher for {TICKER}. Build your bullish thesis with 3-5 data-backed arguments. Include entry price, target, and timeframe. Under 400 words.\n\nData:\n{data package}",
"agentId": "invest-bull",
"label": "bull-{TICKER}"
}
```
sessions_spawn returns immediately with `{ status: "accepted", runId }`. The result will be announced back to you automatically when Bull finishes. **Wait for the announce before proceeding.**
**Wait for announce before proceeding.**
## Step 3: Bear Case
After receiving Bull's result, use `sessions_spawn`:
```json
{
"task": "You are the Bear Researcher. For {TICKER}, Bull argued:\n\n{Bull's argument}\n\nBuild your bearish counter-argument with 3-5 specific data-backed points. Keep under 400 words.",
"task": "You are the Bear Researcher for {TICKER}. Bull argued:\n\n{Bull's argument}\n\nCounter with 3-5 data-backed bearish points. Under 400 words.",
"agentId": "invest-bear",
"label": "bear-{TICKER}"
}
```
Wait for Bear's announce.
**Wait for announce.**
## Step 4: Bull Rebuttal (FINAL)
```json
{
"task": "You are the Bull Researcher. Bear responded:\n\n{Bear's argument}\n\nThis is your FINAL rebuttal. Counter Bear's strongest point. Keep under 300 words.",
"task": "FINAL rebuttal for {TICKER}. Bear argued:\n\n{Bear's argument}\n\nCounter Bear's strongest point. State your final conviction. Under 300 words.",
"agentId": "invest-bull",
"label": "bull-final-{TICKER}"
}
```
**STOP Bull/Bear debate after this. Maximum 3 spawns for Bull/Bear.**
**STOP Bull/Bear after this. Maximum 3 spawns.**
## Step 5: Hawk Risk
Formulate a trading proposal, then:
Formulate a preliminary trading proposal based on the debate, then:
```json
{
"task": "You are the Hawk (aggressive) Risk Analyst. Evaluate this {TICKER} trading proposal. Propose position size, entry, stop-loss with specific numbers.\n\nProposal: {direction, entry, stop, target}",
"task": "Aggressive risk assessment for {TICKER}. Propose position size, entry, stop-loss, target with exact numbers.\n\nProposal: {BUY/SELL at $X, stop $Y, target $Z}\nBull case: {summary}\nBear case: {summary}",
"agentId": "invest-hawk",
"label": "hawk-{TICKER}"
}
@@ -80,15 +105,15 @@ Formulate a trading proposal, then:
```json
{
"task": "You are the Dove (conservative) Risk Analyst. Hawk proposed:\n\n{Hawk response}\n\nEvaluate from capital preservation perspective. Propose safer sizing.\n\nKeep under 300 words.",
"task": "Conservative risk assessment for {TICKER}. Hawk proposed:\n\n{Hawk's response}\n\nPropose safer position sizing and entry strategy. Under 300 words.",
"agentId": "invest-dove",
"label": "dove-{TICKER}"
}
```
## Step 7: Final Verdict (ONLY output to Discord)
## Step 7: Final Verdict
After all spawns complete, synthesize and output:
After ALL 5 spawns complete, synthesize and output this **single message** to Discord:
```
# ⚖️ Trading Verdict: {TICKER}
@@ -97,7 +122,18 @@ After all spawns complete, synthesize and output:
## Confidence: {1-10}/10
### Summary
{2-3 sentences}
{2-3 sentences — the core thesis}
### 📊 Data Snapshot
| Metric | Value | Signal |
|--------|-------|--------|
| Price | ${} | - |
| P/E | {} | {cheap/fair/rich} |
| RSI | {} | {OB/OS/neutral} |
| MACD | {} | {bull/bear cross} |
| Sentiment | {} | {bull/bear/neutral} |
| Short Interest | {}% | {low/mod/high} |
| VIX | {} | {fear level} |
### Entry Plan
| Item | Value |
@@ -107,34 +143,42 @@ After all spawns complete, synthesize and output:
| Stop-loss | ${price} ({%} risk) |
| Target | ${price} ({%} upside) |
| Position | {%} of portfolio |
| Timeframe | {weeks/months} |
| Risk:Reward | {ratio} |
### 🐂 Bull Case
1. {point}
2. {point}
3. {point}
1. {strongest data-backed point}
2. {second point}
3. {third point}
### 🐻 Bear Case
1. {point}
2. {point}
3. {point}
1. {strongest data-backed point}
2. {second point}
3. {third point}
### Risk Assessment
| Analyst | Position | Stop | View |
|---------|----------|------|------|
| 🦅 Hawk | {%} | ${} | {line} |
| 🕊️ Dove | {%} | ${} | {line} |
| **Final** | **{%}** | **${}** | **{why}** |
| Analyst | Position | Stop | Strategy |
|---------|----------|------|----------|
| 🦅 Hawk | {%} | ${} | {approach} |
| 🕊️ Dove | {%} | ${} | {approach} |
| **Adopted** | **{%}** | **${}** | **{rationale}** |
### ⚠️ Catalysts & Risks
- Upcoming: {earnings date, ex-div date, FOMC meeting if relevant}
- Key risk: {single biggest risk}
- Key catalyst: {single biggest upside trigger}
```
## Step 8: Save to Memory
Write decision to today's memory log.
Write decision summary to today's memory log.
## Rules
1. **Use `sessions_spawn`** with `agentId` — NOT sessions_send (it will timeout)
2. **Wait for each announce** before spawning the next agent
1. **Use `sessions_spawn`** with `agentId` — NOT sessions_send
2. **Wait for each announce** before spawning next
3. **Only YOU post to Discord** — spawn agents are silent
4. **Max spawns**: Bull(2) + Bear(1) + Hawk(1) + Dove(1) = 5 total
5. If spawn times out, skip and continue
4. **Max 5 spawns**: Bull(2) + Bear(1) + Hawk(1) + Dove(1)
5. If spawn times out, note it and continue
6. **Never use @ mentions**
7. The verdict should be ONE comprehensive message, not multiple