# vernonoy/alpha-skills architecture

> Architecture diagram of the GitHub repository vernonoy/alpha-skills, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vernonoy/alpha-skills
- Repository: https://github.com/vernonoy/alpha-skills

## Overview

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`](https://github.com/vernonoy/alpha-skills/blob/main/knowledge/README.md) (Knowledge), [`README.md`](https://github.com/vernonoy/alpha-skills/blob/main/README.md) (README), [`skills/alpha-evaluate/SKILL.md`](https://github.com/vernonoy/alpha-skills/blob/main/skills/alpha-evaluate/SKILL.md) (Evaluate), [`skills/alpha-library/SKILL.md`](https://github.com/vernonoy/alpha-skills/blob/main/skills/alpha-library/SKILL.md) (Library)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_root["Root"]
  node_node_readme["README<br/>overview<br/>[README.md]"]
end

subgraph group_group_skills["Skills"]
  node_node_skill_discover["Discover<br/>skill module<br/>[SKILL.md]"]
  node_node_skill_evaluate["Evaluate<br/>skill module<br/>[SKILL.md]"]
  node_node_skill_mine["Mine<br/>skill module<br/>[SKILL.md]"]
  node_node_skill_library[("Library<br/>skill module<br/>[SKILL.md]")]
  node_node_skill_backtest["Backtest<br/>skill module<br/>[SKILL.md]"]
  node_node_skill_monitor["Monitor<br/>skill module<br/>[SKILL.md]"]
  node_node_skill_report["Report<br/>skill module<br/>[SKILL.md]"]
  node_node_skill_signal["Signal<br/>skill module<br/>[SKILL.md]"]
  node_node_skill_autopilot["Autopilot<br/>skill module<br/>[SKILL.md]"]
end

subgraph group_group_knowledge["Knowledge"]
  node_node_knowledge_readme["Knowledge<br/>methodology docs<br/>[README.md]"]
  node_node_knowledge_eval["Eval method<br/>methodology docs"]
  node_node_knowledge_taxonomy["Taxonomy<br/>domain docs<br/>[factor-taxonomy.md]"]
  node_node_knowledge_micro["Microstructure<br/>domain docs"]
  node_node_knowledge_portfolio["Portfolio<br/>domain docs"]
  node_node_knowledge_regime["Regime<br/>domain docs<br/>[regime-analysis.md]"]
  node_node_knowledge_risk["Risk<br/>domain docs"]
end

subgraph group_group_examples["Examples"]
  node_node_examples_readme["Examples<br/>usage docs<br/>[README.md]"]
  node_node_example_hk["HK adapter<br/>market adapter example"]
  node_node_example_us["US adapter<br/>market adapter example"]
end

node_node_readme -->|"loads"| node_node_skill_discover
node_node_readme -->|"guides"| node_node_skill_evaluate
node_node_readme -->|"governs"| node_node_skill_library
node_node_readme -->|"references"| node_node_knowledge_readme
node_node_readme -->|"shows"| node_node_examples_readme
node_node_skill_discover -->|"feeds"| node_node_skill_mine
node_node_skill_mine -->|"screens"| node_node_skill_evaluate
node_node_skill_evaluate -->|"registers"| node_node_skill_library
node_node_skill_library -->|"supplies"| node_node_skill_backtest
node_node_skill_backtest -->|"watches"| node_node_skill_monitor
node_node_skill_monitor -->|"summarizes"| node_node_skill_report
node_node_skill_library -->|"activates"| node_node_skill_signal
node_node_skill_signal -->|"loops into"| node_node_skill_autopilot
node_node_skill_report -->|"closes loop"| node_node_skill_autopilot
node_node_knowledge_readme -->|"organizes"| node_node_knowledge_eval
node_node_knowledge_readme -->|"organizes"| node_node_knowledge_taxonomy
node_node_knowledge_readme -->|"organizes"| node_node_knowledge_micro
node_node_knowledge_readme -->|"organizes"| node_node_knowledge_portfolio
node_node_knowledge_readme -->|"organizes"| node_node_knowledge_regime
node_node_knowledge_readme -->|"organizes"| node_node_knowledge_risk
node_node_examples_readme -->|"demonstrates"| node_node_example_hk
node_node_examples_readme -->|"demonstrates"| node_node_example_us
node_node_example_hk -.->|"supports"| node_node_skill_discover
node_node_example_us -.->|"supports"| node_node_skill_backtest
node_node_knowledge_micro -.->|"constrains"| node_node_skill_evaluate
node_node_knowledge_portfolio -.->|"constrains"| node_node_skill_backtest
node_node_knowledge_risk -.->|"guards"| node_node_skill_evaluate

click node_node_readme "https://github.com/vernonoy/alpha-skills/blob/main/README.md"
click node_node_skill_discover "https://github.com/vernonoy/alpha-skills/blob/main/skills/alpha-discover/SKILL.md"
click node_node_skill_evaluate "https://github.com/vernonoy/alpha-skills/blob/main/skills/alpha-evaluate/SKILL.md"
click node_node_skill_mine "https://github.com/vernonoy/alpha-skills/blob/main/skills/alpha-mine/SKILL.md"
click node_node_skill_library "https://github.com/vernonoy/alpha-skills/blob/main/skills/alpha-library/SKILL.md"
click node_node_skill_backtest "https://github.com/vernonoy/alpha-skills/blob/main/skills/alpha-backtest/SKILL.md"
click node_node_skill_monitor "https://github.com/vernonoy/alpha-skills/blob/main/skills/alpha-monitor/SKILL.md"
click node_node_skill_report "https://github.com/vernonoy/alpha-skills/blob/main/skills/alpha-report/SKILL.md"
click node_node_skill_signal "https://github.com/vernonoy/alpha-skills/blob/main/skills/alpha-signal/SKILL.md"
click node_node_skill_autopilot "https://github.com/vernonoy/alpha-skills/blob/main/skills/alpha-autopilot/SKILL.md"
click node_node_knowledge_readme "https://github.com/vernonoy/alpha-skills/blob/main/knowledge/README.md"
click node_node_knowledge_eval "https://github.com/vernonoy/alpha-skills/blob/main/knowledge/evaluation-methodology.md"
click node_node_knowledge_taxonomy "https://github.com/vernonoy/alpha-skills/blob/main/knowledge/factor-taxonomy.md"
click node_node_knowledge_micro "https://github.com/vernonoy/alpha-skills/blob/main/knowledge/market-microstructure.md"
click node_node_knowledge_portfolio "https://github.com/vernonoy/alpha-skills/blob/main/knowledge/portfolio-construction.md"
click node_node_knowledge_regime "https://github.com/vernonoy/alpha-skills/blob/main/knowledge/regime-analysis.md"
click node_node_knowledge_risk "https://github.com/vernonoy/alpha-skills/blob/main/knowledge/risk-and-pitfalls.md"
click node_node_examples_readme "https://github.com/vernonoy/alpha-skills/blob/main/examples/README.md"
click node_node_example_hk "https://github.com/vernonoy/alpha-skills/blob/main/examples/hk_data_yfinance.py"
click node_node_example_us "https://github.com/vernonoy/alpha-skills/blob/main/examples/us_data_yfinance.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_node_readme toneBlue
class node_node_skill_discover,node_node_skill_evaluate,node_node_skill_mine,node_node_skill_library,node_node_skill_backtest,node_node_skill_monitor,node_node_skill_report,node_node_skill_signal,node_node_skill_autopilot toneAmber
class node_node_knowledge_readme,node_node_knowledge_eval,node_node_knowledge_taxonomy,node_node_knowledge_micro,node_node_knowledge_portfolio,node_node_knowledge_regime,node_node_knowledge_risk toneMint
class node_node_examples_readme,node_node_example_hk,node_node_example_us toneRose
```

