Communitygithub.com

投資組合分析器 - 配置漂移與再平衡建議

計算當前資產配置百分比、識別與目標的偏差,並分析保證金效率。

投資組合分析器 - 配置漂移與再平衡建議 是什麼?

此技能(majiayu000/claude-skill-registry)是「portfolio_balancer」工作流程中的第二步(共四步),旨在自動化執行哈利·布朗的永久投資組合策略。它讀取從第一步收集的投資組合快照,計算股票、長期債券、黃金和現金/國庫券四大資產類別各自的當前配置百分比(目標為各 25%),並與用戶設定的漂移閾值進行比較,以判斷是否需要重新平衡。此外,該技能還會分析衛星配置(若啟用)的合理性,並評估保證金使用的成本效益,將實際支付的費用與計算出的成本進行對比。最後,它會依據「四季」經濟週期提供情境解讀,說明當前超配或低配的資產在何種經濟條件下可能受益,最終生成一個結構化的 YAML 分析文件(allocation_analysis.yml),為後續的再平衡建議提供依據。該技能主要支援 Claude Code 和 Cursor 等 AI 代理平台,並透過 CLI 工具與 Robinhood 等資料來源整合。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/majiayu000/claude-skill-registry/tree/HEAD/skills/analysis/portfolio-balancer-analyze-allocation-ncrmro-deepwork-permanent-

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

portfolio_balancer.analyze_allocation

第 2/4 步,屬於 portfolio_balancer 工作流程

每日永久投資組合分析,包含配置漂移與再平衡建議

前置條件(請先確認)

在開始之前,請確認已完成以下步驟:

  • /portfolio_balancer.collect_portfolio_data

指令

目標:計算當前配置百分比、識別與目標的偏差、分析保證金效率

分析配置

目標

根據 25/25/25/25 的永久投資組合目標,計算當前配置百分比,識別與目標的偏差,並分析保證金效率。

任務

分析投資組合快照,確定當前配置與哈利·布朗永久投資組合目標的比較情況。識別哪些資產類別超配或低配,並評估使用保證金是否具有成本效益。

流程

  1. 讀取投資組合快照 從 collect_portfolio_data 步驟載入 portfolio_balancer/data/portfolio_snapshot.yml。

  2. 計算當前配置百分比 對於每個資產類別,計算:

    current_percentage = (asset_class_value / total_portfolio_value) * 100
    
  3. 計算與目標的偏差 永久投資組合中每個資產類別的目標為 25%:

    drift = current_percentage - 25.0
    
    • 正偏差 = 超配
    • 負偏差 = 低配
  4. 判斷是否需要重新平衡 將每個資產類別的偏差與快照中的 drift_threshold 進行比較:

    • 如果任何 |drift| > drift_threshold,則建議重新平衡
    • 記錄哪些資產類別超過了閾值
  5. 分析衛星配置(若啟用) 如果啟用了 satellite_tracking:

    • 計算衛星部位佔總股票配置的百分比
    • 與目標進行比較(通常為 10-20%)
    • 判斷衛星配置是否需要調整
  6. 分析保證金效率 如果啟用了保證金:

    • 計算年度保證金成本:margin_balance * interest_rate
    • 評估成本/效益:保證金資產的預期回報是否大於保證金成本?
    • 如果保證金費用超過合理閾值則標記
  7. 應用四季情境 注意哪些經濟條件有利於當前的超配/低配部位:

    • 春季(繁榮):股票受益
    • 夏季(通膨):黃金受益
    • 秋季(資金緊縮):現金受益
    • 冬季(通貨緊縮):長期債券受益

輸出格式

portfolio_balancer/data/allocation_analysis.yml

一個包含完整配置分析的 YAML 檔案。

結構:

analysis_date: "YYYY-MM-DD"
drift_threshold: 5  # 來自快照

total_portfolio_value: 100000.00

# 配置細項
allocations:
  stocks:
    target_percentage: 25.0
    current_percentage: 28.0
    current_value: 28000.00
    drift: 3.0  # 超配 3%
    exceeds_threshold: false
    status: "overweight"
    # 衛星配置細項(若啟用)
    satellite:
      enabled: true
      core_percentage: 89.3  # 核心指數佔股票比例
      satellite_percentage: 10.7  # 衛星部位佔股票比例
      target_satellite_percentage: 15.0
      satellite_drift: -4.3  # 衛星部位低配

  long_term_bonds:
    target_percentage: 25.0
    current_percentage: 24.0
    current_value: 24000.00
    drift: -1.0  # 低配 1%
    exceeds_threshold: false
    status: "underweight"

  gold:
    target_percentage: 25.0
    current_percentage: 23.0
    current_value: 23000.00
    drift: -2.0
    exceeds_threshold: false
    status: "underweight"

  cash_treasuries:
    target_percentage: 25.0
    current_percentage: 25.0
    current_value: 25000.00
    drift: 0.0
    exceeds_threshold: false
    status: "on_target"

