uzi-skill-stock-analyzer

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

UZI Skill — Stock Deep Analyzer

UZI Skill — 股票深度分析工具

Skill by ara.so — Daily 2026 Skills collection.
UZI Skill transforms any AI coding agent into a private stock analyst. Feed it a ticker and it runs 22 data dimensions, applies 17 institutional analysis methods (DCF, Comps, LBO, IC Memo, etc.), and simulates 51 distinct investor personas (Buffett through Chinese retail游资) each scoring the stock against their own quantitative rule sets. Output is a self-contained HTML report, shareable image cards, and a plain-text summary.
Supported markets: A股 (SZ/SH), 港股 (HK), 美股 (US)
Data sources: All free — akshare, 东方财富, 雪球, yfinance, DuckDuckGo (zero API keys required)

ara.so 开发的Skill — 每日2026技能合集。
UZI Skill可将任意AI编码Agent转变为私人股票分析师。输入股票代码后,它会调用22个数据维度,应用17种机构分析方法(DCF、Comps、LBO、IC Memo等),并模拟51种不同的投资者角色(从巴菲特到中国散户游资),每个角色都会根据自身的量化规则集对股票进行评分。输出内容包含独立HTML报告、可分享图片卡片以及纯文本摘要。
支持市场:A股 (SZ/SH)港股 (HK)美股 (US)
数据来源:全部免费 — akshare、东方财富、雪球、yfinance、DuckDuckGo(无需API密钥)

Installation

安装

Claude Code (recommended)

Claude Code(推荐)

/plugin marketplace add wbh604/UZI-Skill
/plugin install stock-deep-analyzer@uzi-skill
Then run:
/analyze-stock 贵州茅台
/plugin marketplace add wbh604/UZI-Skill
/plugin install stock-deep-analyzer@uzi-skill
然后运行:
/analyze-stock 贵州茅台

Other Agents — Universal Install

其他Agent — 通用安装

Paste this into any agent (Codex, Cursor, Gemini CLI, Windsurf, Devin):
克隆 https://github.com/wbh604/UZI-Skill ,读 AGENTS.md 了解怎么用,帮我深度分析 贵州茅台。
将以下内容粘贴到任意Agent中(Codex、Cursor、Gemini CLI、Windsurf、Devin):
克隆 https://github.com/wbh604/UZI-Skill ,读 AGENTS.md 了解怎么用,帮我深度分析 贵州茅台。

Codex

Codex

请按照 https://raw.githubusercontent.com/wbh604/UZI-Skill/main/.codex/INSTALL.md 的指引安装 UZI-Skill,然后帮我深度分析 贵州茅台。
请按照 https://raw.githubusercontent.com/wbh604/UZI-Skill/main/.codex/INSTALL.md 的指引安装 UZI-Skill,然后帮我深度分析 贵州茅台。

Gemini CLI

Gemini CLI

bash
gemini extensions install https://github.com/wbh604/UZI-Skill
bash
gemini extensions install https://github.com/wbh604/UZI-Skill

Manual Clone

手动克隆

bash
git clone https://github.com/wbh604/UZI-Skill
cd UZI-Skill
pip install -r requirements.txt

bash
git clone https://github.com/wbh604/UZI-Skill
cd UZI-Skill
pip install -r requirements.txt

Quick Start

快速开始

Full Deep Analysis (5–8 minutes)

完整深度分析(5–8分钟)

/analyze-stock 水晶光电        # by name
/analyze-stock 002273          # by A-share code
/analyze-stock 00700.HK        # Hong Kong
/analyze-stock AAPL            # US stock
/analyze-stock 水晶光电        # 按名称
/analyze-stock 002273          # 按A股代码
/analyze-stock 00700.HK        # 港股
/analyze-stock AAPL            # 美股

Mobile / Remote Mode

移动端/远程模式

When away from a computer, ask any agent:
分析 贵州茅台,用远程模式,生成一个公网链接让我手机能看。
The agent launches with
--remote
to start a Cloudflare Tunnel and returns a
https://xxx.trycloudflare.com
URL.

