AI Agent Quick Context Guide
AI Agent Quick Context Guide
For AI agents, LLMs, and multi-agent systems working on this codebase
TL;DR - 30 Second Context
PROJECT: AI Options Trading System
STATUS: Paper trading, Day 50/90 R&D phase
GOAL: $1/day profit via options premium
TECH: Python 3.11, Alpaca API, Claude AI
EQUITY: $100,697 (+$697 profit)
Critical Rules (MUST READ)
- Never trade real money - Paper mode only until Day 90
- Never merge to main directly - Always use PRs
- Verify before claiming - Test imports, run dry runs
- Market hours matter - US equities: Mon-Fri 9:30-4:00 ET only
- Check calendar - No trading on holidays (see
holidayspackage)
Key Entry Points
| To Do This | Start Here |
|---|---|
| Run trading | src/orchestrator/main.py |
| Execute trades | src/execution/alpaca_executor.py |
| Risk management | src/risk/trade_gateway.py |
| Core strategy | src/strategies/core_strategy.py |
| Check positions | scripts/check_positions.py |
Directory Map
src/
βββ orchestrator/ # Main trading logic (START HERE)
βββ strategies/ # Trading strategies (5 tiers)
βββ agents/ # Trading agents (momentum, sentiment, debate)
βββ risk/ # Position sizing, circuit breakers
βββ execution/ # Alpaca API integration
βββ learning/ # Thompson Sampling, Trade Memory
data/
βββ system_state.json # Current state (CHECK FIRST)
βββ trades_YYYY-MM-DD.json # Daily trade logs
βββ performance_log.json # Historical metrics
rag_knowledge/
βββ lessons_learned/ # 66+ documented lessons
βββ youtube/ # Phil Town transcripts
βββ blogs/ # Trading wisdom
State Files (Always Check First)
| File | Purpose | Check When |
|---|---|---|
data/system_state.json |
Current portfolio state | Every session |
claude-progress.txt |
Session continuity notes | Start of work |
feature_list.json |
Feature tracking | Before new features |
RAG Knowledge Base
Located in rag_knowledge/lessons_learned/:
- 66+ lessons from past mistakes
- Semantic search capability
- Query before making changes
Top Lessons:
- LL-051: Calendar awareness is critical
- LL-052: We do NOT trade crypto
- LL-010: Dead code causes silent failures
For Claude Code Agents
Full context in .claude/CLAUDE.md including:
- Complete rules in
.claude/rules/MANDATORY_RULES.md - Skills in
.claude/skills/(17 specialized capabilities) - Commands in
.claude/commands/
API Keys Required
Set in .env or GitHub Secrets:
ALPACA_API_KEY/ALPACA_SECRET_KEY- TradingOPENAI_API_KEY- LLM reasoningANTHROPIC_API_KEY- Claude integrationDEVTO_API_KEY- Blog publishing
Testing Before Changes
# Quick verification
python3 -c "from src.orchestrator.main import TradingOrchestrator; print('OK')"
# Full test suite
python -m pytest tests/ -v
# Lint check
ruff check src/
CI/CD Pipeline
All PRs trigger:
- Lint & format check
- Unit tests
- Integration tests
- Workflow integrity check
- Phil Town RAG completeness check
DO NOT merge if CI is red.
Common Tasks
Add a new feature
- Check
feature_list.jsonfor existing features - Query RAG for related lessons
- Create feature branch
- Implement with tests
- Create PR (not direct merge)
Fix a bug
- Search
rag_knowledge/lessons_learned/for similar issues - Write regression test FIRST
- Fix the bug
- Verify CI passes
Update trading logic
- Check
data/system_state.jsonfor current state - Review existing strategies in
src/strategies/ - Test in paper mode
- Log to
rag_knowledge/lessons_learned/
Performance Metrics
Current targets:
- Win rate: >55%
- Sharpe ratio: >1.2
- Max drawdown: <10%
- Daily profit: $1+
Last Updated: December 24, 2025 Maintained By: Claude (CTO) + Igor Ganapolsky (CEO)