Agent skill

trader-memory-core

Track investment theses across their lifecycle — from screening idea to closed position with postmortem. Register theses from screener outputs, manage state transitions, attach position sizing, review due dates, and generate postmortem reports with P&L and MAE/MFE analysis. Trigger when user says "register thesis", "track this idea", "thesis status", "review due", "close position", "postmortem", or "trading journal".

Stars 489
Forks 117

Install this agent skill to your Project

npx add-skill https://github.com/tradermonty/claude-trading-skills/tree/main/skills/trader-memory-core

SKILL.md

Trader Memory Core

Overview

Persistent state layer that bundles screening → analysis → position sizing → portfolio management outputs into a single "thesis object" per investment idea. Tracks what you thought, what happened, and what you learned — across conversations.

Phase 1 supports single-ticker theses: dividend_income, growth_momentum, mean_reversion, earnings_drift, pivot_breakout.

When to Use

  • After a screener (kanchi, earnings-trade-analyzer, vcp, pead, canslim, edge-candidate-agent) produces candidates
  • When transitioning a thesis from IDEA → ENTRY_READY → ACTIVE → CLOSED
  • When attaching position-sizer output to a thesis
  • When checking which theses are due for review
  • When closing a position and generating a postmortem with lessons learned

Prerequisites

  • Python 3.10+
  • pyyaml (already in project dependencies)
  • FMP API key (optional, only for MAE/MFE calculation in postmortem)

Workflow

1. Register — Ingest screener output as thesis

Read the screener's JSON output and convert to thesis using the appropriate adapter.

bash
python3 skills/trader-memory-core/scripts/thesis_ingest.py \
  --source kanchi-dividend-sop \
  --input reports/kanchi_entry_signals_2026-03-14.json \
  --state-dir state/theses/

Supported sources: kanchi-dividend-sop, earnings-trade-analyzer, vcp-screener, pead-screener, canslim-screener, edge-candidate-agent.

Each thesis starts in IDEA status.

2. Query — Search and list theses

bash
python3 skills/trader-memory-core/scripts/thesis_store.py \
  --state-dir state/theses/ list --ticker AAPL --status ACTIVE

Filter by --ticker, --status, or --type.

3. Update — Transition, attach position, link reports

State transition (IDEA → ENTRY_READY only):

Use thesis_store.transition(state_dir, thesis_id, "ENTRY_READY", reason) from Python.

Open position (ENTRY_READY → ACTIVE):

Use thesis_store.open_position(state_dir, thesis_id, actual_price, actual_date) — the only path to ACTIVE. Accepts optional shares and event_date (for backfilling past trades).

Close or invalidate (→ CLOSED or INVALIDATED):

Use thesis_store.terminate(state_dir, thesis_id, terminal_status, exit_reason, actual_price, actual_date). For CLOSED, delegates to close() which computes P&L. For INVALIDATED, P&L is computed if entry/exit prices are available.

Record review (any non-terminal):

Use thesis_store.mark_reviewed(state_dir, thesis_id, review_date=..., outcome="OK"|"WARN"|"REVIEW") to advance next_review_date and record alerts.

Attach position-sizer output:

Use thesis_store.attach_position(state_dir, thesis_id, report_path) to link position sizing data. Validates that the report mode is "shares" (not budget).

Link related reports:

Use thesis_store.link_report(state_dir, thesis_id, skill, file, date) to cross-reference analysis documents.

4. Review — Check due dates and monitoring status

bash
python3 skills/trader-memory-core/scripts/thesis_review.py \
  --state-dir state/theses/ review-due --as-of 2026-04-15

List theses with next_review_date <= as_of. Use with kanchi-dividend-review-monitor triggers (T1-T5) for systematic review.

5. Postmortem — Close and reflect

bash
python3 skills/trader-memory-core/scripts/thesis_review.py \
  --state-dir state/theses/ postmortem th_aapl_div_20260314_a3f1

Generate a structured postmortem in state/journal/. If FMP API key is available, includes MAE/MFE (Maximum Adverse/Favorable Excursion) metrics.

Summary statistics:

bash
python3 skills/trader-memory-core/scripts/thesis_review.py \
  --state-dir state/theses/ summary

Shows win rate, average P&L%, and per-type breakdown across all closed theses.

