Communitygithub.com

bg-szy/TOP-SKILLS

為 Portfolio Buddy 2 開發自動載入的上下文。適用於任何涉及 React 19 開發、TypeScript、投資組合分析功能、指標計算、交易策略比較或 Portfolio Buddy 2 程式碼庫的任務。包含技術棧、已知問題和架構約束。

TOP-SKILLS 是什麼?

此技能為 Portfolio Buddy 2 提供完整專案上下文,這是一款專為投資者和期貨交易者設計的投資組合分析工具。它詳細說明了技術棧(React 19、TypeScript、Vite、Tailwind CSS、Chart.js、Supabase),並列出了用於比較交易策略、計算相關矩陣以及分析夏普比率和索提諾比率等風險指標的核心功能。該上下文記錄了重要的架構限制,例如元件上限為 200 行、使用純 React Hook 進行狀態管理以及嚴格的 TypeScript 強制執行,同時也識別了現有技術債務,例如超標的元件、未使用的相依套件以及 15 個 TypeScript any 型別違規。此外,它還概述了已知的錯誤,包括 Supabase 上傳錯誤,並說明了近期新增的功能,例如索提諾比率計算和日期範圍篩選。此技能主要用於 Cursor 和類似基於 AI 的編輯器,以為開發工作提供特定專案的引導。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/bg-szy/TOP-SKILLS/tree/HEAD/skills/marketplace/portfolio-context

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Portfolio Buddy 2 - 專案上下文

技術棧

  • 前端:React 19、TypeScript、Vite
  • UI:Tailwind CSS、shadcn/ui(僅色彩系統)
  • 圖表:Chart.js、react-chartjs-2、chartjs 外掛(縮放、註釋、日期適配器)
  • 狀態管理:純 React(useState、useMemo、useCallback)
  • 資料工具:date-fns 用於日期操作
  • 後端:Supabase (PostgreSQL)
  • 部署:Cloudflare Pages

專案目的

為投資者和期貨交易者提供投資組合分析工具,用於:

  • 比較交易策略與基準資產(SPY、GLD)
  • 計算資產之間的相關矩陣(Spearman 與 Pearson)
  • 分析風險指標與績效(夏普比率、索提諾比率、最大回撤等)
  • 透過 CSV 上傳交易資料並視覺化結果
  • 應用合約乘數調整期貨交易的指標
  • 按日期範圍篩選資料進行特定時期分析

已知問題與技術債務

當前技術債務

  1. 未使用的相依套件:已安裝 Recharts(11.5KB)但從未匯入

    • 應從 package.json 中移除
    • 目前改用 Chart.js
  2. 超標元件:違反 200 行標準

    • PortfolioSection.tsx(591 行)→ 需要重構為子元件
    • App.tsx(351 行)→ 將區塊提取為元件
    • MetricsTable.tsx(242 行)→ 已改善但仍超出限制
  3. TypeScript 違規:15 處使用 any 型別

    • usePortfolio.ts:11 處,用於交易/指標型別
    • useMetrics.ts:4 處,用於排序比較
    • dataUtils.ts:1 處,用於 Metrics 介面

已知錯誤

  1. Supabase 上傳錯誤:大型上傳時偶發 500 錯誤
    • 已在提交 9fb7fdb 中增強錯誤處理
    • 檢查上傳 hook 中的錯誤處理
    • 確認免費方案未超過資料列限制

近期新增功能

  • 索提諾比率計算(提交 258ba3a、9f25040)
    • 位置:在 PortfolioSection.tsx 中內聯實作(第 133-158 行)
    • 無風險利率輸入狀態,使用者可指定無風險利率
    • 使用 sqrt(365) 因子計算年化下行偏離度
    • 修正變異數計算(除以總收益率,而非僅負值)
    • 顯示於投資組合統計區域(第 535 行)
    • 注意:不在 dataUtils.ts 中 - 因投資組合層級上下文保留在元件內
  • 日期範圍篩選(提交 258ba3a)
    • 按開始/結束日期篩選投資組合資料
    • 在 usePortfolio hook 中實作
  • 進階多欄排序(useSorting hook)
    • 依優先級對多個欄位排序
    • 每欄自訂比較邏輯

架構約束

  • 元件限制:每個元件最多 200 行(目前有 3 個元件違規)
  • Hook 模式:自訂 Hook 置於 /src/hooks/
  • 工具模式:純函數置於 /src/utils/
  • 型別安全:嚴格 TypeScript,不使用 any 型別(目前有 15 處技術債務違規)
  • 狀態管理:僅使用純 React Hook - 不使用 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       (完成 UI)
