Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

portfolio-manager

БесплатноЗапускает вложенные скриптыНе проверен

Comprehensive portfolio analysis using Alpaca MCP Server integration to fetch holdings and positions, then analyze asset allocation, risk metrics, individual…

tradermontyот tradermonty★ 9 343 звезды на GitHub33 установки в других каталогах

Об этом скилле

Portfolio Manager

Overview

Analyze and manage investment portfolios by integrating with Alpaca MCP Server to fetch real-time holdings data, then performing comprehensive analysis covering asset allocation, diversification, risk metrics, individual position evaluation, and rebalancing recommendations. Generate detailed portfolio reports with actionable insights.

The full brokerage analysis uses Alpaca's API through MCP for live portfolio data. The portfolio-holdings-review workflow provides a limited offline allocation review from CSV or saved Alpaca positions JSON. It reports gross holdings weights and per-position unrealized P&L; account-wide risk analysis uses the full brokerage workflow.

When to Use

Invoke this skill when the user requests:

  • "Analyze my portfolio"
  • "Review my current positions"
  • "What's my asset allocation?"
  • "Check my portfolio risk"
  • "Should I rebalance my portfolio?"
  • "Evaluate my holdings"
  • "Portfolio performance review"
  • "What stocks should I buy or sell?"
  • Any request involving portfolio-level analysis or management

Prerequisites

Limited Offline CSV Review

For a local USD equity holdings snapshot without credentials, read references/csv-holdings-review.md and run scripts/review_csv.py with an explicit source timestamp. Use the bundled fictional CSV to verify offline execution. This produces gross allocation and per-position unrealized P&L only; it cannot measure account exposure, leverage or historical performance. Keep personal holdings and reports local. Do not fetch brokerage data or continue the full workflow for this limited mode. Ask Navigator for "review my portfolio from CSV" to select portfolio-holdings-review. The recommendation does not read the file: provide the real input path and source timestamp to the CLI before review. Saved Alpaca positions JSON can use --input-format alpaca-json for the same limited calculations; it does not fetch broker data. Both formats follow the shared output schema in assets/holdings-review.schema.json.

Alpaca MCP Server Setup (Full Brokerage Analysis)

The full brokerage analysis requires Alpaca MCP Server to be configured and connected. The MCP server provides access to:

  • Current portfolio positions
  • Account equity and buying power
  • Historical positions and transactions
  • Market data for held securities

MCP Server Tools Used:

  • get_account_info - Fetch account equity, buying power, cash balance
  • get_positions - Retrieve all current positions with quantities, cost basis, market value
  • get_portfolio_history - Historical portfolio performance data
  • Market data tools for price quotes and fundamentals

If Alpaca MCP Server is not connected, inform the user and provide setup instructions from references/alpaca-mcp-setup.md.

REST Fallback Connection Check

Run the connection check from the repository root. Use paper credentials first; never paste credentials into a report or commit them to the repository.

export ALPACA_API_KEY="<alpaca-key-id>"
export ALPACA_SECRET_KEY="<alpaca-secret-key>"
export ALPACA_PAPER="true"
uv run python skills/portfolio-manager/scripts/check_alpaca_connection.py

The command writes a redacted diagnostic summary to stdout and returns zero only when the account and positions endpoints succeed. It does not create a report file or place orders.

Workflow

Step 1: Fetch Portfolio Data via Alpaca MCP or REST fallback

Use Alpaca MCP Server tools to gather current portfolio information when available. In scheduled Hermes jobs, MCP tools may not be exposed even when Alpaca credentials are present; in that case, use the Alpaca REST API directly with ALPACA_API_KEY, ALPACA_SECRET_KEY, and ALPACA_PAPER.

Read references/alpaca-data-fetch.md (section "Step 1 detail: account, positions and portfolio history requests") when fetching data. It holds the MCP tool and REST fallback endpoints and headers for steps 1.1 to 1.3.

Scheduled-job fallback discipline:

  • Clearly label the source as Alpaca REST fallback rather than MCP.
  • Use ALPACA_PAPER=true to choose paper endpoint; otherwise use live endpoint.
  • Still validate that long market value plus cash approximately reconciles to equity, and highlight margin/leverage if long_market_value > equity.
  • For weekly core portfolio cron jobs, compute exposure using equity as the denominator as well as gross market value: gross_long_exposure = long_market_value / equity, cash_pct = cash / equity, and explicitly flag margin-funded portfolios when gross exposure is materially above 100% or cash is negative. Do not let sector weights look benign by using only gross-long denominator when the account is levered.
  • When the request emphasizes dividend holdings or forced-review triggers, build normalized monitor input from the live holdings and hand it to kanchi-dividend-review-monitor rather than treating dividend review as a narrative-only section. Also build tax-planning input for
Полный SKILL.md на GitHub

Установить portfolio-manager в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

README.mdassets/fictional_alpaca_positions.jsonassets/fictional_holdings.csvassets/holdings-review.schema.jsonreferences/alpaca-data-fetch.mdreferences/alpaca-mcp-setup.mdreferences/asset-allocation.mdreferences/csv-holdings-review.mdreferences/diversification-principles.mdreferences/follow-up-and-advanced.mdreferences/portfolio-risk-metrics.mdreferences/position-evaluation.mdreferences/position-reconciliation.mdreferences/rebalancing-strategies.mdreferences/report-section-templates.mdreferences/resource-index.mdreferences/risk-profile-questionnaire.mdreferences/target-allocations.mdrequirements.txtscripts/check_alpaca_connection.pyscripts/normalize_alpaca_positions.pyscripts/reconcile_positions.pyscripts/review_csv.py

FAQ

Что делает скилл portfolio-manager?

Comprehensive portfolio analysis using Alpaca MCP Server integration to fetch holdings and positions, then analyze asset allocation, risk metrics, individual stock positions, diversification, and generate rebalancing recommendations. Use when user requests portfolio review, position analysis, risk assessment, performance evaluation, or rebalancing suggestions for their brokerage account.

Как установить скилл portfolio-manager?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл portfolio-manager запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить portfolio-manager с