How the AI Berkshire Industry Funnel Skill Screens Companies: A 5-Stage Pipeline
The AI Berkshire industry funnel skill screens companies through a deterministic five-stage pipeline that narrows a 30-60 company universe down to three investable targets using quantitative hard filters and qualitative moat analysis.
The AI Berkshire industry funnel skill implements a reproducible, multi-stage screening workflow defined in the canonical skill file skills/industry-funnel.md. It ingests market data from A-share, Hong Kong, US, and private equity universes to eliminate subjective bias through mandatory value criteria and disciplined portfolio construction.
The Five-Stage Screening Architecture
The funnel operates as a deterministic decision tree where each stage records explicit discard reasons. This prevents black-box filtering and ensures auditability across the entire pipeline.
Stage 1: Whole Market Scan (全市场扫描)
The initial universe construction pulls active stocks across all accessible markets. In skills/industry-funnel.md, this stage defines three sub-classes that merge into a single pool:
- A-class: 30-day average turnover ranking top-30 in each market
- B-class: Union of 30-day and 90-day price-gain top-20 performers
- C-class: Market-cap ranking top-30 within the specific industry, regardless of price movement
The union of A∪B∪C produces approximately 30-60 companies for downstream analysis.
Stage 2: Hard Value Filters (价值硬指标粗筛)
This stage applies strict quantitative thresholds defined in Section 2.1 of the skill file. Companies must satisfy all five mandatory indicators to proceed:
- PE Ratio: Reasonable versus historical averages and peers (PEG < 1.5 allowed for high-growth situations)
- ROE: Greater than 15% or demonstrating a clear improving trend
- Operating Cash Flow: Positive and exceeding 70% of net profit
- Debt-to-Asset: Below 60% (relaxed to 70% for utility sectors)
- Moat Rating: Qualitative assessment of ★★★ or higher
This filter typically reduces the universe to 10 or fewer companies.
Stage 3: Structured Dossier Generation
Surviving companies receive concise 300-500 word analyses using the template specified in Section 3.1 of skills/industry-funnel.md. Each dossier includes standardized sections covering business model, financial quality, moat depth, top-3 risks, valuation snapshot, and a binary "enter final-3" checkbox.
Stage 4: Four-Master Deep Analysis
The final three candidates undergo 800-1200 word deep dives from four distinct investment perspectives:
- 段永平 (Duan Yongping): Business essence and competitive positioning
- 巴菲特 (Buffett): Moat durability and margin of safety
- 芒格 (Munger): Failure modes and downside scenario analysis
- 李录 (Li Lu): Civilization-level trend alignment
This multi-master framework ensures dimensional analysis beyond pure financial metrics.
Stage 5: Portfolio Construction and Output
The skill outputs a final comparison table, ETF substitutes, confidence scoring, and portfolio weighting recommendations. Unlike conventional scoring systems, selection prioritizes portfolio complementarity over raw rankings—typically combining a Buffett-type defensive holding, a growth-oriented compounder, and an optional high-risk "option-style" candidate.
Implementation Details and Source Files
The industry funnel logic lives in three primary locations:
skills/industry-funnel.md: The canonical source of truth defining stages, filters, and output formatscodex-skills/industry-funnel/SKILL.md: Generated artifact mirroring the canonical skill for OpenAI Codex userstools/financial_rigor.py: Python utilities providingfetch_market_data()andapply_hard_filters()functions referenced by the skill
According to the xbtlin/ai-berkshire source code, the skill uses deterministic filtering logic that explicitly logs why each company fails a specific threshold, creating an audit trail from the initial 30-60 company pool to the final three.
Running the Industry Funnel Skill
After installation via scripts/install-claude-commands.sh or scripts/install-codex-skills.sh, invoke the funnel through the CLI:
# Screen the AI Compute sector
ai-berkshire industry-funnel "AI算力"
For IDE or chat interfaces using Claude-Code syntax:
/industry-funnel AI算力
Both commands execute the five-stage pipeline and generate a markdown report at reports/<industry>-funnel-<YYYYMMDD>.md.
For custom tooling, implement the internal flow using the reference functions:
from tools.financial_rigor import fetch_market_data, apply_hard_filters
def industry_funnel(industry: str):
# Stage 1: Scan whole market
universe = fetch_market_data(
industry,
markets=['A', 'HK', 'US', 'Private']
)
# Stage 2: Apply the 5 hard filters
screened = apply_hard_filters(universe)
# Stage 3: Generate structured analysis
analyses = [generate_template(ticker) for ticker in screened]
# Stage 4: Select final 3 based on complementarity
final_three = select_three(analyses)
# Stage 5: Render markdown report
render_report(industry, final_three)
industry_funnel("AI算力")
Summary
- The AI Berkshire industry funnel skill implements a five-stage deterministic pipeline defined in
skills/industry-funnel.md. - Stage 1 builds a 30-60 company universe from A-share, HK, US, and private equity markets using liquidity and momentum criteria.
- Stage 2 enforces five mandatory hard filters: PE reasonableness, ROE > 15%, operating cash flow coverage, debt limits, and moat ratings.
- Stage 3 produces structured 300-500 word dossiers for remaining candidates.
- Stage 4 applies four-master qualitative analysis (Duan, Buffett, Munger, Li Lu) to the final three selections.
- The skill prioritizes portfolio complementarity over raw scoring, ensuring diversified exposure within the targeted industry.
Frequently Asked Questions
What markets does the AI Berkshire industry funnel cover?
The skill scans four distinct market segments: A-share (Mainland China), Hong Kong-listed equities, US-listed equities, and private equity candidates. This cross-border coverage prevents geographic blind spots and captures companies at different maturity stages and regulatory environments.
What are the five hard filters applied in Stage 2?
The deterministic filters require: (1) reasonable PE ratios with PEG under 1.5 for high-growth exceptions, (2) ROE exceeding 15% or showing improvement, (3) operating cash flow positive and greater than 70% of net profit, (4) debt-to-asset below 60% (70% for utilities), and (5) a qualitative moat rating of three stars or higher. Companies must clear all five thresholds to advance.
How does the skill select the final three companies?
Rather than ranking by composite scores, the funnel selects three companies based on portfolio complementarity. The final basket typically includes a defensive Buffett-style compounder, a high-growth innovation play, and an optional asymmetric "option-style" candidate, ensuring the shortlist represents diverse risk/return profiles within the industry.
Where is the skill logic defined?
The canonical definition resides in skills/industry-funnel.md, which serves as the single source of truth for both Claude-Code and Codex implementations. Generated artifacts are stored in codex-skills/industry-funnel/SKILL.md, while the underlying data-fetching and filtering utilities are implemented in tools/financial_rigor.py.
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 →