How to Use the Investment-Research Skill in AI Berkshire for Comprehensive Analysis
Invoke the /investment-research skill in AI Berkshire with a company ticker or name to trigger a seven-module parallel analysis that synthesizes the investment philosophies of Warren Buffett, Charlie Munger, Duan Yong-ping, and Li Lu into a structured markdown report with cross-validated financial data.
The investment-research skill in the xbtlin/ai-berkshire repository implements the flagship "四大师综合分析" (Four Masters Comprehensive Analysis) workflow. This skill orchestrates a multi-agent pipeline that evaluates investment targets through multiple value-investing lenses, producing rigorous research reports grounded in exact financial arithmetic and bias-aware methodologies.
Invoking the Investment-Research Skill
The primary entry point is the slash command parsed by Claude Code or Codex. The skill definition resides in [skills/investment-research.md](https://github.com/xbtlin/ai-berkshire/blob/main/skills/investment-research.md), which routes the request to the seven-module pipeline.
To initiate research on any public company, use the ticker or full name:
# Analyze Tencent (腾讯) using the full pipeline
/investment-research 腾讯
# Optional: Specify scenario analysis horizon (if implemented)
/investment-research 腾讯 --scenario three
For programmatic access via Codex-style integration:
import codex
codex.run('investment-research', '腾讯')
The Seven-Module Research Pipeline
The workflow executes sequentially through three distinct phases: bias checking, data collection, and master-specific analysis.
Pre-Research Bias Check (Lines 13–31)
Before data collection begins, the skill evaluates the information richness of the target, assigning a rating of A, B, or C. This triggers the "AI research bias self-awareness" checklist defined in lines 13–31 of the skill file. This mechanism prevents over-confidence when underlying data are scarce, forcing the system to annotate uncertainty levels explicitly in the final report.
Data Collection and Validation (Lines 35–53)
A background Task agent gathers raw financial data, market share statistics, and management information. All quantitative inputs must pass through the financial-rigor tool at [tools/financial_rigor.py](https://github.com/xbtlin/ai-berkshire/blob/main/tools/financial_rigor.py) (lines 55–92). This tool performs exact arithmetic using Python’s decimal.Decimal class to avoid floating-point errors in market-cap calculations and valuation multiples.
Master-Specific Analysis Modules
The core analysis runs through six interconnected modules, each embodying a specific investment philosophy:
-
Business Essence (段永平) – Lines 20–25 execute first-principles questioning about customer value, repeatability of purchases, competitive dynamics, and management decision-making frameworks.
-
Moat Assessment (巴菲特) – Identifies durable competitive advantages and barriers to entry using Class A/B/C moat classification.
-
Reverse Thinking (芒格) – Lines 46–48 force "what-if-the-company-dies?" scenario analysis, examining failure modes and terminal risks.
-
Management Review – Combines Duan Yong-ping and Buffett lenses to evaluate capital allocation discipline and owner-like thinking.
-
Civilization Trend (李录) – Evaluates long-term macro forces and technological shifts that could obsolete the business model over decades.
-
Valuation & Safety Margin (Lines 81–86) – Computes multi-scenario target prices using the rigor tool, requiring explicit margin-of-safety thresholds before recommendation.
Parallel Agent Architecture
Internally, the skill launches four independent agents, each dedicated to one master’s analytical framework. These agents run the full data-gather-analyze-report cycle in parallel. A Team-Lead agent collates the results, ensuring redundancy elimination and cross-validation, as documented in the architecture diagram in [README.md](https://github.com/xbtlin/ai-berkshire/blob/main/README.md) (lines 31–45).
This architecture prevents single-agent cognitive bias while maintaining analytical depth through specialization.
Output Format and Deliverables
The skill emits a structured markdown report containing three critical components:
-
Information-Richness Rating – The pre-assigned A/B/C grade with confidence annotations explaining data limitations.
-
综合决策备忘录 Table – Lines 50–60 generate a decision matrix summarizing each master’s view, consensus areas, and conflicting signals.
-
镜子测试 (Mirror Test) Verdict – A mandatory pass/fail assessment requiring a five-sentence justification that forces the AI to confront its own analytical limitations and potential blind spots.
All numeric calculations embed the tool output logs as an appendix, guaranteeing reproducibility and audit trails.
Verification and Cross-Validation
For manual verification of specific calculations, invoke the underlying rigor tool directly:
python3 ~/ai-berkshire/tools/financial_rigor.py verify-market-cap \
--price 510 --shares 9.11e9 --reported 4.65e12 --currency HKD
This command validates that computed market capitalization matches reported figures using exact decimal arithmetic, flagging discrepancies greater than 0.1%.
Key Implementation Files
-
skills/investment-research.md– The markdown skill definition containing the full research pipeline, checklists, and prompt templates. -
tools/financial_rigor.py– Python utilities for exact market-cap verification, valuation calculations, and multi-source cross-validation. -
scripts/install-claude-commands.sh– Bash installer that copies the skill into Claude’s global command directory for system-wide access. -
codex-skills/investment-research/SKILL.md– Auto-generated Codex package linking the markdown source to the Codex runtime. -
README.md(lines 31–45) – Visual diagram and explanation of the three-layer architecture (Skill → Agent → Tool).
Summary
- The
/investment-researchskill triggers a seven-module parallel analysis combining four investment masters' frameworks. - Pre-research bias checks (lines 13–31) prevent over-confidence by rating information richness before analysis begins.
- All financial calculations use
decimal.Decimalfor exact arithmetic and are validated bytools/financial_rigor.py. - Four independent agents execute master-specific analyses concurrently, collated by a Team-Lead agent.
- Final reports include a mirror test verdict and 综合决策备忘录 table synthesizing conflicting viewpoints.
Frequently Asked Questions
What is the exact command syntax for the investment-research skill?
Type /investment-research followed by the company ticker or full name (e.g., /investment-research 腾讯). The command is parsed by Claude Code or Codex and routed to skills/investment-research.md. Optional flags like --scenario can specify analysis depth if implemented in your installation.
How does AI Berkshire prevent AI hallucination in financial calculations?
The system mandates cross-validation through tools/financial_rigor.py (lines 55–92), which performs all calculations using Python’s decimal.Decimal class to eliminate floating-point errors. Additionally, the pre-research bias checklist (lines 13–31) flags low-information environments where hallucination risk is elevated, forcing explicit confidence annotations in the final report.
What is the "mirror test" (镜子测试) in the final report?
The mirror test is a mandatory pass/fail verdict requiring a five-sentence justification that forces the AI to examine its own analytical limitations. Located in the output synthesis section (around the final report generation), it acts as a final sanity check against confirmation bias and over-confidence, particularly when data quality is rated B or C.
Can I run the investment-research skill standalone without Claude Code?
Yes. While the slash command integrates with Claude Code, you can invoke the underlying logic programmatically using the Codex wrapper or by importing the skill components directly. The codex-skills/investment-research/SKILL.md file provides the runtime linkage for standalone execution, and tools/financial_rigor.py can be executed independently for manual verification of specific financial metrics.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →