phase-gated-debugging
Use when debugging any bug. Enforces a 5-phase protocol where code edits are blocked until root cause is confirmed. Prevents premature fix attempts.
Best use case
phase-gated-debugging is best used when you need a repeatable AI agent workflow instead of a one-off prompt. It is especially useful for teams working in multi. Use when debugging any bug. Enforces a 5-phase protocol where code edits are blocked until root cause is confirmed. Prevents premature fix attempts.
Use when debugging any bug. Enforces a 5-phase protocol where code edits are blocked until root cause is confirmed. Prevents premature fix attempts.
Users should expect a more consistent workflow output, faster repeated execution, and less time spent rewriting prompts from scratch.
Practical example
Example input
Use the "phase-gated-debugging" skill to help with this workflow task. Context: Use when debugging any bug. Enforces a 5-phase protocol where code edits are blocked until root cause is confirmed. Prevents premature fix attempts.
Example output
A structured workflow result with clearer steps, more consistent formatting, and an output that is easier to reuse in the next run.
When to use this skill
- Use this skill when you want a reusable workflow rather than writing the same prompt again and again.
When not to use this skill
- Do not use this when you only need a one-off answer and do not need a reusable workflow.
- Do not use it if you cannot install or maintain the related files, repository context, or supporting tools.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/phase-gated-debugging/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How phase-gated-debugging Compares
| Feature / Agent | phase-gated-debugging | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Use when debugging any bug. Enforces a 5-phase protocol where code edits are blocked until root cause is confirmed. Prevents premature fix attempts.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Cursor vs Codex for AI Workflows
Compare Cursor and Codex for AI coding workflows, repository assistance, debugging, refactoring, and reusable developer skills.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
SKILL.md Source
# Phase-Gated Debugging ## Overview AI coding agents see an error and immediately edit code. They guess at fixes, get it wrong, and spiral. This skill enforces a strict 5-phase protocol where you CANNOT edit source code until the root cause is identified and confirmed. Based on [claude-debug](https://github.com/krabat-l/claude-debug) (full plugin with PreToolUse hook enforcement). ## When to Use Use this skill when: - a bug keeps getting "fixed" without resolving the underlying issue - you need to slow an agent down and force disciplined debugging before code edits - the failure is intermittent, a regression, performance-related, or otherwise hard to isolate - you want an explicit user confirmation checkpoint before any fix is applied ## The Protocol ### Phase 1: REPRODUCE Run the failing command/test. Capture the exact error. Run 2-3 times for consistency. - Do NOT read source code - Do NOT hypothesize - Do NOT edit any files ### Phase 2: ISOLATE Read code. Add diagnostic logging marked `// DEBUG`. Re-run with diagnostics. Binary search to narrow down. - Only `// DEBUG` marked logging is allowed - Do NOT fix the bug even if you see it ### Phase 3: ROOT CAUSE Analyze WHY at the isolated location. Use "5 Whys" technique. Remove debug logging. State: "This is my root cause analysis: [explanation]. Do you agree, or should I investigate further?" **WAIT for user confirmation. Do NOT proceed without it.** ### Phase 4: FIX Remove all `// DEBUG` lines. Apply minimal change addressing confirmed root cause. - Only edit files related to root cause - Do NOT refactor unrelated code ### Phase 5: VERIFY Run original failing test — must pass. Run related tests. For intermittent bugs, run 5+ times. If verification fails: root cause was wrong, go back to Phase 2. ## Bug-Type Strategies | Type | Technique | |------|-----------| | Crash/Panic | Stack trace backward — trace the bad value to its source | | Wrong Output | Binary search — log midpoint, halve search space each iteration | | Intermittent | Compare passing vs failing run logs — find ordering divergence | | Regression | `git bisect` — find the offending commit | | Performance | Timing at stage boundaries — find the bottleneck | ## Key Rules 1. NEVER edit source code in phases 1-3 (except `// DEBUG` in phase 2) 2. NEVER proceed past phase 3 without user confirmation 3. ALWAYS reproduce before investigating 4. ALWAYS verify after fixing ## Limitations - Use this skill only when the task clearly matches the scope described above. - Do not treat the output as a substitute for environment-specific validation, testing, or expert review. - Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Related Skills
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
nextjs-best-practices
Next.js App Router principles. Server Components, data fetching, routing patterns.
network-101
Configure and test common network services (HTTP, HTTPS, SNMP, SMB) for penetration testing lab environments. Enable hands-on practice with service enumeration, log analysis, and security testing against properly configured target systems.
neon-postgres
Expert patterns for Neon serverless Postgres, branching, connection pooling, and Prisma/Drizzle integration
nanobanana-ppt-skills
AI-powered PPT generation with document analysis and styled images
multi-agent-patterns
This skill should be used when the user asks to "design multi-agent system", "implement supervisor pattern", "create swarm architecture", "coordinate multiple agents", or mentions multi-agent patterns, context isolation, agent handoffs, sub-agents, or parallel agent execution.
monorepo-management
Build efficient, scalable monorepos that enable code sharing, consistent tooling, and atomic changes across multiple packages and applications.
monetization
Estrategia e implementacao de monetizacao para produtos digitais - Stripe, subscriptions, pricing experiments, freemium, upgrade flows, churn prevention, revenue optimization e modelos de negocio SaaS.
modern-javascript-patterns
Comprehensive guide for mastering modern JavaScript (ES6+) features, functional programming patterns, and best practices for writing clean, maintainable, and performant code.
microservices-patterns
Master microservices architecture patterns including service boundaries, inter-service communication, data management, and resilience patterns for building distributed systems.
mcp-builder
Create MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. The quality of an MCP server is measured by how well it enables LLMs to accomplish real-world tasks.
makepad-skills
Makepad UI development skills for Rust apps: setup, patterns, shaders, packaging, and troubleshooting.