Investments Dashboard — Cowork 投資追蹤系統建置提示詞
本講目錄 · ON THIS PAGE ▾
Investments Dashboard (Put this prompt into cowork)
Tina’s note to you: This uses the Bigdata MCP, which has a 7-day free trial before switching to paid. I chose it for reliability across different portfolio types, but web search or your brokerage are also valid alternatives.
I tested this prompt and it runs smoothly — that said, monitor Cowork throughout the build and be ready to course correct. A little patience goes a long way. Happy building!!! :)
👇👇👇👇👇👇👇👇👇👇
I want to build a personal investment tracking system in this Cowork workspace. It has three layers:
Holdings input (investments/inputs/holdings.csv) — I maintain this manually. It's the source of truth for what I own: tickers, share counts, cost basis, currency. I update it when I buy or sell.
Data layer (investments/data/) — auto-generated by a scheduled task. Reads the CSV, fetches live prices via Bigdata.com MCP, and writes structured JSON + appends a history row. I never touch these files manually.
Investment dashboard (investments/outputs/dashboard.html) — a self-contained HTML file that reads the data layer and shows my portfolio at a glance. Regenerated daily by the same scheduled task.
Here are my holdings: [PASTE SCREENSHOT OR LIST HERE]
Please work through this in four phases. Do each phase completely before moving to the next. Ask me questions before starting each phase if anything is unclear.
Phase 1 — Extract my holdings into a CSV
Read the holdings I provided and create a file called investments/inputs/holdings.csv with this exact schema:
ticker,shares,cost_basis,currency,notes
Rules:
ticker is the exchange symbol exactly as it trades on its primary exchange. Use whatever format the exchange uses — alphabetic tickers (e.g. AAPL), numeric codes, or ticker+suffix combos. If a position trades on multiple exchanges, use the one where you actually hold it and note the exchange in the notes field if it's ambiguous.
shares is the number of shares (use fractional if applicable, e.g. 0.02 BTC, 213.35 for an ETF)
cost_basis is my average purchase price in the position's native currency
currency is the 3-letter ISO code for the native currency of that position (USD, HKD, GBP, etc.)
notes is a plain-English description of what the position is
Cash holdings go in the same file with ticker = CASH-{ISO} (e.g. CASH-USD), shares = the cash amount, cost_basis = 1.00
After creating the CSV, show it to me in full and ask me to confirm it's accurate before continuing to Phase 2. I'll correct anything that's wrong.
Phase 2 — Set up the folder structure
Create this folder structure under the project workspace. Create placeholder files (empty or with a header comment) where noted:
investments/
├── CLAUDE.md ← see content below
├── inputs/
│ └── holdings.csv ← already created in Phase 1
├── data/ ← auto-populated by scheduled tasks (create empty dir)
│ ├── holdings.json ← placeholder: {}
│ ├── history.csv ← placeholder: header row only (includes _TOTAL rows for history chart)
│ └── news.json ← placeholder: {"as_of": null, "news": {}}
└── outputs/
├── dashboard.html ← placeholder: "Dashboard will be generated here"
└── research/ ← empty dir for future research outputs
Content for investments/CLAUDE.md:
# Investments — operating instructions
When working in this folder, act as a rigorous investment analyst.
- Cite sources for factual claims. Prefer Bigdata.com MCP as primary market data source.
- Distinguish clearly between facts, analysis, and speculation.
- Show reasoning, not just conclusions.
- No direct buy/sell recommendations — present the case, let me decide.
- Don't paraphrase analyst sentiment as fact.
- Don't conflate price action with fundamentals.
My holdings are at: investments/inputs/holdings.csv
Live data lives at: investments/data/ (auto-refreshed by scheduled tasks)
Dashboard is at: investments/outputs/dashboard.html
investments/data/history.csv placeholder content:
date,ticker,shares,close_price,position_value,unrealized_pnl,day_change_pct,currency,position_value_base
(Replace base with the 3-letter ISO code for the base reporting currency once confirmed, e.g. position_value_gbp)
After creating all files and folders, show me the directory tree and confirm before continuing.
Phase 3 — Build and schedule the data pipeline
This phase sets up one scheduled task that does everything in sequence: fetch prices → write holdings.json → append to history.csv → regenerate the dashboard. One task, one daily run, no inter-task timing dependency.
Show me the full task definition before scheduling it. I need to see:
Task ID and cron schedule
Exactly what it reads and writes
The full prompt it will run with
Wait for my explicit "yes, schedule this" before calling create_scheduled_task.
Task A — Daily portfolio refresh (invest-daily-refresh)
Schedule: Once daily, timed to run after the latest market session in the portfolio closes. Look at which exchanges the holdings trade on and pick a time that falls after all of them have closed for the day. Ask me what timezone I'm in if you need it to set the cron correctly.
What it does, in order:
Step 1 — Fetch prices. Read investments/inputs/holdings.csv. For every non-cash row, look up the current (or last-close) price using the Bigdata.com MCP (bigdata_company_tearsheet or get_securities). Also fetch FX rates for any currencies in the portfolio that differ from the base reporting currency (fetch once at the start of the run, not per holding). Cash rows (CASH-{ISO} tickers) skip price lookup: current_price = 1.00, day_change_pct = 0.
Step 2 — Overwrite investments/data/holdings.json. Compute position values and unrealized P&L in both the position's native currency and the base reporting currency. Use the actual base currency ISO code (e.g. GBP, EUR) in the field names — not a generic placeholder. Schema pattern:
{
"as_of": "2026-05-06T21:00:00Z",
"base_currency": "EUR",
"fx_rates_to_base": {"USD": 0.92, "GBP": 1.17, "EUR": 1.0},
"holdings": [
{
"ticker": "AAPL",
"shares": 10,
"cost_basis": 150.00,
"currency": "USD",
"current_price": 175.00,
"day_change_pct": 0.8,
"position_value": 1750.00,
"position_value_base": 1610.00,
"unrealized_pnl": 250.00,
"unrealized_pnl_base": 230.00,
"notes": "Apple Inc."
}
]
}
Rules:
position_value and unrealized_pnl are always in the position's native currency
position_value_base and unrealized_pnl_base are converted to the base reporting currency via fx_rates_to_base
If a position's native currency equals the base currency, the _base value equals the native value and no conversion is needed
If a price lookup fails for a ticker, preserve the last known value and add "stale": true — don't abort the run
Step 3 — Fetch news and overwrite investments/data/news.json. For each non-cash position, use the Bigdata.com MCP (bigdata_company_tearsheet or bigdata_search) to fetch the 2–3 most recent material news headlines. Store in a flat structure keyed by ticker:
{
"as_of": "2026-05-06T21:00:00Z",
"news": {
"AAPL": [
{"headline": "Apple reports record services revenue", "source": "Reuters", "url": "https://...", "published_at": "2026-05-06T14:00:00Z"}
]
}
}
If a ticker returns no news, store an empty array — don't error. Limit to 3 headlines per ticker maximum.
Step 4 — Append to investments/data/history.csv. One row per holding. Dedupe: check today's date doesn't already exist for that ticker before appending. Skip cash rows. Also append one portfolio total row with ticker = "_TOTAL" summing all position_value_base values — this is what the history chart on the dashboard reads. Use the actual base currency ISO code in the column name (e.g. position_value_eur, not the generic position_value_base).
date,ticker,shares,close_price,position_value,unrealized_pnl,day_change_pct,currency,position_value_base
2026-05-06,AAPL,10,175.00,1750.00,250.00,0.8,USD,1610.00
2026-05-06,_TOTAL,,,,,,,221600.00
Step 5 — Regenerate investments/outputs/dashboard.html. Read the freshly written holdings.json, history.csv, news.json, and the research file list from investments/outputs/research/, then rewrite the dashboard file with all current data baked in (same structure as Phase 4).
Bigdata MCP usage note: Use bigdata_company_tearsheet or get_securities. Ticker format requirements vary by exchange — test a lookup on one position before running the full portfolio, and adjust the format (e.g. adding an exchange suffix) if a lookup fails.
After I approve and schedule the task, run it manually once right now (don't wait for the cron — execute the prompt inline yourself) so we can verify the data layer populates correctly before building the dashboard in Phase 4.
Phase 4 — Build the investment dashboard
Build a self-contained single-file HTML dashboard at investments/outputs/dashboard.html.
The dashboard reads investments/data/holdings.json at load time using window.cowork.callMcpTool if this is a Cowork artifact, OR displays static data from the JSON if opened as a plain HTML file.
Actually, build it as a plain static HTML file that I can open in any browser. It will be regenerated each time it's needed (I'll ask Claude to refresh it, or we can add a third scheduled task for that later). Hard-code the current data from holdings.json into the page — the task that regenerates it will always pull fresh data.
Dashboard sections (required):
Portfolio header — total portfolio value in base currency, total unrealized P&L in base currency and %, last refreshed timestamp. Label clearly with the base currency symbol/code.
Holdings table — one row per position with columns:
Ticker + notes/name
Shares
Current price (native currency, labelled with currency code)
Position value (native currency)
Position value (base currency)
Unrealized P&L (base currency) + color coded green/red
Day change %
% of total portfolio
Sort by position size (largest first, by base currency value)
Cash rows at the bottom, separated visually
Allocation breakdown — a simple donut or horizontal bar chart showing:
By geography/market — infer categories from the currency, exchange, and notes fields (e.g. equities by country, ETFs, crypto, cash). Use whatever groupings make sense for my actual portfolio.
By native currency (shows FX exposure)
Top movers today — 3 biggest day-change-% gainers and 3 biggest losers, each showing ticker, % change, and position size in base currency
Portfolio history chart — a line chart of total portfolio value over time, read from the _TOTAL rows in history.csv. X-axis: date. Y-axis: portfolio value in base currency. If fewer than 3 data points exist, show a placeholder message ("History will appear here after a few daily runs") instead of an empty chart.
News feed — grouped by ticker, show the 2–3 most recent headlines from news.json for each position. Sort tickers by position size (largest positions first). Show headline text, source, and published date. Make headlines clickable links. Skip tickers with no news.
Research — list all files in investments/outputs/research/ as clickable links, sorted by filename descending (most recent first, assuming date-stamped filenames). Label the section "Research & Theses." If the folder is empty, show a placeholder ("No research saved yet").
Design:
Clean, minimal, dark mode preferred
Responsive (works at laptop width)
No external dependencies other than what's available on cdnjs.cloudflare.com — Chart.js for the allocation donut and history line chart
After building the dashboard, open it and show me a screenshot or describe what's visible. Note: the daily scheduled task from Phase 3 regenerates this file automatically each morning.
Before you start — ask me these questions first
Don't begin Phase 1 until you have answers to all of the following:
Base reporting currency — what currency should the portfolio totals, P&L, and dashboard be displayed in? This is the currency you'll convert everything else into for portfolio-level math. (e.g. USD, GBP, EUR, HKD, SGD — whatever feels like "home" to you.)
Holdings clarity — after reading the screenshot/list I provided, flag anything ambiguous before touching files: fractional share counts, which exchange a position trades on, what currency the cost basis is in.
Bigdata.com MCP — confirm it's connected in this Cowork project. You'll need it for Phase 3 price lookups.
Workspace writable — confirm you can create files in the project directory.
Wait for my answers before starting Phase 1.
- B轉載之第三方內容,逐字提取、未改寫/Users/ark/Desktop/03_培訓與AI工具/提示詞:skill/個人重要提示詞/Cowork Prompts.docx