agentleFS
mattmirelesmattmireles/gemma-tuner-multimodal/.claude/skills/debug/SKILL.md

debug

Skill1.5k starsChanged 4 days agoMITView on GitHub

Systematic debugging for gemma-macos-tuner: consult `README/` and `README.md` first, pull current library docs via Context7 MCP, parallelize investigation with multiple subagents when stuck, prove fixes before calling success, then capture one consolidated note (e.g. `README/notes/debug-notes.md` via **write-notes**) as the **final** step before ending the session. For extreme cases, delegate a multi-agent audit via the Claude Code CLI. Use when the user invokes **debug**, **use debug**, asks to debug or fix a tricky bug, or work is blocked by unclear failure modes after quick local checks.

We split this skill into the rules it gives an agent

16 rules. 0 are common, 14 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 171 edited versions we read keep these.

  • 14

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    CLI multi-agent audit: only for exceptional escalation.

    line 21
  2. Distinctive:

    Before writing code or deep-diving the stack:

    line 41
  3. Distinctive:

    When the bug touches specific libraries, CLIs, or cloud products (PyTorch, Transformers, PEFT, librosa, GCP clients, Typer, etc.):

    line 50
  4. Distinctive:

    Use the Context7 MCP server: resolve the library ID, then fetch focused docs for the API or behavior in question (errors, limits, migration …

    line 53
  5. Distinctive:

    Prefer Context7 over memory or generic web search for API shape and version-sensitive behavior.

    line 55
  6. Distinctive:

    If Context7 is unavailable, say so briefly and fall back to official docs in the browser or MCP fetch—do not invent APIs.

    line 58
  7. Distinctive:

    If the problem is hard, cross-cutting, or you have been going in circles after the reproduce-and-narrow pass (step 3):

    line 70
  8. Distinctive:

    Ask each for plausible hypotheses ranked by likelihood and concrete next checks (files, logs, experiments)—not generic advice.

    line 75
  9. Distinctive:

    When you are still stuck after parallel investigation, or the blast radius is high (money, data loss, production):

    line 84
  10. Very specific:

    Use the Claude Code CLI from the repo root (or the user’s preferred invocation) to run a multi-agent audit over the scoped slice that …

    line 87
  11. Distinctive:

    Do not say the bug is fixed, resolved, done, or imply victory until there is objective proof the original failure mode is gone: e.g.

    line 102
  12. Distinctive:

    If you cannot verify yet, state unverified or needs proof and list the exact check still missing.

    line 107
  13. Distinctive:

    Skip: only when the user explicitly wants no note or the outcome is a trivial obvious one-liner.

    line 121
  14. Distinctive:

    Leading hypothesis(es): if still open, else root cause summary.

    line 130
  15. Distinctive:

    If CLI audit was invoked: scope given to Claude Code and what you need back (graded findings, P0 list).

    line 131
  16. Very specific:

    write-notes: follow write-notes once at the end of the debug session (step 7), after honest verification status.

    line 150

“Common” is measured: kept by at least 6 in 10 of the 171 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

Purpose

Reduce guesswork and wheel-spinning: README/ and existing notes first, Context7 when library behavior is uncertain, parallel hypotheses when stuck, proof before “fixed”, one write-notes pass at session end, CLI multi-agent audit only for exceptional escalation.

Use When

  • The user says debug, use the debug skill, debug this, or equivalent, or the task is clearly bug investigation / root-cause analysis that is stalling.
  • Failures involve frameworks, SDKs, or cloud APIs where training data may be stale—Context7 should be used before assuming APIs.

Do Not Use When

  • The user only wants a trivial fix with an obvious stack trace and no doc ambiguity (still skim README/ if the area is known to be finicky).
  • The task is greenfield feature build with no defect—use normal dev flow.

Workflow (in order)

1. Read repo knowledge first (mandatory)

Before writing code or deep-diving the stack:

  1. Skim README/ — especially README/notes/debug-notes.md and relevant guides under README/guides/ — for subsystem match (MPS, collators, wizard, BigQuery/GCS paths). Look for known issues, workarounds, and checklists.
  2. Skim README.md for structure, scripts, and links to other docs. Use README/skills/ when debugging agent/plan routing.

Many answers live here; do not skip this step to “save time.”

2. Context7 MCP (library and platform docs)

When the bug touches specific libraries, CLIs, or cloud products (PyTorch, Transformers, PEFT, librosa, GCP clients, Typer, etc.):

  1. Use the Context7 MCP server: resolve the library ID, then fetch focused docs for the API or behavior in question (errors, limits, migration notes).
  2. Prefer Context7 over memory or generic web search for API shape and version-sensitive behavior.

If Context7 is unavailable, say so briefly and fall back to official docs in the browser or MCP fetch—do not invent APIs.

3. Reproduce and narrow

  • Confirm minimal repro or the exact request / job / log line that fails.
  • State a one-sentence current hypothesis and what evidence would falsify it.

4. Parallel investigation when stuck

If the problem is hard, cross-cutting, or you have been going in circles after the reproduce-and-narrow pass (step 3):

  • In one turn, spin up multiple Task subagents with readonly: true and narrow charters (e.g. “collator only”, “config/INI only”, “MPS device path only”).
  • Ask each for plausible hypotheses ranked by likelihood and concrete next checks (files, logs, experiments)—not generic advice.
  • Merge overlapping hypotheses; avoid duplicate deep reads of the same file.

When in doubt, parallelize (same posture as audit, but hypothesis-driven and allowed to propose experiments).

5. Exceptionally frustrating or elusive bugs — CLI + audit

When you are still stuck after parallel investigation, or the blast radius is high (money, data loss, production):

  1. Use the Claude Code CLI from the repo root (or the user’s preferred invocation) to run a multi-agent audit over the scoped slice that matters (paths, feature, or git range).
  2. In the CLI handoff prompt, explicitly attach or cite:
    • The relevant files under README/ (and optional README/Guides/ / README/Notes/ if present) (paths or paste key excerpts),
    • A short symptom + what was already ruled out,
    • Instruction to use the audit skill with multiple readonly subagents and findings-first output.

This is for escalation, not first resort—after README/, notes, Context7, and a fair parallel pass.

6. Prove the fix (before claiming success)

Do not say the bug is fixed, resolved, done, or imply victory until there is objective proof the original failure mode is gone: e.g. failing test passes, manual repro clean, bad log line absent, pipeline green— whatever matches the bug—not because a change ought to work.

If you cannot verify yet, state unverified or needs proof and list the exact check still missing.

7. Write notes once (mandatory last step before ending the session)

After steps 2–6, perform a single notes update using write-notes (typically appending or restructuring README/notes/debug-notes.md; consolidate the whole session; do not dribble edits earlier).

  • Do not repeatedly open or patch note files while investigating; keep working detail in memory or chat until this step.
  • One pass should capture: symptom, repro fingerprint, what was ruled out, root cause (TBD if unknown), fix (if any), verification (proven / not proven / not run), pointers to relevant docs.
  • Skip only when the user explicitly wants no note or the outcome is a trivial obvious one-liner; when in doubt, write once here.

Output expectations

  • What was read from README/ / notes (document names or paths).
  • Verification: what proved the fix (or honest unverified / blocked).
  • Which notes file(s) were updated in step 7 (or why skipped).
  • Whether Context7 was used and for which library/topic.
  • Leading hypothesis(es) if still open, else root cause summary.
  • If CLI audit was invoked: scope given to Claude Code and what you need back (graded findings, P0 list).

Anti-patterns

  • Jumping straight to code changes without README/ / README.md.
  • Assuming API behavior without Context7 or official docs when versions matter.
  • Serial thrashing (same file, same guess) instead of parallel charters.
  • Calling audit for every small typo—keep escalation proportionate.
  • Declaring victory without verification (step 6).
  • Patching notes throughout the session instead of one end-of-session pass (step 7).

Relation to other skills

  • audit: structured repo review; use via CLI escalation when debug skill maxes out.
  • write-notes: follow write-notes once at the end of the debug session (step 7), after honest verification status; consolidates the full investigation for the next engineer’s step 1 (prefer README/notes/debug-notes.md in this repo unless a different notes layout exists).
  • phase-audit: plan-phase checks—not the same as production debugging.

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.