$npx -y skills add minihellboy/factorminer --skill factor-miningDiscover alpha factors by running the FactorMiner research engine — the paper-faithful Ralph loop or the enhanced Helix loop (causal validation, regime conditioning, multi-specialist debate, canonicalization). Use to generate a new factor library from a validated dataset. Trigger
| 1 | # Factor Mining |
| 2 | |
| 3 | This skill runs FactorMiner's self-evolving discovery loop: it retrieves memory priors, proposes candidate factor formulas with an LLM, evaluates them, and admits the survivors to a factor library. |
| 4 | |
| 5 | See `references/loop-architecture.md` for the stage-by-stage loop design and `references/dsl-operators.md` for the factor-formula operator vocabulary. |
| 6 | |
| 7 | ## Choosing the loop |
| 8 | |
| 9 | | Use | When | |
| 10 | |---|---| |
| 11 | | `mine` (Ralph loop) | Default. Paper-faithful Algorithm 1 — retrieve, generate, evaluate, admit, evolve memory. | |
| 12 | | `helix` (Helix loop) | When you want Phase 2 features: do-calculus causal validation, regime-conditional evaluation, multi-specialist debate generation, or SymPy canonicalization. Drop-in superset of Ralph. | |
| 13 | |
| 14 | ## Workflow |
| 15 | |
| 16 | ### 1. Confirm prerequisites |
| 17 | |
| 18 | The dataset must already pass `factor-data` validation. Confirm the iteration budget — mining cost scales with `iterations × batch-size`. |
| 19 | |
| 20 | ### 2. Run the Ralph loop |
| 21 | |
| 22 | ```bash |
| 23 | factorminer -o output/run1 mine \ |
| 24 | --data path/to/market_data.csv \ |
| 25 | --iterations 40 --batch-size 16 --target 30 |
| 26 | ``` |
| 27 | |
| 28 | - `--iterations` — maximum mining iterations (the loop also stops early once `--target` factors are admitted). |
| 29 | - `--batch-size` — candidate factors proposed per iteration. |
| 30 | - `--target` — desired library size. |
| 31 | - `--resume path/to/factor_library.json` — continue a previous run. |
| 32 | - `--mock` — synthetic data + mock LLM, no API calls. Use only for smoke tests. |
| 33 | |
| 34 | ### 3. Or run the Helix loop |
| 35 | |
| 36 | ```bash |
| 37 | factorminer -o output/run1 helix \ |
| 38 | --data path/to/market_data.csv \ |
| 39 | --iterations 40 --batch-size 16 --target 30 \ |
| 40 | --causal --regime --debate --canonicalize |
| 41 | ``` |
| 42 | |
| 43 | Each `--feature / --no-feature` flag overrides the config; omit a flag to keep the config default. Phase 2 features cost extra compute and LLM calls — enable the ones the research question needs. |
| 44 | |
| 45 | ### 4. Inspect the result |
| 46 | |
| 47 | ```bash |
| 48 | factorminer session inspect output/run1 --json |
| 49 | ``` |
| 50 | |
| 51 | Report library size, iteration count, and yield rate. The factor library is written to `output/run1/factor_library.json`; the run log to `session_log.json`. |
| 52 | |
| 53 | ## Guardrails |
| 54 | |
| 55 | - Mining proposes formulas; it does not prove them. Always follow with `factor-evaluation` on the held-out split. |
| 56 | - A low yield rate usually means thresholds are too strict for the dataset, not that the data is bad — tune `ic_threshold` / `correlation_threshold` in config, do not silently relax them in a report. |
| 57 | - `--mock` output is never a research result; never present mock metrics as real. |
| 58 | |
| 59 | ## MCP alternative |
| 60 | |
| 61 | When the FactorMiner MCP server is connected, `mine_factors` and `helix_mine` expose the same workflow as tools, returning a structured session summary directly. |