How the /earnings-review Skill Functions: Complete Technical Architecture Guide

The /earnings-review skill is an eight-stage automated pipeline that converts a simple "company quarter" query into a rigorously audited investment report by orchestrating parallel document fetching, exact-decimal financial validation, and qualitative tone analysis.

The /earnings-review skill in the xbtlin/ai-berkshire repository automates first-hand earnings research through a declarative markdown-based workflow. It executes a multi-agent pipeline defined in skills/earnings-review.md that fetches primary source filings, validates financial data with decimal-precision rigor, and generates decision-ready reports structured for investment analysis.

The /earnings-review Skill Execution Pipeline

The skill implements a strict, repeatable workflow that processes user queries from raw data acquisition to final audit.

Stage 1: Source Availability Classification

The pipeline begins by classifying data availability into A/B/C levels according to the "前置步骤:资料可得性评级" table in skills/earnings-review.md. Level A indicates full original filing availability, Level B indicates partial filings, and Level C restricts analysis to secondary news sources only.

Stage 2: Primary Source Acquisition

Task agents execute in parallel to download original documents from authoritative sources:

  • SEC EDGAR (10-K/10-Q filings)
  • 港交所披露易 (HKEX disclosure)
  • 巨潮资讯网 (CNINFO)
  • IR webpages, earnings call transcripts, shareholder letters, and investor day materials

This stage uses the "Task 工具启动多个后台 Agent 并行获取" block. When primary sources are unavailable, the skill falls back to the financial-data skill's data-source matrix (macrotrends, stockanalysis, aastocks, 东方财富) and flags the data as secondary.

Stage 3: Financial Data Extraction and Verification

The skill extracts income statement, cash flow, and balance sheet items, then invokes tools/financial_rigor.py for exact-decimal verification. Key validation functions include:

  • verify_market_cap – Cross-checks market capitalization calculations
  • verify_valuation – Validates valuation multiples against raw data
  • cross_validate – Reconciles figures across multiple data providers

This eliminates floating-point drift and ensures mathematical precision required for investment-grade analysis.

Stage 4: Management Discussion and Analysis (MD&A) Deep Read

The skill parses MD&A sections and earnings call transcripts, flagging tone signals defined in the "管理层语气分析" tables:

  • 坦诚 (Frank/Transparent)
  • 清晰 (Clear)
  • 模糊 (Vague)
  • 转移 (Deflecting)
  • 归因外部化 (Externalizing blame)

It also tracks commitment fulfillment against previous guidance.

Stage 5: Footnote and Hidden Information Mining

The "必查附注项" (mandatory footnote checklist) directs analysis toward:

  • 关联交易 (Related-party transactions)
  • 股权激励 (Equity incentives)
  • 或有负债 (Contingent liabilities)
  • 会计政策变更 (Accounting policy changes)
  • 分部信息 (Segment information)
  • 集中度 (Concentration risks)

Anomaly detectors flag signals such as operating cash flow consistently trailing net income.

Stage 6: Historical Comparison

The system builds time-series datasets spanning minimum 4 quarters or 3 years, comparing actual results against prior management guidance using the templated "趋势分析" and "与管理层指引对比" tables.

Stage 7: Report Generation

The final output assembles a decision-oriented report containing:

  • 核心数据速览 (Core data overview)
  • 重点变化 (Key changes)
  • 语气追踪 (Tone tracking)
  • 附注隐藏信息 (Hidden footnote insights)
  • Q&A精选 (Selected Q&A highlights)
  • 投资结论 (Investment conclusion)

The report skeleton is defined in the "报告结构" code block of the skill definition.

Stage 8: Audit and Release Gate

The skill writes the markdown file to reports/{公司名}-earnings-{期间}.md and invokes tools/report_audit.py for a release-gate audit. This "数据抽检(准出流程)" step determines whether the report meets publication standards or requires revision.

/earnings-review Core Architectural Components

Four integrated systems power the /earnings-review capability.

Task-Based Parallel Agents

The skill leverages Claude Code's Task tool to spawn multiple background agents simultaneously. This architecture enables concurrent downloads from disparate regulatory sources (SEC, HKEX, CNINFO) without blocking the main analysis thread.

