Agent skill

Alpha Library

by VernonOY in VernonOY/alpha-skills

Factor library management. An agent skill from VernonOY/alpha-skills.

Apache-2.0Auto-check passedBusiness, Finance & HR

Install Alpha Library

skills CLI
$ npx skills add VernonOY/alpha-skills --skill alpha-library -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install VernonOY/alpha-skills alpha-library --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/VernonOY/alpha-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/alpha-library .claude/skills/alpha-library && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
alpha-library
GitHub stars
117
Token cost
~1.9k tokens
SKILL.md length
387 words
Files
1
Skills in repo
9
Repo updated
First seen
Licence
Apache-2.0

At a glance

Factor library management. An agent skill from VernonOY/alpha-skills.

  • Works in 4 steps: 如果数据库文件不存在,FactorRegistry会自动创建 / If DB… → 注册时如果名称已存在,会更新 / If name already exists… → 展示因子列表时按ICIR降序排列 / Display factor list… → …
  • Tasks that involve Trading and backtesting
  • SKILL.md covers Bilingual Terms / 双语术语, 项目定位 / Project Context, 子命令识别 / Sub-command Recognition and 操作实现 / Operation Implementation, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Alpha Library is an agent skill from VernonOY/alpha-skills. Factor library management. Register, list, search, retire factors. 因子库管理。注册、查看、搜索、退役因子。 Triggers: "show library", "register factor", "查看因子库", "注册因子"

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Business, Finance & HR, covering Trading and backtesting. It works with SQLite. The repository describes itself as: Quantitative factor research skills for AI coding assistants. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Trading and backtesting

Example prompts

  • “show library”
  • “register factor”
  • “/alpha-library”

Requirements

  • Python 3

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. 如果数据库文件不存在,FactorRegistry会自动创建 / If DB file doesn't exist, FactorRegistry auto-creates it
  2. 注册时如果名称已存在,会更新 / If name already exists on register, it updates(INSERT OR REPLACE)
  3. 展示因子列表时按ICIR降序排列 / Display factor list sorted by ICIR descending
  4. 退役操作不删除数据,只改状态为retired / Retire doesn't delete data, only changes status to retired

What it can do on your machine

Read from SKILL.md and the folder at commit f58f80a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python and markdown).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Alpha Library loads about 1.9k tokens when it runs. Until then it costs about 41 tokens; SKILL.md has 387 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~41
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from VernonOY/alpha-skills at commit f58f80a, republished under its Apache-2.0 licence (© VernonOY). 387 words, ~1,935 tokens.

