agentleFS
SajidisrarSajidisrar/ios-claude-skills/skills/ios-bug-triage/SKILL.md

ios-bug-triage

Skill1 starsChanged 15 days agoMITView on GitHub

Diagnose and fix a bug or crash in this iOS codebase methodically — reproduce it, write the failing test first, fix the cause rather than the symptom. Use when given a crash log, a stack trace, a bug report, a "this screen sometimes shows nothing" complaint, a flaky test, or any report that the app misbehaves. Also use when asked why something is not working.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 6 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    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:

    Use the architecture to narrow it down:

    line 25
  2. Very specific:

    Search for the mechanism, not the message: Grep for the endpoint path, the cache key prefix, the outbox kind, or the LoadState assignment …

    line 38
  3. Distinctive:

    Write the failing test before the fix, in the layer where the bug lives — this is the step that stops it coming back:

    line 44
  4. Distinctive:

    Run it and confirm it fails for the reason you predicted.

    line 56
  5. Distinctive:

    Do not add a defensive check somewhere else to mask it.

    line 63
  6. Distinctive:

    If the fix reveals that the design was wrong, say so and propose the change rather than working around it.

    line 64
  7. Distinctive:

    If the bug came from an ambiguous requirement (what should this screen show when the cached data is two days old?), ask — that is a product …

    line 66

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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 and fix a bug

The rule that makes this reliable: do not change code until you can describe the failing sequence in one sentence. A fix applied to a symptom you have not located moves the bug rather than removing it.

1. Establish the failure

Gather, and state back:

  • What the user did, what happened, what should have happened.
  • Which build (Debug or Release), which environment, which iOS version.
  • Was the device offline, or on a poor connection? Was the session near expiry? These two conditions cause most of the odd behaviour in this app.
  • Is it every time, or intermittent? Intermittent almost always means concurrency, cancellation, or an expiring token.

2. Locate the layer before reading code

Use the architecture to narrow it down:

SymptomLook first at
Wrong or stale data on screenRepository read policy, cache invalidation after writes
Screen stuck on a spinnerA LoadState never leaving .loading — usually an early return in a catch, often the cancellation guard
Content disappears on refreshView model replacing state with .failed instead of keeping content and setting banner
Signed out at randomToken refresh — check for more than one refresh in flight, or a rejected refresh token
A write vanishesOutbox: was it queued, replayed, or dropped after five attempts?
Duplicate recordsA retried non-idempotent request, or queued work merged into more than the first page
Crash on a background threadState mutated off @MainActor, or a Sendable violation
Nothing shown for a real errorAppError.from mapping, or a swallowed try?

Search for the mechanism, not the message: Grep for the endpoint path, the cache key prefix, the outbox kind, or the LoadState assignment in the suspect view model.

3. Reproduce it in a test

Write the failing test before the fix, in the layer where the bug lives — this is the step that stops it coming back:

  • Wrong data or cache behaviour → repository test with StubAPIClient and InMemoryCacheStore.
  • Stuck spinner, lost content, missing error → view-model test with StubWidgetRepository.
  • Auth oddity → AuthSessionStore test with SpyAuthenticationAPI (setRefreshDelay creates the overlap that exposes races).
  • Retry, status mapping, refresh-and-retry → LiveAPIClient over StubHTTPSession.

Run it and confirm it fails for the reason you predicted. If it passes, your theory is wrong — go back to step 2 rather than adjusting the test.

4. Fix the cause

  • Fix it in the layer that owns the concern. A repository bug is not fixed in a view.
  • Do not add a defensive check somewhere else to mask it.
  • If the fix reveals that the design was wrong, say so and propose the change rather than working around it.
  • If the bug came from an ambiguous requirement (what should this screen show when the cached data is two days old?), ask — that is a product decision.

5. Check the neighbours

The same mistake is usually in more than one place. If a view model forgot the cancellation guard, Grep for catch { across the features and check them all.

Verification

  • The failing test now passes, and it failed before the fix for the right reason.
  • The fix is in the layer that owns the concern.
  • Nothing was made "defensive" elsewhere to compensate.
  • Sibling occurrences of the same mistake were checked.
  • No debugging leftovers: no print, no commented-out code, no temporarily relaxed lint rule.
  • The summary names the root cause in one sentence, not just the fix.
  • Human review, passing tests and a clean SAST run are still required before commit.

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.