# How to Use the Investment-Team Skill in AI-Berkshire: Multi-Agent Research Workflow

> Discover how to use the investment-team skill in AI-Berkshire to run a parallel multi-agent research workflow and generate audited investment reports. Mirror top investor frameworks.

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

---

**The investment-team skill orchestrates a parallel multi-agent research workflow that mirrors the analysis frameworks of Buffett, Munger, Duan Yongping, and Li Lu to generate audited investment reports.**

The **investment-team** skill in the [xbtlin/ai-berkshire](https://github.com/xbtlin/ai-berkshire) repository automates institutional-grade equity research by deploying four specialized AI agents simultaneously. According to the source code in [`skills/investment-team.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/investment-team.md), this skill strings together **Team**, **Task**, **TaskUpdate**, **SendMessage**, and **TeamDelete** primitives while enforcing strict data integrity through the **financial-rigor** and **report-audit** utilities.

## Prerequisites: WebSearch Permission Verification

Before deploying the research team, the skill validates that the **WebSearch** permission is enabled in your environment. As implemented in lines 34‑48 of [`skills/investment-team.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/investment-team.md), the workflow aborts immediately if this permission is missing, instructing the user to enable it before proceeding. This requirement ensures all agents can access real-time market data rather than relying on stale training data.

## Setting Up the Investment Research Team

### Creating the Team Structure

The skill initializes the workflow by invoking the `TeamCreate` tool to instantiate a new team named `{company}-research` (e.g., `tencent-research`), assigning the **team-lead** agent as the coordinator (lines 49‑54). This lead agent serves as the orchestrator for the entire analysis pipeline, managing task distribution and final report compilation.

## Deploying the Four Analyst Agents

The core functionality spawns four independent research tasks via `TaskCreate` calls, each configured with role-specific prompts and parallel execution flags.

### Business Analyst: Business Model & Moat

The **business-analyst** agent receives a task definition covering business model analysis and competitive moat evaluation (lines 59‑68). This agent applies the investment philosophy of Buffett and Munger to assess qualitative factors like pricing power and market positioning.

### Financial Analyst: Statements & Valuation

The **financial-analyst** agent processes financial statement analysis and valuation metrics (lines 70‑84). This task requires dual-source financial data validated through [`tools/financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/financial_rigor.py) to ensure accuracy in market-cap calculations and valuation multiples.

### Industry Researcher: Landscape & Competition

The **industry-researcher** agent examines industry structure, competitive dynamics, and secular trends (lines 86‑96). This role incorporates Duan Yongping’s framework for understanding industry evolution and competitive advantage durability.

### Risk Assessor: Risk & Management Review

The **risk-assessor** agent evaluates management quality, governance risks, and operational vulnerabilities (lines 97‑107). This analysis follows Li Lu’s rigorous standards for assessing downside risks and management integrity.

## Parallel Execution and Data Integrity

The four agents launch simultaneously in **one message** with `run_in_background: true` (lines 11‑16 of the prompt template). Each agent receives a role-specific prompt (lines 21‑30) that enforces three critical constraints:

- **Mandatory WebSearch**: Agents must use live web searches for the latest data rather than cached knowledge.
- **Dual-Source Validation**: Financial metrics must pass validation via [`tools/financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/financial_rigor.py) (lines 30‑34), cross-referencing multiple data providers.
- **Anti-Hallucination Protocol**: Explicit prohibition against "pretending" to have data when web access is blocked (lines 34‑35).

## Monitoring Progress and Aggregation

The **team-lead** agent monitors task completion through a live progress table (lines 48‑50) and aggregates key findings from each sub-agent as they complete (lines 46‑49). This real-time visibility allows users to track which analysts have finished their deep dives while others are still processing.

## Final Report Generation and Auditing

After all sub-agents submit their analyses, the workflow executes a structured teardown and deliverable pipeline:

1. **Report Compilation**: The lead agent compiles a master markdown report and writes it to `~/[公司名]投资研究报告_YYYYMMDD.md` (line 97), using the company name and current date in the filename.
2. **Team Teardown**: The skill invokes `TeamDelete` to remove the temporary `{company}-research` team (lines 16‑18), cleaning up resources.
3. **Quality Audit**: The lead runs the three-step data-audit pipeline via [`tools/report_audit.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/report_audit.py) (lines 99‑112), which extracts random samples of data points, validates them against sources, and renders a **准出** (approval) or **打回** (rejection) decision.

## Code Examples

### Slash Command Invocation

The simplest way to trigger the skill is through the slash command interface:

```text
/investment-team 腾讯

```

The argument (`腾讯`) is substituted for `$ARGUMENTS` and drives the team name (`tencent-research`).

### Python SDK Implementation

For programmatic access, use the Python SDK if installed:

```python
from ai_berkshire import invoke_skill

result = invoke_skill(
    skill_name="investment-team",
    arguments="microsoft"
)
print(result)   # Returns the final aggregated research report

```

### Manual Workflow Reproduction (Debugging)

You can manually reproduce the workflow for debugging or customization:

```bash

# 1️⃣ Check WebSearch permission

grep -l '"WebSearch"' .claude/settings.local.json ~/.claude/settings.local.json

# 2️⃣ Create the team

claude tool TeamCreate --team_name=microsoft-research --agent_type=team-lead

# 3️⃣ Launch the four research tasks in parallel (example for business analyst)

claude tool TaskCreate --subject="分析Microsoft商业模式…" \
    --description="…" --activeForm=… --subagent_type=general-purpose \
    --run_in_background=true --team_name=microsoft-research --name=business-analyst

# Repeat for financial-analyst, industry-researcher, and risk-assessor

```

## Key Implementation Files

- **[`skills/investment-team.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/investment-team.md)**: Core skill definition containing the seven-step workflow and permission checks.
- **[`codex-prompts/investment-team.md`](https://github.com/xbtlin/ai-berkshire/blob/main/codex-prompts/investment-team.md)**: Wrapper configuration for Codex slash-command invocation.
- **[`tools/financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/financial_rigor.py)**: CLI utility enforcing market-cap, valuation, and cross-validation checks for dual-source data requirements.
- **[`tools/report_audit.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/report_audit.py)**: Auditing pipeline that extracts random data samples, validates accuracy, and determines report approval status.
- **[`skills/financial-data.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/financial-data.md)**: Specification document defining the dual-source data standards referenced throughout the workflow.

## Summary

- The **investment-team** skill requires **WebSearch** permission and aborts if unavailable (lines 34‑48 of [`skills/investment-team.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/investment-team.md)).
- It creates a temporary team named `{company}-research` using `TeamCreate` and assigns a **team-lead** agent to coordinate four specialized analysts.
- Four parallel tasks (**business-analyst**, **financial-analyst**, **industry-researcher**, **risk-assessor**) execute simultaneously with `run_in_background: true`.
- Data integrity is enforced through [`tools/financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/financial_rigor.py) validation and explicit prohibitions against data hallucination.
- Final deliverables include a timestamped markdown report at `~/[公司名]投资研究报告_YYYYMMDD.md` and a three-step audit via [`tools/report_audit.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/report_audit.py) to ensure **准出** quality standards.

## Frequently Asked Questions

### What permissions are required to run the investment-team skill?

The skill strictly requires the **WebSearch** permission. According to lines 34‑48 of [`skills/investment-team.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/investment-team.md), the workflow checks for this permission before creating the team and aborts immediately if it is missing, instructing the user to enable it. This ensures all agents can access real-time financial data rather than generating unverified responses.

### How does the skill ensure data accuracy and prevent hallucinations?

The skill implements a dual-layer validation system. First, each agent must use **WebSearch** for current data (lines 21‑30). Second, financial data must pass validation through [`tools/financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/financial_rigor.py) (lines 30‑34). Additionally, the prompt template explicitly prohibits agents from "pretending" to have data when web access is unavailable (lines 34‑35), effectively eliminating hallucinated financial metrics.

### Can I customize the four analyst roles or add additional agents?

While the current implementation in [`skills/investment-team.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/investment-team.md) hardcodes the four roles (business-analyst, financial-analyst, industry-researcher, risk-assessor) to mirror Buffett, Munger, Duan Yongping, and Li Lu’s frameworks (lines 59‑107), you can modify the skill definition file to adjust task descriptions or add additional `TaskCreate` calls. The parallel execution framework supports any number of background tasks via `run_in_background: true`.

### What is the 准出 (approval) standard in the audit pipeline?

The **准出** (approval) standard refers to the three-step validation pipeline defined in [`tools/report_audit.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/report_audit.py) (lines 99‑112 of the skill). This pipeline extracts a random sample of data points from the compiled report, validates them against primary sources, and determines whether the report meets publication quality standards. Reports failing validation are **打回** (rejected) for revision, ensuring only rigorously verified research reaches final output.