# How to Use the Investment-Research Skill in AI Berkshire: A Complete Guide

> Master the investment-research skill in AI Berkshire. Generate audited valuation reports with this comprehensive guide covering the seven-step workflow. Learn to analyze public companies effectively.

- Repository: [Xbt Lin/ai-berkshire](https://github.com/xbtlin/ai-berkshire)
- Tags: how-to-guide
- Published: 2026-07-10

---

**The `/investment-research` command in AI Berkshire executes a seven-step master-master workflow defined in [`skills/investment-research.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/investment-research.md) to generate audited valuation reports for any public company.**

AI Berkshire is an open-source investment research framework that automates institutional-grade equity analysis. The `investment-research` skill orchestrates data collection, cross-validation, and multi-scenario valuation through a declarative markdown workflow and deterministic Python tools, producing reproducible research reports every time you run the command.

## Understanding the Three-Layer Architecture

### Skill Layer

The skill layer defines *what* the command does. The workflow is purely declarative, residing in [`skills/investment-research.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/investment-research.md). This file specifies a seven-module analysis pipeline: data collection, business model analysis, moat evaluation, reverse-thinking exercises, management assessment, civilization trend analysis, and final valuation.

### Agent Layer

When you invoke `/investment-research <Company>`, the agent layer executes the skill sequentially. It spawns background tasks to gather data, then walks through each analytical module, appending "master's 追问" (follow-up questions) at each stage to enforce rigorous reasoning.

### Tool Layer

Deterministic calculations are delegated to the tool layer. The skill relies on [`tools/financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/financial_rigor.py) for exact-decimal operations including market-cap verification (`verify-market-cap`), cross-source validation (`cross-validate`), and three-scenario valuation modeling.

## Step-by-Step Execution Flow

The command follows a twelve-stage pipeline from input to audited output:

1. **Input Parsing**: You invoke `/investment-research 腾讯` (or any ticker/company name) via the CLI front-end.

2. **Data Collection**: The agent spawns a background Task scraping financial statements and macro-trends, using the source list defined in [`skills/financial-data.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/financial-data.md).

3. **Cross-Validation**: Key numbers are passed to [`tools/financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/financial_rigor.py) for market-cap verification and multi-source cross-validation to ensure accuracy.

4. **Analysis Modules**: The agent sequentially executes the seven master-master modules (business model, moat, reverse-thinking, management, civilization trend, valuation), building a Markdown section for each.

5. **Report Assembly**: The completed report is written to `~/[Company]投资研究报告.md`.

6. **Audit Verification**: [`tools/report_audit.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/report_audit.py) extracts a random 15% sample of data points for a final sanity check before marking the report as准出 (approved for release).

## Installation and Setup

To enable the skill in your environment, first clone the repository:

```bash
git clone https://github.com/xbtlin/ai-berkshire.git
cd ai-berkshire

```

For **Codex** users, install the skills and optional prompt adapters:

```bash
./scripts/install-codex-skills.sh
./scripts/install-codex-prompts.sh

```

For **Claude Code** users, run the dedicated installer:

```bash
./scripts/install-claude-commands.sh

```

Restart your Codex or Claude client to load the new skill definitions from [`codex-skills/investment-research/SKILL.md`](https://github.com/xbtlin/ai-berkshire/blob/main/codex-skills/investment-research/SKILL.md).

## Running the Investment-Research Command

After installation, invoke the skill with a company name or ticker:

**Codex CLI:**

```bash
investment-research 阿里巴巴

```

**Claude Code (slash command):**

```bash
/investment-research 拼多多

```

Each command automatically:
- Fetches financial data from the sources listed in [`skills/financial-data.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/financial-data.md)
- Validates numbers using [`tools/financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/financial_rigor.py)
- Generates a Markdown report at `~/[Company]投资研究报告.md`
- Runs a 15% random audit via [`tools/report_audit.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/report_audit.py)

## Key Files and Their Roles

- **[`skills/investment-research.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/investment-research.md)**: The master markdown defining the seven-module workflow, data-source table, and required tool calls.
- **[`codex-skills/investment-research/SKILL.md`](https://github.com/xbtlin/ai-berkshire/blob/main/codex-skills/investment-research/SKILL.md)**: Generated Codex wrapper enabling CLI invocation.
- **[`tools/financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/financial_rigor.py)**: Python utilities for market-cap verification, multi-source cross-validation, and three-scenario valuation.
- **[`tools/report_audit.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/report_audit.py)**: Extracts random data samples from generated reports for final verification.
- **[`scripts/install-codex-skills.sh`](https://github.com/xbtlin/ai-berkshire/blob/main/scripts/install-codex-skills.sh)**: Helper script copying skill definitions into `~/.codex/skills`.
- **[`skills/financial-data.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/financial-data.md)**: Reference list of approved financial data sources.

## Summary

- The `investment-research` skill uses a **declarative markdown workflow** in [`skills/investment-research.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/investment-research.md) to define a seven-step research process.
- Execution relies on a **three-layer architecture**: Skill (declaration), Agent (orchestration), and Tool (deterministic calculation).
- **Validation tools** ([`tools/financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/financial_rigor.py)) ensure data accuracy through market-cap verification and cross-source validation.
- **Audit requirements** ([`tools/report_audit.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/report_audit.py)) mandate a 15% random sample check before report approval.
- Reports are saved to `~/[Company]投资研究报告.md` and require no manual formatting.

## Frequently Asked Questions

### What is the seven-step workflow in the investment-research skill?

The workflow defined in [`skills/investment-research.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/investment-research.md) comprises: data collection, business model analysis, moat evaluation, reverse-thinking exercises, management assessment, civilization trend analysis, and final valuation. Each module appends a "master's 追问" (follow-up question) to enforce analytical rigor.

### How does the skill validate financial data?

The skill delegates validation to [`tools/financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/financial_rigor.py), which performs market-cap verification via `verify-market-cap` and cross-source checks via `cross-validate`. These deterministic Python functions ensure exact-decimal calculations and reproducible results across multiple data sources.

### Where are the generated reports saved?

Completed research reports are written to `~/[Company]投资研究报告.md` in your home directory. Before finalization, [`tools/report_audit.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/report_audit.py) performs a mandatory 15% random sample audit to verify data integrity against original sources.

### Can I use the investment-research skill with Claude Code instead of Codex?

Yes. Run [`./scripts/install-claude-commands.sh`](https://github.com/xbtlin/ai-berkshire/blob/main/./scripts/install-claude-commands.sh) to install the slash-command adapter, then invoke the skill using `/investment-research <Company>`. The underlying workflow and validation logic remain identical across both clients.