How wbh604/fund-guy-skill works
Purpose and entry points
Fund Guy Skill is a Python-backed agent skill for auditing Chinese mutual-fund manager behavior from public disclosures, rather than judging raw NAV returns. Its primary CLI entry point is run.py; agent-specific invocation is defined by skills/fund-manager-alpha/SKILL.md and exposed to Claude through commands/analyze-fund.md, commands/quick-check.md, and commands/find-similar.md.
Orchestration and audit contract
run.py coordinates a fund-code-specific pipeline: fetch source evidence, compute behavioral analyses, and emit an offline single-file HTML report. The skill document is the methodological control plane: it requires manager-tenure segmentation, excludes passive position reductions from sell judgments, separates beta from alpha, and labels unavailable evidence rather than inventing it.
Paths: run.py, skills/fund-manager-alpha/SKILL.md, AGENTS.md.
Evidence acquisition and cache boundary
Fetch scripts gather fund NAV/history, quarterly holdings, manager metadata, subscriptions/redemptions, peer funds, market comparisons, gate announcements, stock industries, and price series. Raw source responses are intended to persist in an untracked .cache/ evidence store, isolating volatile external APIs from reproducible downstream analysis.
Paths: scripts/fetch_fund.py, scripts/fetch_stock_klines.py, scripts/fetch_pingzhong.py.
Holdings and market-data enrichment
The pipeline enriches disclosed holdings with A-share/HK weekly K-lines and industry classification, then builds comparison universes: same-house funds, market-wide similar holders, and current top-performing funds. This creates the benchmark boundary needed for behavior attribution rather than standalone portfolio description.
Paths: scripts/fetch_stock_industry.py, scripts/fetch_house.py, scripts/fetch_market_similar.py.
Core behavioral analytics
Fund analysis reconstructs buy/add/reduce/exit behavior from periodic holdings and evaluates subsequent returns, timing, drawdown handling, passive-reduction cases, and score components. House analysis measures manager divergence from firm peers and tests whether independent decisions subsequently outperformed. Gate analysis separately evaluates subscription restrictions/openings against market levels and later outcomes; these are contextual cards, not behavior-score inputs.
Paths: scripts/analyze_fund.py, scripts/analyze_house.py, scripts/analyze_gates.py.
Supplemental forensic modules
Add-on analysis covers year-end ranking behavior, overlap among products managed by the same person, post-opening subscription cohorts, “star manager” red-flag screening, and K-line scenarios. Replay-data generation and K-line renderers transform analysis output into visual event timelines.
Paths: scripts/analyze_addons.py, scripts/build_replay_data.py, scripts/render_kline_interactive.py.
Report assembly and runtime dependencies
build_fund_report.py composes all data and analyses into assets/fund-.html, a self-contained interactive report designed to work offline. Static prototype HTML files are presentation references, while the production builder is the report boundary. Runtime is Python 3.9+ with dependencies in requirements.txt; upstream services include Eastmoney/东方财富 (often through AkShare), Baostock, Sina Finance, and TradingView Lightweight Charts.
Paths: scripts/build_fund_report.py, assets/fund-163417.html, requirements.txt.
Main entry points: run.py Pipeline CLI · build_fund_report.py Offline report builder · analyze_fund.py Holdings behavior · fetch_fund.py Fund disclosures
Components 17
Invocation
- Audit methodology · Defines tenure, attribution, and evidence-availability rules.
skills/fund-manager-alpha/SKILL.md - Agent guidance
AGENTS.md - Claude commands · Analyze, quick-check, and similar-fund invocations.
- Pipeline CLI · Runs the fund-code-specific evidence-to-report pipeline.
run.py
Evidence & Enrichment
- Market data providers · Eastmoney, AkShare, Baostock, Sina Finance, and chart data services.
- Fund disclosures · Retrieves NAV, holdings, managers, flows, peers, and gate evidence.
scripts/fetch_fund.py - Prices & industries · Retrieves stock K-lines and industry classifications.
scripts/fetch_stock_klines.py - Comparison universes · Builds house-peer and market-similar holder benchmarks.
scripts/fetch_house.py - Raw evidence cache · Untracked cache isolates external responses from downstream analysis.
Behavior Analytics
- Holdings behavior · Reconstructs trades, attribution, timing, drawdowns, and score components.
scripts/analyze_fund.py - House divergence · Measures manager independence and subsequent peer-relative outcomes.
scripts/analyze_house.py - Subscription gates · Evaluates gate events separately from behavior scoring.
scripts/analyze_gates.py - Supplemental forensics · Covers ranking behavior, manager overlap, cohorts, and red flags.
scripts/analyze_addons.py - Replay timelines · Transforms analysis output into event timeline data.
scripts/build_replay_data.py
Report Output
- Offline report builder · Composes evidence and analyses into a self-contained interactive report.
scripts/build_fund_report.py - Fund HTML report · Self-contained interactive audit report.
assets/fund-163417.html - Python runtime · Python 3.9+ dependencies for the pipeline.
requirements.txt
Connections 24
- Audit methodology → Pipeline CLI: governs
- Agent guidance → Pipeline CLI: guides
- Claude commands → Pipeline CLI: invokes
- Pipeline CLI → Fund disclosures: fetches
- Pipeline CLI → Prices & industries: fetches
- Pipeline CLI → Comparison universes: builds
- Market data providers → Fund disclosures: disclosures
- Market data providers → Prices & industries: prices and sectors
- Market data providers → Comparison universes: peer data
- Fund disclosures → Raw evidence cache: persists raw data
- Prices & industries → Raw evidence cache: persists enrichment
- Comparison universes → Raw evidence cache: persists benchmarks
- Raw evidence cache → Holdings behavior: holdings and market evidence
- Raw evidence cache → House divergence: house benchmark evidence
- Raw evidence cache → Subscription gates: gate and market evidence
- Raw evidence cache → Supplemental forensics: supplemental evidence
- Holdings behavior → Replay timelines: events
- Holdings behavior → Offline report builder: behavior results
- House divergence → Offline report builder: peer results
- Subscription gates → Offline report builder: context cards
- Supplemental forensics → Offline report builder: forensic cards
- Replay timelines → Offline report builder: timeline data
- Offline report builder → Fund HTML report: emits
- Python runtime → Pipeline CLI: runs