agentleFS
SentryKnown publishergetsentry/sentry-react-native/.agents/skills/diagnosing-bugs/SKILL.md

diagnosing-bugs

Skill1.8k starsChanged 3 months agoMITView on GitHub

A discipline for hard bugs, flaky tests, CI hangs, native crashes, and performance regressions in this SDK. Use when the user says "diagnose" or "debug this", reports something broken/throwing/failing/hanging/slow/crashing, or a test is flaky. Builds a tight, red-capable feedback loop before hypothesizing.

123 other projects use a version of this, 1 of them edited.

Trending

Quiet this year.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the getsentry/sentry-react-native repository that our weekly crawl found: only 9 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Most recently taken up by

Who's talking about getsentry/sentry-react-native

The biggest 5 of 9 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 9

Talked about on GitHub (9 times).

On GitHub · 9

4 more on GitHub

Used with

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

  • +5 more from aws
  • +2 more from Roentek

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 115 edited versions we read keep these.

  • 1

    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 red-capable command, no Phase 2.

    line 40

“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

A discipline for hard bugs. Skip a phase only when you can say why.

The whole skill is Phase 1: get a loop that goes red on this bug. Everything after is mechanical once you have it. If you catch yourself reading code to form a theory before that loop exists, stop — jumping to a hypothesis without a red-capable loop is the exact failure this prevents.

For trivial bugs with an obvious fix and an obvious test, skip this and just write the failing test — this skill is for the bugs that resist.

Phase 1 — Build a feedback loop

A tight loop is fast, deterministic, and goes red on this bug. Build one and the bug is 90% solved. Be aggressive and creative here — spend disproportionate effort.

Ways to construct one — try roughly in this order

  1. Failing Jest test at the seam — yarn test path/to/file.test.ts -t 'name', at whatever seam reaches the bug. Tightest loop there is. Mock the bridge via test/mockWrapper.ts.
  2. Fake-timer harness — for flush timers, debounces, retries, and most flakes: jest.useFakeTimers() and advance the clock deterministically instead of waiting.
  3. Arch/platform matrix — reproduce under the failing combination: pin Platform.OS, isTurboModuleEnabled(), isFabricEnabled(). "Only on New Arch" or "only on Android" is a clue and the loop's config.
  4. Replay a captured payload — save a real envelope / event / native payload to disk and push it through the code path in isolation. Great for serialization / round-trip bugs.
  5. Throwaway harness — a minimal script exercising the bug path with mocked deps.
  6. Sample app — when the bug only shows end-to-end, reproduce in samples/react-native (or samples/expo); see their AGENTS.md. Slower loop; use only when a unit seam can't reach it.
  7. Native repro — for a native crash / leak, reproduce in the native test targets (iOS RNSentryCocoaTester, Android instrumentation) or with the sample app + native debugger. The bridge can't be faked here.
  8. Stress / repetition loop — for non-deterministic bugs: run the trigger 100×, narrow timing windows, inject delays. Goal is a higher reproduction rate, not a clean repro.
  9. Differential loop — same input through two versions/configs (e.g. before/after a dependency or RN bump) and diff the output. For regressions that "appeared after X".

Tighten the loop

Once you have a loop, treat it as a product: faster (narrow scope, skip unrelated init), sharper (assert the exact symptom the user described, not "didn't crash"), more deterministic (fake timers, seed randomness, no real network/bridge). A 2-second deterministic loop beats a 30-second flaky one. For non-deterministic bugs the goal is a high enough reproduction rate to debug against — 50% is debuggable, 1% is not.

Completion criterion

Phase 1 is done when you can name one command — a test invocation or script — that you have already run at least once (paste the invocation and its output), and that is:

  • Red-capable — drives the actual bug path and asserts the user's exact symptom
  • Deterministic — same verdict every run (flaky bugs: a pinned, high reproduction rate)
  • Fast — seconds, not minutes

No red-capable command, no Phase 2.

When you genuinely cannot build a loop

Say so explicitly, list what you tried, and ask the user for: an environment that reproduces it, a captured artifact (envelope dump, native crash log / symbolicated stack, CI run, screen recording with timestamps, adb logcat / Xcode console output), or permission for temporary instrumentation. Do not hypothesise without a loop.

Phase 2 — Reproduce and minimise

Run the loop, watch it go red. Confirm it produces the failure mode the user described — not a nearby one (wrong bug = wrong fix). Then shrink the repro to the smallest scenario that still goes red: cut inputs, callers, config, and steps one at a time, re-running after each cut. Done when every remaining element is load-bearing. The minimal repro becomes the regression test.

Phase 3 — Hypothesise

Generate 3–5 ranked, falsifiable hypotheses before testing any — a single hypothesis anchors you on the first plausible idea. Each states its prediction: "If X is the cause, then changing Y makes the bug vanish." If you can't state the prediction, it's a vibe — sharpen or discard it. Show the ranked list to the user; they often re-rank it instantly ("we just changed #3"). Common suspects in this SDK: arch/platform branch, bridge serialization, timer/async ordering, scope-sync recursion, native memory/lifecycle, RN or native-SDK version skew.

Phase 4 — Instrument & fix

Confirm the hypothesis with the cheapest observation that would falsify it (a log via debug, a native breakpoint, a diffed payload) before changing code. Then make the minimal fix, watch the loop go green, and keep the minimal repro as the regression test. Re-run the broader suite (yarn test) and, for native/bridge fixes, the affected native tests and both architectures.

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.