Imports and syncs investment portfolio data from broker CSVs into Google Sheets.

Install

mkdir -p .claude/skills/portfoliosyncing && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/1426" && unzip -o skill.zip -d .claude/skills/portfoliosyncing && rm skill.zip

Installs to .claude/skills/portfoliosyncing

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Import and sync broker CSV portfolio data to Google Sheets DataHub. Supports Fidelity (automated) with multi-broker planned. USE WHEN user mentions import broker data OR sync portfolio OR update positions OR CSV import OR portfolio-sync OR ingest positions OR bring in positions OR downloaded from Fidelity OR working with Portfolio_Positions CSVs. Handles file ingestion from Downloads, position updates, SPAXX/margin validation, safety checks, and formula protection.
469 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Parse broker-specific CSV portfolio files
  • Sync position updates to Google Sheets
  • Automate Fidelity data ingestion
  • Validate financial position integrity
  • Maintain consistent financial logging

How it works

Uses Python-based workflow scripts to move and parse files from local directories, applying transformation logic before syncing to designated Google Sheets.

Inputs & outputs

You give it
Broker CSV file path
You get back
Updated Google Sheets portfolio state

When to use portfoliosyncing

  • Import portfolio data from Fidelity
  • Sync investment positions to sheets
  • Update financial tracking logs

About this skill

PortfolioSyncing

Refresh positions and balances from SnapTrade into family_office.db, then validate the snapshot against safety thresholds before anyone reasons off it.

family_office.db is the system of record. The Google Sheets DataHub was retired 2026-07-31; there is no spreadsheet to push to and no gdrive MCP configured.

Step 0: Refresh (sync-first, mandatory)

Positions and balances come from the local DB, refreshed FIRST so it can never be stale. Follow the shared Sync-First + DB-Read pattern.

uv run python -m src.integrations.snaptrade.sync_db          # writes positions + balances
uv run python -m src.integrations.snaptrade.sync_db --show   # read back the snapshot

Completion criterion: the positions and balances tables carry this run's synced_at. Everything downstream reads the DB, not a CSV.

To refresh positions, transactions, and bank expenses together:

uv run python -m src.integrations.refresh_all

Account Routing

config/snaptrade-accounts.yaml declares each account's role and enabled flag. An account with no declared role refuses to sync rather than guessing. Cash-management accounts belong to SimpleFIN (TransactionSyncing), not here, so brokerage margin math stays clean.

Safety Gates

⚠️ Capture the "before" state first, or these gates cannot fire. sync_db is a current-state store: it deletes each account's prior position rows and overwrites its single balances row (which is keyed on account_id). No history survives the refresh, so read the existing snapshot before running Step 0 and hold it in the session to diff against. There is no position_history table to fall back on.

# BEFORE Step 0 — capture the prior generation
sqlite3 family_office.db \
  "SELECT symbol, quantity, average_purchase_price FROM positions ORDER BY symbol;"
sqlite3 family_office.db "SELECT * FROM balances;"

STOP conditions (require user confirmation):

  1. Fewer tickers than the previous snapshot (possible sales)
  2. Any quantity change > 10%
  3. Any cost basis change > 20%
  4. Margin balance jumped > $5,000 (unintentional draw)
  5. SPAXX discrepancy > $100 against the balances row

FLAG conditions (alert but proceed): SPAXX off by $1-$100; pending activity off by more than $100.

When STOPPED: show a clear diff table, ask the user to confirm, proceed only after explicit approval.

Cash Position Logic

  • Do NOT use the SPAXX position value; it shows only settled money market.
  • Use "Settled cash" from the balances row for the SPAXX figure.
  • If settled cash is 0, SPAXX is $0 (all funds invested or in margin).
  • "Cash market value" is NOT cash; it is the value of positions held in the Cash account rather than the Margin account.

Layer Classification for New Tickers

Dividend funds → Layer 2, growth → Layer 1, hedges → Layer 3. If a new ticker does not clearly match a pattern, mark it UNKNOWN - Manual Review Required and ask the user rather than guessing.

CSV Fallback

CSV import is a fallback and re-verification path only, not the primary flow. The IngestPositions workflow archives Portfolio_Positions_*.csv and Balances_*.csv from ~/Downloads into notebooks/updates/. Use it when a live source is down or the user explicitly wants an archive.

Classifier for Fidelity position exports: a header containing Ex-date is the dividend view; a header containing Average Cost Basis is the regular view. The dividend view and transaction history CSVs are still consumed by dividend-tracking and TransactionSyncing.

Pre-Flight Checklist

  • SnapTrade account is enabled and routed in config/snaptrade-accounts.yaml
  • SNAPTRADE_* keys are present in .env
  • DATABASE_URL is set in .env

