planning-framework
新規機能開発や設計判断、大規模なリファクタリングなどで、コーディング前に構造的な思考を適用し、Muskの5段階アルゴリズムやICEスコアリングを活用して、より良い実装アプローチを導き出すSkill。
📜 元の英語説明(参考)
Apply structured thinking before coding. Use when: starting new features, making architectural decisions, refactoring large components, or evaluating implementation approaches. Includes Musk's 5-step algorithm and ICE scoring framework.
🇯🇵 日本人クリエイター向け解説
新規機能開発や設計判断、大規模なリファクタリングなどで、コーディング前に構造的な思考を適用し、Muskの5段階アルゴリズムやICEスコアリングを活用して、より良い実装アプローチを導き出すSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o planning-framework.zip https://jpskill.com/download/16751.zip && unzip -o planning-framework.zip && rm planning-framework.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/16751.zip -OutFile "$d\planning-framework.zip"; Expand-Archive "$d\planning-framework.zip" -DestinationPath $d -Force; ri "$d\planning-framework.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
planning-framework.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
planning-frameworkフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
Planning Framework
いつ使うか
重要なコーディングタスクを開始する前に:
- 新機能(50行以上のコード)
- 既存のコンポーネントのリファクタリング
- アーキテクチャの変更
- 複雑な問題のデバッグ
Muskの5段階アルゴリズム
ステップ1:要件をより賢くする
すべてを疑う:
- 誰がこの機能を要求したのか?なぜ?
- 実際に解決する問題は何か?
- 同じ結果を達成するためのより簡単な方法はないか?
- これを構築しないとどうなるか?
Portfolio Buddy 2 の例:
要求: 「メトリックテーブルにソート可能な列を追加する」
質問:
- なぜ?ユーザーは最高の/最悪のパフォーマンスの戦略をすばやく見つけたい
- より簡単な解決策?シャープレシオ(最も重要なメトリック)でデフォルトソートするだけ
- 代替案?「上位3つ」と「下位3つ」のハイライトセクションを追加する
決定:
useSortingフックを介して完全な複数列ソートを実装した理由:
- 異なるユーザーが異なるメトリック(シャープレシオ vs ソルティノ vs 最大DD)を重視する
- ソートはO(n log n) - 100未満の戦略では無視できる
- 再利用可能なフックは、将来のテーブルで使用できる
ステップ2:部品またはプロセスを削除する
何を排除できるか?
- 明確な目的を果たさない機能を削除する
- ワークフローで不要な手順を削減する
- データ構造を簡素化する
- 未使用の依存関係を削除する
ルール: 削除したものの10%を追加し直さない場合は、十分に削除していません。
Portfolio Buddy 2 の例:
発見: Rechartsライブラリ(11.5KB)がインストールされているが、インポートされていない
質問:
- どこかで使われているか?いいえ - 検索でインポートがゼロであることが判明
- なぜインストールされたのか?おそらく最初の計画、Chart.jsに切り替えた
- 削除できますか?はい - 何も依存していない
アクション:
npm uninstall recharts(バンドルで11.5KB節約)結果: よりクリーンな依存関係ツリー、より高速なインストール、より小さなバンドル
ステップ3:簡素化または最適化する
削除後のみ:
- 残りのコードを簡素化する
- 再利用可能な関数を抽出する
- 型安全性を向上させる
- 複雑さを軽減する
Portfolio Buddy 2 の例:
問題: PortfolioSection.tsxは591行(200行の制限の3倍)
最適化前:
function PortfolioSection() { // 50行の契約乗数ロジック // 40行の日付フィルタリングロジック // 100行のChart.js構成 // 80行の統計計算 // 300+行のJSXレンダリング }簡素化後:
// フックを抽出 const portfolio = usePortfolio(files, dateRange) const contracts = useContractMultipliers(strategies) // コンポーネントを抽出 <ContractControls {...contracts} /> <EquityChartSection data={portfolio.equity} /> <PortfolioStats metrics={portfolio.metrics} />結果: メインコンポーネントは100行未満、ロジックはカプセル化され、再利用可能
ステップ4:サイクルタイムを加速する
- ビルド/テスト時間を短縮する
- 開発者のエクスペリエンスを向上させる
- 役立つエラーメッセージを追加する
- フィードバックループを最適化する
Portfolio Buddy 2 の例:
以前: Create React Appのビルド時間:〜30秒
アクション: Viteに移行
以後: Viteのビルド時間:〜2秒(15倍高速)
影響: 開発者は1時間あたり15倍多く反復できる
ステップ5:自動化する
最後のステップのみ - 必要であることが証明されたものを自動化します。
Portfolio Buddy 2 の例:
まだ自動化しないでください: CI/CDパイプライン
- 手動のCloudflareデプロイメントは今のところ問題ありません
- 月に2〜3回しかデプロイしない
- GitHub Actionsの設定には2〜4時間かかる
- デプロイ頻度が増加するまで待つ
自動化する必要がある: コミット時のTypeScriptチェック
- マージ前に
any型の違反を検出する- Git pre-commit hook:
tsc --noEmit- 後でデバッグ時間を節約できる
ICEスコアリングフレームワーク
以下を使用してソリューションを評価します。
- インパクト: これにより、どれだけ状況が改善されるか? (1-10)
- 確信度: これがうまくいくとどれだけ確信しているか? (1-10)
- 容易さ: 実装はどれほど簡単か? (1-10)
ICEスコア = (インパクト × 確信度 × 容易さ) / 10
Portfolio Buddy 2 の例
例1:エラー境界(高優先度)
機能: リスクの高いコンポーネントの周りにReactエラー境界を追加する
- インパクト: 7 (コンポーネントエラーによるアプリ全体のクラッシュを防ぐ)
- 確信度: 9 (標準的なReactパターン、十分に文書化されている)
- 容易さ: 8 (ラッパーコンポーネント + フォールバックUI、〜50行)
- ICEスコア: (7 × 9 × 8) / 10 = 50.4 → 高優先度
決定: すぐに実装する必要があります。手軽な勝利、高いインパクト。
例2:Excelへのエクスポート(中〜高優先度)
機能: メトリックテーブルにExcelエクスポートボタンを追加する
- インパクト: 8 (ユーザーが明示的に要求した)
- 確信度: 8 (xlsxのようなライブラリが存在し、実績のあるソリューション)
- 容易さ: 7 (データのフォーマット、ファイルの生成、ダウンロードのトリガー)
- ICEスコア: (8 × 8 × 7) / 10 = 44.8 → 高優先度
決定: 実装する価値があります。明確なユーザー価値、妥当な労力。
例3:PortfolioSectionのリファクタリング(中優先度)
機能: 591行のコンポーネントをより小さな部分に分割する
- インパクト: 6 (保守性が向上するが、ユーザー向けの変更はない)
- 確信度: 8 (明確な抽出ポイントが特定されている)
- 容易さ: 4 (退屈、4〜6時間、壊れるリスクがある)
- ICEスコア: (6 × 8 × 4) / 10 = 19.2 → 中優先度
決定: コードの健全性にとって重要ですが、緊急ではありません。ユーザー向けの機能の後に行います。
例4:WebSocket経由のリアルタイム価格更新(低優先度)
機能: チャートでのライブマーケットデータ更新
- インパクト: 6 (あると便利だが、アプリは過去のデータを分析する)
- 確信度: 5 (複雑な統合、データソースが必要)
- 容易さ: 3 (WebSocketの設定、状態管理、エラー処理)
- ICEスコア: (6 × 5 × 3) / 10 = 9 → 低優先度
決定: 今はスキップします。コアユースケース(過去の分析)には適合しません。
例5:Recharts依存関係の削除(手軽な勝利)
機能: 未使用のRechartsライブラリをアンインストールする
- インパクト: 3 (バンドルサイズの削減、よりクリーンな依存関係)
- 確信度: 10 (どこにもインポートされていないことを確認済み)
- 容易さ: 10 (1つのコマンド:
npm uninstall recharts) - ICEスコア: (3 × 10 × 10) / 10
(原文はここで切り詰められています)
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Planning Framework
When to Use
Before starting ANY significant coding task:
- New features (> 50 lines of code)
- Refactoring existing components
- Architectural changes
- Debugging complex issues
Musk's 5-Step Algorithm
Step 1: Make Requirements Less Dumb
Question everything:
- Who requested this feature? Why?
- What problem does it actually solve?
- Is there a simpler way to achieve the same outcome?
- What happens if we don't build this?
Portfolio Buddy 2 Example:
Request: "Add sortable columns to metrics table"
Questions:
- Why? Users want to find best/worst performing strategies quickly
- Simpler solution? Just default sort by Sharpe Ratio (most important metric)
- Alternative? Add "Top 3" and "Bottom 3" highlight sections
Decision: Implemented full multi-column sorting via
useSortinghook because:
- Different users care about different metrics (Sharpe vs Sortino vs Max DD)
- Sorting is O(n log n) - negligible for <100 strategies
- Reusable hook can be used in future tables
Step 2: Delete the Part or Process
What can we eliminate?
- Remove features that serve no clear purpose
- Cut unnecessary steps in workflows
- Simplify data structures
- Delete unused dependencies
Rule: If you don't add back 10% of what you deleted, you didn't delete enough.
Portfolio Buddy 2 Example:
Discovery: Recharts library (11.5KB) installed but never imported
Questions:
- Is it used anywhere? NO - search reveals zero imports
- Why was it installed? Probably initial plan, switched to Chart.js
- Can we delete it? YES - nothing depends on it
Action:
npm uninstall recharts(saves 11.5KB in bundle)Result: Cleaner dependency tree, faster installs, smaller bundle
Step 3: Simplify or Optimize
Only after deleting:
- Simplify remaining code
- Extract reusable functions
- Improve type safety
- Reduce complexity
Portfolio Buddy 2 Example:
Problem: PortfolioSection.tsx is 591 lines (3x the 200-line limit)
Before Optimization:
function PortfolioSection() { // 50 lines of contract multiplier logic // 40 lines of date filtering logic // 100 lines of Chart.js configuration // 80 lines of statistics calculations // 300+ lines of JSX rendering }After Simplification:
// Extract hooks const portfolio = usePortfolio(files, dateRange) const contracts = useContractMultipliers(strategies) // Extract components <ContractControls {...contracts} /> <EquityChartSection data={portfolio.equity} /> <PortfolioStats metrics={portfolio.metrics} />Result: Main component < 100 lines, logic encapsulated, reusable
Step 4: Accelerate Cycle Time
- Reduce build/test time
- Improve developer experience
- Add helpful error messages
- Optimize feedback loops
Portfolio Buddy 2 Example:
Before: Create React App build time: ~30 seconds
Action: Migrated to Vite
After: Vite build time: ~2 seconds (15x faster)
Impact: Developer can iterate 15x more per hour
Step 5: Automate
Last step only - automate what's proven necessary.
Portfolio Buddy 2 Example:
Don't automate yet: CI/CD pipeline
- Manual Cloudflare deployments work fine for now
- Only deploying 2-3x per month
- Setting up GitHub Actions would take 2-4 hours
- Wait until deployment frequency increases
Should automate: TypeScript checking on commit
- Would catch
anytype violations before merge- Git pre-commit hook:
tsc --noEmit- Saves debugging time later
ICE Scoring Framework
Evaluate solutions using:
- Impact: How much does this move the needle? (1-10)
- Confidence: How certain are we this will work? (1-10)
- Ease: How simple to implement? (1-10)
ICE Score = (Impact × Confidence × Ease) / 10
Portfolio Buddy 2 Examples
Example 1: Error Boundaries (High Priority)
Feature: Add React error boundaries around risky components
- Impact: 7 (prevents full app crashes from component errors)
- Confidence: 9 (standard React pattern, well-documented)
- Ease: 8 (wrapper component + fallback UI, ~50 lines)
- ICE Score: (7 × 9 × 8) / 10 = 50.4 → HIGH PRIORITY
Decision: Should implement soon. Quick win, high impact.
Example 2: Export to Excel (Medium-High Priority)
Feature: Add Excel export button for metrics table
- Impact: 8 (users explicitly requested it)
- Confidence: 8 (libraries like xlsx exist, proven solution)
- Ease: 7 (format data, generate file, trigger download)
- ICE Score: (8 × 8 × 7) / 10 = 44.8 → HIGH PRIORITY
Decision: Worth implementing. Clear user value, reasonable effort.
Example 3: Refactor PortfolioSection (Medium Priority)
Feature: Split 591-line component into smaller pieces
- Impact: 6 (improves maintainability, no user-facing change)
- Confidence: 8 (clear extraction points identified)
- Ease: 4 (tedious, 4-6 hours, risk of breaking things)
- ICE Score: (6 × 8 × 4) / 10 = 19.2 → MEDIUM PRIORITY
Decision: Important for code health, but not urgent. Do after user-facing features.
Example 4: Real-time Price Updates via WebSocket (Low Priority)
Feature: Live market data updates in charts
- Impact: 6 (nice to have, but app analyzes historical data)
- Confidence: 5 (complex integration, data source needed)
- Ease: 3 (WebSocket setup, state management, error handling)
- ICE Score: (6 × 5 × 3) / 10 = 9 → LOW PRIORITY
Decision: Skip for now. Doesn't fit core use case (historical analysis).
Example 5: Remove Recharts Dependency (Quick Win)
Feature: Uninstall unused Recharts library
- Impact: 3 (small bundle size reduction, cleaner deps)
- Confidence: 10 (confirmed never imported anywhere)
- Ease: 10 (one command:
npm uninstall recharts) - ICE Score: (3 × 10 × 10) / 10 = 30 → MEDIUM PRIORITY
Decision: Easy quick win. Do it next time touching package.json.
Example 6: Sortino Ratio Calculation (Completed)
Feature: Add Sortino Ratio metric (already completed)
- Impact: 8 (important risk-adjusted metric for traders)
- Confidence: 9 (well-defined formula, similar to Sharpe)
- Ease: 7 (calculation + UI + risk-free rate input)
- ICE Score: (8 × 9 × 7) / 10 = 50.4 → HIGH PRIORITY
Result: Successfully implemented in commits 258ba3a & 9f25040.
ICE Score Interpretation
| ICE Score Range | Priority | Action |
|---|---|---|
| 40+ | High | Do soon, within 1-2 sprints |
| 25-39 | Medium-High | Plan for next 2-3 sprints |
| 15-24 | Medium | Backlog, do when capacity available |
| 10-14 | Low | Consider if very easy or strategic |
| < 10 | Very Low | Probably skip unless requirements change |
Planning Checklist
Before coding:
- [ ] Applied Step 1: Questioned requirements thoroughly
- [ ] Applied Step 2: Identified what can be deleted/simplified
- [ ] Calculated ICE score (for features > 100 lines)
- [ ] Confirmed simpler solution doesn't exist
- [ ] Identified which components/hooks will be affected
- [ ] Checked for existing similar functionality in codebase
- [ ] Reviewed related code to understand context
After planning:
- [ ] Written approach in 3-5 bullet points
- [ ] Identified potential issues/edge cases
- [ ] Estimated time realistically (multiply initial guess by 2)
- [ ] Confirmed TypeScript types are planned (no
any) - [ ] Verified component won't exceed 200 lines
Portfolio Buddy 2 Planning Examples
Example: Adding Sortino Ratio (Completed Feature)
Step 1 - Requirements:
- Users need Sortino Ratio alongside Sharpe Ratio
- Sortino focuses on downside risk (more relevant for traders)
- Requires risk-free rate input
Step 2 - Delete:
- Don't need separate page for advanced metrics
- Don't need tutorial/help text (formula is standard)
Step 3 - Simplify:
- Add single risk-free rate input (not per-strategy)
- Calculate in existing
calculateMetrics()function - Add column to existing MetricsTable
ICE Score: 50.4 (High Priority)
Approach:
- Add
calculateSortino()to dataUtils.ts - Include Sortino in metrics calculation
- Add risk-free rate input to PortfolioSection
- Add Sortino column to MetricsTable
- Test with sample data
Time Estimate: 3-4 hours
Result: Completed successfully, but found calculation bug (commit 9f25040 fixed it).
Implementation Note: Sortino was implemented inline in PortfolioSection.tsx (lines 133-158) rather than in dataUtils.ts. This decision was made because:
- Sortino requires portfolio-level daily returns (not trade-level metrics)
- Needs user input state (risk-free rate)
- Different calculation context than win rate, profit factor, etc.
- Team should discuss whether to extract to dataUtils for consistency
Example: Refactoring PortfolioSection (Future Work)
Step 1 - Requirements:
- Component is 591 lines (3x limit)
- Hard to maintain and understand
- Want to follow coding standards
Step 2 - Delete:
- Review for duplicate logic
- Remove commented-out code
- Consolidate similar state handlers
Step 3 - Simplify:
- Extract
ContractControls.tsx(contract multiplier UI) - Extract
EquityChartSection.tsx(Chart.js config) - Extract
PortfolioStats.tsx(statistics display) - Keep only orchestration in main component
ICE Score: 19.2 (Medium Priority)
Approach:
- Create EquityChartSection component (150 lines)
- Create PortfolioStats component (80 lines)
- Create ContractControls component (100 lines)
- Refactor main PortfolioSection to <100 lines
- Test all functionality still works
Time Estimate: 4-6 hours (tedious but straightforward)
Risks:
- Breaking existing functionality
- Props drilling if not careful
- Testing all edge cases
Decision: Medium priority. Do after more urgent user-facing features.
Example: Vitest Testing Setup (Future Work)
Step 1 - Requirements:
- No tests currently
- Critical calculations need testing (Sharpe, Sortino, correlation)
- Prevent regressions in metric calculations
Step 2 - Delete:
- Don't need 100% coverage
- Skip UI/component testing for now
- Focus only on calculation functions
Step 3 - Simplify:
- Test only dataUtils.ts functions
- Use Vitest (built-in with Vite)
- Mock data from real CSV files
ICE Score: 24 (Medium Priority)
Approach:
- Install Vitest:
npm install -D vitest - Add test script to package.json
- Create
dataUtils.test.ts - Write tests for critical calculations
- Run tests in CI eventually
Time Estimate: 6-8 hours (learning curve + writing tests)
Tests to Write:
calculateSharpe()with known datacalculateSortino()with known datacalculateCorrelation()edge casesparseCSV()error handling
Red Flags to Watch For
During Planning
- ❌ "This will only take 30 minutes" (usually takes 2-3 hours)
- ❌ "I'll just use
anytypes for now" (technical debt accumulates) - ❌ "We might need this later" (YAGNI - You Aren't Gonna Need It)
- ❌ "Everyone does it this way" (verify it fits your use case)
During Implementation
- ❌ Component approaching 200 lines (refactor NOW, not later)
- ❌ Duplicating logic from another file (extract to shared utility)
- ❌ Adding dependency without checking size/alternatives
- ❌ No error handling ("will add later" = never happens)
Portfolio Buddy 2 Lessons
- ✅ Did well: Questioned need for Redux, used plain React hooks instead
- ✅ Did well: Chose Chart.js over Recharts after testing both
- ❌ Should improve: Let PortfolioSection grow to 591 lines
- ❌ Should improve: Accumulated 14
anytype violations
Framework in Action
When you're about to start coding, ask:
- What am I building? (clear requirement)
- Why am I building it? (real problem to solve)
- What can I delete? (remove unnecessary parts)
- What's the simplest version? (MVP approach)
- How confident am I? (ICE scoring)
- What's the time estimate? (be realistic, multiply by 2)
Then write your plan as:
- 3-5 bullet point approach
- Time estimate
- Files that will change
- Potential issues
Finally:
- Get feedback if >4 hours of work
- Start with smallest testable increment
- Commit frequently