aiskillstore/planning-guidelines
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.
This is a copy. The original lives at comeonoliver/planning-guidelines.
npx skills add https://github.com/aiskillstore/marketplace --skill planning-guidelines
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:
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.
Take aiskillstore/planning-guidelines from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.