Communitygithub.com

majiayu000/claude-skill-registry-data

計算當前配置比例,識別與目標的偏離,分析保證金效率

claude-skill-registry-data 是什麼?

此技能是 portfolio_balancer 工作流程中的一個步驟(第 2/4 步),用於自動化分析 Harry Browne 永久投資組合的資產配置。它能根據 25/25/25/25 的目標比例,計算每類資產(股票、長期債券、黃金、現金/國庫券)的當前百分比,並識別出超配或低配的偏離情況。此外,技能還會評估保證金使用的成本效益,並在啟用時分析衛星配置(衛星持股佔股票配置的比例)。最終輸出一個結構化的 YAML 檔案(allocation_analysis.yml),包含完整的配置分析、再平衡需求判斷以及四季經濟背景解讀。此技能設計為唯讀,不會自動執行任何交易,所有再平衡建議均需人工審查。它支援在 Claude Code 等代理平台上執行,需先完成 collect_portfolio_data 步驟才能正確運作。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/majiayu000/claude-skill-registry-data/tree/HEAD/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 永久投資組合目標,計算當前配置百分比,識別與目標的偏離,並分析保證金效率。

任務

分析投資組合快照,判斷當前配置與 Harry Browne 永久投資組合目標的比較情況。識別哪些資產類別處於超配或低配狀態,並評估保證金使用的成本效益。

流程

  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. 分析衛星配置(如啟用) 如果衛星追蹤已啟用:

    • 計算衛星佔總股票配置的百分比
    • 與目標(通常為 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>✓ Quality Criteria Met</promise>

背景

此分析是永久投資組合管理的核心。Harry Browne 設計了 25/25/25/25 的配置,以在各種經濟條件(即經濟週期的「四季」)下提供平衡。偏離分析有助於判斷何時需要再平衡以維持此平衡。

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

工作背景

自動化每日投資組合分析,實踐 Harry Browne 的永久投資組合策略。

永久投資組合在四個資產類別之間維持相等的 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

Individual skills in this repo

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

majiayu000/claude-skill-registry-data

Edit existing BMAD agents while maintaining compliance

majiayu000/claude-skill-registry-data

Edit existing BMAD agents while maintaining compliance

majiayu000/claude-skill-registry-data

Edit existing BMAD modules while maintaining coherence

majiayu000/claude-skill-registry-data

Edit existing BMAD modules while maintaining coherence

majiayu000/claude-skill-registry-data

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-data

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-data

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-data

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-data

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-data

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

majiayu000/claude-skill-registry-data

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-data

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

majiayu000/claude-skill-registry-data

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-data

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-data

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-data

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

majiayu000/claude-skill-registry-data

Conduct domain and industry research. Use when the user says "lets create a research report on [domain or industry]

majiayu000/claude-skill-registry-data

Conduct market research on competition and customers. Use when the user says "create a market research report about [business idea]".

majiayu000/claude-skill-registry-data

Conduct technical research on technologies and architecture. Use when the user says "create a technical research report on [topic]".

majiayu000/claude-skill-registry-data

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".

相關技能