Skip to content
Finance
Skill

/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,

BOOST
From plugin
claude-trading-skills
3k74 skills2 agents2 commands
Install
$ npx -y skills add tradermonty/claude-trading-skills --skill portfolio-manager --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/portfolio-manager

Context preview

The summary Claude sees to decide when to auto-load this skill.

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,

SKILL.md

portfolio-manager.SKILL.md
name: portfolio-manager
description: 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

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.

This skill leverages Alpaca's brokerage API through MCP (Model Context Protocol) to access live portfolio data, ensuring analysis is based on actual current positions rather than manually entered data.

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

Alpaca MCP Server Setup

This skill 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`.

**1.1 Get Account Information:**

Preferred: use mcp__alpaca__get_account_info to fetch:
- Account equity (total portfolio value)
- Cash balance
- Buying power
- Account status

Fallback REST endpoints:
- paper: https://paper-api.alpaca.markets/v2/account
- live:  https://api.alpaca.markets/v2/account
Headers:
- APCA-API-KEY-ID=$ALPACA_API_KEY
- APCA-API-SECRET-KEY=$ALPACA_SECRET_KEY

**1.2 Get Current Positions:**

Preferred: use mcp__alpaca__get_positions to fetch all holdings:
- Symbol ticker
- Quantity held
- Average entry price (cost basis)
- Current market price
- Current market value
- Unrealized P&L ($ and %)
- Position size as % of portfolio

Fallback REST endpoints:
- paper: https://paper-api.alpaca.markets/v2/positions
- live:  https://api.alpaca.markets/v2/positions

**1.3 Get Portfolio History (Optional):**

Preferred: use mcp__alpaca__get_portfolio_history for performance analysis:
- Historical equity values
- Time-weighted return calculation
- Drawdown analysis

Fallback REST endpoint:
- /v2/account/portfolio/history

**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 `kanchi-dividend-us-tax-accounting` when account-location notes are requested; label it degraded if account type or holding-period windows are unavailable.

**Data Validation:**

  • Verify all positions have valid ticker symbols
  • Confirm market values sum to approximate account equity
  • Check for any stale or inactive positions
  • Handle edge cases (fractional shares, options, crypto if supported)

Reconcile holdings before weekly allocation review

For `core-portfolio-weekly`, follow [`references/position-reconciliation.md`](references/position-reconciliation.md) to compare complete broker and ACTIVE / PARTIALLY_CLOSED memory snapshots using `scripts/reconcile_positions.py`. Generate the JSON and Markdown reconciliation reports. Stop allocation and rebalance review if `can_continue` is false or if snapshot completeness, account

Read more
Ships withclaude-trading-skills

Claude Trading Skills started as a personal project to use AI to improve my own trading process. Claude Trading Skills is a Claude Skills-based trading workflow toolkit for time-constrained individual investors.

Get the whole plugin

Other skills on claude-trading-skills.