debugging

Rules for investigating software failures methodically by reproducing the problem, reducing it to a small case, and testing possible causes one at a time.

In plain words
What is it for?
They are for reproducing bugs, writing failing tests, isolating variables, using logs, and narrowing down the source of a failure.
Why use it?
They reduce guesswork during debugging and help ensure that a fix addresses the real cause without creating a regression.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/sordi-ai/skill-everything/debugging
Clone the repo
git clone --depth 1 https://github.com/sordi-ai/skill-everything

Made for: Cursor.

Per session 32 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 766 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00032 $0.00766
Opus 5 $0.00016 $0.00383
Sonnet 5 $0.00006 $0.00153
Haiku 4.5 $0.00003 $0.00077

Measured yesterday against content hash 632f11973b0f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

debugging scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/debugging.mdc · 51 lines

How it starts

The opening of the file, as written. The whole thing — 51 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Sub-Skill: Debugging

Purpose: Systematic techniques for reproducing failures, isolating variables, and finding root causes without guessing. Complements skills/tdd/SKILL.md — a failing test is the best reproduction case.


Rules

Reproduction

  1. Reproduce before fixing. Before changing any code, confirm you can trigger the failure on demand. A fix applied to an unreproduced bug is a guess, not a solution. Reference: ERR-2026-018
  2. Capture the minimal reproduction. Reduce the failing scenario to the smallest input, fewest dependencies, and shortest code path that still exhibits the symptom. Smaller reproductions expose the cause faster and prevent regression.
  3. Write the reproduction as a test. Encode the reproduction case as an automated test before touching production code. This locks in the failure signal and prevents silent regression. See skills/tdd/SKILL.md.

Isolation

  1. Change one variable at a time. Never modify multiple suspects simultaneously. Each change must be independently observable so you know which variable caused the change in behaviour.
  2. Use binary search on the call stack. When the failure source is unknown, bisect: confirm the bug is present at the midpoint of the execution path, then recurse into the half that contains it. Avoid reading every line top-to-bottom.
  3. Prefer structured logging over print-debugging. Add log statements at decision boundaries with structured key-value pairs (not free-form strings). Structured output is grep-able, diffable, and removable without side effects.

Hypothesis and Root Cause

  1. State a falsifiable hypothesis before each experiment. Write down: "I believe X causes Y because Z. If I change X, Y should disappear." Run the experiment. If the hypothesis is wrong, update your model before the next experiment.
  2. Distinguish symptom from cause. The error message or stack trace is the symptom. The root cause is the incorrect assumption, missing guard, or wrong state that produced it. Never stop at the symptom — trace back to the decision that allowed the bad state to exist.
  3. Do not fix symptoms in isolation. Patching the symptom without addressing the root cause produces a second bug that hides the first. Ensure the fix makes the root cause impossible, not just the observed symptom unlikely.

Read the full file on GitHub · 51 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 51 lines · 32 tokens per session scan A 632f11973b0f

Subscribe to this mod's changes

debugging is a cursor rule published in the GitHub repository sordi-ai/skill-everything (19 stars, last pushed 3mo ago), licensed MIT. It adds 32 tokens to every session and 766 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.