ワンクリックで
systematic-debugging
Four-phase root cause analysis for reliable bug fixes
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Four-phase root cause analysis for reliable bug fixes
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Apply official FrankX brand standards to all artifacts, ensuring visual consistency across content, products, and communications. Use this skill for any FrankX-related content creation, design work, or communication.
Frank's personalized career and professional mastery coaching
Guided process to create your personalized Soulbook - a comprehensive life transformation system
Creates expert positioning content, social media posts, and marketing materials for Frank's personal brand and AI coaching business with soul-aligned messaging
Master-level visionary book writing system with research-driven methodology, author voice modeling, and iterative refinement across 9 quality dimensions
Expert Suno AI prompt engineering for cinematic, transformative music creation. Use this skill when creating Suno prompts for Vibe OS sessions, meditation tracks, or any AI-generated music that needs professional quality and emotional resonance.
| name | Systematic Debugging |
| description | Four-phase root cause analysis for reliable bug fixes |
| version | 1.0.0 |
| source | Adapted from obra/superpowers |
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.
Quick patches create technical debt. Symptoms mask deeper issues. Every fix must address the actual root cause.
Before touching code, gather evidence:
Read the error carefully
Error: Cannot read properties of undefined (reading 'map')
at ProductList (src/components/ProductList.tsx:15:24)
at renderWithHooks (node_modules/react-dom/...)
Reproduce consistently
# Document exact reproduction steps
1. Navigate to /products
2. Click "Filter by category"
3. Select "Electronics"
4. Error appears
Check recent changes
git log --oneline -10
git diff HEAD~3 -- src/components/ProductList.tsx
Add instrumentation at boundaries
// Before the failing line
console.log('products:', JSON.stringify(products, null, 2));
console.log('type:', typeof products);
console.log('isArray:', Array.isArray(products));
Find working examples and compare:
// Working component
const WorkingList = ({ items }) => {
if (!items || items.length === 0) return <Empty />;
return items.map(item => <Item key={item.id} {...item} />);
};
// Broken component - what's different?
const BrokenList = ({ items }) => {
return items.map(item => <Item key={item.id} {...item} />);
// Missing: null check before .map()
};
Key questions:
Apply the scientific method:
Form specific hypothesis
"The error occurs because
productsis undefined on initial render before the API response arrives."
Test with minimal change
// Test hypothesis: add early return
if (!products) return <Loading />;
One variable at a time
Write failing test FIRST
it('should handle undefined products gracefully', () => {
render(<ProductList products={undefined} />);
expect(screen.getByText('Loading...')).toBeInTheDocument();
});
Implement root cause fix
// Fix at the source, not symptoms
const ProductList = ({ products }: Props) => {
if (!products) return <Loading />;
if (products.length === 0) return <Empty />;
return (
<ul>
{products.map(product => (
<ProductItem key={product.id} product={product} />
))}
</ul>
);
};
Verify without bundling
| Warning Sign | Action |
|---|---|
| Proposing fix before understanding | Go back to Phase 1 |
| Multiple simultaneous changes | Isolate to one change |
| Third fix attempt failing | Question the architecture |
| "It works but I don't know why" | Keep investigating |
If you've tried 3 fixes without success:
console.log() // Basic output
console.table() // Tabular data
console.trace() // Stack trace
console.time() // Performance timing
console.group() // Grouped logs
// Conditional breakpoint
debugger; // Only when condition met
// Logpoint (VS Code)
// Right-click line → Add Logpoint
// Common issue: using client hooks in server components
// Phase 1: Check if component has 'use client'
// Phase 2: Compare with working client components
// Phase 3: Add 'use client' or restructure
// Add request logging
export async function POST(request: Request) {
console.log('=== API DEBUG ===');
const body = await request.json();
console.log('Body:', JSON.stringify(body, null, 2));
console.log('Headers:', Object.fromEntries(request.headers));
// ... rest of handler
}
// Phase 1: Check for Date.now(), Math.random(), or browser APIs
// Phase 2: Find server vs client render differences
// Phase 3: Use useEffect for client-only code
// Phase 4: Verify with 'suppressHydrationWarning' as last resort
test-driven-development - Write test for bug firstwebapp-testing - E2E debugging with Playwrightverification-before-completion - Ensure fix actually works