Loading...
Loading...
AI-powered deep stock analysis engine for A-share/HK/US markets with 51 investor personas, 22 data dimensions, 180 quantitative rules, and 17 institutional methods
npx skill4agent add aradotso/trending-skills uzi-skill-stock-analyzerSkill by ara.so — Daily 2026 Skills collection.
/plugin marketplace add wbh604/UZI-Skill
/plugin install stock-deep-analyzer@uzi-skill/analyze-stock 贵州茅台克隆 https://github.com/wbh604/UZI-Skill ,读 AGENTS.md 了解怎么用,帮我深度分析 贵州茅台。请按照 https://raw.githubusercontent.com/wbh604/UZI-Skill/main/.codex/INSTALL.md 的指引安装 UZI-Skill,然后帮我深度分析 贵州茅台。gemini extensions install https://github.com/wbh604/UZI-Skillgit clone https://github.com/wbh604/UZI-Skill
cd UZI-Skill
pip install -r requirements.txt/analyze-stock 水晶光电 # by name
/analyze-stock 002273 # by A-share code
/analyze-stock 00700.HK # Hong Kong
/analyze-stock AAPL # US stock分析 贵州茅台,用远程模式,生成一个公网链接让我手机能看。--remotehttps://xxx.trycloudflare.com| Command | What it does |
|---|---|
| Full 22-dimension deep analysis, 5–8 min |
| DCF valuation · WACC decomposition + 5×5 sensitivity heatmap |
| Peer benchmarking · PE/PB/EV-EBITDA percentile + implied target price |
| LBO test · PE buyer IRR cross-check |
| Institutional initiation report · JPM/GS/MS format |
| Investment Committee memo · 8 sections, Bull/Base/Bear scenarios |
| Earnings beat/miss detection and interpretation |
| Catalyst calendar · next 60 days, impact-ranked |
| Investment thesis tracker · 5-pillar health monitor |
| 5 quantitative screens: value / growth / quality / momentum / composite |
| Due diligence checklist · 5 workflows, 21 items, auto-status |
| 30-second signal flash |
| 51-investor panel vote only, skip full analysis |
| Pump-and-dump / 杀猪盘 pattern detection |
UZI-Skill/
├── .claude-plugin/
│ ├── plugin.json # Plugin manifest
│ └── marketplace.json # Marketplace config
├── commands/ # 14 slash command definitions
├── skills/
│ ├── deep-analysis/ # Main workflow (6 Tasks)
│ │ ├── SKILL.md # Agent analyst handbook
│ │ ├── references/ # Methodology docs (8 papers)
│ │ ├── assets/ # HTML templates + 51 investor avatars
│ │ └── scripts/
│ │ ├── lib/
│ │ │ ├── fin_models.py # DCF/Comps/LBO/3-Stmt/Merger
│ │ │ ├── research_workflow.py # 7 research output types
│ │ │ ├── deep_analysis_methods.py # 6 PE/IB/WM methods
│ │ │ ├── investor_criteria.py # 51 personas × 180 rules
│ │ │ ├── investor_evaluator.py # Rule engine
│ │ │ ├── stock_features.py # 108 normalized features
│ │ │ └── ...
│ │ ├── fetch_*.py # 22 dimension fetchers
│ │ ├── compute_deep_methods.py # Institutional model calc
│ │ ├── assemble_report.py # HTML assembly
│ │ └── run_real_test.py # Main pipeline
│ ├── investor-panel/ # Standalone panel skill
│ ├── lhb-analyzer/ # 龙虎榜 (hot-money tracker) skill
│ └── trap-detector/ # Pump-and-dump detector skill
├── requirements.txt
├── LICENSE
└── README.md<HARD-GATE>SKILL.mdStage 1 (scripts)
└─ fetch_*.py → Pull 22 data dimensions (price, fundamentals,
└─ compute_deep_methods.py technicals, sentiment, supply chain…)
└─ investor_evaluator.py → Score each of 51 personas against 180 rules
⏸️ <HARD-GATE> — Agent must read data, role-play each investor,
write qualitative judgments, override rules with context
(e.g. Buffett knows Apple is BRK's top holding → override bullish)
Stage 2 (scripts)
└─ assemble_report.py → Synthesize judgments → render HTML + image cards# skills/scripts/run_real_test.py is the main entry point
import subprocess
result = subprocess.run(
["python", "skills/deep-analysis/scripts/run_real_test.py",
"--ticker", "002273",
"--market", "A", # A | HK | US
"--output", "./reports/"],
capture_output=True, text=True
)
print(result.stdout)# Each dimension has its own fetcher with multi-source fallback
from skills.deep_analysis.scripts.lib.stock_features import StockFeatureEngine
engine = StockFeatureEngine(ticker="002273", market="A")
features = engine.fetch_all() # returns dict of 108 normalized features
# Key feature groups:
print(features["valuation"]) # PE, PB, PS, EV/EBITDA, PCF
print(features["growth"]) # Revenue/profit YoY, QoQ, 3Y CAGR
print(features["quality"]) # ROE, ROIC, gross margin, FCF yield
print(features["technical"]) # MA, MACD, RSI, volume ratio, ATR
print(features["sentiment"]) # North-bound flow, margin balance, short interest
print(features["governance"]) # Insider ownership, pledge ratio, audit opinionfrom skills.deep_analysis.scripts.lib.investor_criteria import INVESTOR_REGISTRY
from skills.deep_analysis.scripts.lib.investor_evaluator import InvestorEvaluator
evaluator = InvestorEvaluator(features=features)
# Score all 51 investors
results = evaluator.evaluate_all()
for investor in results:
print(f"{investor['name']:12s} | Score: {investor['score']:3d} | "
f"Stance: {investor['stance']:8s} | "
f"Triggered: {investor['triggered_rules']}")# Evaluate one investor persona against loaded features
result = evaluator.evaluate_single("巴菲特", features)
# Example output structure:
# {
# "name": "巴菲特",
# "score": 62,
# "stance": "neutral",
# "summary": "观望:护城河 27/40 可见;但 ROE 5 年最低 6.7%,达标率仅 0/5",
# "triggered_rules": [
# {"rule": "asset_debt_ratio < 0.4", "met": True, "label": "资产负债率 30% 保守"},
# {"rule": "roe_5y_min > 0.15", "met": False, "label": "ROE 5 年最低 6.7%"},
# ]
# }from skills.deep_analysis.scripts.lib.fin_models import DCFModel
dcf = DCFModel(
ticker="002273",
market="A",
# A-share defaults (override as needed):
risk_free_rate=0.025, # rf = 2.5%
equity_risk_premium=0.06, # ERP = 6%
tax_rate=0.25, # China corporate tax
terminal_growth=0.025, # Gordon Growth g = 2.5%
)
valuation = dcf.run()
print(f"WACC: {valuation['wacc']:.2%}")
print(f"Intrinsic Value: ¥{valuation['intrinsic_value']:.2f}")
print(f"Current Price: ¥{valuation['current_price']:.2f}")
print(f"Safety Margin: {valuation['safety_margin']:.1%}")
print(f"Sensitivity:\n{valuation['sensitivity_table']}") # 5×5 DataFramefrom skills.deep_analysis.scripts.lib.fin_models import CompsModel
comps = CompsModel(ticker="002273", market="A")
result = comps.run()
# result["peer_table"] → DataFrame with PE/PB/EV-EBITDA for each peer
# result["percentiles"] → where subject sits vs peers (0–100)
# result["implied_targets"] → target prices from each multiple
print(result["peer_table"].to_string())
print(f"PE Percentile: {result['percentiles']['pe']:.0f}th")
print(f"Implied target (PE-based): ¥{result['implied_targets']['pe']:.2f}")from skills.deep_analysis.scripts.lib.research_workflow import ICMemo
memo = ICMemo(ticker="002273", market="A", features=features)
output = memo.generate()
# Sections: executive_summary, investment_thesis, risk_factors,
# scenario_analysis, valuation_bridge, catalysts,
# portfolio_fit, recommendation
print(output["scenario_analysis"])
# Bull: ¥26.95 (p=30%) Base: ¥20.73 (p=50%) Bear: ¥14.51 (p=20%)# Example: fetch_realtime_price.py internal logic (simplified)
PRICE_SOURCES = [
("eastmoney_push2", fetch_eastmoney), # Primary
("xueqiu", fetch_xueqiu), # Fallback 1
("tencent", fetch_tencent), # Fallback 2
("sina", fetch_sina), # Fallback 3
("baidu", fetch_baidu), # Fallback 4
]
for source_name, fetch_fn in PRICE_SOURCES:
try:
data = fetch_fn(ticker)
if data and data.get("price"):
return data
except Exception as e:
log.warning(f"{source_name} failed: {e}, trying next...")
raise DataFetchError(f"All price sources failed for {ticker}")| Data Type | Primary | Fallbacks |
|---|---|---|
| Realtime price / PE / market cap | 东方财富 push2 | 雪球 → 腾讯 → 新浪 → 百度 |
| Historical financials | akshare | 雪球 f10 |
| K-line / technicals | akshare | yfinance |
| 龙虎榜 / Northbound / Margin | akshare | 东财 |
| Research reports / announcements | 巨潮 cninfo + akshare | 同花顺 |
| HK stocks | akshare hk | yfinance |
| US stocks | yfinance | akshare us |
| Macro / policy / sentiment / traps | DuckDuckGo search | — |
# From investor_criteria.py — each investor is a dataclass with:
# - group: A–G
# - style: value / growth / macro / technical / china_value / youzi / quant
# - rules: list of Rule objects (field, operator, threshold, weight, label)
# - skip_markets: markets this investor ignores (e.g. 赵老哥 skips US)
# - override_conditions: context-based manual overrides
INVESTOR_GROUPS = {
"A": ["巴菲特", "格雷厄姆", "芒格", "费雪", "邓普顿", "卡拉曼"], # Classic Value
"B": ["林奇", "欧奈尔", "蒂尔", "木头姐"], # Growth
"C": ["索罗斯", "达里奥", "霍华德马克斯", "德鲁肯米勒", "罗伯逊"], # Macro Hedge
"D": ["利弗莫尔", "米内尔维尼", "达瓦斯", "江恩"], # Technical
"E": ["段永平", "张坤", "朱少醒", "谢治宇", "冯柳", "邓晓峰"], # China Value
"F": ["章盟主", "赵老哥", "炒股养家", "佛山无影脚", "北京炒家", "鑫多多",
# ... 17 more 游资 personas], # A-share 游资
"G": ["西蒙斯", "索普", "大卫·肖"], # Quant Systems
}
# Agent override examples (from SKILL.md):
# - Buffett analyzing Apple → agent knows BRK #1 holding → force bullish override
# - 赵老哥 analyzing US stock → agent skips (游资 don't trade US)
# - 木头姐 analyzing 白酒 → agent applies "not disruptive innovation" → bearish override# A sample of Buffett's rules from investor_criteria.py:
BUFFETT_RULES = [
Rule(field="roe_5y_avg", op=">=", threshold=0.15, weight=10, label="ROE 5年均值≥15%"),
Rule(field="roe_5y_min", op=">=", threshold=0.15, weight=10, label="ROE 5年最低≥15%"),
Rule(field="debt_to_equity", op="<=", threshold=0.5, weight=8, label="负债权益比≤0.5"),
Rule(field="gross_margin", op=">=", threshold=0.4, weight=8, label="毛利率≥40%"),
Rule(field="fcf_yield", op=">=", threshold=0.05, weight=7, label="自由现金流收益≥5%"),
Rule(field="moat_score", op=">=", threshold=30, weight=12, label="护城河评分≥30/40"),
Rule(field="pe_ratio", op="<=", threshold=25, weight=6, label="PE≤25x"),
Rule(field="insider_ownership", op=">=", threshold=0.1, weight=5, label="内部人持股≥10%"),
# ... more rules
]/analyze-stock./reports/<ticker>/reports/002273/
├── report.html # Full self-contained report (~600KB), open in browser
├── share_vertical.png # 1080×1920 portrait card for WeChat Moments
├── share_horizontal.png # 1920×1080 landscape card for group sharing
└── summary.txt # Plain-text summary for copy-paste# Test a single fetcher in isolation
python skills/deep-analysis/scripts/fetch_realtime_price.py --ticker 002273
# Run with verbose fallback logging
python run_real_test.py --ticker 002273 --verbosepip install --upgrade akshare
# UZI requires akshare >= 1.10.0
python -c "import akshare; print(akshare.__version__)"pip install -r requirements.txt
# Core deps: akshare, yfinance, pandas, numpy, jinja2, Pillow, requests, duckduckgo-searchls -lh reports/002273/report.html # Should be ~500KB–1MB
# If <10KB, the assembly step failed — check assemble_report.py logs# Correct ticker formats:
# HK: "00700.HK" or "0700.HK" (with .HK suffix)
# US: "AAPL" or "TSLA" (plain uppercase)
# A: "002273" or "600519" (6-digit code)
# A: "贵州茅台" or "水晶光电" (Chinese name also works)<HARD-GATE>SKILL.md在继续生成报告之前,请先以每位评委的身份分别给出判断,不要直接运行 Stage 2 脚本。developgit checkout develop
pip install -r requirements.txt# Proxy (if in restricted network)
export HTTP_PROXY="http://127.0.0.1:7890"
export HTTPS_PROXY="http://127.0.0.1:7890"
# Output directory (default: ./reports/)
export UZI_OUTPUT_DIR="/path/to/reports"
# Report language (default: zh, options: zh | en)
export UZI_LANG="zh"
# Disable image card generation (faster, HTML only)
export UZI_NO_IMAGES=1
# Remote mode tunnel (Cloudflare Tunnel, for mobile access)
export UZI_REMOTE=1# Basic analysis
/analyze-stock 贵州茅台
# With specific focus
分析 002273,重点看 DCF 估值和机构持仓变化
# Panel vote only (faster)
/panel-only 600519
# Check for manipulation patterns
/scan-trap 300999
# Generate IC memo for an investment decision
/ic-memo TSLA
# Quick pre-market scan
/quick-scan 00700.HK
# Full English report for US stock
/analyze-stock NVDAgit checkout develop