Skip to main content
ClaudeWave
Skill32.3k repo starsupdated 3d ago

strategy-dev-manager

Strategy Development Manager: convert academic papers and research reports into validated factors and strategies with automated backtesting, persistent storage, and decay monitoring.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/HKUDS/Vibe-Trading /tmp/strategy-dev-manager && cp -r /tmp/strategy-dev-manager/agent/src/skills/strategy-dev-manager ~/.claude/skills/strategy-dev-manager
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# Strategy Development Manager

## Purpose

SDM orchestrates the full lifecycle from academic paper or research report to validated factor or strategy. It ingests documents, extracts quantitative signals, implements and backtests them through the existing tool chain, evaluates results against statistical thresholds, and monitors long-term decay. SDM does not reinvent any step. It delegates to the tools already available (read_document, factor_analysis, backtest, alpha_bench, and the hypothesis/autopilot stack) and adds a thin coordination layer with persistent artifact tracking.

Use this skill whenever a user wants to go from "here is a paper" to "I have a working, monitored factor or strategy in the system."

## When to Use

Decision tree for routing user requests:

- User provides a paper or report path → **Phase 1: INGEST**
- User says "extract factors from this paper" → **Phase 2: EXTRACT**
- User says "implement and backtest" or "run the backtest" → **Phase 3: IMPLEMENT**
- User says "evaluate results" or "check if it works" → **Phase 4: EVALUATE**
- User says "check decay" or "monitor factors" → **Phase 5: MONITOR**
- User says "disable factor" → `sdm_status(action="disable", artifact_id=...)`
- User says "enable factor" → `sdm_status(action="enable", artifact_id=...)`
- User says "list my factors" or "show status" → `sdm_status(action="list")`

When the user's intent spans multiple phases (for example "read this paper and build a factor"), run the phases sequentially from INGEST through EVALUATE.

## Workflow

### Phase 1: INGEST

Parse the source document and classify its content.

1. Call `read_document(paper_path)` to extract the full text from the PDF or report.
2. Classify the paper type:
   - **factor-research**: the paper proposes one or more cross-sectional factors with formulas (for example Jegadeesh and Titman 1993, Fama-French 1993)
   - **strategy**: the paper describes entry/exit rules, position sizing, and risk management (for example Avramov and Chordia 2006, turtle trading)
   - **mixed**: the paper contains both factor definitions and strategy rules
3. Extract key information from the parsed text:
   - Methodology description
   - Mathematical formulas (preserve LaTeX notation)
   - Variable definitions and data requirements
   - Universe and time period studied
   - Performance metrics reported in the paper

### Phase 2: EXTRACT

Turn the parsed content into structured artifact definitions.

1. **For factors**, extract:
   - `name`: short identifier (for example "momentum_12_1")
   - `formula_latex`: the mathematical formula as written in the paper
   - `variables`: list of input variables and their meanings
   - `columns_required`: OHLCV columns or fundamental fields needed
   - `universe`: target market (for example "equity_us", "equity_cn")
   - `decay_horizon`: recommended holding period in trading days

2. **For strategies**, extract:
   - `name`: short identifier
   - `entry_rules`: conditions that trigger a long or short position
   - `exit_rules`: conditions that close a position
   - `position_sizing`: how to allocate capital across selected instruments
   - `risk_management`: stop-loss, max drawdown, exposure limits
   - `universe`: target market
   - `columns_required`: data fields needed

3. **Deduplication check**: call `alpha_bench` or check `sdm_status(action="list")` to see if a similar artifact already exists. If the Pearson IC between the new factor and an existing alpha exceeds 0.99, treat it as a duplicate and stop. IC between 0.90 and 0.99 may be a variant worth keeping with a note.

4. **Register the artifact**: call `sdm_register(artifact_type, name, universe, ...)` to persist the extracted definition with status "extracted".

### OCR Quality Check

After ingesting a paper via `read_document`, check the `ocr_quality` field in the response:

- `quality_flag == "good"`: proceed with extraction
- `quality_flag == "degraded"`: warn user that some pages could not be OCR'd, suggest manual review
- `quality_flag == "no_ocr_engine"`: suggest installing an OCR engine — `pip install rapidocr_onnxruntime` for local, or set `VIBE_TRADING_OCR_ENGINE=llm-vision` to use a vision-capable LLM model (GPT-4o, Qwen-VL, etc.) via your existing provider config
- `text_density < 100`: flag as potentially low-quality extraction, suggest verifying formulas manually

