agentleFS
Nunchi-tradeNunchi-trade/agent-cli/skills/reflect/SKILL.md

reflect-performance-review

Skill521 starsChanged 7 months agoMITView on GitHub

Reflect, Evaluate, Fine-tune, Learn, Evolve, Correct, Transform — nightly automated performance review

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:

    Load: Read trade log from data/cli/trades.jsonl

    line 23
  2. Distinctive:

    Run REFLECT every night after trading stops — no exceptions

    line 57
  3. Distinctive:

    ALWAYS read the full report before the next trading session

    line 58
  4. Distinctive:

    NEVER ignore FDR warnings — fees silently kill profitability

    line 62

≈ “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

REFLECT — Reflect, Evaluate, Fine-tune, Learn, Evolve, Correct, Transform

Nightly automated performance review engine. APEX runs all day — REFLECT reviews every trade at night, computing metrics, detecting patterns, and producing data-driven improvement recommendations.

Architecture

trades.jsonl → ReflectEngine.compute() → ReflectMetrics → ReflectReporter.generate() → report.md
  1. Load: Read trade log from data/cli/trades.jsonl
  2. Pair: FIFO round-trip matching (buys to sells per instrument)
  3. Compute: Win rate, PF, FDR, holding periods, direction analysis, monster dependency
  4. Recommend: Rule-based recommendations from metrics
  5. Report: Full markdown report saved to data/reflect/YYYY-MM-DD.md
  6. Distill: 3-5 line summary for agent memory

Key Metrics

MetricFormulaHealthy Range
Win Ratewinning_trades / total_trades> 50%
Profit Factor (Gross)gross_wins / gross_losses> 1.5
Profit Factor (Net)(gross_wins - fees) / gross_losses> 1.2
FDR (Fee Drag Ratio)total_fees / gross_wins * 100< 20%
Monster Dependencybest_trade_pnl / net_pnl * 100< 50%
Max Consecutive Losseslongest loss streak< 5

Usage

hl reflect run                      # Review since last report
hl reflect run --since 2026-03-01   # Review from specific date
hl reflect report                   # View latest report
hl reflect report --date 2026-03-03 # View specific date
hl reflect history                  # Show metric trend over time
hl reflect history -n 30            # Last 30 reports

Agent Mandate

You are the REFLECT reviewer. Your job is to analyze every trade from the past session, compute performance metrics, identify weaknesses, and produce actionable recommendations. You run nightly — the APEX runs by day, you review at night.

RULES:

  • Run REFLECT every night after trading stops — no exceptions
  • ALWAYS read the full report before the next trading session
  • Act on CRITICAL recommendations immediately (FDR > 30%, win rate < 35%)
  • Track recommendations across reports — if the same issue appears 3+ times, escalate
  • Save the distilled summary to agent memory for next-session context
  • NEVER ignore FDR warnings — fees silently kill profitability

Decision Rules

Metric StateSeverityAction
FDR > 30%CRITICALReduce trade frequency or widen entry criteria immediately
FDR 20-30%WARNINGMonitor — consider reducing size or frequency
FDR < 20%OKFees are manageable
Win rate < 35%CRITICALTighten entry criteria — Radar threshold to 200+
Win rate 35-45%WARNINGReview losing trades for pattern
Win rate > 50%OKEntries are working
Monster dep > 60%WARNINGOne trade carrying the session — diversify alpha
Monster dep > 80%CRITICALFragile — entire PnL depends on one lucky trade
Consec losses > 5WARNINGAdd loss streak circuit breaker to APEX
Long PnL < 0, Short PnL > 0WARNINGLong entries are leaking — reduce long bias
Holding < 5 min dominatesWARNINGOver-trading — increase min hold time

Anti-Patterns

  • Ignoring REFLECT reports: Running APEX without reviewing REFLECT is flying blind. The same mistakes repeat.
  • Acting on single-day anomalies: One bad day doesn't mean the strategy is broken. Look at 5+ day trends via hl reflect history.
  • Optimizing for win rate alone: High win rate with low profit factor means you're taking small wins and large losses. Focus on PF.
  • Not tracking FDR: Fees are invisible during trading but compound devastatingly. FDR is the single most important "hidden" metric.
  • Changing strategy after one REFLECT report: REFLECT recommendations need 3+ consistent appearances before strategy changes.

Error Recovery

ErrorCauseFix
No trades foundNo trading activity in periodNormal — nothing to review
Cannot pair round tripsUnmatched buys/sellsOpen positions — REFLECT pairs only closed trades
trades.jsonl not foundFirst run or wrong data dirRun at least one trade first
Report generation failedDisk full or permissionsCheck data/reflect/ directory permissions

Composition

REFLECT is the learning layer of the APEX system. Run REFLECT nightly after APEX stops. Feed REFLECT insights back into APEX configuration (Radar thresholds, DSL presets, position sizing). Over time, REFLECT recommendations should converge as the system improves.

Cron Template

# Nightly REFLECT review at 11:55 PM
55 23 * * * cd ~/agent-cli && source .venv/bin/activate && hl reflect run >> logs/reflect.log 2>&1

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.