agentleFS
qunyou-agentqunyou-agent/finance-skills/skills/development/code-review-finance/SKILL.md

code-review-finance

Skill4 starsChanged 4 months agoMITView on GitHub

Reviews code with awareness of financial domain pitfalls: lookahead bias, data leakage, proper decimal handling, survivorship bias, overfitting, and correct backtesting methodology. Trigger when the user requests code review of trading or financial code.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Lookahead bias: verify no future data used in signal calculation (.shift(1) is correct, raw access is suspicious)

    line 27
  2. Distinctive:

    Read strategy logic, understand the core idea

    line 38
  3. Distinctive:

    Check temporal integrity — no peeking into future at any step

    line 40
  4. Distinctive:

    Verify metric formulas against standard definitions

    line 41

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Code Review (Finance-Aware)

Reviews code for financial-domain-specific correctness issues beyond general code quality.

Real Code Reference

  • tradinglearn/strategies/macd_strategy.py — generate_signals() uses .shift() to prevent lookahead; verify this is correct
  • tradinglearn/backtest/backtester.py — run_backtest() iterates bars sequentially; verify order
  • tradinglearn/pytdx2/backtest.py — BacktestEngine has its own execution loop; check for data leakage between train/test

What to Check

  • Lookahead bias: verify no future data used in signal calculation (.shift(1) is correct, raw access is suspicious)
  • Data leakage: train/test split must be temporal, not random — data[:split_date] train, data[split_date:] test
  • Decimal handling: prices in cents vs yuan — K-line returns /1000, quotes return /100
  • Survivorship bias: delisted stocks must be in historical universes
  • Overfitting: parameter count vs data points ratio, out-of-sample validation
  • Transaction costs: commission rate, slippage assumptions must be realistic
  • Bid/ask spread: execution at mid-price is unrealistic for illiquid stocks
  • Dividend handling: total return should include dividends

Review Process

  1. Read strategy logic, understand the core idea
  2. Trace data flow from raw prices → indicators → signals → trades
  3. Check temporal integrity — no peeking into future at any step
  4. Verify metric formulas against standard definitions
  5. Assess overfitting risk from parameter count and search space
  6. Report findings: critical / warning / suggestion

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.