Download SKILL.mdSave it as .claude/skills/alpha-library/SKILL.md (or your agent's skills folder).
name
alpha-library
description
Factor library management. Register, list, search, retire factors. 因子库管理。注册、查看、搜索、退役因子。 Triggers: "show library", "register factor", "查看因子库", "注册因子"

alpha-library — Factor Library Management / 因子库管理

你是一个量化因子库管理员。管理用户的因子注册表(SQLite存储)。 You are a quant factor library manager. Manage user's factor registry (SQLite storage).

Bilingual Terms / 双语术语

English中文
Factor因子
IC (Information Coefficient)信息系数
ICIR (IC Information Ratio)IC信息比率
Quintile五分位/分组
Long-Short多空
Sharpe Ratio夏普比率
Max Drawdown最大回撤
Monotonicity单调性
Robustness鲁棒性
Holding Period持有期
Factor Registry因子注册表
Backtest回测
Gate Check门控检查

项目定位 / Project Context

  • 因子注册表 Factor Registry: alpha_skills.db(项目根目录的SQLite数据库 SQLite database in project root)

Multi-Market Support / 多市场支持:

Alpha Skills support A-share (default), HK, and US stocks via data adapters: Alpha Skills 通过数据适配器支持A股(默认)、港股和美股:

markdown
# .claude/alpha-agent.config.md
MARKET: A-share           # or "HK" or "US"
DATA_MODULE: (leave empty for A-share Tushare default)
                          # or "examples.us_data_yfinance"
                          # or "examples.hk_data_yfinance"

When a custom DATA_MODULE is set, the skill loads MARKET_CONFIG from that module to determine benchmark, cost rate, and trading rules. 设置自定义DATA_MODULE时,skill从该模块加载MARKET_CONFIG来确定基准、成本和交易规则。

注册因子时建议记录 market 字段(A-share / HK / US),以便多市场因子库管理。 When registering factors, record the market field (A-share / HK / US) for multi-market library management.

Language Rule / 语言规则:

  • If the user speaks English, output in English
  • If the user speaks Chinese, output in Chinese
  • Table headers always show both languages: "IC Mean IC均值"

子命令识别 / Sub-command Recognition

根据用户意图执行对应操作 / Execute operation based on user intent:

User Says 用户说Operation 操作
"show library" / "查看因子库" / "my factors" / "我的因子" / "factor list" / "因子列表"→ list
"register factor" / "注册因子" / "add to library" / "加入因子库" / "添加因子"→ add
"factor XXX detail" / "因子XXX详情" / "show XXX" / "看看XXX"→ detail
"retire factor XXX" / "退役因子XXX" / "delete factor XXX" / "删除因子XXX"→ retire/delete
"search factor XXX" / "搜索因子XXX"→ search

操作实现 / Operation Implementation

list — Library Overview / 因子库总览
python
import sys, os, sqlite3, json, uuid
from datetime import datetime

PROJECT_DIR = "<当前工作目录 current working directory>"

# ── 因子注册表(自包含,无外部依赖)/ Factor Registry (self-contained, no external deps) ──

class FactorRegistry:
    def __init__(self, db_path="alpha_skills.db"):
        self.db_path = db_path
        with sqlite3.connect(db_path) as conn:
            conn.execute("""CREATE TABLE IF NOT EXISTS factors (
                id TEXT PRIMARY KEY, name TEXT UNIQUE NOT NULL,
                expression TEXT NOT NULL, category TEXT, description TEXT,
                status TEXT DEFAULT 'active', market TEXT DEFAULT 'A-share',
                ic_mean REAL, icir REAL, best_holding_period INTEGER,
                quality TEXT, eval_date TEXT,
                created_at TEXT DEFAULT CURRENT_TIMESTAMP, metadata TEXT)""")
    
    def register(self, name, expression, **kwargs):
        fid = str(uuid.uuid4())[:8]
        with sqlite3.connect(self.db_path) as conn:
            conn.execute(
                "INSERT OR REPLACE INTO factors (id,name,expression,category,description,status,market,ic_mean,icir,best_holding_period,quality,eval_date,metadata) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)",
                (fid, name, expression, kwargs.get("category",""), kwargs.get("description",""),
                 "active", kwargs.get("market","A-share"), kwargs.get("ic_mean"), kwargs.get("icir"),
                 kwargs.get("best_holding_period"), kwargs.get("quality"),
                 datetime.now().isoformat(), json.dumps(kwargs.get("metadata",{}))))
        return fid
    
    def list_all(self, status=None):
        with sqlite3.connect(self.db_path) as conn:
            conn.row_factory = sqlite3.Row
            if status:
                rows = conn.execute("SELECT * FROM factors WHERE status=? ORDER BY icir DESC", (status,)).fetchall()
            else:
                rows = conn.execute("SELECT * FROM factors ORDER BY icir DESC").fetchall()
            return [dict(r) for r in rows]
    
    def get(self, name):
        with sqlite3.connect(self.db_path) as conn:
            conn.row_factory = sqlite3.Row
            row = conn.execute("SELECT * FROM factors WHERE name=?", (name,)).fetchone()
            return dict(row) if row else None
    
    def update_status(self, name, status):
        with sqlite3.connect(self.db_path) as conn:
            conn.execute("UPDATE factors SET status=? WHERE name=?", (status, name))
    
    def delete(self, name):
        with sqlite3.connect(self.db_path) as conn:
            conn.execute("DELETE FROM factors WHERE name=?", (name,))

reg = FactorRegistry(os.path.join(PROJECT_DIR, "alpha_skills.db"))
factors = reg.list_all()

输出格式 / Output Format:

📚 Factor Library 因子库 (N factors/个因子)

Status 状态  Name 名称         Category 类别  ICIR    Rating 评级    Best HP 最佳持有期
🟢  pv_diverge         PV 量价    0.696   Strong    20 days/日
🟢  turnover_20        PV 量价    0.520   Moderate  20 days/日
🟡  reversal_5         PV 量价    0.365   Moderate  5 days/日
🔴  momentum_60        PV 量价   -0.451   Weak      -

🟢=active  🟡=warning  🔴=alert  ⚫=retired

状态图标映射 Status icon mapping: active→🟢, warning→🟡, alert→🔴, retired→⚫

如果因子库为空 / If library is empty,输出 output:

📚 Factor Library Empty / 因子库为空

No factors registered yet. You can: / 还没有注册任何因子。你可以:
- Say "evaluate XXX factor" / 说"评估XXX因子"来评估一个因子
- After evaluation, say "register to library" / 评估通过后说"加入因子库"来注册
Show full SKILL.md (148 more words)Show less
add — Register Factor / 注册因子

需要以下信息 Required info(部分可从上下文推断 some can be inferred from context):

  • name: 因子名称 Factor name(必需 required)
  • expression: 因子表达式或函数调用 Factor expression or function call(必需 required)
  • category: 类别 Category(PV 量价 / Fundamental 基本面 / Valuation 估值 / Capital Flow 资金流 / Composite 复合)
  • market: 市场 Market(A-share / HK / US,从配置的 MARKET 字段获取 read from config MARKET field)
  • description: 简短描述 Short description
  • ic_mean, icir, best_holding_period, quality: 评估指标 Evaluation metrics(如果刚做完alpha-evaluate,从上下文获取 if just done alpha-evaluate, get from context)
python
reg.register(
    name="pv_diverge",
    expression="price_volume_divergence(close, volume, 20)",
    category="量价",
    market="A-share",  # 从配置读取 read from config
    description="20日量价背离因子 / 20-day price-volume divergence factor",
    ic_mean=0.066,
    icir=0.696,
    best_holding_period=20,
    quality="strong"
)

输出 Output:

✅ Factor Registered / 因子已注册

Name 名称: pv_diverge
Category 类别: PV 量价
Rating 评级: Strong (ICIR=0.696)
Status 状态: 🟢 active
detail — Factor Detail / 因子详情
python
info = reg.get("pv_diverge")

输出因子的完整信息,包括表达式、所有评估指标、注册时间、当前状态。 Output full factor info including expression, all evaluation metrics, registration time, current status.

retire — Retire Factor / 退役因子
python
reg.update_status("old_factor", "retired")

退役前确认 Confirm before retiring:"Retire factor XXX? / 确定要退役因子XXX吗?"

search — Search Factors / 搜索因子
python
results = reg.search("量价")

注意事项 / Notes

  1. 如果数据库文件不存在,FactorRegistry会自动创建 / If DB file doesn't exist, FactorRegistry auto-creates it
  2. 注册时如果名称已存在,会更新 / If name already exists on register, it updates(INSERT OR REPLACE)
  3. 展示因子列表时按ICIR降序排列 / Display factor list sorted by ICIR descending
  4. 退役操作不删除数据,只改状态为retired / Retire doesn't delete data, only changes status to retired

© VernonOY, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/alpha-library of VernonOY/alpha-skills.

Open the folder on GitHubat commit f58f80a

Compare with similar skills

Alpha Library next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Alpha Library compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Alpha Library this skillVernonOY/alpha-skills117—~1.9kAutomated safety check: PassApache-2.0
Polymarket Paper Traderagent-next/polymarket-paper-trader473—~2.6kAutomated safety check: PassMIT
Pp Sec Edgarmvanhorn/printing-press-library2.1k—~3.8kAutomated safety check: NotesApache-2.0
Tushare Datazillionare/zillionare3212 repos~2.3kAutomated safety check: PassNone
Tradingview MCPatilaahmettaner/tradingview-mcp5k—~1.3kAutomated safety check: PassMIT
Digital Oraclekomako-workshop/digital-oracle875—~5.9kAutomated safety check: PassMIT

Similar skills

  • Polymarket Paper Trader

    agent-next/polymarket-paper-trader

    Everyone's trading Polymarket with AI agents. An agent skill from agent-next/polymarket-paper-trader.

    473 GitHub stars~2.6k tokensUpdated today
    Business, Finance & HRAuto-check passed
  • Pp Sec Edgar

    mvanhorn/printing-press-library

    Every SEC filing, every XBRL fact, every insider trade — synced into a local SQLite store you can pivot, search, and watch offline.

    2.1k GitHub stars~3.8k tokensUpdated today
    DatabasesAuto-check: notes
  • Tushare Data

    zillionare/zillionare

    面向中文自然语言的 Tushare 数据研究技能。用于把“看看这只股票最近怎么样”“帮我查财报趋势”“最近哪个板块最强”“北向资金在买什么”“给我导出一份行情数据”这类请求,转成可执行的数据获取、清洗、对比、筛选、导出与简要分析流程。适用于 A 股、指数、ETF/基金、财务、估值、资金流、公告新闻、板块概念与宏观数据等研究场景。

    321 GitHub starsUsed in 2 repos~2.3k tokens
    Business, Finance & HRAuto-check passed
  • Tradingview MCP

    atilaahmettaner/tradingview-mcp

    AI Trading Intelligence — live prices, 30+ technical indicators, backtesting (6 strategies), walk-forward overfitting detection, trade logs, equity curves, licensed news sentiment (Marketaux), and…

    5k GitHub stars~1.3k tokensUpdated yesterday
    Business, Finance & HRAuto-check passed
  • Digital Oracle

    komako-workshop/digital-oracle

    Answer prediction questions using market trading data, not opinions.

    875 GitHub stars~5.9k tokensUpdated 2 mo ago
    Business, Finance & HRAuto-check passed
  • Polyclaw

    chainstacklabs/polyclaw

    Trade on Polymarket via split + CLOB execution. An agent skill from chainstacklabs/polyclaw.

    359 GitHub starsUsed in 1 repo~2k tokens
    Business, Finance & HRAuto-check passed

More from VernonOY/alpha-skills

All 9 skills in this repo
  • Alpha Autopilot

    VernonOY/alpha-skills

    Autonomous factor research loop. An agent skill from VernonOY/alpha-skills.

    117 GitHub stars~2.8k tokensUpdated 5 mo ago
    Auto-check passed
  • Alpha Backtest

    VernonOY/alpha-skills

    Strategy backtest. An agent skill from VernonOY/alpha-skills.

    117 GitHub stars~3.7k tokensUpdated 5 mo ago
    Auto-check passed
  • Alpha Discover

    VernonOY/alpha-skills

    Factor discovery. An agent skill from VernonOY/alpha-skills.

    117 GitHub stars~1.6k tokensUpdated 5 mo ago
    Auto-check passed
  • Alpha Mine

    VernonOY/alpha-skills

    Automated factor mining. An agent skill from VernonOY/alpha-skills.

    117 GitHub stars~3.5k tokensUpdated 5 mo ago
    Auto-check passed
  • Alpha Monitor

    VernonOY/alpha-skills

    Factor monitoring. An agent skill from VernonOY/alpha-skills.

    117 GitHub stars~1.7k tokensUpdated 5 mo ago
    Auto-check passed
  • Alpha Report

    VernonOY/alpha-skills

    Factor reports. An agent skill from VernonOY/alpha-skills.

    117 GitHub stars~998 tokensUpdated 5 mo ago
    Auto-check passed

Works with

Questions about Alpha Library

What does Alpha Library do?

Factor library management. An agent skill from VernonOY/alpha-skills. Alpha Library is an agent skill from VernonOY/alpha-skills. Factor library management.

When should I use Alpha Library?

Alpha Library fits situations like: tasks that involve Trading and backtesting.

How do I install Alpha Library in Claude Code?

Run `npx skills add VernonOY/alpha-skills --skill alpha-library -a claude-code`. Or copy the skill folder (skills/alpha-library in VernonOY/alpha-skills) into .claude/skills/alpha-library in your project. Claude Code loads it when a task matches its description.

How do I install Alpha Library in Codex?

Run `npx skills add VernonOY/alpha-skills --skill alpha-library -a codex`. Or copy the skill folder (skills/alpha-library in VernonOY/alpha-skills) into .agents/skills/alpha-library in your project. Codex loads it when a task matches its description.

Can I use Alpha Library in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add VernonOY/alpha-skills --skill alpha-library -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/alpha-library, .gemini/skills/alpha-library, .github/skills/alpha-library and .opencode/skills/alpha-library in your project.

What does Alpha Library need to run?

SKILL.md names no scripts, command-line tools or credentials: Alpha Library is instructions for the agent only. Our summary lists: Python 3.

Does Alpha Library access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Alpha Library safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Alpha Library use?

Alpha Library is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Alpha Library use?

About 1.9k tokens (SKILL.md is roughly 7.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Alpha Library?

Skills that share tags, products or a category with Alpha Library: Polymarket Paper Trader (agent-next/polymarket-paper-trader, 473 stars), Pp Sec Edgar (mvanhorn/printing-press-library, 2.1k stars), Tushare Data (zillionare/zillionare, 321 stars) and Tradingview MCP (atilaahmettaner/tradingview-mcp, 5k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Alpha Library?

VernonOY (a GitHub user) maintains it in VernonOY/alpha-skills, which has 117 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on April 14, 2026.

Source: VernonOY/alpha-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.