debugging
Systematic debugging methodology with root cause analysis. Phases: investigate, hypothesize, validate, verify. Capabilities: backward call stack tracing, multi-layer validation, verification protocols, symptom analysis, regression prevention. Actions: debug, investigate, trace, analyze, validate, verify bugs. Keywords: debugging, root cause, bug fix, stack trace, error investigation, test failure, exception handling, breakpoint, logging, reproduce, isolate, regression, call stack, symptom vs cause, hypothesis testing, validation, verification protocol. Use when: encountering bugs, analyzing test failures, tracing unexpected behavior, investigating performance issues, preventing regressions, validating fixes before completion claims.
What this skill does
# Debugging Comprehensive debugging framework combining systematic investigation, root cause tracing, defense-in-depth validation, and verification protocols. ## Core Principle **NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST** Random fixes waste time and create new bugs. Find the root cause, fix at source, validate at every layer, verify before claiming success. ## When to Use **Always use for:** Test failures, bugs, unexpected behavior, performance issues, build failures, integration problems, before claiming work complete **Especially when:** Under time pressure, "quick fix" seems obvious, tried multiple fixes, don't fully understand issue, about to claim success ## The Four Techniques ### 1. Systematic Debugging (`references/systematic-debugging.md`) Four-phase framework ensuring proper investigation: - Phase 1: Root Cause Investigation (read errors, reproduce, check changes, gather evidence) - Phase 2: Pattern Analysis (find working examples, compare, identify differences) - Phase 3: Hypothesis and Testing (form theory, test minimally, verify) - Phase 4: Implementation (create test, fix once, verify) **Key rule:** Complete each phase before proceeding. No fixes without Phase 1. **Load when:** Any bug/issue requiring investigation and fix ### 2. Root Cause Tracing (`references/root-cause-tracing.md`) Trace bugs backward through call stack to find original trigger. **Technique:** When error appears deep in execution, trace backward level-by-level until finding source where invalid data originated. Fix at source, not at symptom. **Includes:** `scripts/find-polluter.sh` for bisecting test pollution **Load when:** Error deep in call stack, unclear where invalid data originated ### 3. Defense-in-Depth (`references/defense-in-depth.md`) Validate at every layer data passes through. Make bugs impossible. **Four layers:** Entry validation → Business logic → Environment guards → Debug instrumentation **Load when:** After finding root cause, need to add comprehensive validation ### 4. Verification (`references/verification.md`) Run verification commands and confirm output before claiming success. **Iron law:** NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE Run the command. Read the output. Then claim the result. **Load when:** About to claim work complete, fixed, or passing ## Quick Reference ``` Bug → systematic-debugging.md (Phase 1-4) Error deep in stack? → root-cause-tracing.md (trace backward) Found root cause? → defense-in-depth.md (add layers) About to claim success? → verification.md (verify first) ``` ## Red Flags Stop and follow process if thinking: - "Quick fix for now, investigate later" - "Just try changing X and see if it works" - "It's probably X, let me fix that" - "Should work now" / "Seems fixed" - "Tests pass, we're done" **All mean:** Return to systematic process.
Related in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.