How vernonoy/alpha-skills works
1. Repository purpose
- This is not a traditional application with a compiled runtime; it is a prompt-driven quant research framework for AI coding assistants.
- The core product is a set of 9 skill modules that teach an assistant how to discover, evaluate, mine, backtest, monitor, report, and operationalize factors.
2. Primary architectural boundary
- The key boundary is between the natural-language assistant layer and the Python analytics layer.
- The assistant reads skills/*/SKILL.md, translates user intent into Python workflows, and executes those workflows using standard data-science libraries.
- The repository intentionally avoids a heavy framework; the skill markdown files are the “control plane.”
3. Skill subsystem layout
- Each skill is self-contained in its own folder under skills/:
- alpha-discover, alpha-evaluate, alpha-mine, alpha-library, alpha-backtest, alpha-monitor, alpha-report, alpha-signal, alpha-autopilot
- These represent distinct research stages rather than UI pages or services.
- The architecture is modular by function: each skill owns a narrow research responsibility and can be loaded independently into a coding assistant.
4. Research workflow pipeline
- The intended flow is: discover → evaluate → mine → register/library → backtest → monitor → report/signal → autopilot.
- alpha-discover and alpha-mine generate candidate factors.
- alpha-evaluate applies IC/ICIR, quintiles, long-short, and robustness checks.
- alpha-library stores and manages factor lifecycle.
- alpha-backtest converts selected factors into portfolio-level performance.
- alpha-monitor watches for decay/crowding/regime shifts.
- alpha-report summarizes outputs for human review.
- alpha-autopilot ties the loop together into a continuous research cycle.
5. Data and market adapters
- Market data is external and pluggable, not owned by the repo.
- The README highlights three supported market contexts:
- A-share via Tushare Pro
- Hong Kong and US via Yahoo Finance
- examples/README.md and the example scripts show the expected adapter shape, meaning the repo treats data access as a replaceable boundary.
- This design lets the same factor logic run across different markets with market-specific rules.
6. Multi-market execution model
- The repo encodes market-aware constraints as part of the research engine, not as separate products.
- A-share differs from HK/US in trading rules such as T+1 vs T+0, price limits, transaction costs, and benchmarks.
- This affects both factor evaluation and backtesting, so the market context is part of the input to the analysis pipeline.
7. Core analytical runtime
- The computational layer is standard Python data science: pandas, numpy, scipy, matplotlib, pyarrow.
- The README positions these as the execution substrate for factor computation, IC analysis, ranking, backtesting, and report generation.
- This means the repo’s “engine” is mostly analytical code generated or orchestrated by the assistant, not a long-running server.
8. Factor evaluation and robustness boundary
- The methodology is structured into levels:
- L0 validation
- L1 quick IC screen
- L2 full factor evaluation
- L3 robustness analysis
- This creates a quality gate between candidate generation and library registration/backtesting.
- Optional static pre-flight checks via qtype are mentioned as a guard against look-ahead bias and invalid formulas.
9. Factor library and lifecycle management
- alpha-library acts as the repository’s factor registry boundary.
- The README describes registration, listing, searching, and retirement, with SQLite as the persistence mechanism.
- Conceptually, this is the system of record for factors that survive evaluation and are eligible for monitoring, signal generation, or autopilot reuse.
10. Outputs and operational artifacts
- The main artifacts are not API responses but research outputs: IC summaries, factor rankings, backtest metrics, saved plots, and target portfolio signals.
- alpha-report produces presentation-ready research reports.
- alpha-signal produces daily trading-signal outputs from active factors.
- These outputs close the loop from research to action, but still remain file- or report-oriented rather than service-oriented.
11. Knowledge base as methodology layer
- The knowledge/ directory is a documentation subsystem containing domain guidance on evaluation methodology, factor taxonomy, market microstructure, portfolio construction, regime analysis, and pitfalls.
- This is important architecturally because the assistant is expected to use these docs as the “policy and theory layer” behind generated research steps.
- In practice, the knowledge base constrains how the skills should reason about alpha, overfitting, and market behavior.
12. Examples and extensibility
- examples/ demonstrates how to connect real market data sources and switch between markets.
- The repo is designed to be extended by adding new data adapters or new skill markdowns rather than modifying a central application.
- That makes the architecture highly composable: the core unit is a skill plus a data adapter, not a monolithic service.
Main entry points: knowledge/README.md Knowledge · README.md README · alpha-evaluate/SKILL.md Evaluate · alpha-library/SKILL.md Library
Components 20
Root
Repository entry points and overview
- README · Top-level repo overview and operating model
README.md
Skills
Prompt-driven research workflow modules
- Discover · Find candidate factors
skills/alpha-discover/SKILL.md - Evaluate · Score factors with IC, quintiles, and robustness checks
skills/alpha-evaluate/SKILL.md - Mine · Extract and refine factors from data
skills/alpha-mine/SKILL.md - Library · Register, search, and retire factors
skills/alpha-library/SKILL.md - Backtest · Translate factors into portfolio performance
skills/alpha-backtest/SKILL.md - Monitor · Watch for decay, crowding, and regime shifts
skills/alpha-monitor/SKILL.md - Report · Summarize research outputs for review
skills/alpha-report/SKILL.md - Signal · Generate active trading signals
skills/alpha-signal/SKILL.md - Autopilot · Run the continuous research loop
skills/alpha-autopilot/SKILL.md
Knowledge
Methodology and domain guidance
- Knowledge · Entry to factor research guidance
knowledge/README.md - Eval method · Evaluation levels and screening logic
knowledge/evaluation-methodology.md - Taxonomy · Factor categories and naming patterns
knowledge/factor-taxonomy.md - Microstructure · Market mechanics and constraints
knowledge/market-microstructure.md - Portfolio · Construction and allocation guidance
knowledge/portfolio-construction.md - Regime · Regime analysis and shift detection
knowledge/regime-analysis.md - Risk · Pitfalls, bias, and failure modes
knowledge/risk-and-pitfalls.md
Examples
Market adapter and usage examples
- Examples · Adapter patterns and market examples
examples/README.md - HK adapter · Yahoo Finance Hong Kong example
examples/hk_data_yfinance.py - US adapter · Yahoo Finance US example
examples/us_data_yfinance.py
Connections 27
- README → Discover: loads · Assistant starts with discover workflow
- README → Evaluate: guides · Evaluation methodology is central
- README → Library: governs · Factor lifecycle and registry boundary
- README → Knowledge: references · Methodology and theory layer
- README → Examples: shows · Adapter and market usage patterns
- Discover → Mine: feeds · Candidate discovery progresses to mining
- Mine → Evaluate: screens · Mined factors are evaluated next
- Evaluate → Library: registers · Surviving factors enter the library
- Library → Backtest: supplies · Registered factors can be backtested
- Backtest → Monitor: watches · Live or simulated performance is monitored
- Monitor → Report: summarizes · Monitoring results are reported
- Library → Signal: activates · Library factors can produce signals
- Signal → Autopilot: loops into · Signals feed the continuous cycle
- Report → Autopilot: closes loop · Reports inform the next research cycle
- Knowledge → Eval method: organizes · Knowledge base structures the methodology
- Knowledge → Taxonomy: organizes · Factor taxonomy guidance
- Knowledge → Microstructure: organizes · Market microstructure guidance
- Knowledge → Portfolio: organizes · Portfolio construction guidance
- Knowledge → Regime: organizes · Regime analysis guidance
- Knowledge → Risk: organizes · Bias and pitfall guidance
- Examples → HK adapter: demonstrates · Hong Kong data adapter pattern
- Examples → US adapter: demonstrates · US data adapter pattern
- HK adapter → Discover: supports · Adapter data is consumed by research workflows
- US adapter → Backtest: supports · Market-specific data feeds backtesting
- Microstructure → Evaluate: constrains · Market rules affect factor evaluation
- Portfolio → Backtest: constrains · Portfolio rules shape backtests
- Risk → Evaluate: guards · Bias and overfitting checks