SkillAgentSearch skills...

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

Install / Use

npx skills add tradermonty/claude-trading-skills --skill portfolio-manager

Installs into whichever agent you are using.

About this skill
📄

SKILL.md

Installable skill definition

Quality Score

95/100

Supported Platforms

Universal

Our assessment of portfolio-manager

portfolio-manager scores 95/100 on our quality scale, 402nd of 4,698 Development & Engineering skills we index (top 9%).

Its SKILL.md is 25 KB long, well organised into 57 sections with 11 code examples: a thorough specification that gives an agent plenty to work with.

With 2,885 GitHub stars, it is one of the more widely adopted skills in the catalogue.

Substance
30/30
Structure
20/20
Description
15/15
Adoption
15/20
Freshness
15/15

Maintenance, license and trust

  • The repository was last updated about 2 months ago, so portfolio-manager is actively maintained.
  • Our last check on 2026-11-16 found the source still online.
  • It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
  • Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.

Safety scan

No issues found

Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.

AI review by kimi-k2.7-code on 2026-09-29. Automated pattern scan on 2026-09-29. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.

portfolio-manager compared with similar skills

All 4 of these similar skills score higher than portfolio-manager; compare them before choosing.

SkillScoreStarsUpdatedFormat
portfolio-manager (this skill)by tradermonty952.9k53d agoSKILL.md
taste-skillby Leonxlnx100116.8k8d agoCLAUDE.md
Agent-Reachby Panniantong100112.3k8d agoCLAUDE.md
rufloby ruvnet10081.9ktodayCLAUDE.md
headroomby headroomlabs-ai10079.8ktodayCLAUDE.md

Frequently asked questions

How do I install portfolio-manager?
Run npx skills add tradermonty/claude-trading-skills --skill portfolio-manager. The install tabs above show the steps for each supported agent.
Which AI agents does portfolio-manager work with?
It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
Is portfolio-manager safe to use?
Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
Is portfolio-manager still maintained?
The repository was last updated about 2 months ago, so portfolio-manager is actively maintained.

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)

Step 2: Enrich Position Data

For each position in the portfolio, gather additional market data and fundamentals:

2.1 Current Market Data:

  • Real-time or delayed price quotes
  • Daily volume and liquidity metrics
  • 52-week range
  • Market capitalization

2.2 Fundamental Data: Use WebSearch or available market data APIs to fetch:

  • Sector and industry classification
  • Key valuation metrics (P/E, P/B, dividend yield)
  • Recent earnings and financial health indicators
  • Analyst ratings and price targets
  • Recent news and material developments

2.3 Technical Analysis:

  • Price trend (20-day, 50-day, 200-day moving averages)
  • Relative strength
  • Support and resistance levels
  • Momentum indicators (RSI, MACD if available)

Step 3: Portfolio-Level Analysis

Perform comprehensive portfolio analysis using frameworks from reference files:

3.1 Asset Allocation Analysis

Read references/asset-allocation.md for allocation frameworks

Analyze current allocation across multiple dimensions:

By Asset Class:

  • Equities vs Fixed Income vs Cash vs Alternatives
  • Compare to target allocation for user's risk profile
  • Assess if allocation matches investment goals

By Sector:

  • Technology, Healthcare, Financials, Consumer, etc.
  • Identify sector concentration risks
  • Compare to benchmark sector weights (e.g., S&P 500)

By Market Cap:

  • Large-cap vs Mid-cap vs Small-cap distribution
  • Concentration in mega-caps
  • Market cap diversification score

By Geography:

  • US vs International vs Emerging Markets
  • Domestic concentration risk assessment

Output Format (illustrative values):

## Asset Allocation

### Current Allocation vs Target
| Asset Class | Current | Target | Variance |
|-------------|---------|--------|----------|
| US Equities | 70.0% | 60.0% | +10.0 pp |

### Sector Breakdown
[Pie chart description or table with sector percentages]

### Top 10 Holdings
| Rank | Symbol | % of Portfolio | Sector |
|------|--------|----------------|--------|
| 1 | AAPL | 8.5% | Technology |

3.2 Diversification Analysis

Read references/diversification-principles.md for diversification theory

Evaluate portfolio diversification quality:

Position Concentration:

  • Identify top holdings and their aggregate weight
  • Flag if any single position exceeds 10-15% of portfolio
  • Calculate Herfindahl-Hirschman Index (HHI) for concentration measurement

