portfolio-review
Comprehensive portfolio overview with scores and interactive dashboard
Trigger
When the user says:
- "review my portfolio"
- "portfolio review"
- "/portfolio-review"
- "show portfolio with scores"
- "portfolio dashboard"
- "analyze my portfolio"
- "포트폴리오 리뷰"
- "포트폴리오 분석"
- "내 포트폴리오 확인"
Description
Performs comprehensive portfolio review including:
- Scoring all portfolio holdings (Financial + Valuation + Momentum)
- Calculating portfolio-level metrics (Total value, P&L, weighted score)
- Generating interactive HTML dashboard with Chart.js visualizations
- Providing insights on diversification and weak holdings
- Auto-opening dashboard in browser
Instructions
When triggered:
Locate plugin directory:
Check these paths in order:
~/.claude/skills/portfolio-copilot/../../scripts (installed via symlink)
plugins/portfolio-copilot/scripts (local development)
Use the first path that exists. Store as $PLUGIN_DIR.
Check dependencies (silent auto-install):
python3 -c "import yfinance, pandas, numpy, sqlalchemy" 2>/dev/null || \
pip3 install yfinance pandas numpy sqlalchemy --quiet
If this fails, inform the user to install manually:
cd $PLUGIN_DIR/..
pip3 install -r requirements.txt
Score all portfolio holdings:
cd $PLUGIN_DIR
python3 portfolio_manager.py score
- This updates scores for all holdings in the database
- Shows scoring progress and success rate
Generate HTML dashboard:
python3 dashboard_generator.py
- Generates portfolio-dashboard-YYYY-MM-DD.html in data/ directory
- Creates 3 interactive Chart.js visualizations:
- Sector Allocation pie chart
- Score Distribution bar chart
- P&L by Holding bar chart
- Auto-opens dashboard in browser
Display terminal summary:
python3 portfolio_manager.py show --with-scores
- Shows portfolio holdings table with scores
- Displays ticker, shares, price, P&L%, score, and grade
Provide insights and recommendations:
- Analyze the output and provide:
- Portfolio health assessment based on weighted average score
- Sector concentration warnings (if any sector > 50%)
- Identification of weak holdings (score < 5)
- Underperforming stocks (negative P&L AND low score)
- Rebalancing suggestions if applicable
Example Output
Terminal Summary
🔄 Scoring 3 holdings...
Scoring AAPL... ✅ 7.3/10 (B+ Good)
Scoring MSFT... ✅ 3.9/10 (D Poor)
Scoring NVDA... ✅ 6.6/10 (B Fair)
✅ Scored 3/3 holdings
📊 Portfolio Summary
─────────────────────────────────────
Total Value: $29,707.10
Total Cost: $37,625.00
Total P&L: -21.04% (-$7,917.90)
Weighted Score: 6.1/10 (Fair)
Holdings (with scores):
┌────────┬─────────┬───────────┬──────────┬─────────┬────────┐
│ Ticker │ Shares │ Curr Price│ P&L % │ Score │ Grade │
├────────┼─────────┼───────────┼──────────┼─────────┼────────┤
│ AAPL │ 50.00 │ $275.50 │ +52.63% │ 7.3/10 │ B+ Good│
│ MSFT │ 30.00 │ $404.37 │ -3.72% │ 3.9/10 │ D Poor│
│ NVDA │ 20.00 │ $190.05 │ -76.24% │ 6.6/10 │ B Fair│
└────────┴─────────┴───────────┴──────────┴─────────┴────────┘
✅ Dashboard generated: data/portfolio-dashboard-2026-02-12.html
🌐 Opening dashboard in browser...
AI Analysis
💡 Portfolio Analysis
**Overall Health**: Fair (6.1/10 weighted score)
**Sector Allocation**:
• Technology: 100% ⚠️ CRITICAL - Highly concentrated in single sector
• Recommendation: Consider diversifying into other sectors (Healthcare, Finance, Consumer)
**Performance Highlights**:
• Best Performer: AAPL (+52.63%, Score: 7.3/10) - Strong valuation, maintain position
• Worst Performer: NVDA (-76.24%, Score: 6.6/10) - Consider averaging down if fundamentals remain strong
**Weak Holdings Alert**:
• MSFT (Score: 3.9/10, P&L: -3.72%)
- Issue: Poor score indicates weak fundamentals
- Recommendation: Monitor closely, consider exiting if score doesn't improve
**Action Items**:
1. Diversify out of Technology sector (reduce from 100% to ~60%)
2. Monitor MSFT closely - potential exit candidate
3. Consider adding positions in:
- Healthcare sector (Johnson & Johnson, UnitedHealth)
- Financial sector (JPMorgan, Visa)
- Consumer sector (Procter & Gamble, Coca-Cola)
**Dashboard**: View detailed charts and visualizations in the browser dashboard
Dashboard Features
The HTML dashboard includes:
Portfolio Summary Card
- Total Value, Cost, P&L, Average Score, Number of Holdings
- Color-coded P&L (green for positive, red for negative)
Holdings Table
- Complete list of holdings with live data
- Ticker, Shares, Avg Cost, Current Price, Market Value, P&L%, Score, Grade
- Color-coded scores (Excellent, Good, Fair, Weak)
Interactive Charts
- Sector Allocation Pie Chart: Visual breakdown of sector diversification
- Score Distribution Bar Chart: Number of holdings in each score category
- P&L by Holding Bar Chart: Performance comparison across holdings
Responsive Design
- Clean, professional Financial Times-inspired styling
- Mobile-friendly layout
- Easy to read and navigate
Notes
- Portfolio ID defaults to 1 (primary portfolio)
- Scores are cached in database - use
score command to refresh
- Dashboard is saved as static HTML file in
data/ directory
- Dashboard uses CDN for Chart.js (requires internet connection)
- All monetary values displayed in portfolio's base currency
Error Handling
- If no portfolio exists: Prompts user to create one first
- If holdings have no scores: Runs scoring automatically
- If data fetch fails: Displays "N/A" and shows error message
- If browser doesn't auto-open: Provides file path to open manually
Related Skills
- analyze-stock: Deep-dive analysis of individual stocks
- find-opportunities: Discover undervalued stocks (Phase 2)
- portfolio-chat: AI conversational portfolio advisor (Phase 3)
CLI Commands Reference
Score Portfolio
cd plugins/portfolio-copilot/scripts
python3 portfolio_manager.py score
Show Portfolio with Scores
python3 portfolio_manager.py show --with-scores
Generate Dashboard
python3 dashboard_generator.py [PORTFOLIO_ID]
All-in-One Portfolio Review
python3 portfolio_manager.py score && \
python3 portfolio_manager.py show --with-scores && \
python3 dashboard_generator.py
1---2name: portfolio-review3description: portfolio-review4---5# portfolio-review67Comprehensive portfolio overview with scores and interactive dashboard89## Trigger1011When the user says:12- "review my portfolio"13- "portfolio review"14- "/portfolio-review"15- "show portfolio with scores"16- "portfolio dashboard"17- "analyze my portfolio"18- "포트폴리오 리뷰"19- "포트폴리오 분석"20- "내 포트폴리오 확인"2122## Description2324Performs comprehensive portfolio review including:25- Scoring all portfolio holdings (Financial + Valuation + Momentum)26- Calculating portfolio-level metrics (Total value, P&L, weighted score)27- Generating interactive HTML dashboard with Chart.js visualizations28- Providing insights on diversification and weak holdings29- Auto-opening dashboard in browser3031## Instructions3233When triggered:34351. **Locate plugin directory**:36 Check these paths in order:37 - `~/.claude/skills/portfolio-copilot/../../scripts` (installed via symlink)38 - `plugins/portfolio-copilot/scripts` (local development)3940 Use the first path that exists. Store as `$PLUGIN_DIR`.41422. **Check dependencies (silent auto-install)**:43 ```bash44 python3 -c "import yfinance, pandas, numpy, sqlalchemy" 2>/dev/null || \45 pip3 install yfinance pandas numpy sqlalchemy --quiet46 ```4748 If this fails, inform the user to install manually:49 ```bash50 cd $PLUGIN_DIR/..51 pip3 install -r requirements.txt52 ```53543. **Score all portfolio holdings**:55 ```bash56 cd $PLUGIN_DIR57 python3 portfolio_manager.py score58 ```59 - This updates scores for all holdings in the database60 - Shows scoring progress and success rate61624. **Generate HTML dashboard**:63 ```bash64 python3 dashboard_generator.py65 ```66 - Generates portfolio-dashboard-YYYY-MM-DD.html in data/ directory67 - Creates 3 interactive Chart.js visualizations:68 - Sector Allocation pie chart69 - Score Distribution bar chart70 - P&L by Holding bar chart71 - Auto-opens dashboard in browser72735. **Display terminal summary**:74 ```bash75 python3 portfolio_manager.py show --with-scores76 ```77 - Shows portfolio holdings table with scores78 - Displays ticker, shares, price, P&L%, score, and grade79806. **Provide insights and recommendations**:81 - Analyze the output and provide:82 - Portfolio health assessment based on weighted average score83 - Sector concentration warnings (if any sector > 50%)84 - Identification of weak holdings (score < 5)85 - Underperforming stocks (negative P&L AND low score)86 - Rebalancing suggestions if applicable8788## Example Output8990### Terminal Summary91```92🔄 Scoring 3 holdings...93 Scoring AAPL... ✅ 7.3/10 (B+ Good)94 Scoring MSFT... ✅ 3.9/10 (D Poor)95 Scoring NVDA... ✅ 6.6/10 (B Fair)9697✅ Scored 3/3 holdings9899📊 Portfolio Summary100─────────────────────────────────────101Total Value: $29,707.10102Total Cost: $37,625.00103Total P&L: -21.04% (-$7,917.90)104Weighted Score: 6.1/10 (Fair)105106Holdings (with scores):107┌────────┬─────────┬───────────┬──────────┬─────────┬────────┐108│ Ticker │ Shares │ Curr Price│ P&L % │ Score │ Grade │109├────────┼─────────┼───────────┼──────────┼─────────┼────────┤110│ AAPL │ 50.00 │ $275.50 │ +52.63% │ 7.3/10 │ B+ Good│111│ MSFT │ 30.00 │ $404.37 │ -3.72% │ 3.9/10 │ D Poor│112│ NVDA │ 20.00 │ $190.05 │ -76.24% │ 6.6/10 │ B Fair│113└────────┴─────────┴───────────┴──────────┴─────────┴────────┘114115✅ Dashboard generated: data/portfolio-dashboard-2026-02-12.html116🌐 Opening dashboard in browser...117```118119### AI Analysis120```121💡 Portfolio Analysis122123**Overall Health**: Fair (6.1/10 weighted score)124125**Sector Allocation**:126• Technology: 100% ⚠️ CRITICAL - Highly concentrated in single sector127• Recommendation: Consider diversifying into other sectors (Healthcare, Finance, Consumer)128129**Performance Highlights**:130• Best Performer: AAPL (+52.63%, Score: 7.3/10) - Strong valuation, maintain position131• Worst Performer: NVDA (-76.24%, Score: 6.6/10) - Consider averaging down if fundamentals remain strong132133**Weak Holdings Alert**:134• MSFT (Score: 3.9/10, P&L: -3.72%)135 - Issue: Poor score indicates weak fundamentals136 - Recommendation: Monitor closely, consider exiting if score doesn't improve137138**Action Items**:1391. Diversify out of Technology sector (reduce from 100% to ~60%)1402. Monitor MSFT closely - potential exit candidate1413. Consider adding positions in:142 - Healthcare sector (Johnson & Johnson, UnitedHealth)143 - Financial sector (JPMorgan, Visa)144 - Consumer sector (Procter & Gamble, Coca-Cola)145146**Dashboard**: View detailed charts and visualizations in the browser dashboard147```148149## Dashboard Features150151The HTML dashboard includes:1521531. **Portfolio Summary Card**154 - Total Value, Cost, P&L, Average Score, Number of Holdings155 - Color-coded P&L (green for positive, red for negative)1561572. **Holdings Table**158 - Complete list of holdings with live data159 - Ticker, Shares, Avg Cost, Current Price, Market Value, P&L%, Score, Grade160 - Color-coded scores (Excellent, Good, Fair, Weak)1611623. **Interactive Charts**163 - **Sector Allocation Pie Chart**: Visual breakdown of sector diversification164 - **Score Distribution Bar Chart**: Number of holdings in each score category165 - **P&L by Holding Bar Chart**: Performance comparison across holdings1661674. **Responsive Design**168 - Clean, professional Financial Times-inspired styling169 - Mobile-friendly layout170 - Easy to read and navigate171172## Notes173174- Portfolio ID defaults to 1 (primary portfolio)175- Scores are cached in database - use `score` command to refresh176- Dashboard is saved as static HTML file in `data/` directory177- Dashboard uses CDN for Chart.js (requires internet connection)178- All monetary values displayed in portfolio's base currency179180## Error Handling181182- If no portfolio exists: Prompts user to create one first183- If holdings have no scores: Runs scoring automatically184- If data fetch fails: Displays "N/A" and shows error message185- If browser doesn't auto-open: Provides file path to open manually186187## Related Skills188189- **analyze-stock**: Deep-dive analysis of individual stocks190- **find-opportunities**: Discover undervalued stocks (Phase 2)191- **portfolio-chat**: AI conversational portfolio advisor (Phase 3)192193## CLI Commands Reference194195### Score Portfolio196```bash197cd plugins/portfolio-copilot/scripts198python3 portfolio_manager.py score199```200201### Show Portfolio with Scores202```bash203python3 portfolio_manager.py show --with-scores204```205206### Generate Dashboard207```bash208python3 dashboard_generator.py [PORTFOLIO_ID]209```210211### All-in-One Portfolio Review212```bash213python3 portfolio_manager.py score && \214python3 portfolio_manager.py show --with-scores && \215python3 dashboard_generator.py216```