Skip to content
Back to skills

Debugging

ASecurity

Finds the root cause of a bug before fixing it. Use when something behaves unexpectedly, throws, fails a test, runs slow, or the user says "find out why". Not for a precisely diagnosed fix, test runs, reviews or tests-first work.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 15, 2026
ai-agentsgotestingdebugginggitperformance

Works with

  • cli

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned November 15, 2026

npx -y skills add msFoma/foma-skills --skill debugging --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Debugging?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Debugging
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/msfoma-debugging/badge)](https://www.skillsdirectory.com/skills/msfoma-debugging)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: debugging
description: >-
  Finds the root cause of a bug before fixing it. Use when something behaves unexpectedly, throws, fails a test, runs slow, or the user says "find out why". Not for a precisely diagnosed fix, test runs, reviews or tests-first work.
license: Apache-2.0
metadata:
  level: "method"
  uses: "tdd"
  agents: "explorer"
  tokens: "635"
---

Reproduce the bug with a fast check, find the root cause by testing one hypothesis at a time, then fix it and lock it with a test.

Uses: foma-skills:tdd (regression test), agent `explorer` (wide code search, model haiku; self-contained brief, answer ≤10 lines).

Path: a clear error with one suspect place → a one-command repro, fix, regression test, suite (skip shrinking and the hypothesis log); unclear, flaky, cross-module or after a failed fix → all steps. Say which path in one line.

## Steps
1. Read the full error and stack trace, then recent changes (`git log`, `git diff`). A search across many files (who calls X, where Y is set): delegate it to the explorer agent.
2. Build a fast loop that shows the bug: a failing test, script, curl or CLI run asserting the user's exact symptom. Run it and show it fail. No loop possible: list what you tried and ask the user for access, a captured artifact or permission to add instrumentation.
3. Reproduce and shrink: cut inputs, config and steps one at a time until every remaining part is needed. Confirm it is the user's bug, not a nearby one. Flaky: raise the failure rate (loop it, add load, pin time and seeds) before going on.
4. Hypothesise: state "If X is the cause, then changing Y will remove the bug / Z will worsen it". Test one at a time with the smallest probe: debugger or a targeted log tagged `[DEBUG-xxxx]`. Performance bug: measure a baseline first, then bisect.
5. Fix the root cause, one change. Write the regression test through foma-skills:tdd and see it fail before the fix and pass after. No honest seam for the test: say so in the report.
6. Re-run the loop from step 2, then the suite. Remove every `[DEBUG-` line (grep) and throwaway files.

## Rules
- No fix before a reproduction and a stated root-cause hypothesis; seeing the symptom is not knowing the cause.
- One change per attempt; a failed attempt is reverted, never built on.
- After 3 failed fixes stop, question the approach (shared state, coupling) and ask the user before attempt 4.
- Never "log everything and grep"; every probe tests a named prediction.
- Redact secrets from shown commands, logs and artifacts as `<REDACTED>`.

If the error surfaces deep in a call chain or you need to find which test pollutes state, read `references/tracing.md`.
If the bug is flaky, timing-dependent or a test sleeps for a fixed delay, read `references/flaky-timing.md`.

## Report
- Root cause (`file:line`) and the fix.
- Evidence: loop before and after, regression test, suite result.
- Not checked: <…>

Files in this skill

  • SKILL.md2.9 KB
  • references/flaky-timing.md818 B
  • references/tracing.md1.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.