| name | stocks-daily |
| description | Fetch current stock price plus 1-day / 5-day / 30-day trend and 52-week range position for a list of tickers, defaulting to Apple, Nvidia, Google, Amazon, and Carnival. Render as a compact one-row-per-ticker markdown table. Use this whenever the user asks for "today's stocks", "my stocks", "how's AAPL doing", "stock check", "give me a market snapshot", a daily price update on any of their tracked tickers, or invokes `/stocks-daily` (optionally with a tickers argument). Trigger this skill even when the user does not say "skill" or "stocks-daily" — phrases like "what's NVDA at", "did Carnival drop today", or "any movers in my watchlist" should all invoke it. |
stocks-daily
Produce a compact table of current price + short/medium-term trend for a configurable list of stock tickers.
Workflow
1. Determine the ticker list
Parse tickers from the user's message. Accept any of:
- A comma- or space-separated list ("show me NVDA TSLA")
- A single ticker ("how's AAPL doing")
- No tickers (use defaults)
Default tickers: AAPL, NVDA, GOOG, AMZN, CCL. Always uppercase before passing to the script.
2. Run the fetcher
From the project root:
python3 .claude/skills/stocks-daily/scripts/fetch_stocks.py --tickers AAPL,NVDA,GOOG,AMZN,CCL
The script returns a single JSON object with:
generated_at — ISO-8601 UTC timestamp
tickers — echo of the requested list
quotes — array, one object per ticker. On success contains: price, prev_close, change_today_abs, change_today_pct, change_5d_pct, change_30d_pct, year_high, year_low, pct_of_52w_range, source. On failure contains {"ticker": "X", "error": "..."}.
errors — per-source error strings. Non-empty doesn't mean failure — a Yahoo 429 followed by a successful Stooq fallback both leave entries here.
If a ticker has an error key, render its row with — for missing fields rather than skipping the ticker entirely. The user wants to see all their tickers every day; an outage on one shouldn't make it disappear.
3. Render the table
Use this exact format. Bold the ticker. Use ▲ for positive moves, ▼ for negative, ▬ for flat (|change| < 0.1%). Show the +/- sign on the percent.
# Stocks — {YYYY-MM-DD}
_Generated {generated_at} • {N} tickers_
| Ticker | Price | Today | 5d | 30d | 52w range |
|---|---:|---:|---:|---:|:---:|
| **AAPL** | $245.12 | ▲ +1.20% | ▲ +3.40% | ▼ -2.10% | 78% |
| **NVDA** | … | … | … | … | … |
_52w range: 0% = at 52-week low, 100% = at 52-week high. Higher = closer to recent peak._
{if errors: '⚠️ Source notes: ' + concise error summary}
Formatting rules:
- Right-align numeric columns (use
---: separators).
- Center-align the 52w range column (
:---:).
- Show price with
$ prefix and 2 decimals.
- Show all percent columns with
+ or - and 2 decimals.
- For tickers in error: show
— in price/percent cells, keep the ticker row.
- If
change_today_pct is null (off-hours, holiday): show ▬ closed.
4. Save and print
Save the same markdown to:
output/stocks/{YYYY-MM-DD}.md
Path is relative to project root. Date taken from generated_at in UTC. Overwrite if it exists — the latest run is canonical.
Print the table inline. Add one trailing line:
Saved to output/stocks/{YYYY-MM-DD}.md
When the user asks about a single ticker
If the user asks specifically about one ticker ("how's NVDA today"), still run the script, but render only that ticker's row (or expand it into a 1-line summary like "NVDA is at $148.32, ▲ +1.2% today, ▲ +5.4% over 5d, ▲ +12% over 30d, near the 52w high (94% of range)."). Don't save a dated file in this single-ticker case — single-stock lookups are conversational, not archival.
Why these choices
- Yahoo as primary, Stooq as fallback: free, no API key, two independent providers. See
references/sources.md for endpoint details, especially the User-Agent gotcha and the chartPreviousClose trap.
- Compact table: fits in chat without horizontal scroll. The arrow + signed-percent format makes direction scannable in <1 second.
- 52w range as a single percent: gives a dimensionless "where in the year is this stock" read that doesn't need additional context.
Tuning
To change defaults: edit DEFAULT_TICKERS at the top of scripts/fetch_stocks.py.
For source/endpoint changes: read references/sources.md first — it documents the non-obvious failure modes.