agentleFS
zzgiabaozzbuizzgiabaozzbui/athena-starter/skills/systematic-debugging/SKILL.md

systematic-debugging

Skill1 starsChanged 29 days agoMITView on GitHub

Find the root cause before fixing a bug. Use for a bug, a red test, a stack trace, "error", "wrong", "not working", "prod is broken", "a user reported", or a red verify with no clear reason, even when the bug looks obvious.

191 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use chinese-git-workflow, chinese-code-review and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Leodorareluctant259Skill

    chinese-git-workflow

    适配国内 Git 平台和团队习惯的工作流规范——Gitee、Coding、极狐 GitLab 全覆盖

    Also in 9 projects that use this

  • Leodorareluctant259Skill

    chinese-code-review

    中文代码审查规范——在保持专业严谨的同时,用符合国内团队文化的方式给出有效反馈

    Also in 8 projects that use this

  • SethGammonSkill

    ascii-diagram

    Generate perfectly aligned ASCII diagrams — architecture, flow, sequence, box-and-arrow. Uses a programmatic character-grid approach so alignment is guaranteed by math, not token prediction. Includes post-render verification.

    Also in 4 projects that use this

  • mjunaidcaSkill

    building-chatgpt-apps

    Guides creation of ChatGPT Apps with interactive widgets using OpenAI Apps SDK and MCP servers. Use when building ChatGPT custom apps with visual UI components, embedded widgets, or rich interactive experiences. Covers widget architecture, MCP server setup with FastMCP, response metadata, and Developer Mode configuration. NOT when building standard MCP servers without widgets (use building-mcp-servers skill instead).

    Also in 4 projects that use this

  • mjunaidcaSkill

    building-chat-interfaces

    Build AI chat interfaces with custom backends, authentication, and context injection. Use when integrating chat UI with AI agents, adding auth to chat, injecting user/page context, or implementing httpOnly cookie proxies. Covers ChatKitServer, useChatKit, and MCP auth patterns. NOT when building simple chatbots without persistence or custom agent integration.

    Also in 4 projects that use this

  • +2 more from Leodorareluctant259
  • +5 more from mjunaidca

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 178 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 the whole error message and stack trace: line numbers, paths, error codes.

    line 20
  2. Distinctive:

    Look at recent changes: git log, git diff, dependencies, configuration, environment.

    line 22
  3. Distinctive:

    Remove all temporary logs before commit (R-012).

    line 41

“Common” is measured: kept by at least 6 in 10 of the 178 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
<!-- Adapted from github.com/obra/superpowers · skills/systematic-debugging/ (MIT, © 2025 Jesse Vincent), v6.4.1. -->

Investigate a bug

No fix proposal until the root cause is found. Fixing a symptom is a failure, even when the test turns green.

Two kinds of step

KindIncludesAllowed in
Read-onlyread the error and existing logs · reproduce in dev/test without editing files · trace backwards · compare · git log / git diff. Reproducing that must write shared data or call an external service → ask the userevery call
Edits filesadding diagnostic logs · changing one variable to test a hypothesisa task that already has intent.md allowing edits within its scope (bug fix #6, a red verify in the running task), after intent.md (R-002); done by the agent that does the fix, by role (the developer agent for business logic, API contract, schema, permissions, architecture from MEDIUM; quick-fix for mechanical work). Incident (#3) and research: write the experiment as a proposal for the user (R-116); for #3 follow routing › references/qa-research.md › Incident

1 · Evidence

  1. Read the whole error message and stack trace: line numbers, paths, error codes.
  2. Reproduce reliably: the exact steps, does it happen every time. Cannot reproduce → collect more data, do not guess.
  3. Look at recent changes: git log, git diff, dependencies, configuration, environment.
  4. Multi-layer system (CI → build → deploy, API → service → DB): log the data in / out at each boundary (adding logs = editing files), run once, see which layer breaks, then dig into that layer.
  5. Where does the wrong value come from: trace backwards from the broken spot to the source: references/root-cause-tracing.md.

2 · Compare

Find similar code that works in the repo. List every difference between the working and the broken one, even the ones that "surely do not matter". Understand its dependencies: configuration, environment, assumptions.

3 · Hypothesis

Write one hypothesis: "X is the cause because Y". Test it with the smallest change, one variable at a time. Wrong → a new hypothesis, do not stack more fixes. Do not understand something → say "I do not understand X", do not pretend. A test change is temporary: undo it with your own Edit (no checkout / restore, R-114) before step 4.

4 · Fix

Follow the bug fix flow of routing: the reproducing test first and red, one change aimed at the root cause, no "while I am here" edits (R-010, R-011). An expensive bug (data loss, wrong money, data leak) → references/defense-in-depth.md. The round limit and how to stop when stuck follow R-119; several failed fixes in a row signal a wrong architecture → stop, discuss with the user, do not try once more. Investigation ends with the cause outside the code (flaky external service, environment) → record what was checked, handle it on purpose (timeout, capped retry, clear error), add a log.

Diagnostic logs

  • Print only match / no match, yes / no, length: never the value, never a hash of the value (a hashed ID, OTP or password can still be reversed by guessing; R-016, R-017). To compare two places, compare in code.
  • Remove all temporary logs before commit (R-012).

Excuses

ThoughtReality
"Urgent, fix fast and investigate later"A guessed fix costs more than an investigation; an urgent prod problem needs the right spot even more
"Add a retry / raise the timeout and done"That hides the symptom; find why it is slow, why it fails
"Try one more way"Past the R-119 limit → stop, ask the user
"Prod incident, put a log in the code to be quick"In #3 no file is edited yet; propose the experiment to the user

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.