How the AI Berkshire Industry Funnel Skill Filters Companies: A 5-Stage Deep Dive
The AI Berkshire industry funnel skill filters companies through a deterministic, five-stage pipeline that narrows a broad universe of 30–60 firms down to three high-conviction targets using quantitative thresholds, structured analysis templates, and multi-perspective master reviews.
The Industry Funnel skill in the xbtlin/ai-berkshire repository implements a rigorous, rule-driven screening system designed to counteract common AI biases while maintaining full auditability. This skill processes companies across A-shares, Hong Kong stocks, US equities, international markets, and unlisted entities to generate investment-ready research reports.
The 5-Stage Filtering Architecture
The funnel operates as a sequential filter where each stage eliminates candidates based on specific criteria, with documented rationale for every exclusion. According to the source specification in skills/industry-funnel.md, the architecture comprises five distinct phases.
Stage 1: Universe Scanning (全市场扫描)
The process begins by constructing an initial pool of 30–60 companies from five market segments: A-shares, Hong Kong stocks, US stocks, international markets, and unlisted companies. This phase uses a union of three activity-based selection sets defined in lines 21–33 of skills/industry-funnel.md:
- Class A (A 类): Top 30 firms by 30-day average turnover rank per market
- Class B (B 类): Top 20 gainers over both 30-day and 90-day windows
- Class C (C 类): Top 30 by market capitalization within the target sector
This multi-source approach ensures coverage beyond typical large-cap or English-source biases.
Stage 2: Hard Indicator Screening (价值投资5条硬指标粗筛)
Candidates face mandatory elimination through five quantitative value-investing criteria specified in lines 78–90. Every company must satisfy all five metrics—PE ratio, ROE, Operating Cash Flow, Debt-to-Equity ratio, and a Moat Rating of three stars (★★★) or higher.
The skill applies defined relaxation rules for borderline cases, but companies failing two or more criteria receive immediate elimination with a documented "淘汰理由" (elimination reason). This deterministic gate ensures only financially sound firms with verifiable competitive advantages proceed.
Stage 3: Detailed Analysis (精细分析)
Surviving candidates (typically ≤10 firms) undergo structured snapshot generation. As implemented in lines 13–44, the skill produces a concise 300–500 word analysis for each company following a fixed template covering:
- Business model essence
- Financial quality assessment
- Moat depth evaluation
- Top three risk factors
- Valuation quick-take
- Binary "Enter final-3?" decision
This stage also records explicit dropout reasons for any firm not advancing, maintaining the pipeline's traceability requirement.
Stage 4: Four Masters Deep Analysis (四大师深度分析)
The final three candidates receive comprehensive multi-perspective research through four analytical lenses defined in lines 57–95:
- 段永平 (Duan Yongping): Business essence and simplicity analysis
- 巴菲特 (Buffett): Moat durability and margin of safety assessment
- 芒格 (Munger): Failure mode and psychological bias identification
- 李录 (Li Lu): Civilization-level trend alignment evaluation
Each master perspective contributes a scored table and narrative section, culminating in a unified recommendation including rating, position sizing guidance, and key monitoring triggers.
Stage 5: Final Output and Audit (综合输出&审计)
The pipeline concludes with automated report generation and validation. The system assembles the final markdown report at reports/{行业}-funnel-{YYYYMMDD}.md, then executes the Python audit tool tools/report_audit.py (referenced in lines 77–93). This utility extracts a random 15% sample of data points, cross-checking each against trusted sources defined in skills/financial-data.md (Wind, 同花顺, Yahoo Finance), returning either a 准出 (pass) or 打回 (fix) verdict before publication.
How to Invoke the Industry Funnel Skill
The skill supports multiple invocation methods depending on your workflow environment.
Method 1: Claude-Code Slash Command
For direct integration with Claude-Code, use the generated slash prompt:
/industry-funnel AI算力
Method 2: Programmatic Python Execution
To trigger the funnel from a Python script using the Codex prompt infrastructure:
import subprocess
import shlex
cmd = "ai-berkshire/scripts/install-codex-prompts.sh && ai-berkshire/codex-prompts/industry-funnel.md 'AI算力'"
subprocess.run(shlex.split(cmd))
Method 3: Manual Prompt Interface
For rapid testing or custom workflows, invoke the skill through direct prompt:
> **Prompt**
> "请用 `industry-funnel` 过滤‘AI算力’行业的公司。"
> The model will:
> 1️⃣ 拉取全市场扫描 → 生成表格(公司、代码、市场、入选类别)
> 2️⃣ 应用 5 条硬指标 → 标记保留/淘汰
> 3️⃣ 输出每家 300‑500 字的结构化分析
> 4️⃣ 选出 3 家并给出四大师视角的最终报告
All three methods ultimately produce a markdown report under reports/ai-算力-funnel-YYYYMMDD.md.
Key Architectural Principles
The AI Berkshire industry funnel skill incorporates three design patterns that distinguish it from generic screening tools:
-
Deterministic Filtering: Every stage employs explicit quantitative thresholds rather than black-box neural rankings, ensuring reproducible results across identical market conditions.
-
Traceability: The "AI 研究偏见自觉" table (lines 52–60) enforces equal-weight data collection across markets and requires documented elimination reasons at each gate, creating a complete audit trail from initial universe to final three selections.
-
Bias Mitigation: The architecture deliberately counteracts large-cap favoritism, English-source dominance, and narrative-stock attraction by separating "业务占比" (business revenue weight) from "概念热度" (concept popularity) and enforcing cross-market coverage.
Summary
- The AI Berkshire industry funnel skill implements a five-stage deterministic pipeline defined in
skills/industry-funnel.mdthat filters 30–60 initial candidates down to three high-conviction targets. - Stage 1 builds the universe through turnover, momentum, and market-cap screens across A-shares, Hong Kong, US, and international markets.
- Stage 2 applies mandatory quantitative criteria (PE, ROE, Operating Cash Flow, Debt-to-Equity, Moat Rating ★★★+) with documented elimination rationale.
- Stage 3 generates structured 300–500 word company snapshots for remaining candidates.
- Stage 4 applies the Four Masters framework (Duan Yongping, Buffett, Munger, Li Lu) to produce final recommendations with position sizing.
- Stage 5 outputs to
reports/{industry}-funnel-{YYYYMMDD}.mdand validates viatools/report_audit.pyagainst trusted data sources inskills/financial-data.md.
Frequently Asked Questions
What are the five hard indicators used in the screening phase?
The five mandatory criteria are PE ratio, ROE, Operating Cash Flow, Debt-to-Equity ratio, and Moat Rating (requiring three stars or higher). Each candidate must pass all five metrics to advance from Stage 2, though defined relaxation rules exist for borderline cases. Companies failing two or more indicators are eliminated with documented reasoning.
How does the skill prevent AI bias in company selection?
According to the source code in skills/industry-funnel.md (lines 52–60), the skill implements "AI 研究偏见自觉" (AI research bias awareness) by enforcing equal-weight data collection across A-shares, Hong Kong, US, and international markets. It explicitly separates business revenue weight ("业务占比") from concept popularity ("概念热度") to avoid narrative-driven selection and counteracts large-cap favoritism through the Class A/B/C universe construction method.
Where are the final reports saved and how are they validated?
Final reports are saved to reports/{行业}-funnel-{YYYYMMDD}.md following the Stage 4 analysis. The tools/report_audit.py utility then extracts a random 15% sample of data points, cross-referencing each against trusted financial sources (Wind, 同花顺, Yahoo Finance) specified in skills/financial-data.md. The audit returns either a 准出 (pass) for publication or 打回 (fix) requiring corrections before release.
Can I run the industry funnel skill for sectors other than AI computing?
Yes. The skill accepts any industry sector as input. Replace "AI算力" in the invocation examples with your target sector (e.g., /industry-funnel 新能源 or /industry-funnel 生物医药). The modular pipeline in codex-prompts/industry-funnel.md dynamically adapts the universe scanning and screening criteria to the specified industry while maintaining the same five-stage filtering structure.
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:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →