# rivaldotimoty/trading-agents-lite architecture

> Architecture diagram of the GitHub repository rivaldotimoty/trading-agents-lite, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rivaldotimoty/trading-agents-lite
- Repository: https://github.com/rivaldotimoty/trading-agents-lite

## Overview

Trading Agents Lite is a Claude Agent Skill for one-ticker-at-a-time investment research; Python scripts provide exact data, indicator, risk, and decision-memory calculations. Its documented workflow moves from date-bounded data through independent analysts, a bull/bear research debate, trade proposal, risk review, and portfolio decision to reports and a reusable decision log. The role stages and most handoffs are documented in the README, not shown in sampled runtime code; the graph cites that documentation and avoids claiming unsampled implementation details.

Main entry points: [`trading-agents/references/agents.md`](https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/references/agents.md) (Portfolio decision), [`trading-agents/scripts/fetch_data.py`](https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/scripts/fetch_data.py) (Data snapshot), [`trading-agents/SKILL.md`](https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/SKILL.md) (Analyst team), [`trading-agents/scripts/indicators.py`](https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/scripts/indicators.py) (Technical indicators)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Research workflow"]
  node_analysts["Analyst team<br/>[SKILL.md]"]
  node_research["Bull-bear research<br/>[agents.md]"]
  node_trader["Trade proposal<br/>[agents.md]"]
  node_committee["Risk committee<br/>[agents.md]"]
  node_portfolio["Portfolio decision<br/>[agents.md]"]
end

subgraph group_data["Market data"]
  node_datafetch["Data snapshot<br/>[fetch_data.py]"]
  node_data_guidance["Data-source guidance<br/>[data-sources.md]"]
end

subgraph group_calculations["Exact calculations"]
  node_indicators["Technical indicators<br/>[indicators.py]"]
  node_market_rules["Market rules<br/>[common.py]"]
  node_risk_tools["Risk calculations<br/>[risk_tools.py]"]
end

subgraph group_outputs["Decisions and outputs"]
  node_decision_log[("Decision memory<br/>[decision_log.py]")]
  node_report["Full report<br/>[SKILL.md]"]
  node_summary["Chat summary<br/>[SKILL.md]"]
  node_output_guidance["Output guidance<br/>[output-format.md]"]
end

node_user(("Analyst user"))
node_claude(("Claude skill runtime"))
node_yahoo["Yahoo Finance"]
node_csv["Uploaded price CSV"]
node_web["Web search"]

node_user -->|"requests analysis"| node_claude
node_claude -.->|"runs fetch"| node_datafetch
node_yahoo -->|"provides market data"| node_datafetch
node_csv -->|"supplies prices"| node_indicators
node_web -->|"supplies findings"| node_analysts
node_datafetch -->|"loads price data"| node_indicators
node_market_rules -->|"provides market metadata"| node_indicators
node_datafetch -->|"provides snapshot"| node_analysts
node_indicators -->|"provides computed metrics"| node_analysts
node_analysts -->|"informs debate"| node_research
node_research -->|"provides investment plan"| node_trader
node_trader -->|"calculates trade levels"| node_risk_tools
node_market_rules -->|"provides tick and lot rules"| node_risk_tools
node_risk_tools -->|"provides proposal numbers"| node_committee
node_committee -->|"proposes adjustments"| node_portfolio
node_decision_log -->|"provides prior lessons"| node_portfolio
node_portfolio -->|"records decision"| node_decision_log
node_portfolio -->|"contributes final rating"| node_report
node_portfolio -->|"provides final rating"| node_summary
node_data_guidance -->|"guides fallback data"| node_claude
node_output_guidance -->|"guides report format"| node_claude