# 整體重新平衡評估
rebalancing:
  needed: false
  reason: "沒有資產類別超過 5% 的偏差閾值"
  assets_exceeding_threshold: []

# 保證金分析
margin_analysis:
  enabled: true
  current_balance: 5000.00
  annual_cost: 300.00  # 餘額 * 利率
  monthly_cost: 25.00
  monthly_fees_paid: 50.00
  efficiency_rating: "poor"  # 支付的費用超過了計算成本
  recommendation: "檢視保證金費用 - 每月支付 $50,而預期成本為 $25/月"

# 四季情境
economic_context:
  current_overweights:
    - asset: "stocks"
      favored_condition: "繁榮/成長(春季)"
      drift: 3.0
  current_underweights:
    - asset: "gold"
      favored_condition: "通膨(夏季)"
      drift: -2.0
    - asset: "long_term_bonds"
      favored_condition: "通貨緊縮/衰退(冬季)"
      drift: -1.0
  interpretation: "投資組合目前偏重繁榮期;容易受到通膨影響"

品質標準

  • 分析了所有四個資產類別的當前百分比和偏差
  • 偏差計算是數學正確的
  • 重新平衡閾值比較是準確的
  • 若啟用保證金,則包含保證金效率分析
  • 若啟用衛星追蹤,則包含衛星分析
  • 提供了四季經濟情境
  • 所有百分比總和為 100%(在四捨五入容許範圍內)
  • YAML 是有效且可解析的
  • 當滿足所有標準時,請在回應中包含 <promise>✓ 品質標準已達成</promise>

情境

此分析是永久投資組合管理的核心。哈利·布朗設計了 25/25/25/25 的配置,以在各種經濟條件下提供平衡——即經濟週期的「四季」。偏差分析有助於確定何時需要重新平衡以維持這種平衡。

保證金分析可幫助用戶了解使用保證金是否具有成本效益,將實際支付的費用與計算成本和預期收益進行比較。

工作情境

自動化每日投資組合分析,實施哈利·布朗的永久投資組合策略。

永久投資組合在四個資產類別中維持相等的 25% 配置,這些資產類別旨在在不同的經濟條件下表現:

  • 股票(25%):繁榮/成長
  • 長期債券(25%):通貨緊縮/衰退
  • 黃金(25%):通膨
  • 現金/國庫券(25%):資金緊縮/衰退

此工作流程:

  1. 透過 bin/robinhood positions --save CLI 收集投資組合資料
  2. 分析當前配置是否符合 25/25/25/25 的目標
  3. 追蹤衛星股票選擇(可選,佔股票配置的 10-20%)
  4. 評估保證金使用效率與支付的費用
  5. 當偏差超過用戶定義的閾值時,產生重新平衡建議
  6. 產生一份人類可讀的每日報告以供人工審查

重要提示:此系統為唯讀。不會自動執行任何交易。 所有建議都需要人工審查和執行。

必要輸入

來自先前步驟的檔案 - 請先讀取這些檔案:

  • portfolio_balancer/data/portfolio_snapshot.yml(來自 collect_portfolio_data)

工作分支

使用分支格式:deepwork/portfolio_balancer-[instance]-YYYYMMDD

  • 如果已在相符的工作分支上:繼續使用
  • 如果在 main/master 上:使用 git checkout -b deepwork/portfolio_balancer-[instance]-$(date +%Y%m%d) 建立新分支

輸出

必要輸出:

  • portfolio_balancer/data/allocation_analysis.yml

護欄

  • 如果此步驟有依賴項,請勿跳過前置條件驗證
  • 在完成所有必要輸出之前,請勿產生部分輸出
  • 如果缺少必要輸入,請勿繼續;請向用戶詢問
  • 請勿修改此步驟定義輸出範圍以外的檔案

完成時

  1. 確認輸出已建立
  2. 通知用戶:「步驟 2/4 完成,輸出:portfolio_balancer/data/allocation_analysis.yml」
  3. 繼續工作流程:使用 Skill 工具呼叫 /portfolio_balancer.generate_recommendations

參考檔案:.deepwork/jobs/portfolio_balancer/job.yml、.deepwork/jobs/portfolio_balancer/steps/analyze_allocation.md

工作情境

自動化每日投資組合分析,實施哈利·布朗的永久投資組合策略。

