Portfolio Management Skills in AI Berkshire: Automated Auditing and Income Allocation

AI Berkshire provides two specialized portfolio management skills—portfolio-review and income-investment—that automate portfolio auditing, concentration analysis, stress-testing, and income-focused allocation decisions through a Task-driven WebSearch pipeline.

The xbtlin/ai-berkshire repository extends beyond company research to offer comprehensive portfolio management capabilities. These skills enable investors to analyze position sizing, monitor concentration risk, and evaluate income-generating securities within the context of existing holdings. All portfolio operations follow a canonical workflow defined in skills/*.md files and execute through a modular architecture that separates skill definitions from data-validation utilities.

Available Portfolio Management Skills in AI Berkshire

AI Berkshire implements two distinct skills that handle different aspects of portfolio construction and maintenance.

portfolio-review: Comprehensive Portfolio Auditing and Rebalancing

The portfolio-review skill executes a full portfolio audit workflow that progresses from data ingestion to optimization recommendations. It accepts user-supplied holdings expressed as percentages, share counts with cost basis, or reads from the persistent file reports/portfolio-latest.md. The skill enriches each position with real-time market data—including price, valuation multiples, and analyst estimates—via the Task-driven WebSearch pipeline.

After data enrichment, the skill performs health checks, concentration and correlation analysis, and opportunity-cost ranking to identify suboptimal allocations. It then runs stress-test scenarios against the portfolio structure and emits a structured report that overwrites reports/portfolio-latest.md with updated conclusions. This creates a feedback loop where subsequent skill invocations build upon previous analysis states.

income-investment: Income-Oriented Allocation and Role Assignment

The income-investment skill evaluates whether a security can generate durable dividend or interest income suitable for specific portfolio roles. It assesses securities against defined allocation categories such as core-income and opportunistic-income positions.

This skill invokes tools/financial_rigor.py to perform precise yield calculations and yield-on-cost analysis. When a portfolio file is supplied, it automatically reads the latest portfolio-review output to ensure new income positions do not contradict existing allocation recommendations or concentration limits.

Architecture and Workflow Integration

Both skills adhere to the canonical workflow architecture that separates concerns across three layers. The skill definition layer consists of Markdown files in skills/*.md that specify logic and parameters. The execution engine layer comprises Claude Code and Codex runtime environments that compile these definitions into executable artifacts stored in codex-skills/*/SKILL.md.

The data-validation layer provides reusable utilities that ensure reproducibility. The tools/financial_rigor.py module supplies precise valuation and scenario calculations used by both portfolio skills, while tools/stock_screener.py offers additional filtering capabilities. This modular design keeps the system testable and allows the Task-driven WebSearch pipeline to inject live market data without contaminating the core logic.

Practical Usage Examples

The following commands demonstrate how to invoke the portfolio management skills in AI Berkshire:


# Review a portfolio expressed as percentages

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

# Review a portfolio expressed as share counts with cost basis

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

# Use an existing saved portfolio file

/portfolio-review "我的持仓"

# Evaluate a dividend-paying security for a specific role

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

These invocations automatically fetch the latest market data, perform the appropriate concentration or income-fit analyses, and update the persistent portfolio report at reports/portfolio-latest.md.

Key Implementation Files

  • skills/portfolio-review.md – Defines the complete portfolio-review skill including parsing logic, data enrichment procedures, concentration analysis, and stress-testing algorithms.

  • skills/income-investment.md – Defines the income-investment skill specifying dividend yield calculations, portfolio role assignments, and integration points with existing portfolio data.

  • tools/financial_rigor.py – Provides precise valuation, yield-on-cost, and scenario calculation functions consumed by both portfolio skills.

  • reports/portfolio-latest.md – The persistent portfolio report file that portfolio-review reads from and writes to, maintaining state between analysis sessions.

  • codex-skills/portfolio-review/SKILL.md – Auto-generated Codex artifact linking the portfolio-review skill definition to the execution runtime.

  • codex-skills/income-investment/SKILL.md – Auto-generated Codex artifact linking the income-investment skill definition to the execution runtime.

Summary

  • AI Berkshire provides two primary portfolio management skills: portfolio-review for comprehensive auditing and income-investment for dividend-focused allocation.
  • The portfolio-review skill performs concentration analysis, correlation checks, opportunity-cost ranking, and stress-testing while persisting results to reports/portfolio-latest.md.
  • The income-investment skill evaluates securities for specific income roles by calling tools/financial_rigor.py and cross-referencing existing portfolio data.
  • Both skills utilize a Task-driven WebSearch pipeline for real-time market data enrichment and follow a modular architecture separating skill definitions from validation utilities.

Frequently Asked Questions

What is the primary function of the portfolio-review skill in AI Berkshire?

The portfolio-review skill automates complete portfolio audits by parsing holdings, enriching positions with live market data via the Task-driven WebSearch pipeline, and running concentration, correlation, and stress-test analyses. It outputs structured reports to reports/portfolio-latest.md and provides rebalancing recommendations based on opportunity-cost rankings.

How does the income-investment skill determine if a security fits a portfolio?

The skill evaluates whether a security can generate durable dividend income appropriate for specific roles such as core-income or opportunistic-income using precise calculations from tools/financial_rigor.py. It checks yield sustainability and reads existing portfolio-review outputs to prevent contradictory allocation recommendations when a portfolio file is specified.

Where does AI Berkshire store portfolio analysis results between sessions?

AI Berkshire persists portfolio analysis results in reports/portfolio-latest.md, which serves as the canonical state file. The portfolio-review skill reads from this file when analyzing existing portfolios and writes updated conclusions back to it, enabling cumulative analysis across multiple invocations.

What tools support the calculation logic for AI Berkshire's portfolio skills?

The tools/financial_rigor.py module provides the core calculation engine for both skills, handling precise valuation metrics, yield-on-cost computations, and scenario analyses. The tools/stock_screener.py utility offers additional data validation capabilities, while the Task-driven WebSearch pipeline handles external market data retrieval.

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:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →