Important
This repository is RETIRED (2026-07). All content merged into the
stock-analysis
skill in ReByteAI/rebyte-skills —
the single financial skill (analysis + data-lake access + backtesting).
The realtime-api-data pillar was retired entirely: the platform serves
historical (T+1) lake data only, with no direct provider access.
Do not clone or update this repo; use rebyte-skills/stock-analysis instead.
A top-level router skill for financial work on Rebyte. The umbrella
SKILL.md runs a task as three phases:
- Prepare the Data — hosted historical datasets (
data/) or real-time/API market data (realtime-api-data/, US & CN). - Analyze the Data — write code, compute indicators, run event-driven
backtests (
backtesting/). - Generate the Report — finance templates
(
financial-templates/), always in the Kami style (report-style/), with price charts rendered via TradingView Lightweight Charts (financial-charts/).
| Phase | Directory | What it does |
|---|---|---|
| 1 · Prepare | data/ |
Read-only historical SQL over the Rebyte Financial Data Service (catalog → schema → query). Feeds backtests and research. |
| 1 · Prepare | realtime-api-data/ |
Recent/realtime provider APIs. Self-contained US point-query behavior and CN Stocks provider access. |
| 2 · Analyze | backtesting/ |
Realistic event-driven backtests with NautilusTrader. Phase-gated: setup → parameters → data → execute → report. |
| 3 · Report | financial-templates/ |
Financial statement analysis, valuation, company/industry research, and finance output patterns. If no template fits, bring your own structure. |
| 3 · Report | report-style/ |
The Kami design system — mandatory style for every HTML report. |
| 3 · Report | financial-charts/ |
TradingView Lightweight Charts for price/OHLCV/candlestick/indicator/backtest-marker charts. ECharts stays for generic charts. |
anyfinancial/ ← umbrella skill (this repo)
├── SKILL.md ← top-level router (three phases)
├── data/ ← Phase 1: hosted historical data access
│ ├── SKILL.md
│ ├── scripts/ (anyfinancial_cli.py, shared/constants.json)
│ ├── data_builder/us_news/ (local mirror + semantic search)
│ ├── README.md · TEST_PLAN.md · .env.example
├── realtime-api-data/ ← Phase 1: recent/realtime provider APIs
│ ├── SKILL.md
│ ├── scripts/ (anyfinancial_api_data.py)
│ ├── us/SKILL.md (US point-query behavior)
│ └── cn/SKILL.md (CN Stocks provider)
├── backtesting/ ← Phase 2: analysis / backtest execution
│ ├── SKILL.md
│ ├── scripts/ (setup.sh, fetch_data.py, run_backtest.py, run_workflow.sh)
│ ├── strategies/ · references/ · evals/
│ └── config.example.json
├── financial-templates/ ← Phase 3: finance report templates
│ ├── SKILL.md
│ ├── statement-analysis.md
│ ├── valuation-analysis.md
│ ├── company-research.md
│ ├── industry-research.md
│ ├── output-patterns.md
│ └── daily-market-review.html (daily 复盘 + 交易指南, Kami HTML)
├── report-style/ ← Phase 3: shared Kami style (mandatory form)
│ ├── README.md
│ ├── styles.css (Kami tokens + components — link first)
│ ├── report.css (report layer: doc flow, tables, --chart-* — link after)
│ ├── CHEATSHEET.md
│ └── design.md
├── financial-charts/ ← Phase 3: TradingView price/OHLCV charts
│ ├── SKILL.md
│ ├── templates/price-chart.html
│ └── examples/report-price-chart.json
├── evals/ ← umbrella routing evals
└── README.md · .gitignore ← ripple-level
backtesting retrieves prices through data: its fetch_data.py calls the
data skill's CLI (data/scripts/anyfinancial_cli.py) to pull OHLCV bars from
us.eod / us.bars_1m, then runs them through NautilusTrader. Use data for
historical exploration that supports backtesting.
realtime-api-data/us recreates the US point-query behavior inside this repo: latest
price, latest bars, latest news, point fundamentals, and today's OHLC.
realtime-api-data/cn documents the CN Stocks provider:
POST /api/data/cn-stocks/<operation> with operations bars, adj_factor,
bars_1min, valuation, financials, universe, and news.
financial-templates contains template-only analysis structures. Use those files
to shape outputs, but fill them only with verified provider data, filings,
spreadsheets, or user-supplied inputs. If no template fits, use your own
structure — the report form is still Kami (report-style/).
report-style is the shared Kami style, and every HTML report must use it (warm
parchment canvas, ink-blue accent, serif-led hierarchy). Reports follow a
two-part architecture: the shared style (report-style/styles.css +
report-style/report.css) and a content template that holds only HTML +
placeholders and links those two stylesheets — no inline or duplicated CSS.
Restyle every report by editing the shared CSS once. financial-charts renders
any price/OHLCV/candlestick/indicator/backtest-marker chart with TradingView
Lightweight Charts — fill a declarative JSON spec plus a sibling data JSON and
deliver an artifact (chart canvas colors come from the shared --chart-*
tokens); ECharts stays for generic charts.
# Backtesting data support — discover and query historical data
python3 data/scripts/anyfinancial_cli.py catalog
python3 data/scripts/anyfinancial_cli.py schema us.eod
python3 data/scripts/anyfinancial_cli.py query "SELECT t, c FROM us.eod WHERE ticker='AAPL' ORDER BY t DESC LIMIT 5"
# Backtesting execution — install, then follow backtesting/SKILL.md
bash backtesting/scripts/setup.sh
cp backtesting/config.example.json backtesting/smoke.config.json
# Edit smoke.config.json to a short completed range before running.
bash backtesting/scripts/run_workflow.sh --config backtesting/smoke.config.json --splits full
# Real-time/API Data / CN — provider lookup
AUTH_TOKEN=$(/home/user/.local/bin/rebyte-auth)
API_URL=$(python3 -c "import json; print(json.load(open('/home/user/.rebyte.ai/auth.json'))['sandbox']['relay_url'])")
curl -fsS -X POST "$API_URL/api/data/cn-stocks/universe" \
-H "Authorization: Bearer $AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'
# Real-time/API Data / US — local CLI
python3 realtime-api-data/scripts/anyfinancial_api_data.py us latest-price AAPL
python3 realtime-api-data/scripts/anyfinancial_api_data.py us latest-news TSLA --limit 5
# Financial Templates — template-only, no API call
sed -n '1,120p' financial-templates/valuation-analysis.mdInside a Rebyte VM/workspace the backtesting data CLI and direct provider APIs
use the sandbox token and relay URL from /home/user/.rebyte.ai/auth.json. See
each pillar's SKILL.md for the full workflow.