AI Berkshire is a collection of Claude Code and Codex skills that structures investment research around the methods of four value-investing thinkers and uses multiple agents for adversarial analysis. It is intended for investors who want a disciplined process for researching companies and making valuation-based decisions.
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.
npx skills add xbtlin/ai-berkshire --skill portfolio-reviewgit clone --depth 1 https://github.com/xbtlin/ai-berkshireWrote 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/skills/xbtlin/ai-berkshire/portfolio-review)<a href="https://agentmods.dev/skills/xbtlin/ai-berkshire/portfolio-review"><img src="https://agentmods.dev/badge/skills/xbtlin/ai-berkshire/portfolio-review/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/skills/xbtlin/ai-berkshire/portfolio-review"><img src="https://agentmods.dev/badge/skills/xbtlin/ai-berkshire/portfolio-review.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.00029 | $0.02441 |
| Opus 5 | $0.00015 | $0.01221 |
| Sonnet 5 | $0.00006 | $0.00488 |
| Haiku 4.5 | $0.00003 | $0.00244 |
Grade A, and why
portfolio-review 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 13d 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.
How it starts
The opening of the file, as written. The whole thing — 206 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Codex adapter note
This skill is generated from skills/portfolio-review.md so Claude Code and Codex users share one canonical workflow.
- Treat
$ARGUMENTSas the user's request in the current Codex thread. - When the source mentions Claude-only surfaces such as Task, Agent, WebSearch, Bash, Read, or Write, use the closest Codex capability available in this session: subagents when available, web search when needed, shell commands for local tools, and normal file edits for workspace files.
- Use shared project tools from
tools/in this repository. Prefer running commands from the repository root with paths likepython3 tools/financial_rigor.py ...; if the current thread starts outside the repo, locate the actual checkout path first instead of assuming a fixed home-directory path. - Before starting research, run the
datecommand to confirm today's date; treat it as the baseline for "latest" data and state the data cutoff date in the report header. Never assume the current date from training data. - Preserve the research quality rules from
AGENTS.md: cross-check financial data, use exact arithmetic tools for valuation/math, and clearly label uncertainty and source gaps.
组合管理:从"研究公司"到"管理组合"
对 $ARGUMENTS 执行投资组合审视与优化。
支持输入格式:
- 持仓清单,例如:
腾讯30%, 美团20%, 茅台20%, 英伟达15%, 现金15% - 或:
腾讯 500股 @480港元, 美团 1000股 @130港元, ... - 或:
我的持仓(如果已有保存的组合文件reports/portfolio-latest.md)
"分散投资是对无知的保护。如果你知道自己在做什么,分散投资就没有意义。" —— 巴菲特
"我这辈子见过的真正好的投资机会,十个手指就数得完。" —— 李录
设计理念
研究公司只是投资的一半。另一半是组合层面的决策:
- 买多少?(仓位)
- 用什么钱买?(资金来源——新钱还是换仓)
- 和已有持仓是否冲突?(相关性)
- 最优组合长什么样?(机会成本)
巴菲特从不孤立地看一只股票——他总是在想"这是不是我能做的最好的事?"
执行流程
第一步:解析持仓
从输入中解析出当前持仓,标准化为以下格式:
| 标的 | 代码 | 持仓量 | 成本价 | 现价 | 市值 | 占比 | 盈亏 |
|---|
如果输入只有比例没有金额,按比例分析即可。
同时检查是否存在已有的组合文件(reports/portfolio-latest.md),如有则读取并更新。
第二步:获取最新数据
使用 Task 工具启动后台 Agent,通过 WebSearch 为每个持仓并行获取:
- 当前股价和估值指标(PE、PB、股息率)
- 最近一个季度的关键财务变化
- 近期重大事件
- 分析师一致预期(前瞻PE、目标价)
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.
- 13d ago First seen · 206 lines · 29 tokens per session scan A 7261b78e857f
portfolio-review is a skill published in the GitHub repository xbtlin/ai-berkshire (16,289 stars, last pushed yesterday), licensed MIT. It adds 29 tokens to every session and 2,441 once invoked, about $0.0001 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 skills, from other repositories
dcf-model
Build discounted cash flow valuation workbooks in Excel.
comps-analysis
Build comparable-company valuation workbooks in Excel.
hyperliquid
Hyperliquid market data, account history, trade review.
stocks
Stock quotes, history, search, compare, crypto via Yahoo.
omni-budget
Configure spending limits, token quotas, and rate-limit policies per API key or globally. Inspect current consumption and enforce cost controls across providers.
polymarket
Query Polymarket: markets, prices, orderbooks, history.