Sector Concentration:

  • Identify dominant sectors
  • Flag if any sector exceeds 30-40% of portfolio
  • Compare to benchmark sector diversity

Correlation Analysis:

  • Estimate correlation between major positions
  • Identify highly correlated holdings (potential redundancy)
  • Assess true diversification benefit

Number of Positions:

  • Optimal range: 15-30 stocks for individual portfolios
  • Flag if under-diversified (<10 stocks) or over-diversified (>50 stocks)

Output (illustrative values):

## Diversification Assessment

**Concentration Risk:** [Low / Medium / High]
- Top 5 holdings represent 42% of portfolio
- Largest single position: AAPL at 12%

**Sector Diversification:** [Excellent / Good / Fair / Poor]
- Dominant sector: Technology at 31%
- [Assessment of balance across sectors]

**Position Count:** [Optimal / Under-diversified / Over-diversified]
- Total positions: 18 stocks
- [Recommendation]

**Correlation Concerns:**
- [List any highly correlated position pairs]
- [Diversification improvement suggestions]

3.3 Risk Analysis

Read references/portfolio-risk-metrics.md for risk measurement frameworks

Calculate and interpret key risk metrics:

Volatility Measures:

  • Estimated portfolio beta (weighted average of position betas)
  • Individual position volatilities
  • Portfolio standard deviation (if historical data available)

Downside Risk:

  • Maximum drawdown (from portfolio history)
  • Current drawdown from peak
  • Positions with significant unrealized losses

Risk Concentration:

  • Percentage in high-volatility stocks (beta > 1.5)
  • Percentage in speculative/unprofitable companies
  • Leverage usage (if applicable)

Tail Risk:

  • Exposure to potential black swan events
  • Single-stock concentration risk
  • Sector-specific event risk

Output (illustrative values):

## Risk Assessment

**Overall Risk Profile:** [Conservative / Moderate / Aggressive]

**Portfolio Beta:** 1.12 (vs market at 1.00)
- Interpretation: Portfolio is [more/less] volatile than market

**Maximum Drawdown:** -14.2% (from $125,000 to $107,250)
- Current drawdown from peak: -6.3%

**High-Risk Positions:**
| Symbol | % of Portfolio | Beta | Risk Factor |
|--------|----------------|------|-------------|
| NVDA | 11% | 1.65 | High volatility |

**Risk Concentrations:**
- 31% in a single sector (Technology)
- 18% in stocks with beta above 1.5
- [Other concentration risks]

**Risk Score:** 68/100 (Medium risk)

3.4 Performance Analysis

Evaluate portfolio performance using available data:

Absolute Returns:

  • Overall portfolio unrealized P&L ($ and %)
  • Best performing positions (top 5 by % gain)
  • Worst performing positions (bottom 5 by % loss)

Time-Weighted Returns (if history available):

  • YTD return
  • 1-year, 3-year, 5-year annualized returns
  • Compare to benchmark (S&P 500, relevant index)

Position-Level Performance:

  • Winners vs Losers ratio
  • Average gain on winning positions
  • Average loss on losing positions
  • Positions near 52-week highs/lows

Output (illustrative values):

## Performance Review

**Total Portfolio Value:** $100,000
**Total Unrealized P&L:** $8,500 (+9.3%)
**Cash Balance:** $5,000 (5% of portfolio)

**Best Performers:**
| Symbol | Gain | Position Value |
|--------|------|----------------|
| AAPL | +22.4% | $12,240 |

**Worst Performers:**
| Symbol | Loss | Position Value |
|--------|------|----------------|
| INTC | -12.0% | $6,600 |

**Performance vs Benchmark (illustrative values):**
- Portfolio return: +9.3%
- S&P 500 return: +7.8%
- Alpha: +1.5 percentage points

Step 4: Individual Position Analysis

For key positions (top 10-15 by portfolio weight), perform detailed analysis:

Read references/position-evaluation.md for position analysis framework

For each significant position:

4.1 Current Thesis Validation:

  • Why was this position initiated? (if known from user context)
  • Has the investment thesis played out or broken?
  • Recent

Truncated for display — read the full file on GitHub.

Related Skills

View on GitHub
GitHub Stars2.9k
CategoryDevelopment
Updated1mo ago
Forks655

Languages

Python

Trust signals

100/100

From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.

No cautions