What this skill teaches your AI coding agent
Systematic Debugging enforces an unbending finite-state machine over autonomous coding agents. The Iron Law dictates that zero production code modifications are permitted until a reproduction test isolates the underlying defect. The protocol transitions linearly through four discrete states: Root-Cause Investigation via stack trace and data flow inspection, Pattern Analysis comparing working baseline paths against failing executions, Single-Variable Hypothesis formulation, and Verified Remediation. The agent cannot skip states or apply speculative adjustments without violating the operational invariant.
Systematic Debugging is an open-source engineering skill licensed under MIT that enforces a mandatory 4-phase root-cause isolation protocol before allowing code edits.
You need strict, reproducible guardrails enforcing software engineering discipline across agent interactions.
You are building quick disposable prototypes where architectural consistency and test verification are unnecessary.
Activation boundaries & prompt triggers
- 💬 "User prompts: "Fix this flaky CI failure in the payment webhook""
- 💬 "Test passes locally but fails with exit code 137 in Docker"
- 💬 "Intermittent connection pool timeout under concurrent load"
- ⛔ Construct a minimal, reproducible test case before modifying any application source code.
- ⛔ Formulate a verifiable root-cause hypothesis and confirm it with diagnostic probes.
- ⛔ Never implement speculative patches forward without proving the failure mechanism.
Inject into Claude.ai, Claude Code, or Cursor
Choose your agent runtime to install the playbook directly into local configuration.
.cursor/rules/systematic-debugging.mdc---description: Rigorous 4-phase investigation protocol forcing autonomous agents to isolate root causes and formulate hypotheses before touching production code.globs: *alwaysApply: false---# Systematic Debugging ProtocolCRITICAL: You are strictly forbidden from modifying production code or proposing speculative fixes upon encountering a bug, test failure, or unexpected behavior.Follow this mandatory 4-phase protocol:1. ROOT CAUSE INVESTIGATION: - Read the complete error log, stack trace, and exact line numbers. - Isolate the failing component and trace the exact data flow that led to corrupted state. - Review recent git commits or diffs to identify what changed.2. PATTERN ANALYSIS: - Compare the broken path against working paths in the codebase. - Document all discrepancies in arguments, environment, or timing.3. SINGLE-VARIABLE HYPOTHESIS: - Formulate exactly ONE hypothesis: "X is failing because Y". - Execute a minimal test to confirm or refute. If refuted, return to Phase 1.4. VERIFIED REMEDIATION: - Write a minimal failing automated test that reproduces the bug. - Implement the root-cause fix (symptom patches are forbidden). - Run the full test suite to guarantee zero regressions.Interactive file tree manifest & playbook viewer
Click any file to audit instructions, verification scripts, and architectural references before installation.
SKILL.md---
name: systematic-debugging
description: "Rigorous 4-phase investigation protocol forcing autonomous agents to isolate root causes and formulate hypotheses before touching production code."
version: 1.0.0
license: MIT
compatibility: [claude-3-5-sonnet, cursor, windsurf, cline]
---
# Systematic Debugging Protocol
Systematic Debugging enforces an unbending finite-state machine over autonomous coding agents. The Iron Law dictates that zero production code modifications are permitted until a reproduction test isolates the underlying defect. The protocol transitions linearly through four discrete states: Root-Cause Investigation via stack trace and data flow inspection, Pattern Analysis comparing working baseline paths against failing executions, Single-Variable Hypothesis formulation, and Verified Remediation. The agent cannot skip states or apply speculative adjustments without violating the operational invariant.
## Core Guardrails
- ⛔ Construct a minimal, reproducible test case before modifying any application source code.
- ⛔ Formulate a verifiable root-cause hypothesis and confirm it with diagnostic probes.
- ⛔ Never implement speculative patches forward without proving the failure mechanism.
## Autonomous Activation Triggers
When user prompts:
- "User prompts: "Fix this flaky CI failure in the payment webhook""
- "Test passes locally but fails with exit code 137 in Docker"
- "Intermittent connection pool timeout under concurrent load"
Verified behavioral proof of work
Identical prompt executed with and without this skill under autonomous coding loops.
Investigate intermittent 500 error on checkout webhook
2@@ -14,2 +14,2 @@3- await redis.set(lockKey, "1", "EX", 10);4+ await redis.set(lockKey, "1", "PX", 5000, "NX");Execution safety and file access boundaries
Agent skills with executable scripts can run shell or Python utilities. Always audit scripts before execution.
- Scope: Bound to active workspace branch.
- Network Calls: Zero outbound network calls.
- AST Syntax Gate: Pre-flight verification blocks breaking mutations.
Operational triage & resolution runbook
Skill not triggering during user conversational prompt▼
Agent system prompt does not associate task keywords with the skill's trigger boundary.
Reference the skill name explicitly in your prompt (e.g., "Follow the rules in systematic-debugging to perform this refactoring").
Conflicting rules with root project instructions▼
Global instructions (.cursorrules or CLAUDE.md) contradict the skill's invariants.
Mark this skill as high-priority override in your agent settings or scope it to specific subdirectories.
Context window saturation warning▼
Multiple skills loaded simultaneously without progressive disclosure.
Keep always-on skills under 1,000 tokens total (~380 tokens consumed by this playbook).
Skill vs. MCP Server vs. Plain System Prompt
| Primitive | Best Used When | Token Cost | Execution Risk |
|---|---|---|---|
| Agent Skill (`SKILL.md`) | Multi-step domain workflows & procedural guardrails | Low (~400 tokens) | Minimal (AST verified) |
| MCP Server | External system integrations (APIs, live databases) | Zero (until called) | Scoped by tool permissions |
| Plain System Prompt | Simple style guidelines & tone preferences | High (Always in context) | High drift risk |
Composable peers & official repository
Combine with Behavior-Preserving Refactoring Discipline for complementary agent steering across testing and refactoring.
Inspect SkillCombine with Adversarial Code Review & Reception for complementary agent steering across testing and refactoring.
Inspect SkillCombine with Subagent-Driven Development for complementary agent steering across testing and refactoring.
Inspect Skill