Agent skill

Alpha Desk Investment Research

by JingHao-Leon in JingHao-Leon/dsh-alpha-desk

Runs an AI investment research desk around the aihf hedge-fund CLI, with research cycles, backtests and iFinD data, under a risk gate and a rule against placing real trades.

MITAuto-check: notesBusiness, Finance & HR

SKILL.md written in Chinese; this summary is our English description.

Install Alpha Desk Investment Research

skills CLI
$ npx skills add JingHao-Leon/dsh-alpha-desk --skill alpha-desk -a claude-code

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

GitHub CLI
$ gh skill install JingHao-Leon/dsh-alpha-desk alpha-desk --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/JingHao-Leon/dsh-alpha-desk.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skill .claude/skills/alpha-desk && 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-desk
GitHub stars
181
Token cost
~1.3k tokens
SKILL.md length
285 words
Files
1
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Runs an AI investment research desk around the aihf hedge-fund CLI, with research cycles, backtests and iFinD data, under a risk gate and a rule against placing real trades.

  • Running an AI hedge-fund analysis cycle on a few US stock tickers
  • SKILL.md covers 前置条件检查(每次会话首次使用前执行), 核心概念:mandate(基金委托书), 工作流一:单次投研周期("今天这只基金怎么看这几只票") and 工作流二:回测("这套策略过去一年表现如何"), plus 7 more sections
  • Calls python3, python and pipx; needs DEEPSEEK_API_KEY and ANTHROPIC_API_KEY
  • Backtesting an investing strategy over a past period

What it does

The skill orchestrates virattt/ai-hedge-fund, whose command is aihf, inside a dsh session, alongside iFinD data and local technical analysis skills for A-share and Hong Kong stocks. Compliance comes first: the output is research and education rather than investment advice, so every conclusion carries a disclaimer. Real trading is not executed, and broker order and fund transfer commands are refused even when the risk-gate plugin is absent. The agent also warns that aihf spends your LLM API quota.

Setup checks that aihf is installed through pipx or uv tool and that a financial data API key and one LLM key are present, stopping to ask instead of inventing data. A mandate YAML defines strategy, investor-style models (graham, buffett, munger, lynch, druckenmiller) plus a quantitative earnings-drift model, risk, capital and rebalance frequency, while tickers are passed at run time; three sample mandates are included.

One workflow runs a single research cycle and saves a JSON record for review, and the agent reads out each model's reasoning before the combined position change. Another runs a backtest and reports return against the benchmark, maximum drawdown, win rate and the rebalances that helped or hurt most, after estimating the LLM cost and noting that past results do not predict future returns.

When your agent uses it

  • Running an AI hedge-fund analysis cycle on a few US stock tickers
  • Backtesting an investing strategy over a past period
  • Comparing how investor-style models would view the same stocks
  • Querying filings, shareholder counts or earnings forecasts through iFinD
  • Reviewing an investment thesis after a run

Example prompts

  • “用 deep-value-weekly 对 AAPL 和 MSFT 做一次研究周期,并解读各模型的理由。”
  • “Backtest the deep value mandate on AAPL, MSFT and NVDA since the start of last year and report the drawdown.”
  • “Estimate the LLM cost of a backtest before running it.”

Requirements

  • The aihf CLI, installed with pipx or uv tool
  • A financial data API key and one LLM API key

What it can do on your machine

Read from SKILL.md and the folder at commit 1fe6dec. 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

    Shell commands in SKILL.md call:

    • python3
    • python
    • pipx
    • uv

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

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

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

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • DEEPSEEK_API_KEY
    • ANTHROPIC_API_KEY
    • FINANCIAL_DATASETS_API_KEY
    • OPENAI_API_KEY
    • GOOGLE_API_KEY
    • XAI_API_KEY
    • KIMI_API_KEY

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

Context cost

