agentleFS
hamburger-oshamburger-os/PraxFlow/skills/diagnose/SKILL.md

diagnose

Skill1 starsChanged 2 months agoMITView on GitHub

Diagnose technical failures by establishing expected versus observed behavior, characterizing the failure, generating competing causal hypotheses, designing discriminating experiments, updating hypotheses from evidence, and stopping only when a sufficiently supported cause or bounded next test is established. Use for bugs, CI failures, runtime anomalies, performance regressions, deployment failures, or device/system faults.

193 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use zoom-out, to-prd 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.
  • victorgarciaesgiSkill

    zoom-out

    Tell the agent to zoom out and give broader context or a higher-level perspective. Use when you're unfamiliar with a section of code or need to understand how it fits into the bigger picture.

    Also in 61 projects that use this

  • GoogleSkill

    to-prd

    Turn the current conversation into a PRD and publish it to the project issue tracker — no interview, just synthesis of what you've already discussed.

    Also in 56 projects that use this

  • GoogleSkill

    to-issues

    Break a plan, spec, or PRD into independently-grabbable issues on the project issue tracker using tracer-bullet vertical slices.

    Also in 53 projects that use this

  • simo97Skill

    edit-article

    The user will invoke this skill to help them edit an article.

    Also in 17 projects that use this

  • simo97Skill

    write-a-skill

    Create new agent skills with proper structure, progressive disclosure, and bundled resources. Use when user wants to create, write, or build a new skill.

    Also in 44 projects that use this

  • AnasX7Skill

    setup-pre-commit

    Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.

    Also in 27 projects that use this

  • +4 more from simo97

The file

Show its rules and text

We split this skill into the rules it gives an agent

18 rules. 0 are common, 17 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 174 edited versions we read keep these.

  • 17

    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:

    Do not patch the first suspicious location.

    line 12
  2. Distinctive:

    If expected behavior itself is unclear and consequential, resolve that before declaring a bug.

    line 44
  3. Distinctive:

    when it happens and when it does not.

    line 50
  4. Distinctive:

    Prefer a controlled reproduction, but do not require reproduction as dogma.

    line 61
  5. Distinctive:

    If reproduction is impractical, obtain the strongest available failure record such as:

    line 63
  6. Distinctive:

    Use targeted project understanding to narrow:

    line 75
  7. Very specific:

    Use survey or trace when available and useful.

    line 85
  8. Distinctive:

    When the cause is not established, keep more than one plausible explanation alive when evidence permits.

    line 89
  9. Distinctive:

    Do not mechanically invent a fixed number of hypotheses.

    line 97
  10. Distinctive:

    Prefer the cheapest targeted action that distinguishes plausible hypotheses.

    line 101
  11. Distinctive:

    add one targeted state/log probe instead of broad logging.

    line 113
  12. Distinctive:

    run the same path with one state variable controlled.

    line 114
  13. Distinctive:

    After every useful experiment:

    line 121
  14. Distinctive:

    Do not keep editing around a hypothesis that evidence has contradicted.

    line 128
  15. Distinctive:

    Treat a cause as sufficiently established when it:

    line 132
  16. Distinctive:

    If a full root cause cannot be established, stop with a bounded next experiment rather than fabricating certainty.

    line 139
  17. Distinctive:

    If continued operation can cause consequential damage, data loss, security exposure, physical risk, or expanding production impact, …

    line 143
  18. Distinctive:

    Do not expose unnecessary internal narration.

    line 172

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

Do not patch the first suspicious location. Improve the causal model until the next action is supported by evidence.

flowchart TD
    E[Expected vs observed] --> C[Characterize failure]
    C --> R[Reproduce or capture]
    R --> L[Localize]
    L --> H[Competing hypotheses]
    H --> X[Discriminating experiment]
    X --> V[Collect evidence]
    V --> U[Update hypothesis set]
    U --> Q{Cause sufficiently supported?}
    Q -->|No| X
    Q -->|Yes| F[Bounded causal repair / handoff]
    Q -->|Cannot test further| N[Stop with bounded next experiment]

Method

1. Establish expected versus observed behavior

First determine what should happen and what actually happened.

Expected behavior may come from:

  • an accepted requirement/spec;
  • tests;
  • public/API contracts;
  • standards or domain references;
  • previously verified behavior;
  • an explicit user decision.

If expected behavior itself is unclear and consequential, resolve that before declaring a bug.

2. Characterize the failure

Find conditions that increase information value:

  • when it happens and when it does not;
  • deterministic versus intermittent;
  • input/state/timing/environment dependence;
  • first known bad version or change when available;
  • impact radius;
  • correlated logs, metrics, traces, core dumps, or device observations.

A precise failure signature is often more valuable than reading more code.

3. Reproduce when feasible; capture when not

Prefer a controlled reproduction, but do not require reproduction as dogma.

If reproduction is impractical, obtain the strongest available failure record such as:

  • logs/trace;
  • core dump;
  • metrics;
  • production observation;
  • captured input;
  • hardware/device output;
  • user-reported conditions with explicit uncertainty.

4. Localize before theorizing broadly

Use targeted project understanding to narrow:

flowchart LR
    A[System] --> B[Subsystem]
    B --> C[Behavior path]
    C --> D[State / lifecycle boundary]
    D --> E[Triggering condition]

Use survey or trace when available and useful.

5. Generate competing hypotheses

When the cause is not established, keep more than one plausible explanation alive when evidence permits.

For each candidate, ask:

  • what evidence already supports it?
  • what evidence contradicts it?
  • what observable result would be expected if it were true?

Do not mechanically invent a fixed number of hypotheses. The purpose is to resist premature fixation.

6. Design a discriminating experiment

Prefer the cheapest targeted action that distinguishes plausible hypotheses.

Good experiments are:

  • high-information;
  • reversible or low-risk;
  • narrowly tied to the uncertainty;
  • observable;
  • interpretable under both positive and negative outcomes.

Examples:

  • add one targeted state/log probe instead of broad logging;
  • run the same path with one state variable controlled;
  • compare known-good and failing inputs;
  • temporarily disable one mechanism to test causality;
  • trace whether a callback/event actually fires before inspecting its internals.

7. Update the hypothesis set

After every useful experiment:

  • discard contradicted explanations;
  • strengthen supported ones without overstating certainty;
  • refine overly broad hypotheses;
  • identify the next highest-information uncertainty.

Do not keep editing around a hypothesis that evidence has contradicted.

8. Establish cause before causal repair

Treat a cause as sufficiently established when it:

  • explains the important observed symptoms;
  • is consistent with available evidence;
  • predicts relevant conditions/boundaries;
  • and, when feasible, an intervention affecting the proposed mechanism changes the failure behavior.

If a full root cause cannot be established, stop with a bounded next experiment rather than fabricating certainty.

Containment

If continued operation can cause consequential damage, data loss, security exposure, physical risk, or expanding production impact, prioritize containment before deep diagnosis.

Containment is not the final fix. Preserve enough evidence for later diagnosis when possible.

Output

For active debugging, keep a compact working model:

## Expected vs observed
...

## Failure signature
...

## Hypotheses
- H1 — supported/contradicted/untested: ...
- H2 — ...

## Best next experiment
...

## Evidence update
...

## Current cause / remaining uncertainty
...

Do not expose unnecessary internal narration. Show the evidence and reasoning needed for the engineer to understand or act on the diagnosis.

Stop condition

Stop when either:

  1. a sufficiently supported cause exists for a bounded causal fix; or
  2. the next discriminating experiment is clear but cannot be executed with available capabilities.

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.