## Components

### Root

Repository entry points and overview

- [README](https://github.com/vernonoy/alpha-skills/blob/main/README.md): overview · Top-level repo overview and operating model · `README.md`

### Skills

Prompt-driven research workflow modules

- [Discover](https://github.com/vernonoy/alpha-skills/blob/main/skills/alpha-discover/SKILL.md): skill module · Find candidate factors · `skills/alpha-discover/SKILL.md`
- [Evaluate](https://github.com/vernonoy/alpha-skills/blob/main/skills/alpha-evaluate/SKILL.md): skill module · Score factors with IC, quintiles, and robustness checks · `skills/alpha-evaluate/SKILL.md`
- [Mine](https://github.com/vernonoy/alpha-skills/blob/main/skills/alpha-mine/SKILL.md): skill module · Extract and refine factors from data · `skills/alpha-mine/SKILL.md`
- [Library](https://github.com/vernonoy/alpha-skills/blob/main/skills/alpha-library/SKILL.md): skill module · Register, search, and retire factors · `skills/alpha-library/SKILL.md`
- [Backtest](https://github.com/vernonoy/alpha-skills/blob/main/skills/alpha-backtest/SKILL.md): skill module · Translate factors into portfolio performance · `skills/alpha-backtest/SKILL.md`
- [Monitor](https://github.com/vernonoy/alpha-skills/blob/main/skills/alpha-monitor/SKILL.md): skill module · Watch for decay, crowding, and regime shifts · `skills/alpha-monitor/SKILL.md`
- [Report](https://github.com/vernonoy/alpha-skills/blob/main/skills/alpha-report/SKILL.md): skill module · Summarize research outputs for review · `skills/alpha-report/SKILL.md`
- [Signal](https://github.com/vernonoy/alpha-skills/blob/main/skills/alpha-signal/SKILL.md): skill module · Generate active trading signals · `skills/alpha-signal/SKILL.md`
- [Autopilot](https://github.com/vernonoy/alpha-skills/blob/main/skills/alpha-autopilot/SKILL.md): skill module · Run the continuous research loop · `skills/alpha-autopilot/SKILL.md`

### Knowledge

Methodology and domain guidance

- [Knowledge](https://github.com/vernonoy/alpha-skills/blob/main/knowledge/README.md): methodology docs · Entry to factor research guidance · `knowledge/README.md`
- [Eval method](https://github.com/vernonoy/alpha-skills/blob/main/knowledge/evaluation-methodology.md): methodology docs · Evaluation levels and screening logic · `knowledge/evaluation-methodology.md`
- [Taxonomy](https://github.com/vernonoy/alpha-skills/blob/main/knowledge/factor-taxonomy.md): domain docs · Factor categories and naming patterns · `knowledge/factor-taxonomy.md`
- [Microstructure](https://github.com/vernonoy/alpha-skills/blob/main/knowledge/market-microstructure.md): domain docs · Market mechanics and constraints · `knowledge/market-microstructure.md`
- [Portfolio](https://github.com/vernonoy/alpha-skills/blob/main/knowledge/portfolio-construction.md): domain docs · Construction and allocation guidance · `knowledge/portfolio-construction.md`
- [Regime](https://github.com/vernonoy/alpha-skills/blob/main/knowledge/regime-analysis.md): domain docs · Regime analysis and shift detection · `knowledge/regime-analysis.md`
- [Risk](https://github.com/vernonoy/alpha-skills/blob/main/knowledge/risk-and-pitfalls.md): domain docs · Pitfalls, bias, and failure modes · `knowledge/risk-and-pitfalls.md`

### Examples

Market adapter and usage examples

- [Examples](https://github.com/vernonoy/alpha-skills/blob/main/examples/README.md): usage docs · Adapter patterns and market examples · `examples/README.md`
- [HK adapter](https://github.com/vernonoy/alpha-skills/blob/main/examples/hk_data_yfinance.py): market adapter example · Yahoo Finance Hong Kong example · `examples/hk_data_yfinance.py`
- [US adapter](https://github.com/vernonoy/alpha-skills/blob/main/examples/us_data_yfinance.py): market adapter example · Yahoo Finance US example · `examples/us_data_yfinance.py`

## Connections

- 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
