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.
In this repository37 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ios-accessibility-auditSkill
- ios-api-contract-migrationSkill
- ios-api-endpointSkill
- ios-app-intents-siriSkill
- ios-build-configurationSkill
- ios-cloudkit-syncSkill
- ios-combine-patternsSkill
- ios-commit-and-prSkill
- ios-commitSkill
- ios-concurrency-auditSkill
- ios-coreml-apple-intelligenceSkill
- ios-deep-linkingSkill
- ios-dependency-assessmentSkill
- ios-design-fixSkill
- ios-feature-moduleSkill
- ios-knowledge-baseSkill
- ios-latest-os-adoptionSkill
- ios-localizationSkill
- ios-offline-writeSkill
- ios-performance-tuningSkill
- ios-port-from-androidSkill
- ios-port-to-androidSkill
- ios-precommitSkill
- ios-privacy-complianceSkill
- ios-push-and-background-tasksSkill
- ios-refactorSkill
- ios-release-prepSkill
- ios-sdk-upgradeSkill
- ios-secure-reviewSkill
- ios-storekit-subscriptionsSkill
- ios-swift6-concurrency-migrationSkill
- ios-swiftdataSkill
- ios-swift-testing-migrationSkill
- ios-swiftui-screenSkill
- ios-unit-testsSkill
- ios-widgetkit-live-activitiesSkill
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
- Distinctive: line 25
Use the architecture to narrow it down:
- Very specific: line 38
Search for the mechanism, not the message: Grep for the endpoint path, the cache key prefix, the outbox kind, or the LoadState assignment …
- Distinctive: line 44
Write the failing test before the fix, in the layer where the bug lives — this is the step that stops it coming back:
- Distinctive: line 56
Run it and confirm it fails for the reason you predicted.
- Distinctive: line 63
Do not add a defensive check somewhere else to mask it.
- Distinctive: line 64
If the fix reveals that the design was wrong, say so and propose the change rather than working around it.
- Distinctive: line 66
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 …
≈ “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.
Files
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:
| Symptom | Look first at |
| Wrong or stale data on screen | Repository read policy, cache invalidation after writes |
| Screen stuck on a spinner | A LoadState never leaving .loading — usually an early return in a catch, often the cancellation guard |
| Content disappears on refresh | View model replacing state with .failed instead of keeping content and setting banner |
| Signed out at random | Token refresh — check for more than one refresh in flight, or a rejected refresh token |
| A write vanishes | Outbox: was it queued, replayed, or dropped after five attempts? |
| Duplicate records | A retried non-idempotent request, or queued work merged into more than the first page |
| Crash on a background thread | State mutated off @MainActor, or a Sendable violation |
| Nothing shown for a real error | AppError.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
StubAPIClientandInMemoryCacheStore. - Stuck spinner, lost content, missing error → view-model test with
StubWidgetRepository. - Auth oddity →
AuthSessionStoretest withSpyAuthenticationAPI(setRefreshDelaycreates the overlap that exposes races). - Retry, status mapping, refresh-and-retry →
LiveAPIClientoverStubHTTPSession.
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.
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
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.

