plugins/market-pulse/skills/market-pulse/SKILL.md
Financial market analysis dashboard with value investing tools. Use when user says "market overview", "market pulse", "stock market", "시장 분석", "주식 시장", "시장 현황", "증시 분석", "시장 브리핑", "가치투자", "안전마진", "PEG 스크리닝", "기업 분석", or wants to check financial markets, stocks, crypto, or analyze stocks using Graham/Lynch/Buffett strategies.
npx skillsauth add jaykim88/claude-ai-engineering market-pulseInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Fetches real-time financial market data (US stocks, Korean stocks, global macro, crypto) and generates a comprehensive analysis dashboard using multi-agent pipeline.
Briefly confirm in Korean and start immediately with default scope (overview):
"시장 분석을 시작합니다. 데이터를 수집하고 있습니다..."
Default scope: overview (미국, 한국, 글로벌 매크로, 크립토 전체 요약)
Note: User can request specific scope by saying "미국 시장만", "한국 시장만", etc. In that case, use the appropriate scope:
--scope us--scope kr--scope crypto--scope watchlist--scope deep2-1. Check Python dependencies (silent auto-install):
python3 -c "import yfinance, pykrx, yaml" 2>/dev/null || \
pip3 install yfinance pykrx pyyaml feedparser --quiet
2-2. Locate and run the fetch script:
Find the plugin directory. Check these paths in order:
~/.claude/skills/market-pulse/../../config/fetch_market.py (installed via symlink)plugins/market-pulse/config/fetch_market.py (local development)# Save output to temp file for later use
TEMP_JSON=/tmp/market-pulse-data-$(date +%s).json
# Option 1: With automatic insights (Recommended)
python3 {path_to_fetch_market.py} --scope {scope} --output json --with-analysis > $TEMP_JSON
# Option 2: Without insights (will need manual Phase 3)
# python3 {path_to_fetch_market.py} --scope {scope} --output json > $TEMP_JSON
Note: --with-analysis flag automatically generates data-driven insights, eliminating the need for manual Phase 3. The insights are based on heuristics and will be displayed in the HTML dashboard.
2-3. Error handling:
For overview or deep scope → Go to Step 4 (Multi-Agent Pipeline)
For single-market scope (us, kr, crypto) → Go to Step 5-Single
For watchlist scope → Go to Step 5-Watchlist
For value investing analysis (value, 안전마진, garp, deep-dive) → Go to Step 5-Value
Phase 1: Parallel Analysis
Launch all 3 agents in a SINGLE response block for parallel execution:
Task(
subagent_type="us-market-analyzer",
model="sonnet",
description="Analyze US market data",
prompt="Analyze the following US market data and provide insights.\n\n{us_indices + us_sectors + vix data from JSON}\n\nProvide index trend interpretation, sector rotation analysis, and market sentiment assessment."
)
Task(
subagent_type="kr-market-analyzer",
model="sonnet",
description="Analyze Korean market data",
prompt="Analyze the following Korean market data and provide insights.\n\n{kr_indices + kr_foreign_institutional + kr_top_stocks data from JSON}\n\nAlso consider USD/KRW from currencies data: {usd_krw data}\n\nProvide KOSPI/KOSDAQ interpretation, 외국인/기관 flow analysis, and notable stocks."
)
Task(
subagent_type="crypto-macro-analyzer",
model="sonnet",
description="Analyze crypto and global macro",
prompt="Analyze the following crypto and global macro data.\n\n{crypto + treasury_yields + commodities + currencies data from JSON}\n\nProvide crypto market overview, bond market interpretation, commodity trends, dollar analysis, and global risk assessment."
)
Phase 2: Synthesis
After Phase 1 completes, run the synthesizer:
Task(
subagent_type="market-synthesizer",
model="haiku",
description="Synthesize market dashboard",
prompt="Synthesize the following market analyses into a unified dashboard.\n\nMarket Status: {market_status from JSON}\n\n# US Market Analysis\n{us-market-analyzer output}\n\n# Korean Market Analysis\n{kr-market-analyzer output}\n\n# Crypto & Global Macro Analysis\n{crypto-macro-analyzer output}\n\nCreate unified dashboard with: top 3 key takeaways, all market sections, cross-market themes, and disclaimer."
)
Phase 3: Save Analysis to JSON
CRITICAL: After Phase 2 synthesis completes, you MUST add all agent analysis results to the JSON file before proceeding to Step 6. This ensures the HTML dashboard includes AI insights, not just raw data.
Instructions:
Method 1: Save to temp files (Recommended)
During Phase 1, save each agent output:
# After us-market-analyzer completes
us_analysis = """[paste the full output from us-market-analyzer agent]"""
with open('/tmp/us_analysis.txt', 'w', encoding='utf-8') as f:
f.write(us_analysis)
# After kr-market-analyzer completes
kr_analysis = """[paste the full output from kr-market-analyzer agent]"""
with open('/tmp/kr_analysis.txt', 'w', encoding='utf-8') as f:
f.write(kr_analysis)
# After crypto-macro-analyzer completes
crypto_analysis = """[paste the full output from crypto-macro-analyzer agent]"""
with open('/tmp/crypto_analysis.txt', 'w', encoding='utf-8') as f:
f.write(crypto_analysis)
After Phase 2, save synthesis:
synthesis = """[paste the full output from market-synthesizer agent]"""
with open('/tmp/synthesis.txt', 'w', encoding='utf-8') as f:
f.write(synthesis)
Then add all analysis to JSON:
import json
# Read JSON
with open(TEMP_JSON, 'r', encoding='utf-8') as f:
data = json.load(f)
# Read analysis files
with open('/tmp/us_analysis.txt', 'r', encoding='utf-8') as f:
us_market = f.read()
with open('/tmp/kr_analysis.txt', 'r', encoding='utf-8') as f:
kr_market = f.read()
with open('/tmp/crypto_analysis.txt', 'r', encoding='utf-8') as f:
crypto_macro = f.read()
with open('/tmp/synthesis.txt', 'r', encoding='utf-8') as f:
synthesis = f.read()
# Add analysis section
data['analysis'] = {
'us_market': us_market,
'kr_market': kr_market,
'crypto_macro': crypto_macro,
'synthesis': synthesis
}
# Save updated JSON
with open(TEMP_JSON, 'w', encoding='utf-8') as f:
json.dump(data, f, indent=2, ensure_ascii=False)
print("✅ Analysis added to JSON")
Method 2: Direct inline (Alternative)
If you prefer, you can directly paste the agent outputs into a Python script:
python3 << 'EOF'
import json
# Read original JSON
with open("$TEMP_JSON", 'r', encoding='utf-8') as f:
data = json.load(f)
# Add analysis (paste actual agent outputs here)
data['analysis'] = {
'us_market': """[paste us-market-analyzer output]""",
'kr_market': """[paste kr-market-analyzer output]""",
'crypto_macro': """[paste crypto-macro-analyzer output]""",
'synthesis': """[paste market-synthesizer output]"""
}
# Save
with open("$TEMP_JSON", 'w', encoding='utf-8') as f:
json.dump(data, f, indent=2, ensure_ascii=False)
print("✅ Analysis saved")
EOF
Verification:
# Verify analysis was added
grep -c '"analysis"' $TEMP_JSON
# Should output: 1
# Preview synthesis
python3 -c "import json; data=json.load(open('$TEMP_JSON')); print(data['analysis']['synthesis'][:200])"
IMPORTANT: Do NOT skip Phase 3! If you skip it, the HTML dashboard will only show data tables without any AI insights or investment recommendations.
Go to Step 6.
For us, kr, or crypto scope:
For us:
Task(subagent_type="us-market-analyzer", model="sonnet", ...)
For kr:
Task(subagent_type="kr-market-analyzer", model="sonnet", ...)
For crypto:
Task(subagent_type="crypto-macro-analyzer", model="sonnet", ...)
Go to Step 6.
For watchlist scope, no agents are needed. Display watchlist data directly in a table format:
## My Watchlist
### US Stocks
| Symbol | Price | Change | Alert | Notes |
|--------|-------|--------|-------|-------|
| {symbol} | ${price} | {change_pct}% | {alerts or --} | {notes} |
### Korean Stocks (한국 주식)
| 종목 | 가격 | 등락 | Notes |
|------|------|------|-------|
| {name} ({ticker}) | {price}원 | {change_pct}% | {notes} |
### Crypto
| Coin | Price | 24h Change |
|------|-------|------------|
| {name} | ${price} | {change_pct}% |
Go to Step 6.
NEW in v2.0: Analyze stocks using investment masters' strategies (Graham, Lynch, Buffett, Munger, Asness, Dalio, Fisher).
Trigger phrases:
Analysis Types:
1. Safety Margin Analysis (안전마진 - Graham/Buffett)
python3 {path_to}/analysis/value_investing_analyzer.py \
--tickers "AAPL,MSFT,GOOGL,NVDA,META,TSLA,AMZN" \
--analysis safety_margin
Output: 저평가 종목 (안전마진 20%+) with intrinsic value, current price, safety margin %, recommendation.
2. GARP Screening (Growth At Reasonable Price - Lynch)
python3 {path_to}/analysis/value_investing_analyzer.py \
--tickers "AAPL,MSFT,GOOGL,NVDA,META" \
--analysis garp
Output: GARP 종목 (PEG < 1.0, growth >= 10%) with category, PEG ratio, growth rate, ROE, recommendation.
3. Company Deep Dive (8-Perspective Analysis)
python3 {path_to}/analysis/company_deep_dive.py
Then provide single ticker when prompted. Generates comprehensive report with:
4. All-in-One Analysis
python3 {path_to}/analysis/value_investing_analyzer.py \
--tickers "AAPL,MSFT,GOOGL" \
--analysis all \
--output /tmp/value-analysis-{timestamp}.json
Display Format:
Present results in markdown tables:
안전마진 Top 10 (Safety Margin) | 종목 | 회사명 | 현재가 | 내재가치 | 안전마진 | 추천 | |------|--------|--------|----------|----------|------| | MSFT | Microsoft | $404.37 | $2,045.76 | 80.2% | 강력 매수 | | NVDA | NVIDIA | $190.05 | $574.70 | 66.9% | 강력 매수 |
GARP 종목 (PEG < 1.0) | 종목 | 카테고리 | PEG | 성장률 | ROE | 추천 | |------|----------|-----|--------|-----|------| | MSFT | 고성장주 | 0.36 | 59.8% | 34.4% | 강력 매수 | | NVDA | 고성장주 | 0.37 | 66.7% | 107.4% | 강력 매수 |
Notes:
Go to Step 6.
6-1. Display Terminal Summary
Present a brief summary of the analysis in the terminal (key takeaways only, 5-10 lines).
6-2. Generate Interactive HTML Dashboard
Before generating HTML, verify JSON contains AI analysis:
# Check if analysis section exists
if grep -q '"analysis"' "$TEMP_JSON"; then
echo "✅ Analysis found in JSON"
else
echo "⚠️ WARNING: JSON missing 'analysis' section - HTML will show data only, no insights!"
echo "Did you complete Step 4 Phase 3? The dashboard needs AI analysis for investment insights."
fi
Automatically generate HTML dashboard with visualizations (auto-named with timestamp):
# Locate generate_html.py (same directory as fetch_market.py)
# Output path will be auto-generated: /tmp/market-pulse-YYYYMMDD-HHMMSS.html
HTML_OUTPUT=$(python3 {path_to_generate_html.py} --input $TEMP_JSON)
What the HTML includes:
6-3. Auto-Open in Browser
Automatically open the HTML dashboard:
# macOS
open "$HTML_OUTPUT"
# Linux
xdg-open "$HTML_OUTPUT" 2>/dev/null || sensible-browser "$HTML_OUTPUT"
# Windows
start "$HTML_OUTPUT"
6-4. Confirm to User
Output in Korean:
"✅ 대시보드가 생성되었습니다! 📊 HTML 파일: $HTML_OUTPUT 🌐 브라우저에서 자동으로 열렸습니다.
대시보드에는 다음 정보가 포함되어 있습니다:
추가로 필요하신 게 있으시면 말씀해주세요!"
If user requests additional analysis:
--scope watchlist and displayMarket Overview (English):
Market Overview (Korean):
Value Investing Analysis (NEW in v2.0):
US Market: S&P 500, NASDAQ, DOW, Russell 2000, 11 SPDR Sector ETFs, VIX Korean Market: KOSPI, KOSDAQ, Top 10 market cap stocks, Foreign/Institutional flows Global Macro: Treasury yields (5Y, 10Y, 30Y), Gold, Oil, Natural Gas, DXY, USD/KRW, EUR/USD, USD/JPY Crypto: BTC, ETH, SOL, BNB, XRP, ADA
Edit this file to add your own stocks:
us_stocks:
- symbol: "AAPL"
name: "Apple"
alert_above: 250 # Optional price alert
alert_below: 180
kr_stocks:
- ticker: "005930"
name: "삼성전자"
crypto:
- symbol: "BTC-USD"
name: "Bitcoin"
| Scenario | Response | |----------|----------| | Python missing | "Python 3가 필요합니다. 설치 후 다시 시도해주세요." | | yfinance/pykrx not installed | Auto-install via pip3 | | No internet | "인터넷 연결을 확인해주세요." | | US market closed | Show last close data + note "미국 장 마감 상태" | | KR market closed | Show last close data + note "한국 장 마감" | | Partial data failure | Proceed with available data, note missing sections | | Script not found | Check both symlink and local paths | | Invalid ticker in watchlist | Skip with warning: "[SYMBOL] 데이터 없음" |
pip3 install yfinance pykrx pyyaml feedparser
ai-news-digest: For AI-specific news (use for tech sector context)ai-digest: For detailed article analysis (use after finding interesting financial articles)User: "시장 분석해줘"
→ AskUserQuestion: 분석 범위 선택
User: "전체 시장 개요"
→ Fetch data (30s) → 3 agents parallel (45s) → synthesis (15s)
→ Display dashboard with all markets
→ "추가 분석이 필요하시면..."
User: "없음"
→ End
User: "한국 시장 어때?"
→ AskUserQuestion: 분석 범위
User: "한국 시장"
→ Fetch KR data → kr-market-analyzer only
→ Display KR-focused analysis
→ "추가 분석이 필요하시면..."
User: "삼성전자 좀 더 자세히"
→ Fetch Samsung Electronics detailed data + recent news
→ Display analysis
User: "market deep dive"
→ Scope: deep
→ Fetch all data + watchlist + news (45s)
→ Full multi-agent pipeline
→ Extended dashboard with watchlist and news sections
User: "안전마진 분석해줘" or "저평가 종목 찾아줘"
→ Ask for tickers: "어떤 종목들을 분석하시겠습니까? (쉼표로 구분)"
User: "AAPL, MSFT, GOOGL, NVDA, META"
→ Run: value_investing_analyzer.py --tickers "AAPL,MSFT,GOOGL,NVDA,META" --analysis safety_margin
→ Display table with safety margins (80.2% MSFT, 66.9% NVDA, 59.4% GOOGL)
→ "MSFT, NVDA, GOOGL이 20% 이상 저평가되어 있습니다."
User: "AAPL 기업 분석해줘"
→ Run: company_deep_dive.py (single ticker analysis)
→ Display comprehensive 8-perspective report
- Graham: 22.8% safety margin (HOLD)
- Buffett: Wide moat (100/100)
- Lynch: Fast Grower, PEG 1.62 (expensive)
- Munger: Low risk (15/100), high survivability (85/100)
- Asness: Weak factor scores (27.5/100)
- Overall: 69.3/100, "조건부 매수", 1-3 year horizon
→ "추가로 다른 종목을 분석하시겠습니까?"
User: "PEG 스크리닝해줘" or "GARP 종목 찾아줘"
→ Ask for tickers
User: "테크 대장주들"
→ Interpret: AAPL, MSFT, GOOGL, NVDA, META, AMZN, TSLA
→ Run: value_investing_analyzer.py --tickers "..." --analysis garp
→ Display GARP stocks (PEG < 1.0):
- MSFT: PEG 0.36, 성장률 59.8%
- NVDA: PEG 0.37, 성장률 66.7%
- GOOGL: PEG 0.75, 성장률 31.1%
→ "3개 GARP 종목 발견 (Growth At Reasonable Price)"
development
Design webhooks correctly on both sides — sending (HMAC signing, retries with backoff, at-least-once) and receiving (verify signature on raw body, enqueue + 200 fast, dedupe on event id). Use when adding webhook delivery or consuming a provider's webhooks. Not for internal service-to-service events (use async-messaging) or general outbound-call retry policy (use resilience-patterns).
testing
Use transactions and isolation levels correctly — keep them short, no network calls inside, explicit isolation, retry on serialization conflicts, and choose optimistic vs pessimistic locking. Use when a write spans multiple tables, when concurrent updates corrupt data, or when designing money/inventory flows. Not for cross-service event delivery (use async-messaging Outbox) or schema-level constraints (use schema-design).
development
Backend testing pyramid — unit for pure logic, integration against a real DB (Testcontainers), and consumer-driven contract testing (Pact) for service boundaries. Use before a feature, after a bug fix, or when services break each other on deploy. Not for load testing (use performance-profiling) or security testing (use backend-security-audit).
data-ai
Design a relational schema — normalize to 3NF then denormalize with justification, choose the right Postgres index type per data shape, enforce constraints at the DB. Use when modeling a new domain, when queries are slow, or before a migration. Not for diagnosing slow queries (use query-optimization) or shipping the change without downtime (use migration-strategy).