How the /industry-funnel Skill Narrows 30–60 Companies to 3 Investment Recommendations
The /industry-funnel skill in the ai-berkshire repository uses a four-stage leaky-bucket filtering process that applies liquidity-based scanning, five hard financial metrics, qualitative structured analysis, and portfolio-complementarity rules to compress a broad universe of 30–60 companies into three actionable deep-dive recommendations.
The ai-berkshire project provides AI-driven investment analysis tools inspired by value investing principles. According to the source code in skills/industry-funnel.md, the industry funnel skill implements a rigorous, reproducible workflow that eliminates "story-stock" noise through objective criteria rather than subjective ranking.
Stage 1: Market-Wide Scan to Capture 30–60 Candidates
The funnel begins with a union-based source pool that aggregates three distinct liquidity and visibility classes to ensure no major market segment is missed.
The A/B/C Classification System
The initial scan captures candidates across A-shares, Hong Kong, US equities, and unlisted companies using three parallel filters:
- Class A (A类): Top 30 companies by 30-day average daily turnover (industry-ranked)
- Class B (B类): Top 20 companies by 30-day or 90-day price appreciation (union of both periods)
- Class C (C类): Top 30 companies by market capitalization within the sector
The system takes the union (A ∪ B ∪ C) of these categories, typically yielding a starting universe of 30–60 companies. Each entry is tagged with its source class (A/B/C) and structured data including market, ticker code, size, and primary business description.
Stage 2: Hard Financial Filter (5 Indicators)
The second stage applies value investing hard metrics that function as a binary gate—companies must pass all five criteria to advance, creating an objective, reproducible filter that removes speculative candidates.
The five mandatory indicators defined in skills/industry-funnel.md are:
- PE Ratio: Must be reasonable versus historical averages and peers; high-growth companies require PEG < 1.5
- ROE: Must exceed 15% with an upward trend (relaxed for heavy-asset sectors)
- Operating Cash Flow: Must be positive and exceed 70% of net profit
- Debt-to-Asset Ratio: Must remain below 60% (extended to 70% for utility sectors)
- Moat Rating: Must achieve ★★★ (three stars) or higher
If more than 12 companies survive this filter, the system escalates the moat threshold to ★★★★ (four stars) and repeats the scan until the pool is reduced to ≤10 companies. Survivors are flagged as "keep" or "ditch" with specific elimination reasons documented in a structured table.
Stage 3: Structured Qualitative Analysis
Surviving candidates undergo a 300–500 word structured analysis for each company. This qualitative vetting examines:
- Business model sustainability and competitive positioning
- Financial quality beyond the hard metrics
- Moat depth and durability
- Top three identifiable risks
- Quick valuation judgment (expensive/fair/cheap)
The output annotates each company with a binary decision: "进入终选 3 家? 是/否(理由)" (Enter final selection of 3? Yes/No with reasoning). This stage ensures that only companies with defensible competitive advantages and transparent risk profiles advance to the final round.
Stage 4: Portfolio-Complementarity Final Selection
Unlike traditional ranking systems that simply select the top three scores, the final stage uses portfolio-centric selection based on risk-return complementarity. The system mandates a specific three-bucket allocation:
- At least 1 "High Certainty–Low Elasticity" (Buffett-type): Stable compounders with predictable cash flows
- At least 1 "Medium Certainty–Medium Elasticity" (Growth-type): Balanced risk-return expansion candidates
- Optional 1 "High Elasticity–High Risk" (Option-type): Asymmetric opportunity with higher volatility
Each selected company is then expanded into a full-length four-master report (段永平, 巴菲特, 芒格, 李录 perspectives) and saved to reports/{行业名}-funnel-YYYYMMDD.md, including recommendation scores, position sizing guidelines, and monitoring triggers.
Implementation: Invoking the Skill and Processing Output
While the repository does not ship a runnable CLI, the skill definition in skills/industry-funnel.md supports programmatic invocation and manual markdown-driven workflows.
Python API Pattern
from ai_berkshire.skills import industry_funnel
# Initialize the funnel for a specific sector
result = industry_funnel.run(industry="AI算力")
# Access intermediate filtering tables
print(result["scan_table"]) # 30-60 companies with A/B/C tags
print(result["hard_filter_table"]) # ≤10 survivors after 5-indicator check
# Process final recommendations
for rec in result["final_three"]:
print(f"{rec['company']} – {rec['master_view']}")
Manual Workflow Execution
# Step 1: Generate the raw scan table (Classes A/B/C)
# Step 2: Apply the 5-hard-indicator checklist using spreadsheet or script
# Step 3: Write 300-500 word analysis per survivor following the template
# Step 4: Select three firms based on portfolio complementarity rules
# Step 5: Generate four-master reports to produce final funnel output
Configuration Schema
industry_funnel:
industry: "AI算力"
scan:
include_markets: ["A股", "港股", "美股", "未上市"]
hard_filter:
pe: "reasonable"
roe: ">15%"
cash_flow_ratio: ">0.7"
debt_ratio: "<0.6"
moat: ">=3"
final_selection:
required:
- type: "high_certainty_low_volatility"
- type: "balanced"
- optional: "high_volatility_high_risk"
The tools/financial_rigor.py module provides precise PE/ROE/EV calculations referenced during the hard-indicator step, while tools/report_audit.py validates data completeness and source citations in the generated reports.
Summary
- The
/industry-funnelskill defined inskills/industry-funnel.mdimplements a four-stage leaky-bucket process starting with 30–60 companies. - Stage 1 uses a union of liquidity (A), momentum (B), and size (C) criteria to build the initial universe.
- Stage 2 applies five hard financial gates (PE, ROE >15%, cash flow >70%, debt <60%, moat ★★★) to reduce the pool to ≤10 candidates.
- Stage 3 requires structured 300–500 word qualitative analysis of business models, risks, and valuations.
- Stage 4 selects three companies based on portfolio complementarity (Buffett-type, growth-type, option-type) rather than simple ranking.
- Final outputs are written to
reports/{industry}-funnel-YYYYMMDD.mdwith four-master deep-dive analysis and position sizing.
Frequently Asked Questions
What happens if too many companies pass the hard financial filter?
If more than 12 companies survive the five-indicator screen, the system raises the moat threshold from ★★★ to ★★★★ and re-applies the filter until the pool is reduced to 10 or fewer candidates. This escalation ensures the qualitative analysis stage remains manageable and rigorous.
How does the skill handle different market types (A-shares, HK, US)?
The scan phase explicitly includes A-shares (A股), Hong Kong stocks (港股), US equities (美股), and unlisted companies (未上市) in the initial union pool. The hard-filter metrics (ROE thresholds, debt ratios) include sector-specific relaxations—for example, debt limits extend to 70% for utilities and ROE requirements relax for heavy-asset sectors.
What is the "four-master" report mentioned in the final stage?
The four-master report expands each final recommendation through the analytical lenses of four value investing practitioners: 段永平 (Duan Yongping), 巴菲特 (Warren Buffett), 芒格 (Charlie Munger), and 李录 (Li Lu). This multi-perspective analysis is generated as part of the final output file to stress-test investment theses against different value investing frameworks.
Can the funnel be automated or is it manual-only?
While the repository provides the skill definition in skills/industry-funnel.md and helper utilities in tools/financial_rigor.py, the workflow is designed as a structured markdown-driven process. Users can automate data retrieval and filtering using the Python API pattern, but the 300–500 word qualitative analyses and final portfolio-complementarity decisions require human judgment and are not fully automated.
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 →