Reference Files

  • User Profile: fin-guru/data/user-profile.yaml
  • Account routing: config/snaptrade-accounts.yaml
  • Sync-first pattern: .claude/skills/_shared/SyncFirstDbRead.md

Skill Type: Domain (workflow guidance) Enforcement: BLOCK (data integrity critical) Priority: Critical

When not to use it

  • Real-time market trading execution
  • Analyzing high-frequency data

Prerequisites

Google Sheets accessBroker CSV export file

Limitations

  • Limited to broker-specific parsers
  • Requires manual mapping for non-Fidelity brokers

How it compares

It includes built-in data validation and formula protection that manual spreadsheet imports typically lack.

Compared to similar skills

portfoliosyncing side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
portfoliosyncing (this skill)35moNo flagsIntermediate
finance-manager129moReviewIntermediate
miniqmt-skill06moReviewIntermediate
cfo-log04moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

More by AojdevStudio

View all by AojdevStudio

financereport

AojdevStudio

Generate institutional-quality PDF analysis reports for stocks and ETFs. USE WHEN user mentions generate report, create pdf, stock analysis, ticker report, watchlist analysis, OR regenerate reports. Includes VGT-style headers, embedded charts, portfolio sizing, and Perplexity sentiment integration.

636

formula-protection

AojdevStudio

Prevent accidental modification of sacred spreadsheet formulas in Google Sheets Portfolio Tracker. Blocks edits to GOOGLEFINANCE formulas, calculated columns, and total rows. Allows only IFERROR wrappers, fixing broken references, and expanding ranges. Triggers on update formula, modify column, fix errors, or any attempt to edit formula-based cells.

14

margin-management

AojdevStudio

Update Margin Dashboard with Fidelity balance data and calculate margin-living strategy metrics. Monitors margin balance, interest costs, coverage ratios, and scaling thresholds. Triggers safety alerts for large draws and provides time-based scaling recommendations. Use when updating margin, balances, coverage ratio, or margin strategy analysis.

17

montecarlo

AojdevStudio

Run Monte Carlo simulations for Finance Guru portfolio strategy. USE WHEN user mentions monte carlo OR run simulation OR stress test portfolio OR probability analysis OR income projections OR margin safety analysis. Supports 4-layer portfolio (Growth, Income, Hedge, GOOGL) with auto-detection of current values from Fidelity CSV.

15

retirement-syncing

AojdevStudio

Sync retirement account data from Vanguard and Fidelity CSV exports to Google Sheets DataHub. Handles multiple accounts, aggregates holdings by ticker, and updates quantities in retirement section (rows 46-62). Triggers on sync retirement, update retirement, vanguard sync, 401k update, IRA sync, or working with notebooks/retirement-accounts/ files.

15

transactionsyncing

AojdevStudio

Import Fidelity transaction history CSV into Google Sheets with smart categorization. USE WHEN user mentions "sync transactions", "import transactions", "transaction history", OR wants to import Fidelity History CSV. Routes debit card purchases to Expense Tracker with auto-categorization.

110

You might also like

finance-manager

ailabs-393

Comprehensive personal finance management system for analyzing transaction data, generating insights, creating visualizations, and providing actionable financial recommendations. Use when users need to analyze spending patterns, track budgets, visualize financial data, extract transactions from PDFs, calculate savings rates, identify spending trends, generate financial reports, or receive personalized budget recommendations. Triggers include requests like "analyze my finances", "track my spending", "create a financial report", "extract transactions from PDF", "visualize my budget", "where is my money going", "financial insights", "spending breakdown", or any finance-related analysis tasks.

1221

miniqmt-skill

xiaxiaoqian

MiniQMT量化交易开发技能,基于迅投XtQuant库提供行情数据获取(xtdata)和交易执行(xttrader)功能。用于开发股票、期货、期权等量化交易策略,支持历史/实时行情数据下载、K线/分笔数据获取、财务数据查询、自动下单/撤单、持仓查询、资产查询等。适用于需要连接MiniQMT客户端进行量化交易的场景。

00

cfo-log

MikeChongCan

|

00

state-county-rankings

amkessler

This skill should be used when users need ranked county-level demographic metrics within a state from a local CSV file, such as income, population, poverty, or rent.

00

reconciliation

anthropics

Reconcile accounts by comparing GL balances to subledgers, bank statements, or third-party data. Use when performing bank reconciliations, GL-to-subledger recs, intercompany reconciliations, or identifying and categorizing reconciling items.

30139

analyzing-financial-statements

anthropics

This skill calculates key financial ratios and metrics from financial statement data for investment analysis

32134

Search skills

Search the agent skills registry