debugging-loop

A structured way to debug bugs, failed tests, and unexpected behavior by reproducing the problem, isolating its cause, fixing that cause, verifying the result, and recording what happened.

In plain words
What is it for?
Use it to investigate a reliable reproduction, narrow down a failing code path, add a regression test, run related checks, and report the evidence and fix.
Why use it?
It reduces guesswork and helps prevent fixes that only hide symptoms or create new problems.

Skill for Claude CodeCodexCursor

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 skills/kingemma7/cursor-os/debugging-loop
Any agent
npx skills add KingEmma7/cursor-os --skill debugging-loop
Clone the repo
git clone --depth 1 https://github.com/KingEmma7/cursor-os

Made for: Claude Code, Codex, Cursor.

Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 332 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.00037 $0.00332
Opus 5 $0.00018 $0.00166
Sonnet 5 $0.00007 $0.00066
Haiku 4.5 $0.00004 $0.00033

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

Security

Grade A, and why

debugging-loop 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.

template/.cursor/skills/debugging-loop/SKILL.md · 35 lines

What it actually says

Debugging Loop

Find the root cause before changing code. Resist the urge to guess-and-patch.

1. Reproduce

  • Establish exact, reliable repro steps. Capture the full error, stack trace, and the expected-vs-actual behavior.
  • If you can't reproduce it, gather more evidence (logs, inputs, environment) before proceeding.

2. Isolate

  • Read the failing code path and form a specific hypothesis about the cause.
  • Narrow the surface: bisect inputs, add targeted logging or a failing test, or check recent changes. Confirm the hypothesis with evidence before editing.
  • Distinguish the symptom from the cause. The first error in the chain is often not the real one.

3. Fix

  • Change the root cause, not the symptom. Don't mask it with broad try/catch, retries, or silenced output.
  • Make the smallest fix that resolves it. Keep unrelated cleanup out of the bugfix.

4. Verify

  • Add or run a check that fails before the fix and passes after — a regression test where practical.
  • Run the surrounding tests and confirm the fix didn't break adjacent behavior.

5. Capture

  • Report the root cause, the evidence, the fix, and how you verified it.
  • If this bug points to a recurring trap, record it in docs/repo-memory.md so it doesn't bite again.
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 · 35 lines · 37 tokens per session scan A f62652e47068

Subscribe to this mod's changes

debugging-loop is a skill published in the GitHub repository KingEmma7/cursor-os (2 stars, last pushed 20d ago), licensed MIT. It adds 37 tokens to every session and 332 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-31.

Related

Other skills, from other repositories

onboard-repository

Inspect an unfamiliar or brownfield repository, trace one real operational path, and propose evidence-backed improvements that help future agents work independently. Use when explicitly asked to onboard, map, assess, or backfill agent-facing repository guidance; use again after the user approves exact proposal items.…

hoangnb24/repository-harness · 87 tokens

audit-onboarding-proposal

Independently audit a brownfield onboarding transcript, operational map, or exact proposed documentation patch before application. Use when a fresh reviewer must verify an $onboard-repository first pass, distinguish environment-caused Unknowns from reasoning defects, score its safety and evidence gates, or run a…

hoangnb24/repository-harness · 104 tokens

improve-harness

Run one explicitly authorized, evidence-backed improvement to a repository's agent guidance, tools, runbooks, or validation. Use only when the user invokes $improve-harness or explicitly asks to improve the Harness after observed reusable agent friction. Do not use for ordinary product changes, speculative cleanup…

hoangnb24/repository-harness · 76 tokens

engineering-wisdom

Provide an explicitly requested, repository-grounded engineering review using contextual heuristics for code clarity, SOLID and design, testing, refactoring, architecture, and professional practice. Use only when the user invokes $engineering-wisdom or explicitly asks for this installed engineering-wisdom pack; do not…

hoangnb24/repository-harness · 78 tokens

encode-invariant

Convert accepted repository rules into the smallest repository-native mechanical validation with positive and negative proof and precise enforcement-level reporting. Use for requests to enforce architecture, reliability, security, or quality boundaries; prevent a documented violation from recurring; add structural…

hoangnb24/repository-harness · 81 tokens

daily-brief

Start-of-day ranked brief - open issues, recent commits, work in progress, and anything waiting on a human decision. Use when asked for a 'daily brief', 'morning brief', 'what should I work on today', 'start my day', 'catch me up'.

craigcossairt/trellis · 60 tokens