skills/5minfutures/planning-guidelines/SKILL.md
Core planning principles for Portfolio Buddy 2 development. Use when: planning any feature implementation, modification, or refactoring. Ensures code preservation, mobile/desktop optimization, and thorough requirement gathering.
npx skillsauth add aiskillstore/marketplace planning-guidelinesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
When planning and implementing features for Portfolio Buddy 2, always follow these fundamental principles:
Rule: Preserve existing code unless explicitly instructed to refactor or rewrite.
When implementing new features or fixes:
You MAY propose improvements to existing code ONLY when ALL conditions are met:
When exception applies, you MUST:
Situation: During implementation of Trading Days update, discovered Annual Growth Rate calculation was mathematically incorrect.
Current (incorrect) code:
const tradingPeriodDays = uniqueTradingDates.size || 1; // 150 days
const annualGrowthRate = (totalPnl / startingCapital / tradingPeriodDays) * 365 * 100;
// Result: Inflated by mixing trading days (denominator) with calendar day annualization (365)
Why exception applied:
Very Low Risk ✅
Massive Upside ✅
No Unnecessary Complexity ✅
Result: User approved fix immediately because exception criteria were clearly met.
Every feature must be optimized for both mobile and desktop experiences.
✅ Use Responsive Tailwind Classes
sm: for small screens (640px+)md: for medium screens (768px+)lg: for large screens (1024px+)✅ Touch Targets
touch-manipulation CSS class for better touch response✅ Test Both Viewports
Portfolio Buddy 2 already has excellent responsive patterns. Reference these:
Example 1: Responsive Text Sizing
className="text-xs sm:text-sm" // Smaller on mobile
className="text-base sm:text-lg" // Larger on desktop
Example 2: Responsive Spacing
className="gap-1 sm:gap-2" // Tighter gaps on mobile
className="px-2 sm:px-4 py-2 sm:py-3" // Smaller padding on mobile
Example 3: Responsive Layout
className="flex flex-col sm:flex-row" // Stack on mobile, row on desktop
Example 4: Responsive Visibility
<span className="hidden sm:inline">Total Margin</span> // Hide text on mobile, show on desktop
See: src/components/PortfolioSection.tsx for comprehensive examples of responsive patterns throughout the application.
Ask clarifying questions BEFORE executing when:
Use this structure for ALL clarifying questions:
## Clarifying Question: [Topic]
[Brief context about why you need to ask]
**Option A: [Approach Name]** ✅ (Recommended)
- [Detail about approach]
- [Key characteristics]
- **Pros:** [Benefits]
- **Cons:** [Trade-offs]
- **Why experts prefer this:** [Technical reasoning from domain expert perspective]
**Option B: [Alternative Approach]**
- [Detail about approach]
- [Key characteristics]
- **Pros:** [Benefits]
- **Cons:** [Trade-offs]
- **Trade-offs:** [Why this isn't the top choice]
**Option C: [Another Alternative]** (if applicable)
- [Detail about approach]
- [Key characteristics]
- **Pros:** [Benefits]
- **Cons:** [Trade-offs]
- **Trade-offs:** [Why this isn't the top choice]
From today's conversation about how to calculate Trading Days:
## Clarifying Question 2: Trading Days Calculation with Date Filters
When the user sets a custom date range (Start Date/End Date), should Trading Days represent:
**Option A: The number of calendar days in the selected date range** ✅ (Recommended)
- Example: Jan 1 to Jan 31 = 31 days
- **Pros:** Simple, matches user's mental model of "days in range"
- **Cons:** Doesn't account for non-trading days
- **Why experts prefer this:** For portfolio analysis, calendar days provide accurate time-based performance metrics and match financial industry standards for annualized returns.
**Option B: The number of actual trading days (days with trades) within the date range**
- Example: Jan 1 to Jan 31 = only count days where trades occurred (e.g., 18 days)
- **Pros:** Reflects actual market activity
- **Cons:** Can be misleading - a strategy might not trade every day by design
- **Trade-offs:** Better for measuring trading frequency, not time-based performance
Outcome: User chose Option B, demonstrating how clear options enable informed decisions.
Use this decision tree:
Is the code broken or incorrect?
├─ YES → Fix it (with explanation)
└─ NO → Is there a massively better option?
├─ YES → Does it meet ALL exception criteria?
│ ├─ YES → Propose improvement (get approval)
│ └─ NO → Preserve existing code
└─ NO → Preserve existing code
Before proposing any change to existing code, verify:
Avoid unnecessary complexity:
This skill works alongside other Portfolio Buddy 2 skills:
planning-framework - Apply Musk's 5-step algorithm and ICE scoring for feature planningcoding-standards - Follow React 19 and TypeScript standards during implementationarchitecture-reference - Understand component hierarchy and existing patterns before adding codemigration-tracker - Verify feature parity and check for known issues before startingportfolio-context - Get tech stack and architectural constraints contextWorkflow:
planning-guidelines (this skill) → Understand principlesplanning-framework → Plan the feature approacharchitecture-reference → Find where code goescoding-standards → Write the code correctlymigration-tracker → Document what was addedTask: Set Risk-Free Rate default to 4%
Approach: Pure preservation
useState<number>(0)useState<number>(4)Task: Make Trading Days recalculate when date range changes
Approach: Extend existing calculation
tradingPeriodDays variable and displayTask: Add "Set to Total Margin" button for Starting Capital
Approach: Mobile/desktop optimized integration
className="flex items-center gap-1 sm:gap-2" (responsive spacing)<span className="hidden sm:inline">Total Margin</span> (hide text on mobile)className="h-3 w-3 sm:h-3.5 sm:w-3.5" (smaller icon on mobile)touch-manipulation class for better mobile interactionportfolioData exists (conditional rendering)Task: Originally just fixing Trading Days calculation
Discovery: Found Annual Growth Rate calculation was mathematically incorrect
Exception Applied:
Approach:
Result: User approved immediately because criteria were objective and clearly met.
Always:
Only when ALL criteria met:
Never:
This skill ensures Portfolio Buddy 2 remains maintainable, consistent, and user-friendly across all devices while preserving the stability of working code.
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.