How AI Berkshire's thesis-tracker Monitors Investment Thesis Validity

AI Berkshire's thesis-tracker skill automates a four-layer detection, data-gathering, validation, and reporting system that continuously scores investment thesis health against quantitative triggers and red-line conditions.

The xbtlin/ai-berkshire repository implements a disciplined post-buy monitoring framework designed for value investors. This article analyzes how the thesis-tracker skill validates investment assumptions through structured markdown persistence, automated data verification, and deterministic health scoring.

Detection and Mode Selection Architecture

The monitoring process begins with file-based state detection defined in skills/thesis-tracker.md. The skill checks for the existence of reports/{公司名}-thesis.md to determine which operational mode to execute.

  • Create Thesis Mode ("建立论文"): Activated when the thesis file is missing, initiating a new investment framework workflow.

  • Track-Check Mode ("追踪检查"): Activated when the thesis file exists, triggering a full validation cycle against established hypotheses.

This architecture ensures the system automatically transitions between initial thesis creation and ongoing monitoring without manual configuration.

Data-Gathering Engine and Financial Validation

When monitoring an existing thesis, the skill invokes a multi-source data aggregation layer. According to the implementation in skills/thesis-tracker.md, the engine executes two primary data operations:

  1. WebSearch Integration: Retrieves current share prices, valuation multiples (PE, PB, dividend yield), and recent financial statements.

  2. Research Report Priority: Prefers data from existing research files in /investment-research or /investment-team directories when available.

The system validates this data using tools/financial_rigor.py. Specifically, the skill calls the verify-valuation command (implemented at lines 98-106) to cross-check scraped numbers for internal consistency before hypothesis evaluation.


# Example internal validation invocation

python tools/financial_rigor.py verify-valuation --ticker TCEHY --metrics "PE,PB,dividend_yield"

Hypothesis Validation and Health Scoring

The core validation logic evaluates the thesis against predefined core hypotheses (核心假设清单) and red-line triggers (红线清单). During each tracking run, the skill updates each hypothesis row with new evidence and assigns status indicators:

  • 🟢 Valid (成立)
  • 🟡 Marginal Degradation (边际弱化)
  • 🔴 Invalid (不成立)
  • ⚫ Severe Deviation

The health score calculation follows the precise formula defined in skills/thesis-tracker.md:

健康度 = 10 - (⚫×3) - (🔴×2) - (🟡×1) - (红线触发×5)

This formula aggregates hypothesis degradations into a 0-10 scale. Red-line triggers—which include conditions like management integrity issues or two consecutive quarters of core business decline—impose a severe 5-point penalty each, immediately flagging the thesis for potential liquidation.

Reporting and Persistence Layer

Upon completion of validation, the skill generates a structured markdown report and appends it to the tracking log (追踪记录表) within the existing reports/{公司名}-thesis.md file. This append-only persistence creates an auditable historical trail.

Each tracking report includes:

  • Computed health score (0-10 scale)
  • Updated hypothesis and red-line tables with status changes
  • Key changes summary (≤500 words)
  • Updated valuation metrics
  • Action recommendation: 加仓 (add), 持有 (hold), 减仓 (reduce), or 清仓 (liquidate)

Complete Workflow Execution

The end-to-end execution flow in xbtlin/ai-berkshire follows this deterministic sequence:

  1. Invocation: User triggers !thesis-tracker {company_name} [季度检查] via Claude-code slash syntax.

  2. State Check: Skill verifies existence of reports/{公司名}-thesis.md.

  3. Branching Logic:

    • If missing: Executes 建立论文 workflow—gathers market data, runs financial_rigor.py verify-valuation, prompts for 5-sentence core thesis, and initializes hypothesis/red-line tables.
    • If present: Executes 追踪检查 workflow—refreshes market data, validates against financial_rigor.py, updates hypothesis statuses, recomputes health score, and appends tracking record.
  4. Output: Generates structured markdown report with concrete action recommendations.

Key Implementation Files

The thesis-tracker system spans several critical components:

  • skills/thesis-tracker.md: Human-readable specification containing modes, scoring logic, and table structures.
  • tools/financial_rigor.py: CLI utility (lines 98-106) for valuation verification and cross-source consistency checks.
  • reports/{公司名}-thesis.md: Persistent markdown storage for thesis data, hypothesis tables, and tracking history.
  • scripts/sync-codex-skills.py: Generates Codex-compatible skill packages from markdown sources, ensuring interoperability across AI coding environments.

Summary

  • AI Berkshire's thesis-tracker implements automated post-buy monitoring through a four-layer architecture: detection, data-gathering, validation, and reporting.
  • The system uses file-based state detection (reports/{公司名}-thesis.md) to switch between creation ("建立论文") and tracking ("追踪检查") modes automatically.
  • Validation relies on tools/financial_rigor.py with the verify-valuation command to ensure data accuracy before hypothesis scoring.
  • A deterministic health score formula (健康度 = 10 - (⚫×3) - (🔴×2) - (🟡×1) - (红线触发×5)) quantifies thesis degradation and triggers specific portfolio actions.
  • All monitoring history persists in append-only markdown tables, creating a fully auditable investment decision trail.

Frequently Asked Questions

How does the thesis-tracker determine whether to create a new thesis or monitor an existing one?

The skill checks for the existence of reports/{公司名}-thesis.md at runtime. If the file is missing, it automatically switches to "建立论文" (create thesis) mode to initialize the investment framework. If the file exists, it enters "追踪检查" (track-check) mode to validate the existing thesis against current market data.

What triggers a red-line penalty in the health score calculation?

Red-line triggers (红线触发) impose a severe 5-point penalty in the health formula. These include critical failure conditions such as management integrity issues or core business metrics declining for two consecutive quarters. Unlike standard hypothesis degradation (which uses 🟡/🔴/⚫ indicators), red-line breaches typically mandate immediate liquidation or deep re-evaluation of the position.

How does the skill validate the accuracy of financial data before scoring?

Before updating hypothesis tables, the skill invokes tools/financial_rigor.py with the verify-valuation command (lines 98-106). This tool cross-checks scraped market data—specifically valuation multiples like PE and PB ratios—against primary sources to ensure consistency before the validation layer calculates the health score.

Can the thesis-tracker workflow be triggered programmatically outside of Claude-code?

Yes. The repository includes scripts/sync-codex-skills.py, which generates Codex-compatible skill packages from the markdown specifications. This allows the thesis-tracker logic to execute in various AI coding environments, though the primary interface uses Claude-code's slash syntax (e.g., !thesis-tracker 腾讯季度检查).

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 →