agentleFS
troskatertroskater/flowdeck-claude/skills/debug-flow/SKILL.md

debug-flow

Skill0 starsChanged 22 days agoMITView on GitHub

Systematic debugging workflow. Reproduce the issue, isolate root cause, write a failing test, fix, verify. Use when diagnosing bugs or unexpected behavior.

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read stack traces completely — never skip to the middle

    line 21
  2. Distinctive:

    Check recent changes first — git log --oneline -20

    line 23
  3. Distinctive:

    When something worked before but is broken now:

    line 54

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Debug Flow Skill

Finds root causes through systematic investigation. Does not guess. Does not fix symptoms.

When to Activate

Activate when:

  • A bug has been reported
  • Code is producing unexpected output
  • Tests are failing intermittently
  • An error is occurring in production

Core Principles

  • Read stack traces completely — never skip to the middle
  • Fix root causes, not symptoms
  • Check recent changes first — git log --oneline -20
  • Reproduce before fixing — if you can't reproduce it, you don't understand it

Workflow

  1. Reproduce — confirm you can make the bug happen reliably
  2. Read the full stack trace — start from the top (error), trace to the origin
  3. Check recent changes — git log --oneline -20 to find what changed
  4. Trace execution backward — what called the failing function? What state did it receive?
  5. Identify root cause — the earliest point where invariants are violated
  6. Write a failing test — one test that fails with the bug present
  7. Fix — change the minimum code to make the test pass
  8. Verify — run the full test suite

Common Root Causes

SymptomLikely CauseInvestigation
Cannot read property of undefinedMissing null check upstreamTrace where undefined enters
Wrong calculation resultType coercion ("5" + 3 = "53")Check input types
Race condition / intermittentMissing awaitFind async functions called without await
Auth bypassMissing middlewareCheck route definition vs working routes
Infinite loopWrong termination conditionLog loop counter, check exit logic
Memory leakEvent listener not cleaned upCheck useEffect returns, removeListener calls
Promise rejection unhandledMissing .catch() or try/catchCheck all async call sites
Type error at runtimeas any hiding real typeFind where the cast was added
Stale data in UICache not invalidatedCheck cache keys and invalidation logic
Import errorCircular dependency or missing exportnpx madge --circular src/

Bisect for Regressions

When something worked before but is broken now:

git bisect start
git bisect bad                    # current is broken
git bisect good [last-good-sha]   # last known working commit
npm test                          # run after each checkout
git bisect good                   # or: git bisect bad
git bisect reset                  # when done

Output Format

## Debug Report

**Root Cause**: [one sentence]
**Evidence**: `path/to/file.ts:42` — [what the code does wrong]
**Call Path**: request → controller → service → ❌ null dereference at line 42
**Fix**: [specific change to make]
**Test**: [name of the failing test that reproduces the bug]

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.