# How the /industry-funnel Skill Filters Stocks: A 4-Layer Value Investing Architecture

> Discover how the /industry-funnel skill filters stocks using a 4-layer architecture. Uncover high-conviction investment opportunities through systematic quantitative screening and deep analysis.

- Repository: [Xbt Lin/ai-berkshire](https://github.com/xbtlin/ai-berkshire)
- Tags: architecture
- Published: 2026-07-29

---

**The `/industry-funnel` skill implements a systematic four-stage quantitative funnel that narrows a broad market universe down to three high-conviction stocks through layered screening, hard-filter criteria, structured granular analysis, and master-style deep dives.**

The `/industry-funnel` skill in the `xbtlin/ai-berkshire` repository provides a rigorous, reproducible framework for value-oriented stock selection based on Berkshire Hathaway investment principles. This skill applies a multi-layer filtering architecture that combines quantitative metrics with qualitative deep analysis to identify exceptional opportunities across A-share, HK, US, and international markets.

## The Four-Layer Funnel Architecture

According to the source code in [`skills/industry-funnel.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/industry-funnel.md), the skill processes stocks through four sequential layers, each with explicit inclusion criteria and mandatory audit trails. This design ensures that every elimination decision is documented and reproducible.

### Layer 1: Universe Screening (全市场扫描)

The first layer collects all active tickers from A-share, HK, US, and international markets, including future IPO candidates. As implemented in lines L41-L55 of [`skills/industry-funnel.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/industry-funnel.md), this stage merges three distinct sub-sets:

- **A-type**: Stocks ranked by 30-day average turnover
- **B-type**: Top-20 gainers over 30-day and 90-day periods
- **C-type**: Sector-wide top-30 companies by market capitalization

The union of these categories creates an initial pool of 30-60 tickers that advance to quantitative filtering.

### Layer 2: Value Investing Hard Filters (价值投资硬指标粗筛)

The second layer applies five quantitative "hard" filters to every candidate from Layer 1. Located at lines L82-L90 in [`skills/industry-funnel.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/industry-funnel.md), this stage requires **all five criteria to pass**, or alternatively **four passes plus one "near-pass"** (which must be explicitly highlighted).

If more than 12 companies survive this filter, the moat threshold tightens from ★★★★ to ★★★★ and the filter repeats until the pool is sufficiently narrow. This dynamic tightening mechanism ensures the funnel maintains a manageable cohort for deeper analysis.

### Layer 3: Granular Analysis (精细分析)

For the 10 or fewer survivors of Layer 2, the skill generates a structured 300-500-word analysis following a strict template defined in lines L13-L45. Each analysis covers:

- Business model assessment
- Financial quality evaluation
- Moat depth examination using the five-category taxonomy (brand, switching cost, network effect, scale, technology/license)
- Top-3 risk identification
- Valuation quick-check

### Layer 4: Four-Master Deep Dive (四大师深度分析)

The final stage subjects the top candidates to an 800-1200-word "four-master" analysis (段永平, 巴菲特, 芒格, 李录) as specified in lines L46-L53. Rather than purely rank-based selection, this layer enforces **portfolio complementarity**, ensuring the final three picks represent distinct risk profiles: core-stable, growth-mid, and high-beta.

## Governance, Audit Controls, and Bias Mitigation

The `/industry-funnel` skill incorporates explicit governance mechanisms to prevent black-box decisions. Every company removed at any stage must have a documented **"淘汰理由"** (elimination reason), creating a complete audit trail.

The workflow includes dedicated checks against:
- **AI-story bias**: Preventing narrative fallacies in automated research
- **English-source bias**: Ensuring non-English market coverage receives equal weight
- **Market-type bias**: Balancing large-cap incumbents against IPO candidates

The five-category moat taxonomy uses a ★-rating system throughout the pipeline, providing consistent evaluation criteria across all layers.

## How to Invoke the /industry-funnel Skill

You can execute the skill through CLI commands or programmatic Python wrappers.

Run the skill for a specific sector:

```bash
/industry-funnel AI Compute

```

Programmatic invocation using the Python wrapper:

```python
from ai_berkshire import invoke_skill

result = invoke_skill(
    "industry-funnel",
    args={"行业": "AI Compute"},
    output_path="reports/AI-Compute-funnel-20260729.md"
)
print(result['summary'])

```

Debug a specific layer using the audit tool:

```bash

# Layer 2 – hard-filter check

python3 tools/report_audit.py extract \
    --report reports/AI-Compute-funnel-20260729.md \
    --stage hard_filter

```

## Output Contract and Deliverables

The final report is written to `reports/{行业名}-funnel-{YYYYMMDD}.md` and must include data source links, estimation flags, and a self-assessment matrix. The [`tools/report_audit.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/report_audit.py) script validates the final report against mandatory data-source checklists to ensure compliance with the skill's quality standards.

## Summary

- The `/industry-funnel` skill uses a **four-layer sequential architecture** defined in [`skills/industry-funnel.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/industry-funnel.md) to filter thousands of stocks down to three high-conviction picks
- **Layer 1** creates a 30-60 ticker universe from A-share, HK, US, and IPO candidates using turnover, momentum, and market-cap criteria
- **Layer 2** applies five value-investing hard filters with dynamic threshold tightening when results exceed 12 survivors
- **Layer 3** generates 300-500 word structured analyses covering moats, risks, and valuations for up to 10 finalists
- **Layer 4** conducts 800-1200 word "four-master" deep dives, enforcing portfolio complementarity across the final three selections
- **Mandatory audit trails** require documented elimination reasons for every rejected stock, ensuring reproducibility and bias mitigation

## Frequently Asked Questions

### What makes the /industry-funnel skill different from standard stock screeners?

Unlike static screeners, the `/industry-funnel` skill implements **dynamic threshold tightening** and **mandatory narrative analysis**. When Layer 2 produces more than 12 survivors, the moat threshold automatically tightens from ★★★★ to ★★★★ and re-runs. Furthermore, every elimination requires a documented reason ("淘汰理由"), creating an audit trail impossible in traditional black-box filters.

### How does the skill prevent AI bias in stock selection?

The skill includes explicit bias checks against **AI-story bias**, **English-source bias**, and **market-type bias** (large-cap versus IPO candidates). These safeguards are documented in the "AI 研究偏见自觉" section of [`skills/industry-funnel.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/industry-funnel.md), ensuring the analysis weights non-English sources and smaller market candidates appropriately rather than favoring familiar large-cap narratives.

### What are the five value investing hard filters in Layer 2?

While the specific quantitative thresholds are configurable, the five hard filter categories evaluate: (1) **Profitability metrics**, (2) **Financial stability ratios**, (3) **Capital efficiency**, (4) **Earnings quality**, and (5) **Valuation bounds**. Companies must pass all five criteria or four plus one explicitly flagged near-pass to advance. If more than 12 companies qualify, the moat rating threshold tightens and the layer re-executes.

### Where are the final reports stored and how are they validated?

Final reports are written to `reports/{行业名}-funnel-{YYYYMMDD}.md` following a strict output contract that includes data source links and estimation flags. The [`tools/report_audit.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/report_audit.py) utility validates these reports against mandatory checklists, verifying that every claim is sourced and every elimination has a documented reason, ensuring the deliverable meets the skill's reproducibility standards.