UZI-Skill is a collection of coding-agent skills for analyzing individual stocks across Chinese, Hong Kong, and United States markets using public data, investor viewpoints, quantitative rules, and institutional analysis methods. It is for users who want an agent to produce detailed stock-analysis reports. The catalogue entries are the commands, skills, instructions, plugin, agent, and hook that provide this workflow in supported coding agents.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/wbh604/UZI-SkillWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/wbh604/uzi-skill/rebalance)<a href="https://agentmods.dev/commands/wbh604/uzi-skill/rebalance"><img src="https://agentmods.dev/badge/commands/wbh604/uzi-skill/rebalance/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/wbh604/uzi-skill/rebalance"><img src="https://agentmods.dev/badge/commands/wbh604/uzi-skill/rebalance.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00035 | $0.00898 |
| Opus 5 | $0.00017 | $0.00449 |
| Sonnet 5 | $0.00007 | $0.00180 |
| Haiku 4.5 | $0.00003 | $0.00090 |
Grade A, and why
rebalance scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
/rebalance <持仓> [targets=等权] [threshold=5]
对一个组合做再平衡分析:当前权重偏离目标多少、要不要动、动的话买卖什么、换手要花多少钱。
A 股个人无资本利得税 → 不做税损收割 (TLH),聚焦 漂移 + 风险 + 换手成本。 (持仓含美股时,会一句话提示"美股部分可另议税损"。)
输入
持仓列表 [{ticker, weight, market, industry?, value?, price?}],与 --portfolio 的 CSV 结构同源(ticker / weight / note):
| 字段 | 必填 | 说明 |
|---|---|---|
ticker |
✅ | 600519.SH / 00700.HK / AAPL |
weight |
✅ | 当前权重,0-1 小数或 0-100 百分数(自动归一化) |
market |
选 | A / HK / US,缺省按 ticker 后缀推断 |
industry |
选 | 行业,用于行业分散度 |
value |
选 | 该持仓市值(给了才能算金额/成本) |
price |
选 | 现价(给了才能估股数,A 股按手取整) |
- targets:
None→ 等权 (1/N);或{ticker: 目标权重}显式目标。 - threshold:漂移阈值,单位「百分点」,默认 5(偏离 >5pp 才动)。
工作流
from lib.tier1.rebalance import build_rebalance
out = build_rebalance(holdings, targets=None, drift_threshold=5.0)
# out = {drift_table, trades, turnover_cost, concentration, summary, methodology_log}
配合已有 --portfolio:先 python run.py --portfolio holdings.csv 跑组合体检,
再把同一份 holdings 喂给 build_rebalance 做调仓建议。
输出
- 漂移表
drift_table— 每只 当前 vs 目标 vs 漂移(pp) + 是否超阈值 + 方向(超配→卖/低配→买) - 阈值判断
summary.any_breach/n_breached/max_drift_pp— 默认 >5pp 才触发 - 交易清单
trades— 仅对超阈值持仓:BUY/SELL + 金额 + 估算股数(A 股按手) - 换手成本
turnover_cost— 分市场拆解:- A 股:卖出印花税 0.05%(2023-08 下调)+ 双边佣金 ~0.025%
- 港股:印花税 0.1%(双边)+ 佣金
- 美股:印花税 ≈ 0
- 集中度变化
concentration— 前 3 大集中度 / 最大单只 / HHI / 行业分散 的 前→后 对比
注意
- 小幅漂移在阈值内不动,别为再平衡而再平衡。
- 没给
value/price时只出漂移方向,不估金额与成本。 - 不做 TLH(A/港股个人无资本利得税);美股持仓的税损另议。
改编自
anthropics/financial-serviceswealth-management/portfolio-rebalance,A 股适配。 方法论详见skills/deep-analysis/references/fin-methods/rebalance.md。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 9d ago First seen · 60 lines · 35 tokens per session scan A 75a537ae5eb8
rebalance is a command published in the GitHub repository wbh604/UZI-Skill (6,804 stars, last pushed 3d ago), licensed MIT. It adds 35 tokens to every session and 898 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
valuation-methods
Valuation methods analysis — multiples, DCF inputs, PEG integration, valuation assumption extraction.
merit-reconcile
Preview or check the status of Stripe → Merit payout reconciliation (read-only).
audit-checklist
Perform an internal audit, review controls, or prepare for an external financial audit.
scan
Scan AWS account for cost optimization.
finops-status
Orientation — say where an opportunity or assignment sits in the five-step FinOps lifecycle and what unlocks next. Useful when a record has no active stage: an opportunity while its assignments do the work, an assignment whose plan has not been approved yet, or a rejected or archived assignment. Read-only; mutates…
audit
Scan for non-kernel money math. Rebuild critical flows as JournalEntrys. Replay and prove. Complements /ledger-verify.