不在电脑前时,可向任意Agent发送指令:
分析 贵州茅台,用远程模式,生成一个公网链接让我手机能看。
Agent会启用
--remote
参数启动Cloudflare Tunnel,并返回一个
https://xxx.trycloudflare.com
链接。

All Slash Commands

所有斜杠命令

CommandWhat it does
/analyze-stock <ticker>
Full 22-dimension deep analysis, 5–8 min
/dcf <ticker>
DCF valuation · WACC decomposition + 5×5 sensitivity heatmap
/comps <ticker>
Peer benchmarking · PE/PB/EV-EBITDA percentile + implied target price
/lbo <ticker>
LBO test · PE buyer IRR cross-check
/initiate <ticker>
Institutional initiation report · JPM/GS/MS format
/ic-memo <ticker>
Investment Committee memo · 8 sections, Bull/Base/Bear scenarios
/earnings <ticker>
Earnings beat/miss detection and interpretation
/catalysts <ticker>
Catalyst calendar · next 60 days, impact-ranked
/thesis <ticker>
Investment thesis tracker · 5-pillar health monitor
/screen <ticker>
5 quantitative screens: value / growth / quality / momentum / composite
/dd <ticker>
Due diligence checklist · 5 workflows, 21 items, auto-status
/quick-scan <ticker>
30-second signal flash
/panel-only <ticker>
51-investor panel vote only, skip full analysis
/scan-trap <ticker>
Pump-and-dump / 杀猪盘 pattern detection

命令功能
/analyze-stock <ticker>
全22维度深度分析,耗时5–8分钟
/dcf <ticker>
DCF估值 · WACC分解 + 5×5敏感性热力图
/comps <ticker>
同行基准对比 · PE/PB/EV-EBITDA百分位 + 隐含目标价
/lbo <ticker>
LBO测试 · PE买方IRR交叉验证
/initiate <ticker>
机构首次覆盖报告 · JPM/GS/MS格式
/ic-memo <ticker>
投资委员会备忘录 · 8个章节,牛/基/熊三种情景
/earnings <ticker>
盈利超预期/不及预期检测与解读
/catalysts <ticker>
催化剂日历 · 未来60天,按影响排序
/thesis <ticker>
投资逻辑追踪 · 5大维度健康监测
/screen <ticker>
5种量化筛选:价值/成长/质量/动量/综合
/dd <ticker>
尽职调查清单 · 5个流程,21项内容,自动状态标记
/quick-scan <ticker>
30秒快速信号扫描
/panel-only <ticker>
仅51位投资者投票,跳过完整分析
/scan-trap <ticker>
拉高出货/杀猪盘模式检测

Project Structure

项目结构

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

UZI-Skill/
├── .claude-plugin/
│   ├── plugin.json              # 插件清单
│   └── marketplace.json         # 市场配置
├── commands/                    # 14个斜杠命令定义
├── skills/
│   ├── deep-analysis/           # 主工作流(6个任务)
│   │   ├── SKILL.md             # Agent分析师手册
│   │   ├── references/          # 方法论文档(8篇论文)
│   │   ├── assets/              # HTML模板 + 51个投资者头像
│   │   └── scripts/
│   │       ├── lib/
│   │       │   ├── fin_models.py              # DCF/Comps/LBO/3-Stmt/Merger
│   │       │   ├── research_workflow.py       # 7种研究输出类型
│   │       │   ├── deep_analysis_methods.py   # 6种PE/IB/WM方法
│   │       │   ├── investor_criteria.py       # 51种角色 × 180条规则
│   │       │   ├── investor_evaluator.py      # 规则引擎
│   │       │   ├── stock_features.py          # 108个标准化特征
│   │       │   └── ...
│   │       ├── fetch_*.py                     # 22个维度数据获取器
│   │       ├── compute_deep_methods.py        # 机构模型计算
│   │       ├── assemble_report.py             # HTML报告组装
│   │       └── run_real_test.py               # 主流水线
│   ├── investor-panel/          # 独立投资者投票面板技能
│   ├── lhb-analyzer/            # 龙虎榜(热钱追踪)技能
│   └── trap-detector/           # 拉高出货检测技能
├── requirements.txt
├── LICENSE
└── README.md