│   ├── SortableHeader.tsx        (含排序指示器的表格標頭)
│   ├── UploadedFilesList.tsx     (已上傳檔案清單)
│   └── UploadSection.tsx         (上傳檔案至 Supabase)
├── hooks/
│   ├── useContractMultipliers.ts (管理合約乘數)
│   ├── useMetrics.ts             (計算交易指標)
│   ├── usePortfolio.ts           (投資組合資料與日期篩選)
│   └── useSorting.ts             (進階多欄排序)
└── utils/
    └── dataUtils.ts              (指標計算、CSV 解析、相關性)

主要慣例

  • 路徑別名:@/ 對應 src/ — 所有內部匯入皆使用此別名
  • shadcn-ui:僅色彩權杖 — CSS 變數在 src/index.css 中,未安裝實際的 shadcn 元件。日後可透過 npx shadcn@latest add button 等指令新增
  • Git 工作流程:功能分支 → git checkout -b feature/name → 常規提交(feat:、fix:、chore:)→ PR 至 main
  • 社群品牌:5minfutures.com 交易社群;資產中的 Skool 標誌;內嵌 GoHighLevel 表單

遷移上下文

從舊應用程式遷移 40 項功能(已完成 90%)。詳細資訊請參閱 migration-tracker 技能。

Individual skills in this repo

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

bg-szy/TOP-SKILLS

Brand-first landing page designer — runs a brand-identity interview (colors, typography, shape language), then generates and iterates on a polished landing page via Stitch with deployment-ready HTML. Use when the user asks to create, design, or build a landing page, homepage, or marketing page and has no established visual direction. Skip when they have a design mockup, need a dashboard or app UI, are working at component level, building a multi-page app, or restyling with known design tokens — use frontend-design instead.

bg-szy/TOP-SKILLS

Fill out Microsoft Azure Landing Zone (ALZ) Accelerator checklists by interviewing the user, mapping their Azure subscriptions, integrating IP addressing documentation, and applying Microsoft Cloud Adoption Framework best practices. Produces a completed Excel checklist (.xlsx) ready for ALZ deployment. Use this skill whenever the user mentions Azure Landing Zone, ALZ checklist, landing zone accelerator, platform landing zone configuration, ALZ bootstrap, hub-and-spoke setup, Azure network topology planning, or wants to fill out any ALZ-related checklist or configuration file. Also trigger when the user uploads an Excel file that contains tabs like "Accelerator - Bootstrap", "Accelerator - Bicep", or "Accelerator - Terraform".

bg-szy/TOP-SKILLS

Compose a premium, animated landing page section by section in Next.js + Tailwind + Motion (Framer Motion) — built on a real design system, with editorial copy and motion that feels human-crafted, not template-generated. Use when building or rebuilding a landing page, marketing site, or hero/feature/pricing/CTA sections that need to look production-ready and bespoke from day one.

bg-szy/TOP-SKILLS

Write high-converting landing page copy using proven frameworks like PAS (Problem-Agitate-Solution), AIDA, and StoryBrand. Creates headlines, value propositions, CTAs, and full page sections optimized for conversion. Use when users need landing page copy, sales page content, or marketing website text.

bg-szy/TOP-SKILLS

Optimize landing pages for conversions, performance, and SEO. Use when improving landing pages, increasing conversions, or optimizing page performance.

bg-szy/TOP-SKILLS

Review investment portfolios for risk, diversification, fees. Asset allocation recommendations, tax-loss harvesting, rebalancing.

bg-szy/TOP-SKILLS

Beads Viewer - Graph-aware triage engine for Beads projects. Computes PageRank, betweenness, critical path, and cycles. Use --robot-* flags for AI agents.

bg-szy/TOP-SKILLS

CI red? Call us. Pipeline fire brigade deploys. Use when user mentions CI failures, build errors, test failures, or pipeline issues. Do NOT load for: local builds, standard implementation work, reviews, or setup.

bg-szy/TOP-SKILLS

CASS Memory System - procedural memory for AI coding agents. Three-layer cognitive architecture with confidence decay, anti-pattern learning, cross-agent knowledge transfer, trauma guard safety system. Bun/TypeScript CLI.

bg-szy/TOP-SKILLS

