agentleFS
SnoozleStudioSnoozleStudio/opencode-wp-settings/skills/diagnosing-bugs/SKILL.md

diagnosing-bugs

Skill4 starsChanged 3 days agoMITView on GitHub

Disciplined diagnosis loop for hard bugs and performance regressions — reproduce → minimize → hypothesize → instrument → fix → regression-test. Use for "hard to debug", "only happens sometimes", "works locally but not on the server", "slow page", "memory leak", "strange behavior".

194 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use setup-ts-deep-modules, loop-me 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.
  • liufeng1976Skill

    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 43 projects that use this

  • RoentekSkill

    loop-me

    Grill me about specs for the workflows I want to build, within this workspace.

    Also in 55 projects that use this

  • LesaniSkill

    writing-beats

    Shape an article as a journey of beats, choose-your-own-adventure style. The user picks a starting beat from the raw material, you write only that beat, then offer options for where to pivot next, beat by beat, until the article reaches a natural end. Use when the user has raw material and wants to assemble it as a narrative rather than an argument.

    Also in 58 projects that use this

  • AWSSkill

    to-questionnaire

    Turn a decision you can't fully answer into a questionnaire for someone else to fill in.

    Also in 88 projects that use this

  • LesaniSkill

    writing-shape

    Take a markdown file of raw material and shape it into an article through a conversational session — drafting candidate openings, growing the piece paragraph by paragraph, arguing about format (lists, tables, callouts, quotes) at each step. Use when the user has a pile of notes, fragments, or a rough draft and wants help turning it into something publishable.

    Also in 56 projects that use this

  • 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 122 projects that use this

  • +1 more from Lesani
  • +2 more from aws

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 183 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:

    No repro → you're guessing.

    line 13
  2. Distinctive:

    Verify the hypothesis with evidence before editing:

    line 27
  3. Distinctive:

    Never "fix" by masking symptoms (adding a delay, hiding the element, swallowing the error) without naming what it's masking

    line 47

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

Diagnosing Bugs — The Loop

For bugs that resist direct fixes. The loop, in order — do not skip ahead.

1. Reproduce

Get it on screen deterministically. If it's intermittent, capture the conditions (browser, viewport, reduced-motion state, logged-in user, ACF fields present). No repro → you're guessing. A repro that takes 5 minutes is better than a hypothesis that takes 20.

2. Minimize

Strip the case down: disable half the code paths (comments/toggles), find the minimal input that triggers it. Bisect git history when a recent change is suspected — git bisect or manual bisect across commits. Blame the affected file's history, not the commit the bug report names.

3. Hypothesize

Name the cause in one sentence, with the mechanism: "X happens because Y, which leads to Z." If the sentence needs "I think"/"maybe", you're not ready — instrument instead.

4. Instrument

Verify the hypothesis with evidence before editing:

  • PHP: targeted logging (error_log with context), Query Monitor, step through the data flow
  • JS/CSS: console, computed styles, forced layout measurement, screenshots — the chrome-devtools MCP when available
  • WordPress: check what's actually enqueued/loaded on the page, which options/transients are hit, template file actually in use ({$type}_template filters)

5. Fix

Smallest fix that addresses the named mechanism — scope confined to the bug's files.

6. Regression-test

The repro passes; the canonical verification chain is green (build → format:all:check → phpcs → phpstan, see docs/verification-chain.md). Record the cause + fix in the project's self-evolving learnings log if non-obvious.

Rules

  • Standard bugs that don't need this depth → the fix skill workflow (this loop is for hard/intermittent cases); this skill is the escalation, not the default
  • 2-attempt limit per hypothesis; after 2 failed fixes, stop and re-instrument
  • Never "fix" by masking symptoms (adding a delay, hiding the element, swallowing the error) without naming what it's masking
  • Visual bugs: if a CSS fix fails twice, propose 3 fundamentally different approaches and let the user pick

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.