Architecture: Two-Stage Agent Pipeline

架构:两阶段Agent流水线

The analysis is split into two script stages with a mandatory agent gate in between. The
<HARD-GATE>
tag in
SKILL.md
forces the agent to intervene — it cannot be skipped.
Stage 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

分析过程分为两个脚本阶段,中间设有强制Agent介入环节。
SKILL.md
中的
<HARD-GATE>
标签会强制Agent进行干预,无法跳过。
Stage 1 (脚本)
  └─ fetch_*.py          → 获取22个数据维度(价格、基本面、
  └─ compute_deep_methods.py   技术面、舆情、供应链…)
  └─ investor_evaluator.py     → 根据180条规则为51种角色评分

        ⏸️  <HARD-GATE> — Agent必须读取数据,模拟每位投资者,
            撰写定性判断,结合上下文覆盖规则
            (例如:巴菲特知道苹果是伯克希尔的头号持仓 → 强制看多覆盖)

Stage 2 (脚本)
  └─ assemble_report.py  → 整合判断结果 → 渲染HTML + 图片卡片

Core Python Modules — Usage Examples

核心Python模块 — 使用示例

Running the Full Pipeline Directly

直接运行完整流水线

python
undefined
python
undefined

skills/scripts/run_real_test.py is the main entry point

skills/scripts/run_real_test.py 是主入口

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)
undefined
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)
undefined

Fetching Stock Features (22 Dimensions)

获取股票特征(22个维度)

python
undefined
python
undefined

Each dimension has its own fetcher with multi-source fallback

每个维度都有独立的获取器,支持多源 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
from skills.deep_analysis.scripts.lib.stock_features import StockFeatureEngine
engine = StockFeatureEngine(ticker="002273", market="A") features = engine.fetch_all() # 返回包含108个标准化特征的字典

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 opinion
undefined
print(features["valuation"]) # PE、PB、PS、EV/EBITDA、PCF print(features["growth"]) # 营收/利润同比、环比、3年复合增长率 print(features["quality"]) # ROE、ROIC、毛利率、自由现金流收益率 print(features["technical"]) # MA、MACD、RSI、量比、ATR print(features["sentiment"]) # 北向资金、融资余额、空头持仓 print(features["governance"]) # 内部人持股比例、质押率、审计意见
undefined

Running the Investor Panel

运行投资者投票面板

python
from skills.deep_analysis.scripts.lib.investor_criteria import INVESTOR_REGISTRY
from skills.deep_analysis.scripts.lib.investor_evaluator import InvestorEvaluator

evaluator = InvestorEvaluator(features=features)
python
from 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

为所有51位投资者评分

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']}")
undefined
results = evaluator.evaluate_all()
for investor in results: print(f"{investor['name']:12s} | 评分: {investor['score']:3d} | " f"立场: {investor['stance']:8s} | " f"触发规则: {investor['triggered_rules']}")
undefined

Single Investor Deep Score

单个投资者深度评分

python
undefined
python
undefined

Evaluate one investor persona against loaded features

根据加载的特征评估单个投资者角色

result = evaluator.evaluate_single("巴菲特", features)
result = evaluator.evaluate_single("巴菲特", features)

Example output structure:

示例输出结构:

{

{

"name": "巴菲特",

"name": "巴菲特",

"score": 62,

"score": 62,

"stance": "neutral",

"stance": "neutral",

"summary": "观望:护城河 27/40 可见;但 ROE 5 年最低 6.7%,达标率仅 0/5",

"summary": "观望:护城河 27/40 可见;但 ROE 5 年最低 6.7%,达标率仅 0/5",

"triggered_rules": [

"triggered_rules": [

{"rule": "asset_debt_ratio < 0.4", "met": True, "label": "资产负债率 30% 保守"},

{"rule": "asset_debt_ratio < 0.4", "met": True, "label": "资产负债率 30% 保守"},

{"rule": "roe_5y_min > 0.15", "met": False, "label": "ROE 5 年最低 6.7%"},

{"rule": "roe_5y_min > 0.15", "met": False, "label": "ROE 5 年最低 6.7%"},

]

]

}

}

