jpskill.com
📄 ドキュメント コミュニティ

dividend-tracking

Sync dividend data from Fidelity CSV to Dividends sheet. Reads dividend.csv from notebooks/updates/, calculates actual dividends received (shares × amount per share), writes to input area (rows 2-46), then clicks Add Dividend button to process. Triggers on sync dividends, update dividends, dividend tracker, layer 2 income, or monthly dividend analysis.

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o dividend-tracking.zip https://jpskill.com/download/22808.zip && unzip -o dividend-tracking.zip && rm dividend-tracking.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/22808.zip -OutFile "$d\dividend-tracking.zip"; Expand-Archive "$d\dividend-tracking.zip" -DestinationPath $d -Force; ri "$d\dividend-tracking.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して dividend-tracking.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → dividend-tracking フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

配当トラッキング

目的

Fidelityの配当CSVデータを「Dividends」シートの入力エリアにインポートし、Apps Scriptをトリガーして履歴ログにレコードを処理します。

ワークフローのルーティング

このワークフローを実行する際は、以下の通知を出力してください。

Running the **SyncDividends** workflow from the **dividend-tracking** skill...
ワークフロー トリガー アクション
SyncDividends "sync dividends", "update dividends", "dividend tracker" CSV → 入力エリア → ボタンクリック

「Dividends」シートのアーキテクチャ

「Dividends」タブには2つのセクションがあります。

左側: 入力エリア (列A-D、行2-43)

ここに配当レコードを書き込みます。

フィールド ソース
A チケット CSVシンボル
B 受取配当金 計算値: 数量 × 1株あたりの金額
C 日付 CSV支払日 (MM/DD/YYYY形式)
D DRIP TRUE/FALSE

ルール:

  • ✅ 行2-43にのみ書き込みます (行1はヘッダーです)
  • ✅ 1バッチあたり最大42レコード
  • ❌ 行43を超えて書き込まないでください
  • 書き込み後、「Add Dividend」ボタンをクリックして処理します

右側: 履歴ログ (列G-U、行4+)

Apps Scriptによって入力されます - ここには書き込まないでください。

フィールド
G ファンド名
H ティッカー
I-T 月額 (1月-12月)
U 合計

Apps Scriptは入力エリア (A-D) から読み取り、履歴ログ (G以降) に追加します。

コアワークフロー

1. 配当CSVの読み取り

ファイル場所: notebooks/updates/dividend.csv

主要なCSV列: | CSV列 | 使用方法 | |------------|-----| | Symbol | → 列A (チケット) | | Quantity | 受取配当金の計算に使用 | | Amount per share | 受取配当金の計算に使用 | | Pay date | → 列C (日付) - MM/DD/YYYY形式にフォーマット | | Type | Margin/Cash (集計用) |

2. 受取配当金の計算

Dividends Received = Quantity × Amount per share

集計ルール:

  • 同じティッカーの数量を合計します (Margin + Cash口座)
  • ティッカーごとに1行を使用します
  • Amount per shareに--がある行はスキップします (配当を支払わない銘柄)
  • 支払日が過ぎたもののみ含めます (すでに受領済み)

3. 入力エリアのステータス確認

現在の入力エリアを読み取ります:

mcp__gdrive__sheets(
    operation: "readSheet",
    params: {
        spreadsheetId: "{spreadsheet_id}",
        range: "Dividends!A2:D43"
    }
)

以下を判断します:

  • 最初の空行 (書き込みを開始する場所)
  • 利用可能なスロット (最大45 - 現在のエントリ数)
  • 満杯の場合、停止してユーザーに最初にボタンをクリックするよう警告します

4. 入力エリアへの書き込み

最初の空行から書き込みを開始します:

mcp__gdrive__sheets(
    operation: "updateCells",
    params: {
        spreadsheetId: "{spreadsheet_id}",
        range: "Dividends!A2:D13",  // レコード数に基づいて範囲を調整
        values: [
            ["JEPI", "$51.63", "01/05/2026", "TRUE"],
            ["JEPQ", "$78.62", "01/05/2026", "TRUE"],
            // ... その他のレコード
        ]
    }
)

5. 「Add Dividend」ボタンのクリック (ブラウザ自動化)

レコードを書き込んだ後、ブラウザ自動化を使用して処理します。

// 1. Google Sheetsを開く
mcp__claude-in-chrome__tabs_create_mcp({
    url: "https://docs.google.com/spreadsheets/d/{spreadsheet_id}/edit#gid=2068577140"
})

// 2. シートの読み込みを待つ
// 3. 「Add Dividend」ボタンまたはカスタムメニューを探す
// 4. クリックしてApps Scriptをトリガーする

代替案: Apps Scriptメニューを使用する

  • 拡張機能 → Apps Scriptマクロ
  • またはスクリプトによって追加されたカスタムメニュー

6. 処理の検証

ボタンをクリックした後:

  • 入力エリア (A2:D43) はクリアされているはずです
  • 履歴ログに新しいエントリがあるはずです
  • 月次合計が更新されているはずです

データフロー図