Output Format

Thesis YAML (state/theses/)

Each thesis is a YAML file with:

  • Identity: thesis_id, ticker, created_at
  • Classification: thesis_type, setup_type, catalyst
  • Lifecycle: status, status_history
  • Entry/Exit: target prices, actual prices, conditions
  • Position: shares, value, risk (attached from position-sizer)
  • Monitoring: review dates, triggers, alerts
  • Origin: source skill, screening grade, raw provenance
  • Outcome: P&L, holding days, MAE/MFE, lessons learned

Index (state/theses/_index.json)

Lightweight index for fast queries without loading full YAML files.

Journal (state/journal/)

Postmortem markdown reports: pm_{thesis_id}.md.

Key Principles

  • Forward-only transitions: IDEA → ENTRY_READY → ACTIVE → CLOSED (no backtracking)
  • Raw provenance: All original screener data preserved in origin.raw_provenance
  • Atomic writes: All file operations use tempfile + os.replace
  • Git-tracked state: state/ directory is committed, providing audit trail
  • Phase 1 scope: Single-ticker theses only (pair trades and options in Phase 2)

Resources

  • references/thesis_lifecycle.md — Status states and valid transitions
  • references/field_mapping.md — Source skill → canonical field mapping
  • schemas/thesis.schema.json — JSON Schema for thesis validation

Expand your agent's capabilities with these related and highly-rated skills.

tradermonty/claude-trading-skills

technical-analyst

This skill should be used when analyzing weekly price charts for stocks, stock indices, cryptocurrencies, or forex pairs. Use this skill when the user provides chart images and requests technical analysis, trend identification, support/resistance levels, scenario planning, or probability assessments based purely on chart data without consideration of news or fundamental factors.

489 117
Explore
tradermonty/claude-trading-skills

market-environment-analysis

Comprehensive market environment analysis and reporting tool. Analyzes global markets including US, European, Asian markets, forex, commodities, and economic indicators. Provides risk-on/risk-off assessment, sector analysis, and technical indicator interpretation. Triggers on keywords like market analysis, market environment, global markets, trading environment, market conditions, investment climate, market sentiment, forex analysis, stock market analysis, 相場環境, 市場分析, マーケット状況, 投資環境.

489 117
Explore
tradermonty/claude-trading-skills

us-stock-analysis

Comprehensive US stock analysis including fundamental analysis (financial metrics, business quality, valuation), technical analysis (indicators, chart patterns, support/resistance), stock comparisons, and investment report generation. Use when user requests analysis of US stock tickers (e.g., "analyze AAPL", "compare TSLA vs NVDA", "give me a report on Microsoft"), evaluation of financial metrics, technical chart analysis, or investment recommendations for American stocks.

489 117
Explore
tradermonty/claude-trading-skills

stanley-druckenmiller-investment

スタンレー・ドラッケンミラーの投資哲学と戦略に基づいた投資アドバイスを提供。30年間無敗、年率30%近いリターンを達成した伝説的投資家の思考法を活用し、マクロ経済分析、リスク管理、ポジション構築、市場サイクルの読み方などについて実践的な指導を行う。投資判断、市場分析、リスク管理、ポートフォリオ構築などの相談時に使用。

489 117
Explore
tradermonty/claude-trading-skills

earnings-calendar

This skill retrieves upcoming earnings announcements for US stocks using the Financial Modeling Prep (FMP) API. Use this when the user requests earnings calendar data, wants to know which companies are reporting earnings in the upcoming week, or needs a weekly earnings review. The skill focuses on mid-cap and above companies (over $2B market cap) that have significant market impact, organizing the data by date and timing in a clean markdown table format. Supports multiple environments (CLI, Desktop, Web) with flexible API key management.

489 117
Explore
tradermonty/claude-trading-skills

breadth-chart-analyst

This skill should be used when analyzing market breadth charts, specifically the S&P 500 Breadth Index (200-Day MA based) and the US Stock Market Uptrend Stock Ratio charts. Use this skill when the user provides breadth chart images for analysis, requests market breadth assessment, positioning strategy recommendations, or wants to understand medium-term strategic and short-term tactical market outlook based on breadth indicators. All analysis and output are conducted in English.

489 117
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results