Alpha Desk Investment Research loads about 1.3k tokens when it runs. Until then it costs about 92 tokens; SKILL.md has 285 words of instructions outside code blocks.

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

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: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:23
    需要两类 key(导出在 shell 环境,或写入 `~/.hedge-fund/.env`):
  • NoteMentions a .env fileSKILL.md:72
    t-gw 访问同花顺 iFinD,凭证由脚本自行解析(plugins/ifind/.env 或本机 Kimi 桌面端配置),不需要用户提供任何账号,也不依赖环境变量注入。
  • NoteMentions a .env fileSKILL.md:132
    - 禁止:修改 `~/.hedge-fund/.env` 之外的任何凭证文件。

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 JingHao-Leon/dsh-alpha-desk at commit 1fe6dec, republished under its MIT licence (© JingHao-Leon). 285 words, ~1,315 tokens.

Download SKILL.mdSave it as .claude/skills/alpha-desk/SKILL.md (or your agent's skills folder).
name
alpha-desk
description
AI 投研工作台——在 deepseek-harness 里编排 virattt/ai-hedge-fund(美股多策略 AI 基金,支持回测)、iFinD 权威数据源(经 plugins/ifind 访问,财报/公告/股东/预测/选股,A股港股美股)与本地 A股/港股技术分析技能,配合 risk-gate 风控钩子、定时盯盘与投资记忆,完成"分析→回测→解读→复盘"的完整投研闭环。当用户要求分析美股、运行 AI 基金、回测策略、比较投资大师观点、生成投研报告、定时盯盘、复盘投资假设,或查询财报/财务报表/公告/股东户数/业绩预测/智能选股/iFinD/同花顺数据时使用。触发词:AI 基金、对冲基金、回测、巴菲特、格雷厄姆、投研、美股分析、盯盘、复盘、iFinD、同花顺、股东户数、财务报表、公告、业绩预测。

Alpha Desk — AI 投研工作台

把 dsh 会话变成一个投研交易台:底层引擎是 virattt/ai-hedge-fund(MIT,CLI 名 aihf),上层由 dsh 的 skill / hook / cron / memory 扩展点编排。

硬性合规线(每次回复都要遵守):

  • 本技能输出的是研究与教育内容,不是投资建议;每次给出结论时附上免责声明:"本内容仅供学习研究,不构成投资建议。"
  • 暂不执行真实交易。risk-gate 插件会拦截实盘命令,但即使插件未安装,也不得运行任何券商下单、资金划转命令。用户要求实盘时,明确拒绝并说明原因。
  • aihf 内部对 LLM 信号的调用本身会消耗用户的 LLM API 额度,运行前先告知。

前置条件检查(每次会话首次使用前执行)

bash
command -v aihf && aihf --help | head -5

未安装则:pipx install aihf(或 uv tool install aihf)。

运行需要两类 key(导出在 shell 环境,或写入 ~/.hedge-fund/.env):

  • FINANCIAL_DATASETS_API_KEY — 行情与基本面数据(financialdatasets.ai,有免费档)
  • 一个 LLM key:DEEPSEEK_API_KEY(推荐,与 dsh 同栈)或 ANTHROPIC_API_KEY / OPENAI_API_KEY / GOOGLE_API_KEY / XAI_API_KEY / KIMI_API_KEY

aihf 默认推理模型是 claude-sonnet-5(走 Anthropic)。用 DeepSeek 时,任选其一:

  • export HEDGE_FUND_LLM_MODEL=deepseek-v4-pro(全局默认)
  • 或在命令里加 --model deepseek-v4-pro(单次覆盖)

缺 key 时停下来让用户提供,不要伪造数据、不要编造回测结果。所有数字必须来自 aihf 的真实输出。

核心概念:mandate(基金委托书)

mandate 是一个 YAML,描述"交易台"本身——策略、投资大师模型、风控、资金、再平衡频率——不含股票代码;标的是运行时通过 --tickers 传入的。本仓库 mandates/ 目录自带三份:

文件风格再平衡适用场景
deep-value-weekly.yaml格雷厄姆×2 + 巴菲特 + 芒格,70% 价值 + 30% 财报漂移量化weekly默认首选,稳健演示
fundamental-ls-market-neutral.yaml五位大师投票的多空市场中性monthly展示多空推理
inflections-daily.yaml德鲁肯米勒 + 林奇的宏观拐点daily压力测试风控

可用的 alpha 模型(models[].name):graham、buffett、munger、lynch、druckenmiller(LLM 驱动);pead(财报漂移,量化,不消耗 LLM 额度)。用户想自定义组合时,复制一份 mandate 改写即可。

工作流一:单次投研周期("今天这只基金怎么看这几只票")

bash
aihf mandates/deep-value-weekly.yaml --tickers AAPL,MSFT,NVDA --out records/cycle-$(date +%F).json
  • stdout 是纯 JSON(CycleRecord),人类摘要走 stderr;始终用 --out 落盘到 records/ 供复盘。
  • CycleRecord 关键字段:strategies[].signals[](每个模型的 value ∈ [-1,1] 看多/看空强度 + reasoning 文字理由)、positions(成交后持股)、equity_before、skipped(数据缺失的票及原因)。
  • 解读时:先念各模型的 reasoning 原文要点,再给综合仓位变化——"巴菲特为什么看多、格雷厄姆为什么反对"是用户最想看的。分歧要明确指出,不要和稀泥。

工作流二:回测("这套策略过去一年表现如何")

bash
aihf mandates/deep-value-weekly.yaml --tickers AAPL,MSFT,NVDA --backtest --start 2025-08-01 --out records/backtest-$(date +%F).json
  • 回测从 --start 到 --date(默认今天)按 mandate 的再平衡频率逐周期运行,输出含净值曲线与基准(mandate 里的 benchmark)对比指标。
  • 解读必给:累计收益 vs 基准、最大回撤、胜率,以及哪几次调仓贡献/拖累最大(从逐周期记录里定位)。
  • 回测耗 LLM 额度 = 周期数 × 模型数 × 标的数,运行前估算并告知用户(例:weekly × 52 周 × 3 个 LLM 模型 × 3 只票 ≈ 468 次调用)。想省钱就先缩短区间或减少模型。
  • 明确提醒:历史回测不代表未来收益。

工作流三:A股/港股联动

aihf 只覆盖美股。用户问 A股/港股时,改用 stock-technical-indicators 技能(如已安装)。两边结果可以同框对比(例:"同一套价值逻辑在美股和 A股各自选出什么"),但要讲清两边引擎和数据源不同,结论不可直接互换。

工作流三·五:iFinD 权威数据(plugins/ifind,免 iFinD 账号)

需要权威基本面/公告/股东/预测数据时(财务报表、业务分部、股东户数、业绩预告、智能选股),用本仓库 plugins/ifind/ifind_tool.py——它经 Kimi agent-gw 访问同花顺 iFinD,凭证由脚本自行解析(plugins/ifind/.env 或本机 Kimi 桌面端配置),不需要用户提供任何账号,也不依赖环境变量注入。

bash
# 1. 先读 API 目录(9 个 API 的参数、ticker 格式、覆盖范围约定)
terminal/.venv/bin/python plugins/ifind/ifind_tool.py describe

# 2. 按目录的参数约定调用(必须用 terminal/.venv/bin/python,它有 agent-gw SDK)
terminal/.venv/bin/python plugins/ifind/ifind_tool.py call ifind_get_financial_statements \
  --params-json '{"ticker": "600519.SH", ...}'

规则:

  • 必须先 describe 再 call,参数严格按返回的目录构造(ticker 格式:A股 600519.SH、港股 0001.HK、美股 AAPL.O)。
  • 公告与业绩预测仅覆盖 A 股;调用失败时如实报告错误,禁止编造财务数字。
  • 引用数据时带上报告期/币种/数据口径限定语。
  • 与 gtimg 行情的分工:盘中报价/K线走行情网关,基本面与公告走 ifind。

工作流四:定时盯盘(cron)

用户要求"每天盘前/盘后自动跑"时,用 dsh 的定时任务能力注册调度,例如:

  • 美东盘前(北京时间 21:30 前):跑工作流一,输出当日信号摘要
  • 每周五收盘后:跑回测增量更新 + 本周假设复盘

定时任务产出的记录同样落盘 records/。

工作流五·五:公开预测台账(ledger/,对外可验证)

每次给出可结算的方向性观点(某标的在某时间窗内看多/看空/横盘)时,除了写进记忆,还要入台账:

bash
python3 tools/ledger.py new --symbol <代码> --market cn|hk|us --direction long|short|neutral \
  --confidence <0~1> --horizon <YYYY-MM-DD> --rationale "<理由,必填>" \
  --source "workflow:<来源>" [--invalidate-if "<失效条件>"]

规则:

  • rationale 必填且要具体(依据什么数据/逻辑)——没有理由的观点不入台账。
  • confidence 是自评置信度,事后会做校准统计(声明 0.7 的预测是否 70% 命中),不要拍脑袋给 0.9。
  • new 会自动 git commit;尽快 push(公开时间戳才成立)。commit 后不可改写已入库的预测。
  • 到期后(或用户要求复盘时):python3 tools/ledger.py settle,然后 python3 tools/ledger.py report --write 更新 stats.md,并把结果 commit + push。
  • 结算是机械的(收盘价 + 死区 + 方向),禁止人工改判定结果;数据缺失会记 void 不计分。
  • 台账战绩从零累积、拒绝回填:如实展示 miss 与低胜率,这比虚假战绩值钱。

工作流六:投资记忆与复盘

  • 每次给出一个观点时,把"假设"写进记忆:标的、方向、理由、预期时间窗、失效条件。
  • 复盘时取出历史假设,对照 records/ 里的实际信号与走势,逐条判定对错,并总结哪类假设胜率高。
  • 这是本工作台区别于一次性问答的核心:观点要被记录、被检验、被追责。

失败处理

  • skipped 非空 → 告知用户哪些票数据缺失(常见于新股、退市、数据源未覆盖),不要静默忽略。
  • 报 ANTHROPIC_API_KEY not found 之类错误 → 说明用户没配 LLM key 或没指定模型;提示配 DEEPSEEK_API_KEY 并加 --model deepseek-v4-pro,不要擅自换成别的 provider。
  • 网络/额度错误 → 原样报告 stderr,不要重试超过两次。
  • 用户给的 mandate 路径不存在 → 先用 ls mandates/ 列出可用的,让用户选。

安全红线(risk-gate 插件已装时由其强制执行,未装时自律)

  • 禁止:任何券商 API/CLI 下单命令(ibkr、alpaca、tda、富途、老虎等)、向券商域名发写请求、--live 类参数。
  • 禁止:修改 ~/.hedge-fund/.env 之外的任何凭证文件。
  • 允许:aihf 的全部只读/回测用法、数据查询、报告生成。

© JingHao-Leon, MIT. 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 skill of JingHao-Leon/dsh-alpha-desk.

Open the folder on GitHubat commit 1fe6dec

Compare with similar skills

Alpha Desk Investment Research 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 Desk Investment Research compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Alpha Desk Investment Research this skillJingHao-Leon/dsh-alpha-desk181—~1.3kAutomated safety check: NotesMIT
Quant Buddy Market Data and Backtestingpseudo-longinus/quant-buddy-skills193—~11kAutomated safety check: PassMIT
Stock Market Data MCP QueryYourdaylight/stock_datasource189—~1.1kAutomated safety check: PassMIT
Vibe-Trading Finance ToolkitHKUDS/Vibe-Trading35k—~6.5kAutomated safety check: PassMIT
Fundamental Factor ScreeningHKUDS/Vibe-Trading35k—~1.7kAutomated safety check: PassMIT
Stock Analysisalirezarezvani/claude-skills28k—~8.5kAutomated safety check: PassMIT

Similar skills

  • Quant Buddy Market Data and Backtesting

    pseudo-longinus/quant-buddy-skills

    Queries A-share, Hong Kong and US stock quotes, valuation and financial data through the Quant Buddy API, and runs screening, factor calculation and strategy backtests.

    193 GitHub stars~11k tokensUpdated yesterday
    Business, Finance & HRAuto-check passed
  • Stock Market Data MCP Query

    Yourdaylight/stock_datasource

    Queries historical A-share, Hong Kong stock, ETF and index data through an MCP server: daily K-lines, financial statements, market indicators and screening.

    189 GitHub stars~1.1k tokensUpdated 1 mo ago
    Business, Finance & HRAuto-check passed
  • Finance research toolkit with backtesting, factor analysis, a library of prebuilt alphas, options pricing and a Shadow Account loop that tests rules extracted from your trade journal.

    35k GitHub stars~6.5k tokensUpdated today
    Business, Finance & HRAuto-check passed
  • Builds value or growth stock screens from PE, PB, ROE and financial statement fields for backtests, using tushare data for A-shares and yfinance for Hong Kong and US stocks.

    35k GitHub stars~1.7k tokensUpdated today
    Business, Finance & HRAuto-check passed
  • Stock Analysis

    alirezarezvani/claude-skills

    Produce a rigorous, sector-relative, multi-factor fundamental analysis of a publicly listed company — Indian (NSE/BSE) or US/global.

    28k GitHub stars~8.5k tokensUpdated 1 mo ago
    Business, Finance & HRAuto-check passed
  • Eastmoney Market Data

    HKUDS/Vibe-Trading

    Index of Eastmoney's free, no-token market data interfaces for China A-shares and Hong Kong stocks: fund flows, dragon-tiger lists, margin trading, reports and news.

    35k GitHub stars~1k tokensUpdated today
    Business, Finance & HRAuto-check passed

Works with

Questions about Alpha Desk Investment Research

What does Alpha Desk Investment Research do?

Runs an AI investment research desk around the aihf hedge-fund CLI, with research cycles, backtests and iFinD data, under a risk gate and a rule against placing real trades. The skill orchestrates virattt/ai-hedge-fund, whose command is aihf, inside a dsh session, alongside iFinD data and local technical analysis skills for A-share and Hong Kong stocks. Compliance comes first: the output is research and education rather than investment advice, so every conclusion carries a disclaimer.

When should I use Alpha Desk Investment Research?

Alpha Desk Investment Research fits situations like: running an AI hedge-fund analysis cycle on a few US stock tickers; backtesting an investing strategy over a past period; comparing how investor-style models would view the same stocks; querying filings, shareholder counts or earnings forecasts through iFinD.

How do I install Alpha Desk Investment Research in Claude Code?

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

How do I install Alpha Desk Investment Research in Codex?

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

Can I use Alpha Desk Investment Research 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 JingHao-Leon/dsh-alpha-desk --skill alpha-desk -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-desk, .gemini/skills/alpha-desk, .github/skills/alpha-desk and .opencode/skills/alpha-desk in your project.

What does Alpha Desk Investment Research need to run?

Going by SKILL.md and its folder, Alpha Desk Investment Research needs the command-line tools its instructions call (python3, python, pipx and uv) and credentials named DEEPSEEK_API_KEY, ANTHROPIC_API_KEY, FINANCIAL_DATASETS_API_KEY and OPENAI_API_KEY. Our summary lists: The aihf CLI, installed with pipx or uv tool; A financial data API key and one LLM API key.

Does Alpha Desk Investment Research access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is Alpha Desk Investment Research safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Alpha Desk Investment Research use?

Alpha Desk Investment Research is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Alpha Desk Investment Research use?

About 1.3k tokens (SKILL.md is roughly 5.3k 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 Desk Investment Research?

Skills that share tags, products or a category with Alpha Desk Investment Research: Quant Buddy Market Data and Backtesting (pseudo-longinus/quant-buddy-skills, 193 stars), Stock Market Data MCP Query (Yourdaylight/stock_datasource, 189 stars), Vibe-Trading Finance Toolkit (HKUDS/Vibe-Trading, 35k stars) and Fundamental Factor Screening (HKUDS/Vibe-Trading, 35k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Alpha Desk Investment Research?

JingHao-Leon (a GitHub user) maintains it in JingHao-Leon/dsh-alpha-desk, which has 181 GitHub stars. The repository was last updated on September 23, 2026.

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