Communitygithub.com

aiskillstore/marketplace

自动加载 Portfolio Buddy 2 开发的上下文。适用于任何涉及 React 19 开发、TypeScript、投资组合分析功能、指标计算、交易策略比较或操作 Portfolio Buddy 2 代码库的任务。包含技术栈、已知问题和架构约束。

marketplace 是什么?

该技能为开发者在开发 Portfolio Buddy 2 项目时提供自动加载的上下文,确保 AI 助手能理解项目特定的技术栈、架构约束和已知问题。它适用于所有涉及 React 19、TypeScript、投资组合分析、指标计算和交易策略比较的任务。该技能支持现代前端工具链,包括 Vite、Tailwind CSS 和 Chart.js,以及 Supabase 后端和 Cloudflare Pages 部署。通过提供当前的技术债务(如超大组件、TypeScript 违规)和已知错误(如 Supabase 上传错误)的详细说明,它帮助开发者避免常见陷阱,并保持代码库的一致性。内容包括完整的组件结构、钩子模式和实用方法,确保 AI 生成的代码符合项目约定。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/aiskillstore/marketplace/tree/HEAD/skills/5minfutures/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)
  • 分析风险指标和绩效(Sharpe, Sortino, 最大回撤等)
  • 通过 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: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 解析、相关性)

关键约定

  • 路径别名:@/ 映射到 src/——所有内部导入请使用此别名
  • shadcn-ui:仅颜色令牌——CSS 变量在 src/index.css 中,未安装实际的 shadcn 组件。后续可通过 npx shadcn@latest add button 等方式添加
  • Git 工作流:功能分支 → git checkout -b feature/name → 常规提交(feat:, fix:, chore:)→ 向 main 分支提交 PR
  • 社区品牌: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.

aiskillstore/marketplace

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.

aiskillstore/marketplace

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. 落地页体验预检/广告落地页一致性检查

aiskillstore/marketplace

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.

aiskillstore/marketplace

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.

aiskillstore/marketplace

This skill helps users extract GitHub repository project details and contributor contact information using keywords, stars, and update dates. Agent should proactively apply this skill when users express needs like search for GitHub projects by keywords, find top open-source contributors in specific domains, extract developer contacts from GitHub repositories, discover trending repositories with high stars, gather contributor profiles and social links for tech recruiting, retrieve GitHub project descriptions and metrics, build developer communities by finding active contributors, search for repositories updated recently, collect personal website and Twitter links of developers, generate targeted leads for developer tools, or track active open-source contributors for collaboration.

aiskillstore/marketplace

Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.

aiskillstore/marketplace

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

aiskillstore/marketplace

Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks

aiskillstore/marketplace

Generates creative domain name ideas for your project and checks availability across multiple TLDs (.com, .io, .dev, .ai, etc.). Saves hours of brainstorming and manual checking.

aiskillstore/marketplace

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.

aiskillstore/marketplace

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output should be a bitmap asset rather than repo-native code or vector. Do not use when the task is better handled by editing existing SVG/vector/code-native assets, extending an established icon or logo system, or building the visual directly in HTML/CSS/canvas.

aiskillstore/marketplace

A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).

aiskillstore/marketplace

Router skill for LLMQuant portfolio workflows. Use when the user needs company profiles, thesis tracking, theme research, watchlist monitoring, or alert management.

aiskillstore/marketplace

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", "我的风险", "持仓风险", "风险敞口", "資產", "資產配置", "風險分析", "績效歸因", "撤單

aiskillstore/marketplace

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

aiskillstore/marketplace

Use for Codex models/pricing, scheduled tasks, skills, settings, setup, troubleshooting, customization, automations, and self-knowledge—including 'you,' 'your,' 'this app,' or 'this coding agent' when they refer to Codex—and for OpenAI APIs/products and ChatGPT Work. Also use for model choice/migration, prompting, SDKs, Responses, Realtime, agents, evals, and Chat/Work/Codex comparisons. Do not use for generic app/software tasks that merely mention Codex.

aiskillstore/marketplace

Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.

aiskillstore/marketplace

Presentation creation, editing, and analysis. When Claude needs to work with presentations (.pptx files) for: (1) Creating new presentations, (2) Modifying or editing content, (3) Working with layouts, (4) Adding comments or speaker notes, or any other presentation tasks

aiskillstore/marketplace

Perform a read-only, defect-first review of a specified code change and return every actionable finding. Use when another agent delegates review of uncommitted changes, a base-branch diff, a commit, or custom review instructions.

aiskillstore/marketplace

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.

相关技能