┌─────────────────────────────────┐
│  dividend.csv (Fidelityエクスポート) │
│  - Symbol, Quantity             │
│  - Amount per share, Pay date   │
└──────────────┬──────────────────┘
               │
               ▼
┌─────────────────────────────────┐
│  受取配当金の計算               │
│  数量 × 金額 = 合計配当金       │
│  ティッカーごとに集計           │
│  フィルター: 過去の支払日のみ   │
└──────────────┬──────────────────┘
               │
               ▼
┌─────────────────────────────────┐
│  入力エリア (A2:D43)            │
│  計算された配当金を書き込む     │
│  1バッチあたり最大42レコード    │
└──────────────┬──────────────────┘
               │
               ▼
┌─────────────────────────────────┐
│  「Add Dividend」ボタンをクリック │
│  (ブラウザ自動化または手動)     │
└──────────────┬──────────────────┘
               │
               ▼
┌─────────────────────────────────┐
│  履歴ログ (G4+)                 │
│  Apps Scriptが入力処理を実行    │
│  月次列に追加                   │
└─────────────────────────────────┘

Apps Script連携

「Dividends」シートにはApps Script自動化が組み込まれており、以下の処理を行います。

  • 入力エリア (A2:D43) からレコードを読み取ります
  • ティッカー、金額、日付、DRIPステータスを解析します
  • 適切な日付形式で履歴ログに追加します
  • 月次収入列 (I-T) を更新します
  • 処理後に入力エリアをクリアします

スクリプト場所: scripts/google-sheets/portfolio-optimizer/Dividend.js

カスタムメニュー: 「Portfolio Optimizer」 → (配当関連オプション)

重要なルール

書き込み可能エリア

  • ✅ 列A-D、行2-43 (入力エリア)
  • ✅ 1バッチあたり最大42レコード
  • ✅ 書き込み後、「Add Dividend」ボタンを必ずクリックしてください

変更不可

  • ❌ 行1 (ヘッダー)
  • ❌ 列A-Dの行44以降
  • ❌ 列G-U (履歴ログ - Apps Script管理)
  • ❌ いかなる数式も

日付形式

  • MM/DD/YYYYを使用してください (例: "01/05/2026")
  • シート内の既存のエントリと一致させてください

DRIPステータス

  • TRUE = 配当が再投資された (株式数が増加した)
  • FALSE = 配当が現金で支払われた
  • 蓄積フェーズではデフォルトでTRUE

事前チェックリスト

配当を同期する前に:

  • [ ] dividend.csvnotebooks/updates/に存在すること
  • [ ] CSVが最新であること (下部の「Date downloaded」を確認)
  • [ ] 入力エリア (A2:D43) に利用可能なスロットがあること
  • [ ] 入力エリアにデータがある場合、最初にボタンをクリックしてクリアすること
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Dividend Tracking

Purpose

Import Fidelity dividend CSV data into the Dividends sheet input area, then trigger the Apps Script to process records into the historical log.

Workflow Routing

When executing this workflow, output this notification:

Running the **SyncDividends** workflow from the **dividend-tracking** skill...
Workflow Trigger Action
SyncDividends "sync dividends", "update dividends", "dividend tracker" CSV → Input Area → Click Button

Dividends Sheet Architecture

The Dividends tab has TWO SECTIONS:

Left Side: INPUT AREA (Columns A-D, Rows 2-43)

This is where YOU write dividend records.

Column Field Source
A Ticket CSV Symbol
B Dividends Received Calculated: Quantity × Amount per share
C Date CSV Pay date (MM/DD/YYYY format)
D DRIP TRUE/FALSE

RULES:

  • ✅ Write to rows 2-43 ONLY (row 1 is header)
  • ✅ Maximum 42 records per batch
  • ❌ NEVER write past row 43
  • After writing, click "Add Dividend" button to process

Right Side: HISTORICAL LOG (Columns G-U, Rows 4+)

This is populated by the Apps Script - DO NOT WRITE HERE.

Column Field
G Fund Name
H Ticker
I-T Monthly amounts (JAN-DEC)
U Total

The Apps Script reads from the input area (A-D) and appends to the historical log (G onwards).

Core Workflow

1. Read Dividend CSV

File Location: notebooks/updates/dividend.csv

Key CSV Columns: | CSV Column | Use | |------------|-----| | Symbol | → Column A (Ticket) | | Quantity | Used to calculate dividend received | | Amount per share | Used to calculate dividend received | | Pay date | → Column C (Date) - format as MM/DD/YYYY | | Type | Margin/Cash (for aggregation) |

2. Calculate Dividends Received

Dividends Received = Quantity × Amount per share

Aggregation Rules:

  • Sum quantities for same ticker (Margin + Cash accounts)
  • Use single row per ticker
  • Skip rows with -- in Amount per share (non-dividend payers)
  • Only include pay dates that have PASSED (already received)

3. Check Input Area Status

Read current input area:

mcp__gdrive__sheets(
    operation: "readSheet",
    params: {
        spreadsheetId: "{spreadsheet_id}",
        range: "Dividends!A2:D43"
    }
)

