agentleFS
saintdlesaintdle/agentflow/.agents/skills/diagnosing-bugs/SKILL.md

diagnosing-bugs

Skill2 starsChanged 56 days agoApache-2.0View on GitHub

Diagnose reproducible defects, failing tests, regressions, flaky behavior, performance problems, and unexpected runtime results through an evidence-led feedback loop. Use when the user asks to diagnose, debug, investigate, find a root cause, or fix a reported defect. Diagnose without editing unless the request also authorizes a fix.

123 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use wizard, writing-beats and 9 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.
  • AWSSkill

    wizard

    Generate an interactive bash wizard that walks a human through steps only they can perform. Use when provisioning infrastructure, setting up credentials or CI secrets, walking an unfamiliar third-party dashboard, or running a one-off migration or cutover. Don't invoke this for steps the agent can perform itself.

    Also in 57 projects that use this

  • RoentekSkill

    writing-beats

    Writing, exploit — assemble raw material into a journey of beats, grounding each term before a beat leans on it.

    Also in 23 projects that use this

  • loulanyueSkill

    setup-ts-deep-modules

    Wire dependency-cruiser into a TypeScript repo so each package is a deep module — implementation hidden in subfolders, reachable only through its entry-point files. User-invoked.

    Also in 16 projects that use this

  • AWSSkill

    ask-matt

    Ask which skill or flow fits your situation. A router over the skills in this repo.

    Also in 35 projects that use this

  • RoentekSkill

    writing-shape

    Writing, exploit — shape raw material into an article, paragraph by paragraph.

    Also in 21 projects that use this

  • +4 more from aws
  • +2 more from Roentek

The file

We split this skill into the rules it gives an agent

11 rules. 0 are common, 10 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 115 edited versions we read keep these.

  • 10

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When the repository provides an AGENTS.md, apply its shared coding discipline: inspect affected code, callers, tests, and shared utilities …

    line 8
  2. Very specific:

    Read repository instructions, relevant domain skills, nearby tests, CONTEXT.md, and applicable ADRs before changing anything.

    line 13
  3. Distinctive:

    Check active Beads state. When a bug bead exists, keep its symptom, reproduction, evidence, and disposition current.

    line 14
  4. Distinctive:

    Before forming a cause theory, create one command that exercises the reported path and can distinguish the exact failure from success.

    line 18
  5. Distinctive:

    Run it and capture the command plus concise observed evidence.

    line 35
  6. Distinctive:

    Write three to five ranked, falsifiable hypotheses.

    line 40
  7. Distinctive:

    Test one variable at a time.

    line 41
  8. Distinctive:

    Run the regression test green, then rerun the original unminimized loop.

    line 52
  9. Distinctive:

    Run affected repository checks.

    line 53
  10. Distinctive:

    Remove all tagged instrumentation and throwaway harnesses unless the user approved keeping them.

    line 57
  11. Distinctive:

    If blocked, return one decision or dependency, evidence tried, available options, recommendation, current branch/check state, and remaining …

    line 60

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

Diagnose Bugs

When the repository provides an AGENTS.md, apply its shared coding discipline: inspect affected code, callers, tests, and shared utilities before changing code; keep authorized fixes complete and focused; and state material assumptions. Ask only questions that could change scope, correctness, or authority.

Establish authority and context

  1. Determine whether the request authorizes diagnosis only or diagnosis plus a fix. Do not edit product code for a diagnosis-only request.
  2. Read repository instructions, relevant domain skills, nearby tests, CONTEXT.md, and applicable ADRs before changing anything.
  3. Check active Beads state. When a bug bead exists, keep its symptom, reproduction, evidence, and disposition current. Store distilled facts and artifact paths, not raw logs or transcripts.

Build the feedback loop

Before forming a cause theory, create one command that exercises the reported path and can distinguish the exact failure from success.

Prefer, in order:

  1. An existing focused unit, integration, or end-to-end test.
  2. A minimal CLI, API, browser, or fixture-driven reproduction.
  3. A deterministic replay, differential comparison, or benchmark.
  4. A bounded stress loop for intermittent behavior.
  5. A temporary harness around the narrowest real interface.

The loop must be:

  • Red-capable: it detects the user's symptom, not merely a nearby error.
  • Repeatable: repeated runs produce a trustworthy verdict; for flaky defects, record the reproduction rate.
  • Focused: unrelated setup and noise are removed.
  • Agent-runnable: it can run unattended within the authorized environment.

Run it and capture the command plus concise observed evidence. If no trustworthy loop can be built, stop with the missing environment, artifact, access, or user action needed. Do not replace reproduction with speculation.

Minimize and explain

  1. Reduce the input, configuration, callers, and environment while preserving the failure.
  2. Write three to five ranked, falsifiable hypotheses. For each, state the observation that would support or refute it.
  3. Test one variable at a time. Prefer debuggers, traces, profilers, and narrow boundary logging over broad log collection.
  4. Mark temporary instrumentation with a unique searchable tag.
  5. Identify the root cause only when evidence rules in one explanation and rules out credible alternatives.

For diagnosis-only work, stop here and return the cause, evidence, impact, and smallest recommended correction. Clearly label anything still unverified.

Fix when authorized

  1. Choose a regression-test seam that observes public behavior and represents the real failure. If no sound seam exists, document that architectural limitation instead of adding a misleading test.
  2. Convert the minimized reproduction into a failing test and run it red.
  3. Make the smallest correction that addresses the established cause. Do not bundle opportunistic refactors.
  4. Run the regression test green, then rerun the original unminimized loop.
  5. Run affected repository checks.

Clean up and return

  • Remove all tagged instrumentation and throwaway harnesses unless the user approved keeping them.
  • Record the correct hypothesis and evidence in the bead, commit, or PR.
  • Report: outcome; diagnosis or fix; reproduction command; root-cause evidence; changed files and commit when applicable; checks; residual risks; and untested lanes.
  • If blocked, return one decision or dependency, evidence tried, available options, recommendation, current branch/check state, and remaining risk.

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.