Migration tracker

From aiskillstore/marketplace · View interactive version

Migration tracker is an AI agent skill from the GitHub repository aiskillstore/marketplace. Context for ongoing migration from old Portfolio Buddy app. Use when: fixing bugs, adding migrated features, checking feature parity, or understanding why certain code exists. Contains list of 40 features being migrated and known issues.

How to use this skill

Skill file

Portfolio Buddy 2 - Migration Tracker

Migration Status: 40 Features

✅ Completed (36/40 - 90%)

Core features migrated and working:

🚧 In Progress (3/40)

  1. Advanced filtering - Partial implementation
  1. Export functionality - CSV export only
  1. Historical comparison - Backend ready, UI pending

❌ Not Started (2/40)

  1. Multi-period analysis - Complex, low priority
  1. Risk scenario modeling - Requires new backend logic

Recent Completed Features

Database Fetch Implementation (Nov 16, 2025) ✅ COMPLETED

Status: Production ready - Tested and deployed

Commits: c4fa57c, a5ce0ec, 676de06, eba4c8d, ee7cec8, ae9202d

Merged to main: d56497a (PR #1)

Implementation Journey (6 commits):

  1. Initial Implementation (c4fa57c)
  1. Fix Query Syntax (a5ce0ec)
  1. Fix Trade Count Limit (676de06)
  1. Fix TypeScript Build Errors (eba4c8d)
  1. Fix Metrics Calculation (ee7cec8) ⭐ CRITICAL FIX
  1. Update Documentation (ae9202d)

Final Results:

Files Modified:

How It Works:

  1. User clicks "Load Data" button
  2. App fetches strategies from Supabase
  3. For each strategy, fetches ALL trades separately (no 60-row limit)
  4. Builds filename from metadata (e.g., SI_Long_Test_TestStrategy1.csv)
  5. Transforms to cleanedData format with 3 columns (no Entry/Exit column)
  6. calculateMetrics() auto-detects format and processes correctly
  7. Pre-populates contract multipliers from database
  8. Auto-selects strategies and displays metrics/charts

Backward Compatibility:

Database Integration Planning (Nov 16, 2025)

Status: Planning complete, ready for implementation

What Changed:

New Database Schema:

Implementation Plan:

  1. Add calculateMetricsFromDatabase() function in dataUtils.ts (~80 lines)
  2. Update fetchFromSupabase() query in App.tsx (~60 lines changed)
  3. Transform database data to match cleanedData format
  4. Pre-populate contract multipliers from database
  5. Test with 119 existing trades

Current State:

Next Steps:

Strategy Delete Feature (Nov 19, 2025) ✅

Commit: c372ab7a92d267eda3e540b298872484ef09e38d

Files: App.tsx (+47), MetricsTable.tsx (+18), PortfolioSection.tsx (+8)

What it does:

Git Forensic Recovery (Dec 2, 2025) ✅

Problem: Delete feature was "lost" (local repo behind origin/main)

Solution:

git fetch origin
git merge origin/main  # Fast-forward to c372ab7

Key lesson: Always check git log origin/main when work seems missing

Sortino Ratio (Oct 2025)

Commits: 258ba3a, 9f25040

What Changed:

Files Modified:

Implementation Details:

Date Range Filtering (Oct 2025)

Commit: 258ba3a

What Changed:

Files Modified:

Enhanced Error Handling (Sept 2025)

Commit: 9fb7fdb

What Changed:

Files Modified:

Current Tech Debt

High Priority

  1. PortfolioSection.tsx is 591 lines (3x the 200-line limit)
  1. Remove unused Recharts dependency (11.5KB waste)
  1. Fix 15 TypeScript any violations

Medium Priority

  1. App.tsx is 351 lines (175% of limit)
  1. MetricsTable.tsx is 242 lines (121% of limit)
  1. No error boundaries implemented

Low Priority

  1. No testing setup
  1. No CI/CD pipeline

Known Issues

Issue 1: Supabase 500 Errors

Status: Partially fixed (commit 9fb7fdb)

Root cause: Row limit exceeded on free tier

Current workaround:

Long-term fix: Implement data aggregation before storage

Issue 2: Large Component Files

Status: Documented but not fixed

Problem: Components grew during migration

Affected:

Fix needed: Systematic refactoring into smaller components

Issue 3: No Select All Button

Status: Feature doesn't exist

Note: Previous skill version documented a "Select All bug" but this feature was either removed or never implemented. MetricsTable has individual selection but no "Select All" functionality.

Issue 4: Lost/Missing Code

Status: Recoverable via git forensics

Problem: Can't find recently added features or code seems to have disappeared

Solution:

  1. Check remote: git log origin/main --oneline -10
  2. Search commits: git log --all --grep="keyword"
  3. Fast-forward if behind: git merge origin/main
  4. Use reflog to see recent HEAD positions: git reflog

Example: On Dec 2, 2025, the delete feature was recovered by fast-forwarding from f4e752a to c372ab7

Migration Priorities (ICE Scored)

| Feature | Impact | Confidence | Ease | ICE Score | Status |

|---------|--------|------------|------|-----------|--------|

| Refactor PortfolioSection | 6 | 8 | 4 | 19.2 | ❌ |

| Remove Recharts | 3 | 10 | 10 | 30 | ❌ |

| Fix TypeScript any | 5 | 9 | 6 | 27 | ❌ |

| Export to Excel | 8 | 8 | 7 | 44.8 | 🚧 |

| Advanced filters | 7 | 6 | 5 | 21 | 🚧 |

| Historical comparison UI | 6 | 7 | 4 | 16.8 | 🚧 |

| Error boundaries | 7 | 9 | 8 | 50.4 | ❌ |

| Testing setup | 6 | 8 | 5 | 24 | ❌ |

| Risk scenarios | 5 | 4 | 2 | 4 | ❌ |

Top Priorities by ICE Score:

  1. Error boundaries (50.4) - High impact, easy to implement
  2. Export to Excel (44.8) - User-requested feature
  3. Remove Recharts (30) - Quick win, technical cleanup
  4. Fix TypeScript violations (27) - Code quality
  5. Testing setup (24) - Long-term maintainability

What Changed from Old App

Tech Stack Evolution

| Component | Old App | New App | Reason |

|-----------|---------|---------|--------|

| React | 16.x | 19.x | Latest features, better performance |

| Language | JavaScript | TypeScript | Type safety, better DX |

| Build Tool | Create React App | Vite | 10x faster builds, modern |

| Styling | Material-UI v4 | Tailwind + shadcn | More flexible, lighter |

| Charts | Recharts | Chart.js | Better performance, more features |

| State | Redux | Plain React hooks | Simpler, less boilerplate |

| Backend | Custom Node.js | Supabase | Faster development, PostgreSQL |

State Management Migration

Note: Skills previously claimed migration to TanStack Query + Zustand, but actual implementation uses plain React hooks only.

Why No Global State Library?

Portfolio Buddy 2 is simple enough to use React's built-in state:

Migration Lessons Learned

What Went Well

  1. Vite adoption - Build times dropped from 30s to 2s
  2. TypeScript migration - Caught many bugs early
  3. Chart.js over Recharts - Better performance with large datasets
  4. Simplified state - No Redux complexity
  5. Supabase integration - Fast backend setup

What Could Be Better

  1. Component size discipline - Let components grow too large
  2. TypeScript strictness - Too many any escapes
  3. Testing from start - No tests written yet (tech debt)
  4. Code reviews - Need refactoring before more features
  5. Documentation - Should have updated skills continuously

Migration Velocity

Next Steps

Immediate (This Sprint)

  1. Remove Recharts dependency
  2. Add error boundaries to risky components
  3. Fix highest-impact TypeScript any violations

Short Term (Next 2 Sprints)

  1. Refactor PortfolioSection into smaller components
  2. Implement Excel export
  3. Complete symbol/strategy filtering

Long Term (Next Quarter)

  1. Set up Vitest testing framework
  2. Add CI/CD with GitHub Actions
  3. Multi-period analysis UI
  4. Risk scenario modeling

Feature Parity Checklist

Comparing to old Portfolio Buddy v1:

| Feature | Old App | New App | Notes |

|---------|---------|---------|-------|

| CSV Upload | ✅ | ✅ | Improved error handling |

| Sharpe Ratio | ✅ | ✅ | Same calculation |

| Sortino Ratio | ✅ | ✅ | Fixed calculation (9f25040) |

| Max Drawdown | ✅ | ✅ | Same calculation |

| CAGR | ✅ | ✅ | Same calculation |

| Correlation Matrix | ✅ | ✅ | Added Pearson + Spearman |

| Equity Curves | ✅ | ✅ | Better charts with zoom/pan |

| Contract Multipliers | ❌ | ✅ | New feature |

| Date Filtering | ❌ | ✅ | New feature |

| Multi-column Sort | ✅ | ✅ | Improved with useSorting |

| Export to CSV | ✅ | ✅ | Same functionality |

| Export to Excel | ✅ | ❌ | Regression - needs reimplementation |

| Export to PDF | ✅ | ❌ | Regression - low priority |

| Symbol Filtering | ✅ | ❌ | Regression - in progress |

| Historical Compare | ✅ | ❌ | Regression - backend ready |

Parity Status: 85% (11/13 core features complete)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.