undefined
undefined

DCF Valuation

DCF估值

python
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 DataFrame
python
from skills.deep_analysis.scripts.lib.fin_models import DCFModel

dcf = DCFModel(
    ticker="002273",
    market="A",
    # A股默认参数(可按需覆盖):
    risk_free_rate=0.025,      # 无风险利率 = 2.5%
    equity_risk_premium=0.06,  # 股权风险溢价 = 6%
    tax_rate=0.25,             # 中国企业税率
    terminal_growth=0.025,     # 永续增长率 g = 2.5%
)

valuation = dcf.run()

print(f"WACC:            {valuation['wacc']:.2%}")
print(f"内在价值: ¥{valuation['intrinsic_value']:.2f}")
print(f"当前价格:   ¥{valuation['current_price']:.2f}")
print(f"安全边际:   {valuation['safety_margin']:.1%}")
print(f"敏感性分析:\n{valuation['sensitivity_table']}")  # 5×5 DataFrame

Comps (Peer Benchmarking)

Comps(同行基准对比)

python
from skills.deep_analysis.scripts.lib.fin_models import CompsModel

comps = CompsModel(ticker="002273", market="A")
result = comps.run()
python
from 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["peer_table"] → 包含同行PE/PB/EV-EBITDA的DataFrame

result["percentiles"] → where subject sits vs peers (0–100)

result["percentiles"] → 标的在同行中的百分位排名(0–100)

result["implied_targets"] → target prices from each multiple

result["implied_targets"] → 基于各乘数计算的目标价

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}")
undefined
print(result["peer_table"].to_string()) print(f"PE百分位: {result['percentiles']['pe']:.0f}th") print(f"隐含目标价(基于PE): ¥{result['implied_targets']['pe']:.2f}")
undefined

IC Investment Committee Memo

IC投资委员会备忘录

python
from skills.deep_analysis.scripts.lib.research_workflow import ICMemo

memo = ICMemo(ticker="002273", market="A", features=features)
output = memo.generate()
python
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,

章节: executive_summary、investment_thesis、risk_factors、

scenario_analysis, valuation_bridge, catalysts,

scenario_analysis、valuation_bridge、catalysts、

portfolio_fit, recommendation

portfolio_fit、recommendation

print(output["scenario_analysis"])
print(output["scenario_analysis"])

Bull: ¥26.95 (p=30%) Base: ¥20.73 (p=50%) Bear: ¥14.51 (p=20%)

牛市: ¥26.95 (概率30%) 基准: ¥20.73 (概率50%) 熊市: ¥14.51 (概率20%)


---

---

Data Source Fallback Chain

数据源 fallback 链

Each fetcher implements a multi-source fallback. If the primary source fails, it automatically tries the next:
python
undefined
每个数据获取器都实现了多源 fallback 机制。如果主数据源失败,会自动尝试下一个:
python
undefined

Example: fetch_realtime_price.py internal logic (simplified)

示例: fetch_realtime_price.py 内部逻辑(简化版)

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 | — |