永久投資組合在四個資產類別中維持相等的 25% 配置,這些資產類別旨在在不同的經濟條件下表現:

  • 股票(25%):繁榮/成長
  • 長期債券(25%):通貨緊縮/衰退
  • 黃金(25%):通膨
  • 現金/國庫券(25%):資金緊縮/衰退

此工作流程:

  1. 透過 bin/robinhood positions --save CLI 收集投資組合資料
  2. 分析當前配置是否符合 25/25/25/25 的目標
  3. 追蹤衛星股票選擇(可選,佔股票配置的 10-20%)
  4. 評估保證金使用效率與支付的費用
  5. 當偏差超過用戶定義的閾值時,產生重新平衡建議
  6. 產生一份人類可讀的每日報告以供人工審查

重要提示:此系統為唯讀。不會自動執行任何交易。 所有建議都需要人工審查和執行。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

majiayu000/claude-skill-registry

Builds, edit or validate Agent Skill through conversational discovery. Use when the user requests to "Create an Agent", "Optimize an Agent" or "Edit an Agent".

majiayu000/claude-skill-registry

Edit existing BMAD agents while maintaining compliance

majiayu000/claude-skill-registry

Edit existing BMAD agents while maintaining compliance

majiayu000/claude-skill-registry

Edit existing BMAD modules while maintaining coherence

majiayu000/claude-skill-registry

Edit existing BMAD modules while maintaining coherence

majiayu000/claude-skill-registry

Analyzes current state and user query to answer BMad questions or recommend the next workflow or agent. Use when user says what should I do next, what do I do now, or asks a question about BMad

majiayu000/claude-skill-registry

Build AI agents with Google ADK Python (Agent Development Kit). Use for multi-agent systems, workflow agents (sequential/parallel/loop), Vertex AI deployment, tool integration, human-in-the-loop.

majiayu000/claude-skill-registry

Build AI agents with Google ADK Python (Agent Development Kit). Use for multi-agent systems, workflow agents (sequential/parallel/loop), Vertex AI deployment, tool integration, human-in-the-loop.

majiayu000/claude-skill-registry

Portfolio allocation and rebalancing optimizer. Manages asset allocation across stocks/cash/bonds, performs periodic rebalancing, and ensures diversification according to market regime and risk tolerance.

majiayu000/claude-skill-registry

Create a hilarious and ultra-realistic video of an anthropomorphic animal acting like a human vlogger in a real-world setting.

majiayu000/claude-skill-registry

Speech-to-text transcription and translation via OpenAI Audio API -- models, response formats, timestamps, prompting, streaming, chunking, and diarization

majiayu000/claude-skill-registry

BlockRun works with Claude Code and Google Antigravity.

majiayu000/claude-skill-registry

This skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code generation involving libraries, or mentions of specific frameworks like React, Vue, Next.js, Prisma, Supabase, etc.

majiayu000/claude-skill-registry

小省导购员数字人带货版即梦视频提示词生成系统,基于四大智能体协同(提示词生成师、质量管控师、知识库运维师、跨环节适配师),按照"主体+运动+场景+(镜头语言+光影+氛围)"公式输出中英文双版提示词,适配5s短视频。确保人物一致性、视觉连贯性、情绪连贯性,支持知识库智能复用和跨工具适配(Suno音乐、AI绘画),为数字人带货视频提供高质量提示词生成服务。

majiayu000/claude-skill-registry

Upload and manage files using Google Gemini File API via scripts/. Use for uploading images, audio, video, PDFs, and other files for use with Gemini models. Supports file upload, status checking, and file management. Triggers on "upload file", "file API", "upload image", "upload PDF", "upload video", "file management".

majiayu000/claude-skill-registry

CRITICAL: Use for MolyKit AI chat toolkit. Triggers on: BotClient, OpenAI, SSE streaming, AI chat, molykit, PlatformSend, spawn(), ThreadToken, cross-platform async, Chat widget, Messages, PromptInput, Avatar, LLM

majiayu000/claude-skill-registry

AI and machine learning workflow covering LLM application development, RAG implementation, agent architecture, ML pipelines, and AI-powered features.

majiayu000/claude-skill-registry

Analyze images/audio/video with Gemini API (better vision than Claude). Generate images (Imagen 4), videos (Veo 3). Use for vision analysis, transcription, OCR, design extraction, multimodal AI.

majiayu000/claude-skill-registry

Analyze images/audio/video with Gemini API (better vision than Claude). Generate images (Imagen 4), videos (Veo 3). Use for vision analysis, transcription, OCR, design extraction, multimodal AI.

majiayu000/claude-skill-registry

Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory.

相關技能