Determine:

  • First empty row (where to start writing)
  • Available slots (max 45 - current entries)
  • If full, STOP and alert user to click button first

4. Write to Input Area

Write starting at first empty row:

mcp__gdrive__sheets(
    operation: "updateCells",
    params: {
        spreadsheetId: "{spreadsheet_id}",
        range: "Dividends!A2:D13",  // Adjust range based on record count
        values: [
            ["JEPI", "$51.63", "01/05/2026", "TRUE"],
            ["JEPQ", "$78.62", "01/05/2026", "TRUE"],
            // ... more records
        ]
    }
)

5. Click "Add Dividend" Button (Browser Automation)

After writing records, use browser automation to process them:

// 1. Open Google Sheets
mcp__claude-in-chrome__tabs_create_mcp({
    url: "https://docs.google.com/spreadsheets/d/{spreadsheet_id}/edit#gid=2068577140"
})

// 2. Wait for sheet to load
// 3. Look for "Add Dividend" button or custom menu
// 4. Click to trigger Apps Script

Alternative: Use Apps Script Menu

  • Extensions → Apps Script macros
  • Or custom menu added by the script

6. Verify Processing

After clicking button:

  • Input area (A2:D43) should be cleared
  • Historical log should have new entries
  • Monthly totals should update

Data Flow Diagram

┌─────────────────────────────────┐
│  dividend.csv (Fidelity export) │
│  - Symbol, Quantity             │
│  - Amount per share, Pay date   │
└──────────────┬──────────────────┘
               │
               ▼
┌─────────────────────────────────┐
│  Calculate Dividends Received   │
│  Qty × Amount = Total Dividend  │
│  Aggregate by ticker            │
│  Filter: only PAST pay dates    │
└──────────────┬──────────────────┘
               │
               ▼
┌─────────────────────────────────┐
│  INPUT AREA (A2:D43)            │
│  Write calculated dividends     │
│  Max 42 records per batch       │
└──────────────┬──────────────────┘
               │
               ▼
┌─────────────────────────────────┐
│  CLICK "Add Dividend" BUTTON    │
│  (Browser automation or manual) │
└──────────────┬──────────────────┘
               │
               ▼
┌─────────────────────────────────┐
│  HISTORICAL LOG (G4+)           │
│  Apps Script processes input    │
│  Appends to monthly columns     │
└─────────────────────────────────┘

Apps Script Integration

The Dividends sheet has Apps Script automation that:

  • Reads records from input area (A2:D43)
  • Parses ticker, amount, date, DRIP status
  • Appends to historical log with proper date formatting
  • Updates monthly income columns (I-T)
  • Clears input area after processing

Script Location: scripts/google-sheets/portfolio-optimizer/Dividend.js

Custom Menu: "Portfolio Optimizer" → (dividend-related options)

Critical Rules

WRITABLE Area

  • ✅ Columns A-D, Rows 2-43 (input area)
  • ✅ Maximum 42 records per batch
  • ✅ Must click "Add Dividend" button after writing

DO NOT MODIFY

  • ❌ Row 1 (header)
  • ❌ Rows 44+ in columns A-D
  • ❌ Columns G-U (historical log - Apps Script managed)
  • ❌ Any formulas

Date Format

  • Use MM/DD/YYYY (e.g., "01/05/2026")
  • Match existing entries in the sheet

DRIP Status

  • TRUE = dividend was reinvested (shares increased)
  • FALSE = dividend paid as cash
  • Default TRUE for accumulation phase

Pre-Flight Checklist

Before syncing dividends:

  • [ ] dividend.csv exists in notebooks/updates/
  • [ ] CSV is recent (check "Date downloaded" at bottom)
  • [ ] Input area (A2:D43) has available slots
  • [ ] If input area has data, click button first to clear it
  • [ ] Browser automation available for button click

Example Scenario

User: "sync dividends"

Agent workflow:

  1. ✅ Read CSV - found 40 rows
  2. ✅ Filter - 12 tickers with dividend data for past pay dates
  3. ✅ Aggregate - combined Margin/Cash positions
  4. ✅ Calculate - total dividends: $786.86
  5. ✅ Check input area - rows 2-43 empty, 42 slots available
  6. ✅ Write records - added 12 rows to A2:D13
  7. ✅ Open browser - navigate to Dividends sheet
  8. ✅ Click button - trigger "Add Dividend" Apps Script
  9. ✅ Verify - input area cleared, historical log updated
  10. ✅ LOG: "Synced 12 dividend records totaling $786.86"

Google Sheets Integration

Spreadsheet ID: {spreadsheet_id} Dividends Sheet ID: 2068577140 Direct URL: https://docs.google.com/spreadsheets/d/{spreadsheet_id}/edit#gid=2068577140

Reference Files

  • Dividend CSV: notebooks/updates/dividend.csv
  • Apps Script: scripts/google-sheets/portfolio-optimizer/Dividend.js
  • Spreadsheet: Finance Guru Portfolio Tracker (Dividends tab)

Skill Type: Domain (workflow guidance) Enforcement: SUGGEST (high priority advisory) Priority: High