AI Berkshire Models Input and Output Formats: Complete Technical Guide

AI Berkshire models accept plain-text slash commands as input and always return deeply formatted Markdown documents containing standardized tables, scoring matrices, and reproducible calculation snippets.

The xbtlin/ai-berkshire repository implements a skill-based architecture that treats AI-driven investment research as executable commands. According to the source code in README_EN.md (lines 118-122), the framework guarantees that identical inputs produce structurally consistent outputs regardless of the underlying LLM, creating a reliable "research team" interface rather than a conversational chatbot.

Input Format for AI Berkshire Models

AI Berkshire structures its capabilities as skills—discrete commands that can be invoked through Claude Code or Codex prompts. The input contract follows a strict slash-command pattern to ensure predictable parsing.

Slash Command Syntax

Every skill invocation begins with a leading slash (/) followed by the skill name and space-separated arguments:

/skill-name <primary-argument> [optional-arguments]

The repository defines specific patterns for core skills in skills/investment-research.md:

  • /investment-research <Company> – Generates comprehensive analysis for a public company
  • /investment-team <Company> – Creates team-style evaluation reports
  • /news-pulse <Ticker> [optional-description] – Provides price-move attribution and sentiment analysis

Argument Conventions

Arguments are plain-text identifiers (tickers, company names, or themes) separated by spaces or commas. The input layer normalizes these identifiers before processing, ensuring that /investment-research Tencent and /investment-research tencent trigger the same deterministic pipeline.

Output Format Structure

AI Berkshire models always produce fully-formed Markdown documents with predefined hierarchical sections. This standardization enables side-by-side comparison of multiple companies and reliable parsing by downstream reporting tools.

Markdown Document Architecture

Every output contains these structural elements as documented in README_EN.md (lines 66-71):

  • Header sections with title and brief overview
  • Scoring tables using uniform rating grids for business quality, moat analysis, and management assessment
  • Recommendation matrices mapping Aggressive, Moderate, and Conservative strategies to specific price ranges
  • Data-validation notes referencing exact-precision calculations
  • Narrative commentary incorporating Buffett, Munger, and other value investing frameworks

Standardized Table Elements

The output relies heavily on Markdown tables for structured data. A typical recommendation matrix appears as:

| Strategy | Recommendation | Price Range |
|----------|---------------|-------------|
| Aggressive | Build 20% position at current price | $95–105 |
| Moderate   | Wait for buyback policy clarity   | $85–95 |
| Conservative| Doesn't meet 10-year certainty bar — pass | — |

Scoring tables follow a consistent four-column format:

| Dimension | Framework | Score | Core Judgment |
|-----------|-----------|-------|---------------|
| Business Quality | Platform business, network effects | ★★★★★ | Excellent |
| Moat | Scale economies | ★★★★☆ | Wide and widening |

Data Validation and Precision

Outputs include exact-precision validation commands using decimal.Decimal implementations from tools/financial_rigor.py. For example:

python3 tools/financial_rigor.py verify-market-cap --ticker AAPL --precision 2

This ensures that financial calculations shown in the Markdown (such as market cap or P/E ratios) are reproducible and auditable.

Code Examples and Usage Patterns

Below are three typical invocations demonstrating the input-to-output transformation.

Investment Research Command

Input:

$ /investment-research Tencent

Output:

#### Comprehensive Decision Memo

| Dimension          | Conclusion                                                | Confidence |
|-------------------|-----------------------------------------------------------|------------|
| Business Quality  | Excellent: platform business, two-sided network effects  | ★★★★★     |
| Moat              | Wide and widening: network effects + scale economies      | ★★★★☆    |
| Management        | Strong: founder-led, excellent capital allocation         | ★★★★☆    |
| Top Risk (Munger) | Regulatory policy uncertainty                             | ★★★☆☆    |
| Valuation         | Current P/E 18×, slightly below historical median          | ★★★★☆    |

News Pulse Attribution

Input:

$ codex --prompt "news-pulse NVIDIA"

Output:

#### One-Line Attribution

Approximately 70-80% of the 12% drop was driven by fund flows and sentiment...

| Candidate Explanation                | Estimated Contribution | Confidence |
|--------------------------------------|-----------------------|------------|
| Fund outflows (southbound selling)   | -4%                  | High       |
| AI narrative shift (new competitor) | -3%                  | Medium     |
| No fundamental deterioration         | 0%                   | Very High  |

Financial Data Retrieval

Input:

$ codex --prompt "financial-data AAPL"

Output:

#### Financial Data Retrieval & Cross-Validation

| Metric | Source 1 | Source 2 | Consensus | Deviation |
|--------|----------|----------|-----------|-----------|
| Market Cap (USD) | 2.45 T | 2.46 T | 2.455 T | 0.04% |
| P/E Ratio | 28.7 | 28.9 | 28.8 | 0.35% |

Key Implementation Files

The input-output contract is enforced across these critical source files:

  • skills/investment-research.md – Defines the /investment-research skill syntax and expected Markdown section headers
  • tools/financial_rigor.py – Provides exact-precision financial utilities for market-cap verification and ratio calculations
  • AGENTS.md – Describes the architecture separating Skill, Agent, and Tool layers that maintain the I/O consistency guarantee
  • README_EN.md – Documents the "same input → same output" contract (lines 118-122) and concrete table formatting examples (lines 66-71)

Summary

  • AI Berkshire models accept slash-command inputs (/skill-name <arguments>) through Claude Code or Codex interfaces.
  • Output is always Markdown containing standardized tables for scoring, recommendations, and financial validation.
  • The I/O contract is deterministic—identical inputs produce structurally identical outputs regardless of the underlying LLM.
  • File paths matter: skills/investment-research.md defines command syntax, while tools/financial_rigor.py provides calculation precision.
  • Downstream integration is simplified because outputs use standard Markdown tables rather than proprietary formats.

Frequently Asked Questions

What happens if I omit arguments in an AI Berkshire slash command?

The skill will either prompt for required arguments or return an error message indicating the expected syntax. According to skills/investment-research.md, the parser expects plain-text identifiers and cannot proceed without a valid company ticker or name to anchor the research pipeline.

Can I customize the output format of AI Berkshire models?

No. The output format is strictly enforced to maintain consistency across the investment research workflow. While the narrative content varies based on the company analyzed, the structural elements—scoring tables, recommendation matrices, and validation sections—remain constant as specified in README_EN.md (lines 66-71).

How does AI Berkshire ensure calculation accuracy in outputs?

The framework references tools/financial_rigor.py within its Markdown outputs, providing exact-precision commands using decimal.Decimal for financial calculations. This allows auditors to reproduce market-cap figures, P/E ratios, and other metrics independent of the LLM generation, ensuring the quantitative data in the Markdown reports is mathematically verifiable.

Is the AI Berkshire input format compatible with standard CLI tools?

Yes. The slash-command style integrates directly with Claude Code and can be adapted for Codex prompts using --prompt flags. Because inputs are plain text without special encoding, they can be scripted in bash, included in Makefiles, or triggered through CI/CD pipelines that need to generate standardized investment research reports.

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 →