This file provides guidance to Claude Code (claude.ai/code) when working in this repository.
Read AGENTS.md and PRD.md first. This file is intentionally short — it points at the canonical sources and adds Claude-specific notes only.
etorotui is a copy-trading–first Textual TUI for analysing personal eToro investments. It replaces the single-file Rich script at ~/madpin/uvility/cli/etoro/portfolio.py with a multi-panel app backed by local SQLite history.
- PRD is the source of truth. Conflicts with the PRD must be raised before coding.
- Read-only against eToro in MVP. Trading actions are placeholders only.
- Never persist or log credentials. Headers only.
- UI → services → (api | db). UI must not import
httpxorsqlite3directly. - Manual refresh only. No background tasks or WebSocket in MVP.
- Always
from __future__ import annotations. Python 3.12+, type hints required inapi/,services/,db/. - Reuse the math from the legacy script (
monthly_realized,current_unrealized,compound_monthly_pct,_money,_pct) — port intosrc/etorotui/utils/, do not rewrite.
# venv (the user rule: always activate before running Python)
uv venv
source .venv/bin/activate
uv pip install -e ".[dev]"
etorotui # default: real account, ./etorotui.toml, ./.env
etorotui --mode demo
uv run etorotui # alternativeLint/format/test:
ruff check .
ruff format .
pytest -q- Use the TodoWrite tool for any task touching ≥3 files or panels. Each panel in PRD.md §10/§11 is naturally one or two todos (service wiring + UI).
- Prefer the Read/Grep/Glob tools over shell for file inspection. Don't
cat, don'tfind. - Parallel tool calls are encouraged when reading independent files (e.g.
app.py+panels/stocks.py+services/portfolio.py). - Never run
git commitorgit pushwithout an explicit ask — even when changes look "obviously commit-worthy". - Do not generate mock JSON fixtures; the user has a working
--jsondump from the legacy script. If you need fixtures, ask which path on disk to read from. - Mirror look-through is the differentiator (PRD.md §10.5). When uncertain whether a feature aggregates "self vs copies", check there.
- No emojis in code, commits, or UI text unless explicitly requested.
- API endpoint catalog:
https://api-portal.etoro.com/llms.txt - eToro skill (if MCP is configured): use the
etoro-skillreference in the docs portal. - Schema disagreements:
db/schema.sqlis canonical, not the dataclasses. - Keybinding disagreements:
[keybindings]inetorotui.tomloverrides; defaults inapp.py.