[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EJ0NHMPD2NY1AV85SFAK1W":3,"skill-same:01M6EJ0NHMPD2NY1AV85SFAK1W":69},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":35,"linkOnly":36,"markdownContent":37,"markdownBody":38,"frontMatter":39,"refName":40,"commitSha":41,"skillDirectory":42,"forksCount":43,"repositoryHtmlUrl":44,"repositoryHomepageUrl":45,"ownerHtmlUrl":46,"ownerBlogUrl":6,"ownerDescription":47,"updatedAt":48,"install":49,"resources":62},"01M6EJ0NHMPD2NY1AV85SFAK1W","planning-guidelines",null,"Core planning principles for Portfolio Buddy 2 development. Use when: planning any feature implementation, modification, or refactoring. Ensures code preservation, mobile\u002Fdesktop optimization, and thorough requirement gathering.","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002F5minfutures\u002Fplanning-guidelines\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34],"guidelines","planning","planning guidelines","development","core","desktop","code","Optimization","refactoring","use","portfolio","implementation","mobile","feature implementation","feature","preservation","2026-11-10 10:12:30",false,"---\nname: planning-guidelines\ndescription: \"Core planning principles for Portfolio Buddy 2 development. Use when: planning any feature implementation, modification, or refactoring. Ensures code preservation, mobile\u002Fdesktop optimization, and thorough requirement gathering.\"\n---\n\n# Planning Guidelines for Portfolio Buddy 2\n\n## Core Principles\n\nWhen planning and implementing features for Portfolio Buddy 2, always follow these fundamental principles:\n\n1. **Preserve Existing Code** - Default to extending rather than replacing\n2. **Optimize for Mobile & Desktop** - Every feature must work well on both\n3. **Ask Clarifying Questions** - Gather complete context before execution\n4. **Integrate Seamlessly** - New code should feel native to the existing codebase\n\n---\n\n## Code Preservation Strategy\n\n### Default Behavior: Always Preserve\n\n**Rule:** Preserve existing code unless explicitly instructed to refactor or rewrite.\n\nWhen implementing new features or fixes:\n- ✅ Extend existing components\n- ✅ Add new functions alongside existing ones\n- ✅ Preserve existing patterns and conventions\n- ✅ Maintain backward compatibility\n- ❌ Don't refactor working code \"just because\"\n- ❌ Don't introduce new patterns without justification\n\n### Exception: Massively Better Options\n\nYou MAY propose improvements to existing code **ONLY** when ALL conditions are met:\n\n1. **Very Low Risk** - Change is isolated, well-understood, easily reversible\n2. **Massive Upside** - Significant benefit (correctness, performance, maintainability)\n3. **No Unnecessary Complexity** - Solution is simpler or equal complexity\n4. **Clear Justification** - Can explain why exception applies\n\n**When exception applies, you MUST:**\n- Explain the problem with current implementation\n- Show the proposed improvement\n- Demonstrate why it meets all three criteria\n- Get user approval before implementing\n\n### Real Example: Annual Growth Rate Fix\n\n**Situation:** During implementation of Trading Days update, discovered Annual Growth Rate calculation was mathematically incorrect.\n\n**Current (incorrect) code:**\n```typescript\nconst tradingPeriodDays = uniqueTradingDates.size || 1;  \u002F\u002F 150 days\nconst annualGrowthRate = (totalPnl \u002F startingCapital \u002F tradingPeriodDays) * 365 * 100;\n\u002F\u002F Result: Inflated by mixing trading days (denominator) with calendar day annualization (365)\n```\n\n**Why exception applied:**\n1. **Very Low Risk** ✅\n   - Isolated calculation (one line)\n   - Easy to understand (calendar days vs trading days)\n   - Easily reversible if wrong\n\n2. **Massive Upside** ✅\n   - Fixes incorrect financial metric (accuracy critical)\n   - Returns were inflated by ~2.4x\n   - Aligns with financial industry standards\n\n3. **No Unnecessary Complexity** ✅\n   - Added 9 lines (calendar day calculation)\n   - Clearer, more correct logic\n   - No new dependencies\n\n**Result:** User approved fix immediately because exception criteria were clearly met.\n\n---\n\n## Mobile & Desktop Optimization\n\nEvery feature must be optimized for both mobile and desktop experiences.\n\n### Quick Reference Checklist\n\n✅ **Use Responsive Tailwind Classes**\n- Base styles for mobile (no prefix)\n- `sm:` for small screens (640px+)\n- `md:` for medium screens (768px+)\n- `lg:` for large screens (1024px+)\n\n✅ **Touch Targets**\n- Minimum 44x44 pixels for all interactive elements\n- Use `touch-manipulation` CSS class for better touch response\n\n✅ **Test Both Viewports**\n- Verify layout works on mobile and desktop before completion\n- Check that text is readable on small screens\n- Ensure buttons\u002Finputs are appropriately sized\n\n### Existing Patterns to Follow\n\nPortfolio Buddy 2 already has excellent responsive patterns. Reference these:\n\n**Example 1: Responsive Text Sizing**\n```tsx\nclassName=\"text-xs sm:text-sm\"        \u002F\u002F Smaller on mobile\nclassName=\"text-base sm:text-lg\"      \u002F\u002F Larger on desktop\n```\n\n**Example 2: Responsive Spacing**\n```tsx\nclassName=\"gap-1 sm:gap-2\"           \u002F\u002F Tighter gaps on mobile\nclassName=\"px-2 sm:px-4 py-2 sm:py-3\" \u002F\u002F Smaller padding on mobile\n```\n\n**Example 3: Responsive Layout**\n```tsx\nclassName=\"flex flex-col sm:flex-row\"  \u002F\u002F Stack on mobile, row on desktop\n```\n\n**Example 4: Responsive Visibility**\n```tsx\n\u003Cspan className=\"hidden sm:inline\">Total Margin\u003C\u002Fspan>  \u002F\u002F Hide text on mobile, show on desktop\n```\n\n**See:** [src\u002Fcomponents\u002FPortfolioSection.tsx](src\u002Fcomponents\u002FPortfolioSection.tsx) for comprehensive examples of responsive patterns throughout the application.\n\n---\n\n## Clarifying Questions Framework\n\n### When to Ask Questions\n\nAsk clarifying questions **BEFORE** executing when:\n- Requirements are ambiguous\n- Multiple valid approaches exist\n- Decision affects architecture or user experience\n- User's request could be interpreted multiple ways\n- You need context about business logic or domain knowledge\n\n### Question Format Template\n\nUse this structure for ALL clarifying questions:\n\n```\n## Clarifying Question: [Topic]\n\n[Brief context about why you need to ask]\n\n**Option A: [Approach Name]** ✅ (Recommended)\n- [Detail about approach]\n- [Key characteristics]\n- **Pros:** [Benefits]\n- **Cons:** [Trade-offs]\n- **Why experts prefer this:** [Technical reasoning from domain expert perspective]\n\n**Option B: [Alternative Approach]**\n- [Detail about approach]\n- [Key characteristics]\n- **Pros:** [Benefits]\n- **Cons:** [Trade-offs]\n- **Trade-offs:** [Why this isn't the top choice]\n\n**Option C: [Another Alternative]** (if applicable)\n- [Detail about approach]\n- [Key characteristics]\n- **Pros:** [Benefits]\n- **Cons:** [Trade-offs]\n- **Trade-offs:** [Why this isn't the top choice]\n```\n\n### Key Requirements\n\n1. **Mark Best Option** - Use ✅ to indicate expert-recommended choice\n2. **Explain Reasoning** - \"Why experts prefer this\" section required\n3. **Unbiased Options** - Present all options fairly, let marking indicate preference\n4. **Complete Context** - User should understand trade-offs without additional research\n\n### Real Example: Trading Days Calculation\n\nFrom today's conversation about how to calculate Trading Days:\n\n```\n## Clarifying Question 2: Trading Days Calculation with Date Filters\n\nWhen the user sets a custom date range (Start Date\u002FEnd Date), should Trading Days represent:\n\n**Option A: The number of calendar days in the selected date range** ✅ (Recommended)\n- Example: Jan 1 to Jan 31 = 31 days\n- **Pros:** Simple, matches user's mental model of \"days in range\"\n- **Cons:** Doesn't account for non-trading days\n- **Why experts prefer this:** For portfolio analysis, calendar days provide accurate time-based performance metrics and match financial industry standards for annualized returns.\n\n**Option B: The number of actual trading days (days with trades) within the date range**\n- Example: Jan 1 to Jan 31 = only count days where trades occurred (e.g., 18 days)\n- **Pros:** Reflects actual market activity\n- **Cons:** Can be misleading - a strategy might not trade every day by design\n- **Trade-offs:** Better for measuring trading frequency, not time-based performance\n```\n\n**Outcome:** User chose Option B, demonstrating how clear options enable informed decisions.\n\n---\n\n## Decision Criteria\n\n### When to Preserve vs Improve\n\nUse this decision tree:\n\n```\nIs the code broken or incorrect?\n├─ YES → Fix it (with explanation)\n└─ NO → Is there a massively better option?\n    ├─ YES → Does it meet ALL exception criteria?\n    │   ├─ YES → Propose improvement (get approval)\n    │   └─ NO → Preserve existing code\n    └─ NO → Preserve existing code\n```\n\n### Risk Assessment Checklist\n\nBefore proposing any change to existing code, verify:\n\n- [ ] Change is isolated to specific files\u002Ffunctions\n- [ ] No ripple effects on other features\n- [ ] TypeScript compilation succeeds\n- [ ] No breaking changes to interfaces\n- [ ] Existing tests still pass (if tests exist)\n- [ ] Can be reverted with single git revert\n\n### Complexity Evaluation\n\nAvoid unnecessary complexity:\n\n- ❌ Adding new libraries when existing ones suffice\n- ❌ Introducing new patterns when existing patterns work\n- ❌ Over-engineering simple features\n- ❌ Premature optimization\n- ✅ Using existing utilities and components\n- ✅ Following established patterns\n- ✅ Simple, readable solutions\n\n---\n\n## Integration with Other Skills\n\nThis skill works alongside other Portfolio Buddy 2 skills:\n\n- **Use with `planning-framework`** - Apply Musk's 5-step algorithm and ICE scoring for feature planning\n- **Reference `coding-standards`** - Follow React 19 and TypeScript standards during implementation\n- **Check `architecture-reference`** - Understand component hierarchy and existing patterns before adding code\n- **Consult `migration-tracker`** - Verify feature parity and check for known issues before starting\n- **Load `portfolio-context`** - Get tech stack and architectural constraints context\n\n**Workflow:**\n1. Load `planning-guidelines` (this skill) → Understand principles\n2. Load `planning-framework` → Plan the feature approach\n3. Check `architecture-reference` → Find where code goes\n4. Apply `coding-standards` → Write the code correctly\n5. Update `migration-tracker` → Document what was added\n\n---\n\n## Real Portfolio Buddy 2 Examples\n\n### Example 1: Risk-Free Rate Default (Code Preservation)\n\n**Task:** Set Risk-Free Rate default to 4%\n\n**Approach:** Pure preservation\n- Found existing code: `useState\u003Cnumber>(0)`\n- Changed ONLY the default value: `useState\u003Cnumber>(4)`\n- Preserved everything else: input field, validation, usage in Sortino Ratio\n- **Result:** One line changed, zero risk\n\n### Example 2: Trading Days Update (Code Preservation)\n\n**Task:** Make Trading Days recalculate when date range changes\n\n**Approach:** Extend existing calculation\n- Kept existing `tradingPeriodDays` variable and display\n- Added new logic to count unique dates from filtered trades\n- Preserved all downstream usage (Annual Growth Rate, etc.)\n- **Result:** Extended, didn't replace\n\n### Example 3: Total Margin Button (Seamless Integration)\n\n**Task:** Add \"Set to Total Margin\" button for Starting Capital\n\n**Approach:** Mobile\u002Fdesktop optimized integration\n- Added button next to existing Starting Capital input\n- Used existing Portfolio Buddy 2 responsive patterns:\n  - `className=\"flex items-center gap-1 sm:gap-2\"` (responsive spacing)\n  - `\u003Cspan className=\"hidden sm:inline\">Total Margin\u003C\u002Fspan>` (hide text on mobile)\n  - `className=\"h-3 w-3 sm:h-3.5 sm:w-3.5\"` (smaller icon on mobile)\n  - `touch-manipulation` class for better mobile interaction\n- Matched existing blue theme and styling\n- Only appears when `portfolioData` exists (conditional rendering)\n- **Result:** Feels native, works on both viewports\n\n### Example 4: Annual Growth Rate Fix (Exception Case)\n\n**Task:** Originally just fixing Trading Days calculation\n\n**Discovery:** Found Annual Growth Rate calculation was mathematically incorrect\n\n**Exception Applied:**\n- **Very Low Risk:** Isolated calculation, 9 lines added, clear logic\n- **Massive Upside:** Fixed inflated returns (was ~2.4x too high), critical for financial accuracy\n- **No Complexity:** Simpler logic (calendar days vs trading days), more maintainable\n\n**Approach:**\n1. Explained the problem clearly\n2. Showed incorrect vs correct formula with examples\n3. Demonstrated exception criteria were met\n4. Got user approval\n5. Implemented fix\n\n**Result:** User approved immediately because criteria were objective and clearly met.\n\n---\n\n## Summary\n\n**Always:**\n- Preserve existing code by default\n- Optimize for mobile AND desktop\n- Ask clarifying questions with ✅ marked recommendations\n- Integrate seamlessly with existing patterns\n\n**Only when ALL criteria met:**\n- Propose improvements (low risk + massive upside + no added complexity)\n- Get user approval before implementing\n\n**Never:**\n- Refactor working code without justification\n- Add complexity unnecessarily\n- Guess at requirements when you could ask\n- Ignore mobile or desktop experience\n\n---\n\n**This skill ensures Portfolio Buddy 2 remains maintainable, consistent, and user-friendly across all devices while preserving the stability of working code.**","# Planning Guidelines for Portfolio Buddy 2\n\n## Core Principles\n\nWhen planning and implementing features for Portfolio Buddy 2, always follow these fundamental principles:\n\n1. **Preserve Existing Code** - Default to extending rather than replacing\n2. **Optimize for Mobile & Desktop** - Every feature must work well on both\n3. **Ask Clarifying Questions** - Gather complete context before execution\n4. **Integrate Seamlessly** - New code should feel native to the existing codebase\n\n---\n\n## Code Preservation Strategy\n\n### Default Behavior: Always Preserve\n\n**Rule:** Preserve existing code unless explicitly instructed to refactor or rewrite.\n\nWhen implementing new features or fixes:\n- ✅ Extend existing components\n- ✅ Add new functions alongside existing ones\n- ✅ Preserve existing patterns and conventions\n- ✅ Maintain backward compatibility\n- ❌ Don't refactor working code \"just because\"\n- ❌ Don't introduce new patterns without justification\n\n### Exception: Massively Better Options\n\nYou MAY propose improvements to existing code **ONLY** when ALL conditions are met:\n\n1. **Very Low Risk** - Change is isolated, well-understood, easily reversible\n2. **Massive Upside** - Significant benefit (correctness, performance, maintainability)\n3. **No Unnecessary Complexity** - Solution is simpler or equal complexity\n4. **Clear Justification** - Can explain why exception applies\n\n**When exception applies, you MUST:**\n- Explain the problem with current implementation\n- Show the proposed improvement\n- Demonstrate why it meets all three criteria\n- Get user approval before implementing\n\n### Real Example: Annual Growth Rate Fix\n\n**Situation:** During implementation of Trading Days update, discovered Annual Growth Rate calculation was mathematically incorrect.\n\n**Current (incorrect) code:**\n```typescript\nconst tradingPeriodDays = uniqueTradingDates.size || 1;  \u002F\u002F 150 days\nconst annualGrowthRate = (totalPnl \u002F startingCapital \u002F tradingPeriodDays) * 365 * 100;\n\u002F\u002F Result: Inflated by mixing trading days (denominator) with calendar day annualization (365)\n```\n\n**Why exception applied:**\n1. **Very Low Risk** ✅\n   - Isolated calculation (one line)\n   - Easy to understand (calendar days vs trading days)\n   - Easily reversible if wrong\n\n2. **Massive Upside** ✅\n   - Fixes incorrect financial metric (accuracy critical)\n   - Returns were inflated by ~2.4x\n   - Aligns with financial industry standards\n\n3. **No Unnecessary Complexity** ✅\n   - Added 9 lines (calendar day calculation)\n   - Clearer, more correct logic\n   - No new dependencies\n\n**Result:** User approved fix immediately because exception criteria were clearly met.\n\n---\n\n## Mobile & Desktop Optimization\n\nEvery feature must be optimized for both mobile and desktop experiences.\n\n### Quick Reference Checklist\n\n✅ **Use Responsive Tailwind Classes**\n- Base styles for mobile (no prefix)\n- `sm:` for small screens (640px+)\n- `md:` for medium screens (768px+)\n- `lg:` for large screens (1024px+)\n\n✅ **Touch Targets**\n- Minimum 44x44 pixels for all interactive elements\n- Use `touch-manipulation` CSS class for better touch response\n\n✅ **Test Both Viewports**\n- Verify layout works on mobile and desktop before completion\n- Check that text is readable on small screens\n- Ensure buttons\u002Finputs are appropriately sized\n\n### Existing Patterns to Follow\n\nPortfolio Buddy 2 already has excellent responsive patterns. Reference these:\n\n**Example 1: Responsive Text Sizing**\n```tsx\nclassName=\"text-xs sm:text-sm\"        \u002F\u002F Smaller on mobile\nclassName=\"text-base sm:text-lg\"      \u002F\u002F Larger on desktop\n```\n\n**Example 2: Responsive Spacing**\n```tsx\nclassName=\"gap-1 sm:gap-2\"           \u002F\u002F Tighter gaps on mobile\nclassName=\"px-2 sm:px-4 py-2 sm:py-3\" \u002F\u002F Smaller padding on mobile\n```\n\n**Example 3: Responsive Layout**\n```tsx\nclassName=\"flex flex-col sm:flex-row\"  \u002F\u002F Stack on mobile, row on desktop\n```\n\n**Example 4: Responsive Visibility**\n```tsx\n\u003Cspan className=\"hidden sm:inline\">Total Margin\u003C\u002Fspan>  \u002F\u002F Hide text on mobile, show on desktop\n```\n\n**See:** [src\u002Fcomponents\u002FPortfolioSection.tsx](src\u002Fcomponents\u002FPortfolioSection.tsx) for comprehensive examples of responsive patterns throughout the application.\n\n---\n\n## Clarifying Questions Framework\n\n### When to Ask Questions\n\nAsk clarifying questions **BEFORE** executing when:\n- Requirements are ambiguous\n- Multiple valid approaches exist\n- Decision affects architecture or user experience\n- User's request could be interpreted multiple ways\n- You need context about business logic or domain knowledge\n\n### Question Format Template\n\nUse this structure for ALL clarifying questions:\n\n```\n## Clarifying Question: [Topic]\n\n[Brief context about why you need to ask]\n\n**Option A: [Approach Name]** ✅ (Recommended)\n- [Detail about approach]\n- [Key characteristics]\n- **Pros:** [Benefits]\n- **Cons:** [Trade-offs]\n- **Why experts prefer this:** [Technical reasoning from domain expert perspective]\n\n**Option B: [Alternative Approach]**\n- [Detail about approach]\n- [Key characteristics]\n- **Pros:** [Benefits]\n- **Cons:** [Trade-offs]\n- **Trade-offs:** [Why this isn't the top choice]\n\n**Option C: [Another Alternative]** (if applicable)\n- [Detail about approach]\n- [Key characteristics]\n- **Pros:** [Benefits]\n- **Cons:** [Trade-offs]\n- **Trade-offs:** [Why this isn't the top choice]\n```\n\n### Key Requirements\n\n1. **Mark Best Option** - Use ✅ to indicate expert-recommended choice\n2. **Explain Reasoning** - \"Why experts prefer this\" section required\n3. **Unbiased Options** - Present all options fairly, let marking indicate preference\n4. **Complete Context** - User should understand trade-offs without additional research\n\n### Real Example: Trading Days Calculation\n\nFrom today's conversation about how to calculate Trading Days:\n\n```\n## Clarifying Question 2: Trading Days Calculation with Date Filters\n\nWhen the user sets a custom date range (Start Date\u002FEnd Date), should Trading Days represent:\n\n**Option A: The number of calendar days in the selected date range** ✅ (Recommended)\n- Example: Jan 1 to Jan 31 = 31 days\n- **Pros:** Simple, matches user's mental model of \"days in range\"\n- **Cons:** Doesn't account for non-trading days\n- **Why experts prefer this:** For portfolio analysis, calendar days provide accurate time-based performance metrics and match financial industry standards for annualized returns.\n\n**Option B: The number of actual trading days (days with trades) within the date range**\n- Example: Jan 1 to Jan 31 = only count days where trades occurred (e.g., 18 days)\n- **Pros:** Reflects actual market activity\n- **Cons:** Can be misleading - a strategy might not trade every day by design\n- **Trade-offs:** Better for measuring trading frequency, not time-based performance\n```\n\n**Outcome:** User chose Option B, demonstrating how clear options enable informed decisions.\n\n---\n\n## Decision Criteria\n\n### When to Preserve vs Improve\n\nUse this decision tree:\n\n```\nIs the code broken or incorrect?\n├─ YES → Fix it (with explanation)\n└─ NO → Is there a massively better option?\n    ├─ YES → Does it meet ALL exception criteria?\n    │   ├─ YES → Propose improvement (get approval)\n    │   └─ NO → Preserve existing code\n    └─ NO → Preserve existing code\n```\n\n### Risk Assessment Checklist\n\nBefore proposing any change to existing code, verify:\n\n- [ ] Change is isolated to specific files\u002Ffunctions\n- [ ] No ripple effects on other features\n- [ ] TypeScript compilation succeeds\n- [ ] No breaking changes to interfaces\n- [ ] Existing tests still pass (if tests exist)\n- [ ] Can be reverted with single git revert\n\n### Complexity Evaluation\n\nAvoid unnecessary complexity:\n\n- ❌ Adding new libraries when existing ones suffice\n- ❌ Introducing new patterns when existing patterns work\n- ❌ Over-engineering simple features\n- ❌ Premature optimization\n- ✅ Using existing utilities and components\n- ✅ Following established patterns\n- ✅ Simple, readable solutions\n\n---\n\n## Integration with Other Skills\n\nThis skill works alongside other Portfolio Buddy 2 skills:\n\n- **Use with `planning-framework`** - Apply Musk's 5-step algorithm and ICE scoring for feature planning\n- **Reference `coding-standards`** - Follow React 19 and TypeScript standards during implementation\n- **Check `architecture-reference`** - Understand component hierarchy and existing patterns before adding code\n- **Consult `migration-tracker`** - Verify feature parity and check for known issues before starting\n- **Load `portfolio-context`** - Get tech stack and architectural constraints context\n\n**Workflow:**\n1. Load `planning-guidelines` (this skill) → Understand principles\n2. Load `planning-framework` → Plan the feature approach\n3. Check `architecture-reference` → Find where code goes\n4. Apply `coding-standards` → Write the code correctly\n5. Update `migration-tracker` → Document what was added\n\n---\n\n## Real Portfolio Buddy 2 Examples\n\n### Example 1: Risk-Free Rate Default (Code Preservation)\n\n**Task:** Set Risk-Free Rate default to 4%\n\n**Approach:** Pure preservation\n- Found existing code: `useState\u003Cnumber>(0)`\n- Changed ONLY the default value: `useState\u003Cnumber>(4)`\n- Preserved everything else: input field, validation, usage in Sortino Ratio\n- **Result:** One line changed, zero risk\n\n### Example 2: Trading Days Update (Code Preservation)\n\n**Task:** Make Trading Days recalculate when date range changes\n\n**Approach:** Extend existing calculation\n- Kept existing `tradingPeriodDays` variable and display\n- Added new logic to count unique dates from filtered trades\n- Preserved all downstream usage (Annual Growth Rate, etc.)\n- **Result:** Extended, didn't replace\n\n### Example 3: Total Margin Button (Seamless Integration)\n\n**Task:** Add \"Set to Total Margin\" button for Starting Capital\n\n**Approach:** Mobile\u002Fdesktop optimized integration\n- Added button next to existing Starting Capital input\n- Used existing Portfolio Buddy 2 responsive patterns:\n  - `className=\"flex items-center gap-1 sm:gap-2\"` (responsive spacing)\n  - `\u003Cspan className=\"hidden sm:inline\">Total Margin\u003C\u002Fspan>` (hide text on mobile)\n  - `className=\"h-3 w-3 sm:h-3.5 sm:w-3.5\"` (smaller icon on mobile)\n  - `touch-manipulation` class for better mobile interaction\n- Matched existing blue theme and styling\n- Only appears when `portfolioData` exists (conditional rendering)\n- **Result:** Feels native, works on both viewports\n\n### Example 4: Annual Growth Rate Fix (Exception Case)\n\n**Task:** Originally just fixing Trading Days calculation\n\n**Discovery:** Found Annual Growth Rate calculation was mathematically incorrect\n\n**Exception Applied:**\n- **Very Low Risk:** Isolated calculation, 9 lines added, clear logic\n- **Massive Upside:** Fixed inflated returns (was ~2.4x too high), critical for financial accuracy\n- **No Complexity:** Simpler logic (calendar days vs trading days), more maintainable\n\n**Approach:**\n1. Explained the problem clearly\n2. Showed incorrect vs correct formula with examples\n3. Demonstrated exception criteria were met\n4. Got user approval\n5. Implemented fix\n\n**Result:** User approved immediately because criteria were objective and clearly met.\n\n---\n\n## Summary\n\n**Always:**\n- Preserve existing code by default\n- Optimize for mobile AND desktop\n- Ask clarifying questions with ✅ marked recommendations\n- Integrate seamlessly with existing patterns\n\n**Only when ALL criteria met:**\n- Propose improvements (low risk + massive upside + no added complexity)\n- Get user approval before implementing\n\n**Never:**\n- Refactor working code without justification\n- Add complexity unnecessarily\n- Guess at requirements when you could ask\n- Ignore mobile or desktop experience\n\n---\n\n**This skill ensures Portfolio Buddy 2 remains maintainable, consistent, and user-friendly across all devices while preserving the stability of working code.**",{"name":5,"description":7},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Faiskillstore\u002Fmarketplace\u002F5minfutures\u002Fplanning-guidelines",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":50,"prompt":60,"zipAvailable":61},[51,54,57],{"tool":52,"command":53},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill planning-guidelines",{"tool":55,"command":56},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill planning-guidelines",{"tool":58,"command":59},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill planning-guidelines","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002F5minfutures\u002Fplanning-guidelines\u002FSKILL.md",true,[63],{"path":64,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":67,"sourceHtmlUrl":68},"skill-report.json","REFERENCE","参考文档",13428,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Faiskillstore\u002Fmarketplace\u002F5minfutures\u002Fplanning-guidelines\u002Fskill-report.json",[70,79,88,97,103,109],{"skillNo":71,"name":72,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":35},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[76,77,78],"model","model hierarchy","model hierarchy skill",{"skillNo":80,"name":81,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":35},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[85,86,87],"MCP","zoom","zoom mcp",{"skillNo":89,"name":90,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":35},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[94,95,96,86],"sdk","zoom apps sdk","apps",{"skillNo":98,"name":99,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":35},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[99],{"skillNo":104,"name":105,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":35},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[105],{"skillNo":110,"name":111,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":35},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[111]]