Agent skill
debugging-protocol
Comprehensive protocol for validating root causes of software issues. Use when you need to systematically debug a complex bug, flaky test, or unknown system behavior by forming hypotheses and validating them with specific tasks.
Install this agent skill to your Project
npx add-skill https://github.com/irahardianto/awesome-agv/tree/main/.agents/skills/debugging-protocol
SKILL.md
Debugging Protocol
Overview
This skill provides a rigorous framework for debugging complex software issues. It moves beyond ad-hoc troubleshooting to a structured process of hypothesis generation and validation.
Use this skill to:
- Formalize a debugging session.
- Systematically eliminate potential root causes.
- Document findings for future reference or team communication.
Protocol Workflow
To run a structured debugging session, follow these steps:
1. Initialize the Session
Create a new debugging document using the provided template. This serves as the "source of truth" for the investigation.
Template location: assets/debugging-session-template.md
Save to: docs/debugging/{issue-name}-{YYYY-MM-DD}-{HHmm}.md
- Create
docs/debugging/if it doesn't exist - Copy the template and fill in the issue details
- This makes the session accessible from other conversations and agents (e.g., when handing off to a
/quick-fixor/orchestratorworkflow)
2. Define the Problem
Clearly articulate the System Context and Problem Statement.
- Symptom: What is the observable behavior? How does it differ from expected behavior?
- Scope: Which components are involved?
3. Formulate Hypotheses
List distinct, testable hypotheses.
- Avoid vague guesses.
- Differentiate between layers (e.g., "Frontend Hypothesis" vs "Backend Hypothesis").
- Example: "Race condition in UI state update" vs "Database schema misconfiguration".
4. Design Validation Tasks
For each hypothesis, design a specific validation task.
- Objective: What are you trying to prove or disprove?
- Steps: Precise, reproducible actions.
- Code Pattern: Provide the exact code or command to run (e.g., a specific SQL query, a Python script using the client library, a
curlcommand). - Success Criteria: Explicitly state what output confirms the hypothesis.
5. Execute and Document
Run the tasks in order. For each task, record:
- Status: ✅ VALIDATED, ❌ FAILED, or ⚠️ INCONCLUSIVE.
- Findings: Key observations and raw evidence (logs, screenshots).
- Conclusion: Does this support or refute the hypothesis?
6. Determine Root Cause
Synthesize the findings into a Root Cause Analysis.
- Identify the Primary Root Cause.
- Assign a Confidence Level.
- Propose specific fixes.
Best Practices
- Be Specific: Don't just say "check the logs." Say "grep for 'Error 500' in
/var/log/nginx/access.log". - Isolate Variables: Change one thing at a time.
- Validate Assumptions: Verify configuration and versions first (e.g., "Task 1: Validate Current Schema").
- Preserve Evidence: Keep the specific trace IDs, log timestamps, or reproduction scripts.
Language-Specific Modules
The languages/ directory contains modular, language-specific debugging guides. When debugging a project, load the relevant language module to augment this protocol with language-specific tools, hypothesis categories, and validation strategies.
Convention: Each module is a standalone markdown file at languages/{language}.md.
How to use:
- Identify the primary language of the codebase being debugged
- Load the corresponding module from
languages/ - Integrate its toolchain, hypothesis categories, and validation tasks into your debugging session
Available modules:
| Module | Languages/Runtimes |
|---|---|
| Rust | Rust (cargo, rustc, tokio) |
| Frontend | Vue 3, React, browser, Vite |
Contributing new modules: To add support for a new language, create
languages/{language}.mdfollowing the structure of existing modules. Each module should include: a toolchain reference table, language-specific hypothesis categories, validation task patterns, and an error-type-to-first-action quick reference.
Rule Compliance
When debugging, verify against:
- Error Handling Principles @error-handling-principles.md (proper error propagation)
- Logging and Observability Principles @logging-and-observability-principles.md (structured logging for diagnostics)
- Testing Strategy @testing-strategy.md (regression test for the fix)
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
guardrails
Pre-flight checklist and post-implementation self-review protocol. Use before generating any code (pre-flight) and after writing code but before verification (self-review) to catch issues early.
code-review
Structured code review protocol for inspecting code quality against the full rule set. Use when auditing code written by yourself or another agent, during the /audit workflow, or when the user asks for a code review.
mobile-design
Generates distinctive, production-grade mobile interfaces for Flutter and React Native. Prioritizes platform-native patterns, adaptive layouts, and fluid motion. Use when building mobile apps, screens, widgets, or when the user requests to style or create visually striking mobile UI.
perf-optimization
Profile-driven performance optimization protocol. Use when profiling data (CPU, heap, trace) is available or when the user requests performance analysis. Covers methodology, pattern catalog, safety invariants, and when-to-stop heuristics. Language-specific tooling is in languages/*.md.
adr
Architecture Decision Record skill for documenting significant architectural decisions with context, options, and consequences. Use during the Research phase when choosing between approaches, or whenever the user asks to document an architectural decision.
frontend-design
Generates distinctive, production-grade frontend interfaces and artifacts (React, Vue, HTML/CSS). Prioritizes bold aesthetics, unique typography, and motion to avoid generic designs. Use when building websites, landing pages, dashboards, posters, or when the user requests to style, beautify, or create visually striking UI.
Didn't find tool you were looking for?