Communitygithub.com

Portfolio Buddy 2 - プロジェクトコンテキスト

React 19、TypeScript、ポートフォリオ分析機能、指標計算、取引戦略比較、またはPortfolio Buddy 2コードベースに関するあらゆるタスクに使用する自動ロードコンテキスト。テクノロジースタック、既知の問題、アーキテクチャ上の制約を含みます。

Portfolio Buddy 2 - プロジェクトコンテキスト とは?

このスキルは、投資家や先物トレーダー向けのポートフォリオ分析ツール「Portfolio Buddy 2」の開発に関する包括的なプロジェクトコンテキストを提供します。テクノロジースタック(React 19、TypeScript、Vite、Chart.js、Tailwind CSS、Supabaseなど)、プロジェクトの目的(戦略比較、相関行列計算、リスク指標分析、CSVアップロード、先物取引の契約乗数適用など)、既知の問題と技術的負債(未使用依存関係Recharts、200行制限を超える肥大化コンポーネント、15件のany型違反、Supabaseアップロードの断続的な500エラー)、および最近追加された機能(Sortino比率計算、日付範囲フィルタリング、高度なマルチカラムソート)を網羅しています。また、コンポーネントの最大200行制限、カスタムフックパターン、厳格なTypeScript使用、プレーンなReactフックによる状態管理などのアーキテクチャ上の制約も定義しています。主にClaude CodeなどのAIエージェントで使用することを想定しており、コード生成やリファクタリング時にプロジェクトのルールや現在の状態を把握するのに役立ちます。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/aiskillstore/marketplace/5minfutures/portfolio-context

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Portfolio Buddy 2 - プロジェクトコンテキスト は何をしますか?

テクノロジースタック

  • フロントエンド: React 19, TypeScript, Vite
  • UI: Tailwind CSS, shadcn/ui(カラーパレットのみ)
  • チャート: Chart.js, react-chartjs-2, chartjsプラグイン(zoom, annotation, date adapter)
  • 状態管理: プレーンなReact(useState, useMemo, useCallback)
  • データユーティリティ: date-fns(日付操作)
  • バックエンド: Supabase(PostgreSQL)
  • デプロイ: Cloudflare Pages

プロジェクトの目的

投資家と先物トレーダーのためのポートフォリオ分析ツール。以下の機能を提供します。

  • 取引戦略とベンチマーク資産(SPY、GLD)の比較
  • 資産間の相関行列の計算(Spearman & Pearson)
  • リスク指標とパフォーマンスの分析(Sharpe、Sortino、最大ドローダウンなど)
  • CSVによる取引データのアップロードと結果の可視化
  • 先物取引の指標調整のための契約乗数の適用
  • 期間別分析のための日付範囲フィルタリング

既知の問題と技術的負債

現在の技術的負債

  1. 未使用の依存関係: Recharts (11.5KB) がインストールされているが、一度もインポートされていない

    • package.jsonから削除すべき
    • 現在は Chart.js を使用している
  2. 肥大化したコンポーネント: 200行の標準を超過

    • PortfolioSection.tsx (591行) → サブコンポーネントへのリファクタリングが必要
    • App.tsx (351行) → セクションをコンポーネントに抽出
    • MetricsTable.tsx (242行) → 改善されたが、依然として制限超過
  3. TypeScript違反: any 型が15件存在

    • usePortfolio.ts: 取引/指標タイプに11件
    • useMetrics.ts: ソート比較に4件
    • dataUtils.ts: Metricsインターフェースに1件

既知のバグ

  1. Supabaseアップロードエラー: 大規模アップロード時に断続的な500エラーが発生
    • コミット9fb7fdbでエラーハンドリングを強化
    • アップロードフックのエラーハンドリングを確認
    • 無料枠の行上限を超えていないか確認

最近追加された機能

  • Sortino比率計算(コミット 258ba3a, 9f25040)
    • 場所: PortfolioSection.tsx にインライン実装(133~158行目)
    • ユーザー指定のリスクフリーレートのための入力状態
    • sqrt(365) 係数を使用した年率化下方偏差
    • 修正された分散計算(全リターンで除算、負のリターンのみではない)
    • ポートフォリオ統計セクションに表示(535行目)
    • 注意: dataUtils.tsにはなく、ポートフォリオレベルのコンテキストのためにコンポーネント内に保持
  • 日付範囲フィルタリング(コミット 258ba3a)
    • 開始日/終了日でポートフォリオデータをフィルタリング
    • usePortfolioフックに実装
  • 高度なマルチカラムソート(useSortingフック)
    • 優先順位付きの複数列ソート
    • カラムごとのカスタム比較ロジック

アーキテクチャ上の制約

  • コンポーネントの行数制限: コンポーネントあたり最大200行(現在3つのコンポーネントが違反)
  • フックパターン: カスタムフックは /src/hooks/
  • ユーティリティパターン: 純粋関数は /src/utils/
  • 型安全性: 厳格なTypeScript、any 型は禁止(技術的負債として15件の違反あり)
  • 状態管理: プレーンなReactフックのみ - ZustandやTanStack Queryは使用しない

主要コンポーネント構成

src/
├── components/
│   ├── AnalyticsControls.tsx     (指標/ポートフォリオ/相関ビューの切り替え)
│   ├── ContractInput.tsx         (契約乗数入力)
│   ├── CorrelationHeatmap.tsx    (相関の可視化)
│   ├── CorrelationSection.tsx    (相関分析ラッパー)
│   ├── CustomTooltip.tsx         (チャートのツールチップ)
│   ├── ErrorList.tsx             (エラー表示)
│   ├── Header.tsx                (アプリヘッダー)
│   ├── MasterContractControl.tsx (全アイテムに契約値を適用)
│   ├── MetricsTable.tsx          (指標表示と選択)
│   ├── PortfolioSection.tsx      (ポートフォリオチャートと分析 - 591行!)
│   ├── SessionComplete.tsx       (完了画面)
│   ├── SortableHeader.tsx        (ソートインジケータ付きテーブルヘッダー)
│   ├── UploadedFilesList.tsx     (アップロード済みファイルのリスト)
│   └── UploadSection.tsx         (Supabaseへのファイルアップロード)
├── hooks/
│   ├── useContractMultipliers.ts (契約乗数の管理)
│   ├── useMetrics.ts             (取引指標の計算)
│   ├── usePortfolio.ts           (ポートフォリオデータと日付フィルタリング)
│   └── useSorting.ts             (高度なマルチカラムソート)
└── utils/
    └── dataUtils.ts              (指標計算、CSV解析、相関)

移行コンテキスト

旧アプリから40の機能を移行中(35/40完了)。詳細は migration-tracker スキルを参照。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Next.js 16+ uses App Router with Server Components by default. Client Components are only used when interactivity is needed (hooks, event handlers, browser APIs).

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

関連スキル