Financial Rigor Toolkit

Located in tools/financial_rigor.py, this toolkit enforces exact-decimal arithmetic to prevent floating-point errors in financial calculations. It provides validation utilities for market capitalization, valuation metrics, and cross-source data reconciliation, alongside statistical checks like Benford's Law analysis for anomaly detection.

Qualitative Analysis Engine

The markdown-defined workflow includes structured signal tables for management tone assessment and footnote mining. This transforms qualitative text into structured investment signals without hard-coded NLP models.

Automated Audit Gate

The tools/report_audit.py module implements the final quality control layer, extracting checklist items from generated reports and rendering pass/fail verdicts before publication.

/earnings-review Source Files and Implementation

The /earnings-review skill spans multiple files in the repository:

Component File Path Description
Skill Definition skills/earnings-review.md Full workflow specification, rating tables, and report templates
Financial Rigor tools/financial_rigor.py Exact-decimal validation functions (verify_market_cap, cross_validate)
Report Audit tools/report_audit.py Release-gate extraction and verdict logic
Data Fallback skills/financial-data.md Secondary source matrix (macrotrends, stockanalysis, aastocks, 东方财富)
Codex Compatibility codex-prompts/earnings-review.md Slash-command interface for Codex-style execution

Practical Usage Examples

Invoke the skill directly from a Claude Code session:

/earnings-review 腾讯 2025Q4

Run individual financial rigor validations used by the pipeline:


# Verify market cap consistency

python3 tools/financial_rigor.py verify-market-cap \
  --price 101 --shares 1.488e9 --reported 1.44e11 --currency USD

# Cross-validate revenue across sources

python3 tools/financial_rigor.py cross-validate \
  --field revenue \
  --values '{"公司财报": 108.3, "Yahoo Finance": 107.9, "StockAnalysis": 108.0}' \
  --unit 亿

Execute the audit gate manually on generated reports:


# Extract audit checklist items

python3 tools/report_audit.py extract \
  --report reports/腾讯-earnings-2025Q4.md

# Render final verdict

python3 tools/report_audit.py verdict \
  --results '<JSON-from-extract>' \
  --report reports/腾讯-earnings-2025Q4.md

Summary

  • The /earnings-review skill implements an 8-stage pipeline from source classification to audited report delivery.
  • Parallel Task agents fetch primary filings from SEC, HKEX, and CNINFO simultaneously.
  • Exact-decimal validation via tools/financial_rigor.py eliminates floating-point errors in financial calculations.
  • Qualitative analysis captures management tone signals and mines footnotes for hidden risks.
  • Automated audit gates in tools/report_audit.py enforce quality standards before publication.
  • All workflow logic is declarative in skills/earnings-review.md, enabling transparent, reproducible analysis.

Frequently Asked Questions

How does /earnings-review handle missing primary sources?

When primary filings are unavailable, the skill automatically falls back to the financial-data skill's secondary source matrix, including macrotrends, stockanalysis, aastocks, and 东方财富. It classifies the output as Level C data and flags all derived metrics as secondary to maintain transparency.

What makes the financial validation "exact-decimal"?

Unlike standard floating-point arithmetic that introduces rounding errors, the tools/financial_rigor.py module uses decimal-precision calculations via functions like verify_market_cap and cross_validate. This ensures that market capitalization calculations and cross-source validations match to the exact decimal place, preventing the micro-discrepancies that invalidate investment models.

How does the skill detect management tone signals?

The skill parses MD&A sections and earnings transcripts against predefined signal tables in skills/earnings-review.md, categorizing management communication into five tonal buckets: 坦诚 (frank), 清晰 (clear), 模糊 (vague), 转移 (deflecting), and 归因外部化 (externalizing). It also tracks whether stated commitments from previous quarters were fulfilled in current results.

Can I use the financial rigor tools independently of the full skill?

Yes. The tools/financial_rigor.py utilities are designed as standalone command-line tools. You can invoke verify-market-cap, cross-validate, and other functions directly via Python CLI for ad-hoc financial verification without triggering the full /earnings-review workflow, making them reusable for other analysis pipelines.

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 →