### Phase 3: IMPLEMENT

Build the SignalEngine, run the backtest, and link results.

1. Call `create_hypothesis(title, thesis, universe, signal_definition)` to create a research hypothesis that tracks this work.
2. Call `generate_backtest_config(hypothesis_id, start_date, end_date)` to produce the `config.json` for the backtest runner.
3. Call `scaffold_signal_engine(hypothesis_id, run_dir)` to generate the skeleton `signal_engine.py` in the run directory.
4. Implement the full `signal_engine.py` using the appropriate template from `templates/`:
   - Factor artifacts → `templates/factor_signal_engine.py`
   - Strategy artifacts → `templates/strategy_signal_engine.py`
5. Validate syntax: `bash("python -c \"import ast; ast.parse(open('code/signal_engine.py').read()); print('OK')\"")`
6. Call `backtest(run_dir)` to execute the backtest.
7. Call `link_autopilot_backtest(hypothesis_id, run_dir)` to link the run results back to the hypothesis.
8. Call `sdm_status(action="detail", artifact_id=...)` and update the artifact status to "benching".

### Phase 4: EVALUATE

Judge the backtest output against quality thresholds.

1. **For factors**: call `factor_analysis` with the factor CSV and return CSV. Check:
   - IC mean > 0.03 (basic predictive power)
   - IR > 0.5 (stable effectiveness)
   - IC positive ratio > 55% (directional stability)

2. **For strategies**: read `artifacts/metrics.csv` and `run_card.json`. Check:
   - Sharpe ratio > 0.5 (minimum acceptable)
   - Max drawdown < 30% (risk tolerance)
   - Win rate and profit factor for additional context

3. **If the artifact is alive** (meets thresholds):
vibe-tradingSkill

Professional finance research toolkit — backtesting (10 engines + benchmark comparison panel), factor analysis, Alpha Zoo (462 pre-built alphas across qlib158/alpha101/gtja191/academic/fundamental), options pricing, 90 finance skills, 30 multi-agent swarm teams, Trade Journal analyzer, and Shadow Account (extract → backtest → render) across 25 market-data sources (tushare, yfinance, okx, binance, akshare, baostock, tencent, mootdx, ccxt, futu, mt5, tickerall, local, eastmoney, sina, stooq, yahoo, pykrx, india_broker, qveris, longbridge, plus optional-key finnhub/alphavantage/tiingo/fmp).

adr-hshareSkill

ADR/H-share/A-share cross-listing premium analysis — track pricing gaps between US-listed ADRs, HK-listed H-shares, and A-shares for arbitrage signals, dual-listing valuation, and delisting risk assessment.

akshareSkill

AKShare financial data aggregator (18k+ stars). Free, no API key. Covers A-shares, US, HK, futures, macro, forex. Primary fallback for tushare and yfinance.

alpha-zooSkill

Browse and bench the bundled alpha zoos — prebuilt cross-sectional factor libraries (Kakushadze 101, GTJA 191, Qlib 158, Fama-French / Carhart). Use when the user asks "which alphas exist", wants metadata on a named alpha, or wants to run IC/IR on a whole zoo over a universe.

ashare-pre-st-filterSkill

A 股 ST/*ST 风险预测框架 — 基于最新中报/三季报或业绩预告/快报,预测下一财年是否会因营收、利润、净资产、分红不达标而被风险警示,并将新浪监管处罚记录作为独立证据面纳入风险等级。仅适用于 A 股,不预测财务造假。

asset-allocationSkill

Asset allocation theory and optimizer usage — MPT / Black-Litterman / risk budgeting / all-weather strategy, including guides for 5 optimizers and rebalancing rules.

backtest-diagnoseSkill

Diagnose failed or underperforming backtests, locate the root cause, and fix the issue

behavioral-financeSkill

Behavioral finance applications: theories of overreaction and underreaction, behavioral explanations for momentum and reversal, investor sentiment cycles, cognitive-bias checklists, and debiasing quantitative strategies.