portfolio-manager
БесплатноЗапускает вложенные скриптыНе проверенComprehensive portfolio analysis using Alpaca MCP Server integration to fetch holdings and positions, then analyze asset allocation, risk metrics, individual…
Об этом скилле
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 balanceget_positions- Retrieve all current positions with quantities, cost basis, market valueget_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 fallbackrather than MCP. - Use
ALPACA_PAPER=trueto 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-monitorrather than treating dividend review as a narrative-only section. Also build tax-planning input for
Установить portfolio-manager в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
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 запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic