break-loop
Deep post-fix bug analysis across five dimensions: root cause categorization, fix failure analysis, prevention mechanisms, systematic expansion, and knowledge capture. Updates .trellis/spec/ guides with lessons learned to prevent recurring bugs. Use when a debugging session completes, after fixing a tricky bug, when the same class of bug keeps recurring, or when you want to capture debugging insights into project documentation.
What this skill does
# Break the Loop - Deep Bug Analysis When debug is complete, use this skill for deep analysis to break the "fix bug -> forget -> repeat" cycle. --- ## Analysis Framework Analyze the bug you just fixed from these 5 dimensions: ### 1. Root Cause Category Which category does this bug belong to? | Category | Characteristics | Example | |----------|-----------------|---------| | **A. Missing Spec** | No documentation on how to do it | New feature without checklist | | **B. Cross-Layer Contract** | Interface between layers unclear | API returns different format than expected | | **C. Change Propagation Failure** | Changed one place, missed others | Changed function signature, missed call sites | | **D. Test Coverage Gap** | Unit test passes, integration fails | Works alone, breaks when combined | | **E. Implicit Assumption** | Code relies on undocumented assumption | Timestamp seconds vs milliseconds | ### 2. Why Fixes Failed (if applicable) If you tried multiple fixes before succeeding, analyze each failure: - **Surface Fix**: Fixed symptom, not root cause - **Incomplete Scope**: Found root cause, didn't cover all cases - **Tool Limitation**: grep missed it, type check wasn't strict - **Mental Model**: Kept looking in same layer, didn't think cross-layer ### 3. Prevention Mechanisms What mechanisms would prevent this from happening again? | Type | Description | Example | |------|-------------|---------| | **Documentation** | Write it down so people know | Update thinking guide | | **Architecture** | Make the error impossible structurally | Type-safe wrappers | | **Compile-time** | TypeScript strict, no any | Signature change causes compile error | | **Runtime** | Monitoring, alerts, scans | Detect orphan entities | | **Test Coverage** | E2E tests, integration tests | Verify full flow | | **Code Review** | Checklist, PR template | "Did you check X?" | ### 4. Systematic Expansion What broader problems does this bug reveal? - **Similar Issues**: Where else might this problem exist? - **Design Flaw**: Is there a fundamental architecture issue? - **Process Flaw**: Is there a development process improvement? - **Knowledge Gap**: Is the team missing some understanding? ### 5. Knowledge Capture Solidify insights into the system: - [ ] Update `.trellis/spec/guides/` thinking guides - [ ] Update `.trellis/spec/backend/` or `frontend/` docs - [ ] Create issue record (if applicable) - [ ] Create feature ticket for root fix - [ ] Update check skills if needed --- ## Output Format Please output analysis in this format: ```markdown ## Bug Analysis: [Short Description] ### 1. Root Cause Category - **Category**: [A/B/C/D/E] - [Category Name] - **Specific Cause**: [Detailed description] ### 2. Why Fixes Failed (if applicable) 1. [First attempt]: [Why it failed] 2. [Second attempt]: [Why it failed] ... ### 3. Prevention Mechanisms | Priority | Mechanism | Specific Action | Status | |----------|-----------|-----------------|--------| | P0 | ... | ... | TODO/DONE | ### 4. Systematic Expansion - **Similar Issues**: [List places with similar problems] - **Design Improvement**: [Architecture-level suggestions] - **Process Improvement**: [Development process suggestions] ### 5. Knowledge Capture - [ ] [Documents to update / tickets to create] ``` --- ## Core Philosophy > **The value of debugging is not in fixing the bug, but in making this class of bugs never happen again.** Three levels of insight: 1. **Tactical**: How to fix THIS bug 2. **Strategic**: How to prevent THIS CLASS of bugs 3. **Philosophical**: How to expand thinking patterns 30 minutes of analysis saves 30 hours of future debugging. --- ## After Analysis: Immediate Actions **IMPORTANT**: After completing the analysis above, you MUST immediately: 1. **Update spec/guides** - Don't just list TODOs, actually update the relevant files: - If it's a cross-platform issue → update `cross-platform-thinking-guide.md` - If it's a cross-layer issue → update `cross-layer-thinking-guide.md` - If it's a code reuse issue → update `code-reuse-thinking-guide.md` - If it's domain-specific → update `backend/*.md` or `frontend/*.md` 2. **Sync templates** - After updating `.trellis/spec/`, sync to `src/templates/markdown/spec/` 3. **Commit the spec updates** - This is the primary output, not just the analysis text > **The analysis is worthless if it stays in chat. The value is in the updated specs.**
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.