# AI Berkshire Portfolio Management Skills: Automated Audit, Sizing, and Rebalancing

> Explore AI Berkshire's portfolio management skills: automated audit, sizing, and rebalancing. Enhance your investment strategy with advanced AI tools.

- Repository: [Xbt Lin/ai-berkshire](https://github.com/xbtlin/ai-berkshire)
- Tags: deep-dive
- Published: 2026-07-29

---

**AI Berkshire provides two specialized portfolio management skills—`portfolio-review` and `income-investment`—that automate portfolio auditing, concentration analysis, stress-testing, and income-oriented allocation decisions using a Task-driven WebSearch pipeline and persistent Markdown reporting.**

The `xbtlin/ai-berkshire` repository implements a sophisticated portfolio management system that bridges the gap between individual company research and holistic portfolio analysis. These AI-powered capabilities enable automated parsing of holdings, real-time market data enrichment via the `Task`-driven pipeline, and generation of structured rebalancing recommendations stored in [`reports/portfolio-latest.md`](https://github.com/xbtlin/ai-berkshire/blob/main/reports/portfolio-latest.md).

## The `portfolio-review` Skill: Complete Portfolio Auditing

The `portfolio-review` skill, defined in [`skills/portfolio-review.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/portfolio-review.md), orchestrates a comprehensive workflow from portfolio audit through optimization to rebalancing. This skill handles multiple input formats and performs advanced risk analytics before emitting structured reports.

### Parsing Holdings and Data Enrichment

The skill accepts portfolio definitions as percentages, share counts with prices, or references to saved files. Upon invocation, it parses the holding list and enriches each position with market data including current price, valuation multiples, and analyst estimates via the `Task`-driven WebSearch pipeline.

```bash

# Review portfolio expressed as percentages

/portfolio-review "腾讯30%, 美团20%, 茅台20%, 现金30%"

# Review portfolio expressed as share counts

/portfolio-review "腾讯 500股 @480HK, 美团 1000股 @130HK"

# Reference existing saved portfolio file

/portfolio-review "我的持仓"

```

### Concentration Analysis and Stress Testing

After data enrichment, the system executes health checks and calculates concentration metrics and correlations between positions. It performs opportunity-cost ranking to identify optimal allocations and runs scenario-based stress tests to evaluate portfolio resilience under market shocks.

### Persistent Report Generation

The skill outputs a structured analysis report that is written back to [`reports/portfolio-latest.md`](https://github.com/xbtlin/ai-berkshire/blob/main/reports/portfolio-latest.md), creating a persistent audit trail that subsequent skill invocations reference to avoid contradictory recommendations.

## The `income-investment` Skill: Income-Focused Allocation

The `income-investment` skill, defined in [`skills/income-investment.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/income-investment.md), specializes in evaluating securities for income-oriented portfolio roles such as **core-income** or **opportunistic-income** holdings.

### Dividend Yield Calculations

This skill calls [`tools/financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/financial_rigor.py) to execute precise valuation and **yield-on-cost** calculations. It determines whether a security can generate durable dividend or interest income that fits specific portfolio requirements.

### Portfolio Integration and Role Assignment

When a portfolio file is supplied, the skill reads the latest `portfolio-review` output from [`reports/portfolio-latest.md`](https://github.com/xbtlin/ai-berkshire/blob/main/reports/portfolio-latest.md) to ensure consistent allocation recommendations. It evaluates the security's fit within the existing portfolio structure and assigns appropriate income roles.

```bash

# Evaluate dividend security for specific portfolio role

/income-investment "中国平安" mode=new role=core-income quantity=200 cost_basis=45 portfolio_file=reports/portfolio-latest.md

```

## Architecture and Implementation Files

The portfolio management system isolates skill definitions from execution engines and data-validation utilities. According to the `xbtlin/ai-berkshire` source code, the architecture maintains clean separation between Markdown-based skill definitions, the Claude Code / Codex runtime, and Python-based calculation tools.

- **[`skills/portfolio-review.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/portfolio-review.md)**: Defines the complete portfolio-review workflow including parsing, enrichment, concentration analysis, and stress-test logic.
- **[`skills/income-investment.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/income-investment.md)**: Defines income-investment parameters including yield calculations and role-specific allocation criteria.
- **[`tools/financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/financial_rigor.py)**: Provides precise valuation, yield-on-cost, and scenario calculations consumed by both skills.
- **[`reports/portfolio-latest.md`](https://github.com/xbtlin/ai-berkshire/blob/main/reports/portfolio-latest.md)**: Persistent portfolio state file that `portfolio-review` reads from and writes to, enabling stateful analysis across sessions.
- **[`codex-skills/portfolio-review/SKILL.md`](https://github.com/xbtlin/ai-berkshire/blob/main/codex-skills/portfolio-review/SKILL.md)** and **[`codex-skills/income-investment/SKILL.md`](https://github.com/xbtlin/ai-berkshire/blob/main/codex-skills/income-investment/SKILL.md)**: Auto-generated Codex-compatible artifacts that link skill definitions to the execution runtime.

## Summary

- **AI Berkshire provides two primary portfolio management skills**: `portfolio-review` for holistic portfolio auditing and `income-investment` for dividend-focused allocation decisions.
- **The `portfolio-review` skill** parses holdings in multiple formats, enriches data via WebSearch, performs concentration and correlation analysis, stress-tests scenarios, and persists results to [`reports/portfolio-latest.md`](https://github.com/xbtlin/ai-berkshire/blob/main/reports/portfolio-latest.md).
- **The `income-investment` skill** leverages [`tools/financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/financial_rigor.py) for precise yield calculations and checks portfolio fit against existing allocations to prevent contradictory recommendations.
- **Both skills** follow the canonical `skills/*.md` workflow and compile into Codex-compatible artifacts, maintaining clean separation between skill definitions, execution engines, and data-validation utilities.

## Frequently Asked Questions

### What portfolio management skills does AI Berkshire provide?

AI Berkshire provides the `portfolio-review` and `income-investment` skills. The `portfolio-review` skill handles complete portfolio auditing from parsing holdings through stress-testing and rebalancing, while the `income-investment` skill evaluates securities for specific income-generating roles within a portfolio context.

### How does the `portfolio-review` skill handle data enrichment?

The skill enriches each position with current market data including prices, valuation multiples, and analyst estimates via the `Task`-driven WebSearch pipeline defined in the system architecture. This enrichment happens automatically during the audit process before concentration and correlation analyses are performed.

### What file does AI Berkshire use to persist portfolio analysis results?

The system writes structured portfolio reports to [`reports/portfolio-latest.md`](https://github.com/xbtlin/ai-berkshire/blob/main/reports/portfolio-latest.md). This file serves as the persistent state storage that both skills can reference—the `portfolio-review` skill writes updates here, and the `income-investment` skill reads from it to ensure allocation recommendations remain consistent with previous analyses.

### How does the `income-investment` skill calculate income sustainability?

The skill calls [`tools/financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/financial_rigor.py) to perform precise yield-on-cost and valuation calculations. It evaluates whether a security can generate durable dividend or interest income appropriate for specific portfolio roles such as core-income or opportunistic-income, checking against existing holdings to avoid concentration risks in income-generating assets.