click node_datafetch "https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/scripts/fetch_data.py"
click node_indicators "https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/scripts/indicators.py"
click node_market_rules "https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/scripts/common.py"
click node_analysts "https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/SKILL.md"
click node_research "https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/references/agents.md"
click node_trader "https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/references/agents.md"
click node_risk_tools "https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/scripts/risk_tools.py"
click node_committee "https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/references/agents.md"
click node_portfolio "https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/references/agents.md"
click node_decision_log "https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/scripts/decision_log.py"
click node_report "https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/SKILL.md"
click node_summary "https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/SKILL.md"
click node_data_guidance "https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/references/data-sources.md"
click node_output_guidance "https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/references/output-format.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_analysts,node_research,node_trader,node_committee,node_portfolio,node_user toneBlue
class node_datafetch,node_data_guidance toneAmber
class node_indicators,node_market_rules,node_risk_tools toneMint
class node_decision_log,node_report,node_summary,node_output_guidance toneRose
class node_claude,node_yahoo,node_csv,node_web toneIndigo
```

## Components

### Research workflow

- [Analyst team](https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/SKILL.md): `trading-agents/SKILL.md`
- [Bull-bear research](https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/references/agents.md): `trading-agents/references/agents.md`
- [Trade proposal](https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/references/agents.md): `trading-agents/references/agents.md`
- [Risk committee](https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/references/agents.md): `trading-agents/references/agents.md`
- [Portfolio decision](https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/references/agents.md): `trading-agents/references/agents.md`

### Market data

- [Data snapshot](https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/scripts/fetch_data.py): `trading-agents/scripts/fetch_data.py`
- [Data-source guidance](https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/references/data-sources.md): `trading-agents/references/data-sources.md`

### Exact calculations

- [Technical indicators](https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/scripts/indicators.py): `trading-agents/scripts/indicators.py`
- [Market rules](https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/scripts/common.py): `trading-agents/scripts/common.py`
- [Risk calculations](https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/scripts/risk_tools.py): `trading-agents/scripts/risk_tools.py`

### Decisions and outputs

- [Decision memory](https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/scripts/decision_log.py): `trading-agents/scripts/decision_log.py`
- [Full report](https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/SKILL.md): `trading-agents/SKILL.md`
- [Chat summary](https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/SKILL.md): `trading-agents/SKILL.md`
- [Output guidance](https://github.com/rivaldotimoty/trading-agents-lite/blob/main/trading-agents/references/output-format.md): `trading-agents/references/output-format.md`

### Other components

- **Analyst user**
- **Claude skill runtime**
- **Yahoo Finance**
- **Uploaded price CSV**
- **Web search**

## Connections

- Analyst user → Claude skill runtime: requests analysis (evidence: `README.md`)
- Claude skill runtime → Data snapshot: runs fetch
- Yahoo Finance → Data snapshot: provides market data (evidence: `trading-agents/scripts/fetch_data.py`)
- Uploaded price CSV → Technical indicators: supplies prices (evidence: `trading-agents/scripts/indicators.py`)
- Web search → Analyst team: supplies findings (evidence: `README.md`)
- Data snapshot → Technical indicators: loads price data (evidence: `trading-agents/scripts/fetch_data.py`)
- Market rules → Technical indicators: provides market metadata (evidence: `trading-agents/scripts/indicators.py`)
- Data snapshot → Analyst team: provides snapshot (evidence: `README.md`)
- Technical indicators → Analyst team: provides computed metrics (evidence: `README.md`)
- Analyst team → Bull-bear research: informs debate (evidence: `README.md`)
- Bull-bear research → Trade proposal: provides investment plan (evidence: `README.md`)
- Trade proposal → Risk calculations: calculates trade levels (evidence: `README.md`)
- Market rules → Risk calculations: provides tick and lot rules (evidence: `trading-agents/scripts/risk_tools.py`)
- Risk calculations → Risk committee: provides proposal numbers (evidence: `README.md`)
- Risk committee → Portfolio decision: proposes adjustments (evidence: `README.md`)
- Decision memory → Portfolio decision: provides prior lessons (evidence: `README.md`)
- Portfolio decision → Decision memory: records decision (evidence: `README.md`)
- Portfolio decision → Full report: contributes final rating (evidence: `README.md`)
- Portfolio decision → Chat summary: provides final rating (evidence: `README.md`)
- Data-source guidance → Claude skill runtime: guides fallback data (evidence: `README.md`)
- Output guidance → Claude skill runtime: guides report format (evidence: `README.md`)
