Skill站外收录 @skilllib/skill-2014279365138264065
TransactionSyncing
自动同步 Fidelity 交易记录至 Google Sheets,主表存档全部流水并智能筛选消费条目,按预设规则分类后导入 Expense Tracker,实现支出数据与预算系统的无缝衔接,支持去重识别与执行摘要生成。
效率工具 AI 技能
Skills.MD
# TransactionSyncing
Import Fidelity transaction history CSV into Google Sheets using a hybrid architecture: master Transactions tab for full audit trail + auto-routing of debit card purchases to Expense Tracker for Budget Planner integration.
## Workflow Routing
**When executing this workflow, output this notification:**
```
Running the **SyncTransactions** workflow from the **TransactionSyncing** skill...
```
| Workflow | Trigger | File |
|----------|---------|------|
| **SyncTransactions** | "sync transactions", "import transactions", "transaction sync" | `workflows/SyncTransactions.md` |
## Examples
**Example 1: Sync after downloading Fidelity transaction history**
```
User: "sync transactions"
-> Reads History_for_Account_Z05724592.csv from notebooks/transactions/
-> Creates/updates Transactions tab with full Fidelity data
-> Routes DEBIT CARD PURCHASE entries to Expense Tracker
-> Auto-categorizes expenses (H-E-B -> Groceries, Tesla -> Auto & Transport)
-> Reports: "Added 45 transactions, 12 expenses categorized"
```
**Example 2: Import new transaction export**
```
User: "import the transaction history"
-> Invokes SyncTransactions workflow
-> Detects duplicates by date + action + amount
-> Skips existing entries, adds only new ones
-> Flags uncategorized expenses for manual review
```
**Example 3: Check recent transactions**
```
User: "import fidelity transactions and update expense tracker"
-> Full sync with expense routing
-> Generates summary of dividends received, purchases, margin interest
```
## Architecture Overview
### Data Flow
```
Fidelity CSV (notebooks/transactions/)
|
v
+-------------------+
| Transactions Tab | <- Master source (ALL transactions)
| (Full Fidelity) |
+-------------------+
|
| Filter: DEBIT CARD PURCHASE
v
+-------------------+
| Expense Tracker | <- Budget Planner integration
| (Categorized) |
+-------------------+
```
### Transaction Types Handled
| Fidelity Action | Destination | Category |
|-----------------|-------------|----------|
| DIVIDEND RECEIVED | Transactions only | DIVIDEND |
| REINVESTMENT | Transactions only | REINVESTMENT |
| DEBIT CARD PURCHASE | Transactions + Expense Tracker | Auto-categorized |
| MARGIN INTEREST | Transactions only | MARGIN_INTEREST |
| DIRECT DEPOSIT | Transactions only | INCOME |
| LONG-TERM CAP GAIN | Transactions only | CAP_GAIN |
| JOURNALED | Transactions only | INTERNAL_TRANSFER |
### Smart Categorization
See `CategoryRules.md` for the full pattern matching rules.
**Sample patterns:**
- `H-E-B`, `KROGER`, `COSTCO`, `WAL-MART` -> Groceries
- `Tesla`, `SUPERCHA` -> Auto & Transport
- `BENIHANA`, `GOLDEN CORRAL`, `PAPA JOHN` -> Dining Out
- `CVS`, `PHARMACY` -> Health & Wellness
## Core Workflow
### 1. Read Fidelity Transaction History CSV
**Location**: `notebooks/transactions/History_for_Account_Z05724592.csv`
**CSV Columns**:
```
Run Date, Action, Symbol, Description, Type, Price ($), Quantity,
Commission ($), Fees ($), Accrued Interest ($), Amount ($),
Cash Balance ($), Settlement Date
```
### 2. Create/Update Transactions Tab
**Google Sheets Structure**:
| Column | Header | Source |
|--------|--------|--------|
| A | Date | Run Date |
| B | Action | Action (cleaned) |
| C | Symbol | Symbol |
| D | Description | Description |
| E | Type | Type (Cash/Margin) |
| F | Amount | Amount ($) |
| G | Category | Auto-assigned |
| H | Balance | Cash Balance ($) |
| I | Settlement | Settlement Date |
### 3. Deduplicate
**Match criteria**: Date + Action + Amount
```
For each CSV row:
key = f"{run_date}|{action}|{amount}"
if key exists in sheet:
SKIP (already imported)
else:
ADD to Transactions tab
```
### 4. Route Expenses to Expense Tracker
**Filter**: Action contains "DEBIT CARD PURCHASE"
**Expense Tracker Format**:
| Date | Description | Category | Amount | Month |
|------|-------------|----------|--------|-------|
**Category Assignment**: See `CategoryRules.md`
### 5. Generate Summary
```
SYNC SUMMARY - [Date]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
TRANSACTIONS TAB:
New entries: 45
Skipped (duplicates): 12
EXPENSE TRACKER:
Expenses routed: 18
Auto-categorized: 15
Needs review: 3
BY TYPE:
Dividends: $342.50
Margin Interest: -$18.43
Debit Card: -$1,245.67
Direct Deposit: +$5,054.09
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
```
## Google Sheets Integration
**Spreadsheet ID**: Read from `fin-guru/data/user-profile.yaml` -> `google_sheets.portfolio_tracker.spreadsheet_id`
### Creating Transactions Tab (if needed)
```javascript
// Check if Transactions tab exists
mcp__gdrive__sheets(operation: "listSheets", params: {
spreadsheetId: SPREADSHEET_ID
})
// Create if missing
mcp__gdrive__sheets(operation: "createSheet", params: {
spreadsheetId: SPREADSHEET_ID,
title: "Transactions"
})
// Add headers
mcp__gdrive__sheets(operation: "updateCells", params: {
spreadsheetId: SPREADSHEET_ID,
range: "Transactions!A1:I1",
values: [["Date", "Action", "Symbol", "Description", "Type", "Amount", "Category", "Balance", "Settlement"]]
})
```
### Adding to Expense Tracker
```javascript
// Append expense row
mcp__gdrive__sheets(operation: "appendRows", params: {
spreadsheetId: SPREADSHEET_ID,
sheetName: "Expense Tracker",
values: [[date, description, category, amount, month]]
})
```
## Critical Rules
### WRITABLE Destinations
- Transactions tab: All columns (new tab, we control format)
- Expense Tracker: Append new rows only (preserve existing)
### NEVER MODIFY
- Budget Planner formulas
- Existing Expense Tracker entries
### Deduplication Key
- Transactions tab: `Date|Action|Amount`
- Expense Tracker: `Date|Description|Amount`
## Reference Files
- **CategoryRules.md**: Pattern matching rules for expense categorization
- **fin-guru/data/user-profile.yaml**: Spreadsheet ID
- **scripts/google-sheets/portfolio-optimizer/**: Apps Script reference
## Pre-Flight Checklist
Before syncing transactions:
- [ ] Transaction History CSV exists in `notebooks/transactions/`
- [ ] CSV is from Fidelity (not other broker)
- [ ] Expense Tracker tab exists in Google Sheets
- [ ] Current date retrieved via `date` command
---
**Skill Type**: Domain (workflow guidance)
**Enforcement**: SUGGEST
**Priority**: Medium
**Line Count**: < 300 (following 500-line rule)
评论 0
还没有评论,来抢沙发。
相关内容
同类或同场景的收录内容
building-with-kafka-strimzi
在 Kubernetes 上构建基于 Apache Kafka 的事件驱动系统,支持高可靠的消息传递、事务性处理与精确一次语义,结合 Strimzi 运营商实现集群自动化管理,利用 Schema Registry 保障事件模式演进,适用于微服务间解耦通信与实时数据流处理场景。
站外数据与分析
609 0.0
personal-tool-builder
专注于从个人真实痛点出发快速构建实用工具,涵盖命令行程序、本地优先应用和自动化脚本的开发与演进,强调先满足自身需求再逐步扩展,通过持续自用打磨功能,避免过度设计,确保工具简洁有效且长期可维护。
站外商业与营销
196 0.0
threejs-lighting
实现三维场景中的光照与阴影控制,支持多种光源类型及环境光照明,提供从基础布光到高级阴影优化的完整方案,适用于需要真实感渲染或性能平衡的可视化项目。
站外效率工具
442 0.0
aggregation-helper
提供数据聚合场景的自动化辅助能力,涵盖 SQL 查询编写、统计分析建模、可视化方案设计及商业智能配置,支持从需求理解到生产级代码生成的全流程指导。
站外效率工具数据与分析
217 0.0
举报「TransactionSyncing」
举报信息仅审核团队可见,同一资产 24 小时内仅可举报一次