---
PRICE_SOURCES = [ ("eastmoney_push2", fetch_eastmoney), # 主数据源 ("xueqiu", fetch_xueqiu), # 备用1 ("tencent", fetch_tencent), # 备用2 ("sina", fetch_sina), # 备用3 ("baidu", fetch_baidu), # 备用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} 失败: {e}, 尝试下一个...")
raise DataFetchError(f"{ticker} 的所有价格数据源均失败")

| 数据类型 | 主数据源 | 备用数据源 |
|---|---|---|
| 实时价格 / PE / 市值 | 东方财富 push2 | 雪球 → 腾讯 → 新浪 → 百度 |
| 历史财务数据 | akshare | 雪球 f10 |
| K线 / 技术指标 | akshare | yfinance |
| 龙虎榜 / 北向资金 / 融资融券 | akshare | 东财 |
| 研究报告 / 公告 | 巨潮 cninfo + akshare | 同花顺 |
| 港股 | akshare hk | yfinance |
| 美股 | yfinance | akshare us |
| 宏观 / 政策 / 舆情 / 陷阱 | DuckDuckGo搜索 | — |

---

The 51-Investor Panel: Groups and Logic

51位投资者面板:分组与逻辑

python
undefined
python
undefined

From investor_criteria.py — each investor is a dataclass with:

来自 investor_criteria.py — 每位投资者都是一个数据类,包含:

- group: A–G

- group: A–G

- style: value / growth / macro / technical / china_value / youzi / quant

- style: value / growth / macro / technical / china_value / youzi / quant

- rules: list of Rule objects (field, operator, threshold, weight, label)

- rules: Rule对象列表(字段、运算符、阈值、权重、标签)

- skip_markets: markets this investor ignores (e.g. 赵老哥 skips US)

- skip_markets: 该投资者忽略的市场(例如:赵老哥跳过美股)

- override_conditions: context-based manual overrides

- override_conditions: 基于上下文的手动覆盖规则

INVESTOR_GROUPS = { "A": ["巴菲特", "格雷厄姆", "芒格", "费雪", "邓普顿", "卡拉曼"], # Classic Value "B": ["林奇", "欧奈尔", "蒂尔", "木头姐"], # Growth "C": ["索罗斯", "达里奥", "霍华德马克斯", "德鲁肯米勒", "罗伯逊"], # Macro Hedge "D": ["利弗莫尔", "米内尔维尼", "达瓦斯", "江恩"], # Technical "E": ["段永平", "张坤", "朱少醒", "谢治宇", "冯柳", "邓晓峰"], # China Value "F": ["章盟主", "赵老哥", "炒股养家", "佛山无影脚", "北京炒家", "鑫多多", # ... 17 more 游资 personas], # A-share 游资 "G": ["西蒙斯", "索普", "大卫·肖"], # Quant Systems }
INVESTOR_GROUPS = { "A": ["巴菲特", "格雷厄姆", "芒格", "费雪", "邓普顿", "卡拉曼"], # 经典价值派 "B": ["林奇", "欧奈尔", "蒂尔", "木头姐"], # 成长派 "C": ["索罗斯", "达里奥", "霍华德马克斯", "德鲁肯米勒", "罗伯逊"], # 宏观对冲派 "D": ["利弗莫尔", "米内尔维尼", "达瓦斯", "江恩"], # 技术派 "E": ["段永平", "张坤", "朱少醒", "谢治宇", "冯柳", "邓晓峰"], # 中国价值派 "F": ["章盟主", "赵老哥", "炒股养家", "佛山无影脚", "北京炒家", "鑫多多", # ... 17位更多游资角色], # A股游资 "G": ["西蒙斯", "索普", "大卫·肖"], # 量化系统派 }

Agent override examples (from SKILL.md):

Agent覆盖规则示例(来自SKILL.md):

- Buffett analyzing Apple → agent knows BRK #1 holding → force bullish override

- 巴菲特分析苹果 → Agent知道这是伯克希尔头号持仓 → 强制看多覆盖

- 赵老哥 analyzing US stock → agent skips (游资 don't trade US)

- 赵老哥分析美股 → Agent跳过(游资不交易美股)

- 木头姐 analyzing 白酒 → agent applies "not disruptive innovation" → bearish override

- 木头姐分析白酒 → Agent应用“非颠覆性创新”规则 → 看空覆盖

undefined
undefined

Rule Engine Example (180 Rules Total)

规则引擎示例(共180条规则)

python
undefined
python
undefined

A sample of Buffett's rules from investor_criteria.py:

来自 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 ]

---
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%"), # ... 更多规则 ]

---

Report Outputs

报告输出

Every
/analyze-stock
run produces three artifacts in
./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
每次运行
/analyze-stock
都会在
./reports/<ticker>/
目录下生成三个文件:
reports/002273/
├── report.html          # 完整独立报告(约600KB),可直接在浏览器打开
├── share_vertical.png   # 1080×1920竖版卡片,适合微信朋友圈分享
├── share_horizontal.png # 1920×1080横版卡片,适合群组分享
└── summary.txt          # 纯文本摘要,便于复制粘贴

Report Sections (HTML)

HTML报告章节

  1. Hero Score — Composite score, overall stance, one-line verdict
  2. 22-Dimension Deep Scan — K-line candles, PE Band, radar chart, supply chain flow, thermometers, donut charts
  3. DCF Model — WACC breakdown, 5×5 sensitivity heatmap (green=undervalued → red=overvalued)
  4. IC Memo — 8 chapters, Bull/Base/Bear with probabilities
  5. Comps Table — Peer PE/PB/EV-EBITDA percentiles
  6. Jury Seats — 51 colored lights (green=bull, red=bear, grey=neutral)
  7. The Great Divide — Biggest bull vs biggest bear, 3-round debate with cited numbers
  8. Chat Room — Each investor speaking in their own voice, citing triggered rules
  9. Catalyst Calendar — Next 60 days, impact-ranked
  10. Trap Detector — Pump-and-dump pattern flags (if any)

  1. 核心评分 — 综合评分、整体立场、一句话结论
  2. 22维度深度扫描 — K线蜡烛图、PE Band、雷达图、供应链流向、热力图、环形图
  3. DCF模型 — WACC分解、5×5敏感性热力图(绿色=低估 → 红色=高估)
  4. IC备忘录 — 8个章节,包含牛/基/熊三种情景及概率
  5. 同行对比表 — 同行PE/PB/EV-EBITDA百分位
  6. 评委席位 — 51个彩色指示灯(绿色=看多,红色=看空,灰色=中性)
  7. 观点分歧 — 最看多与最看空的投资者,3轮辩论并引用数据
  8. 投资者聊天室 — 每位投资者用自身风格发言,引用触发的规则
  9. 催化剂日历 — 未来60天事件,按影响排序
  10. 陷阱检测器 — 拉高出货模式标记(如有)

Troubleshooting

故障排查

Data fetch failures

数据获取失败

bash
undefined
bash
undefined

Test a single fetcher in isolation

单独测试某个数据获取器

python skills/deep-analysis/scripts/fetch_realtime_price.py --ticker 002273
python skills/deep-analysis/scripts/fetch_realtime_price.py --ticker 002273

Run with verbose fallback logging

启用详细fallback日志运行

python run_real_test.py --ticker 002273 --verbose

Most failures are transient rate limits. Re-run or wait 30 seconds — the fallback chain handles most outages automatically.
python run_real_test.py --ticker 002273 --verbose

大多数失败是临时限流导致的。重新运行或等待30秒 — fallback链会自动处理大多数故障。

akshare version issues

akshare版本问题

bash
pip install --upgrade akshare
bash
pip install --upgrade akshare

UZI requires akshare >= 1.10.0

UZI 需要 akshare >= 1.10.0

python -c "import akshare; print(akshare.version)"
undefined
python -c "import akshare; print(akshare.version)"
undefined

Missing dependencies

缺失依赖

bash
pip install -r requirements.txt
bash
pip install -r requirements.txt

Core deps: akshare, yfinance, pandas, numpy, jinja2, Pillow, requests, duckduckgo-search

核心依赖: akshare, yfinance, pandas, numpy, jinja2, Pillow, requests, duckduckgo-search

undefined
undefined

Report HTML won't open

HTML报告无法打开

The HTML is self-contained (all CSS/JS inlined). If it's blank, check:
bash
ls -lh reports/002273/report.html   # Should be ~500KB–1MB
HTML报告是独立的(所有CSS/JS均内联)。如果显示空白,请检查:
bash
ls -lh reports/002273/report.html   # 大小应约为500KB–1MB

If <10KB, the assembly step failed — check assemble_report.py logs

如果小于10KB,说明报告组装步骤失败 — 检查assemble_report.py日志

undefined
undefined

HK / US stock not recognized

港股/美股无法识别

python
undefined
python
undefined

Correct ticker formats:

正确的代码格式:

HK: "00700.HK" or "0700.HK" (with .HK suffix)

港股: "00700.HK" 或 "0700.HK" (需带.HK后缀)

US: "AAPL" or "TSLA" (plain uppercase)

美股: "AAPL" 或 "TSLA" (纯大写)

A: "002273" or "600519" (6-digit code)

A股: "002273" 或 "600519" (6位数字代码)

A: "贵州茅台" or "水晶光电" (Chinese name also works)

A股: "贵州茅台" 或 "水晶光电" (中文名称也可)

undefined
undefined

Agent skips the HARD-GATE

Agent跳过HARD-GATE

The
<HARD-GATE>
in
SKILL.md
is a mandatory pause requiring agent judgment. If your agent auto-skips it, explicitly tell it:
在继续生成报告之前,请先以每位评委的身份分别给出判断,不要直接运行 Stage 2 脚本。
SKILL.md
中的
<HARD-GATE>
是强制暂停环节,需要Agent进行判断。如果你的Agent自动跳过,请明确告知:
在继续生成报告之前,请先以每位评委的身份分别给出判断,不要直接运行 Stage 2 脚本。

Developing on the
develop
branch (latest features, less stable)

develop
分支开发(最新功能,稳定性较低)

bash
git checkout develop
pip install -r requirements.txt

bash
git checkout develop
pip install -r requirements.txt

Configuration Reference

配置参考

No API keys required. Optional environment variables for advanced use:
bash
undefined
无需API密钥。高级用户可设置以下可选环境变量:
bash
undefined

Proxy (if in restricted network)

代理(适用于受限网络)

export HTTP_PROXY="http://127.0.0.1:7890" export HTTPS_PROXY="http://127.0.0.1:7890"
export HTTP_PROXY="http://127.0.0.1:7890" export HTTPS_PROXY="http://127.0.0.1:7890"

Output directory (default: ./reports/)

输出目录(默认: ./reports/)

export UZI_OUTPUT_DIR="/path/to/reports"
export UZI_OUTPUT_DIR="/path/to/reports"

Report language (default: zh, options: zh | en)

报告语言(默认: zh,选项: zh | en)

export UZI_LANG="zh"
export UZI_LANG="zh"

Disable image card generation (faster, HTML only)

禁用图片卡片生成(速度更快,仅生成HTML)

export UZI_NO_IMAGES=1
export UZI_NO_IMAGES=1

Remote mode tunnel (Cloudflare Tunnel, for mobile access)

远程模式隧道(Cloudflare Tunnel,用于移动端访问)

export UZI_REMOTE=1

---
export UZI_REMOTE=1

---

Common Agent Prompts

常用Agent指令

undefined
undefined

Basic analysis

基础分析

/analyze-stock 贵州茅台
/analyze-stock 贵州茅台

With specific focus

指定重点

分析 002273,重点看 DCF 估值和机构持仓变化
分析 002273,重点看 DCF 估值和机构持仓变化

Panel vote only (faster)

仅投票面板(更快)

/panel-only 600519
/panel-only 600519

Check for manipulation patterns

检查操纵模式

/scan-trap 300999
/scan-trap 300999

Generate IC memo for an investment decision

生成投资决策用IC备忘录

/ic-memo TSLA
/ic-memo TSLA

Quick pre-market scan

盘前快速扫描

/quick-scan 00700.HK
/quick-scan 00700.HK

Full English report for US stock

美股完整英文报告

/analyze-stock NVDA

---
/analyze-stock NVDA

---

Links

链接