Mandatory entry point: read this first for any request to make, create, edit, animate, or render a video, animation, or motion graphic, including a promo, explainer, captioned clip, title card, overlay, slideshow or interactive deck, Remotion port, or any HyperFrames HTML composition. Also use it to inspect, diagnose, validate, preview, publish, or batch-render an existing HyperFrames project. Inputs may be a website URL, GitHub PR, Figma design or URL, text or brief, existing footage, or music. It resumes project state, captures intent when applicable, selects and installs the owning workflow, and routes domain capabilities. HyperFrames is the default output framework unless the user explicitly chooses another framework for the deliverable or asks only to record a browser session.

bg-szy/TOP-SKILLS

Expert in building portfolios that actually land jobs and clients - not just showing work, but creating memorable experiences. Covers developer portfolios, designer portfolios, creative portfolios, and portfolios that convert visitors into opportunities.

bg-szy/TOP-SKILLS

Use when the user asks to "pre-launch check the landing page", "run a Quality-Score preflight", or "verify ad-to-page message match before launch"; produces an ad↔page continuity report — message-match gaps, above-the-fold check, page-speed read, form-friction count, mobile-render flags — as a pass/fix punch list. Not for redesigning or rewriting the page — use landing-optimizer; not for scoring the account or the RQS — use ad-account-auditor. 落地页体验预检/广告落地页一致性检查

bg-szy/TOP-SKILLS

Use when the user asks to "optimize our landing page for influencer traffic", "fix our promo-code landing page", or "improve conversion from a creator campaign"; produces a message-match audit, page-structure and social-proof recommendations, a promo-code/CTA conversion plan, and an A/B test roadmap. Not for measuring campaign results after launch — use performance-analyzer.

bg-szy/TOP-SKILLS

Audit a landing page, sales page or checkout page for conversion leaks and return a fix list ordered by expected revenue impact. Use when asked to review, critique or improve a landing page, sales page, opt-in page, product page or checkout flow, when conversion rate is low, when paid traffic is not converting, or when someone asks "why isn't this page converting" or wants a CRO / landing page review.

bg-szy/TOP-SKILLS

Landing page conversion optimization with layout rules, hero section design, and CTA psychology. Covers above-the-fold formula, social proof placement, mobile design, and F-pattern reading. Use for: startup landing pages, product pages, SaaS marketing, conversion optimization. Triggers: landing page, hero section, above the fold, conversion optimization, landing page design, cta button, hero image, landing page layout, saas landing page, product page design, conversion rate, landing page best practices

bg-szy/TOP-SKILLS

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.

bg-szy/TOP-SKILLS

Landing page conversion optimization with layout rules, hero section design, and CTA psychology. Covers above-the-fold formula, social proof placement, mobile design, and F-pattern reading. Use for: startup landing pages, product pages, SaaS marketing, conversion optimization. Triggers: landing page, hero section, above the fold, conversion optimization, landing page design, cta button, hero image, landing page layout, saas landing page, product page design, conversion rate, landing page best practices

bg-szy/TOP-SKILLS

Account assets, equity and fund positions, P&L, cash flow records, account statements, margin ratios, buy-power estimates, order management, and DCA recurring investments via Longbridge (most require Trade permission). Frameworks: portfolio diagnosis, rebalancing, asset allocation, risk analysis (VaR/CVaR), performance attribution, and tax-loss harvesting. Triggers: "持仓", "账户", "盈亏", "资产", "对账单", "下单", "买入", "卖出", "撤单", "定投", "组合诊断", "再平衡", "资产配置", "风险分析", "绩效归因", "税损收割", "持倉", "賬戶", "盈虧", "對賬單", "下單", "買入", "賣出", "組合診斷", "再平衡", "稅損收割", "positions", "portfolio", "P&L", "order", "buy", "sell", "DCA", "statement", "risk analysis", "rebalancing", "tax harvesting", "我的风险", "持仓风险", "风险敞口", "資產", "資產配置", "風險分析", "績效歸因", "撤單

bg-szy/TOP-SKILLS

Process video files with audio extraction, format conversion (mp4, webm), and Whisper transcription. Use when user mentions video conversion, audio extraction, transcription, mp4, webm, ffmpeg, or whisper transcription.

bg-szy/TOP-SKILLS

Using the Wonda CLI to generate images, videos, music, and audio from the terminal — plus LinkedIn, Reddit, and X/Twitter research and automation

相關技能