debugging
Skill4 starsChanged 6 months agoMITView on GitHub
Use when diagnosing runtime crashes, SwiftUI render errors, concurrency violations, or unexpected behavior. Covers crash investigation methodology, LLDB debugging via XcodeBuildMCP, common iOS crash patterns, and the async renderer color crash.
81 other projects use a version of this.
Adopted by
Most recently taken up by
- JetBrains/intellij-communitytheir own version, first seen Oct 3, 2026
- iliaal/ai-skillstheir own version, first seen Oct 3, 2026
- kapadias/nonnatheir own version, first seen Oct 1, 2026
- JetBrains/MPStheir own version, first seen Oct 1, 2026
- kynn-dev/agent-skillstheir own version, first seen Sep 30, 2026
- geeks-accelerator/in-bed-aitheir own version, first seen Sep 29, 2026
Used with
Projects with it also use media-processing, databases 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.
mrgoonieSkillmedia-processing
Process multimedia files with FFmpeg (video/audio encoding, conversion, streaming, filtering, hardware acceleration) and ImageMagick (image manipulation, format conversion, batch processing, effects, composition). Use when converting media formats, encoding videos with specific codecs (H.264, H.265, VP9), resizing/cropping images, extracting audio from video, applying filters and effects, optimizing file sizes, creating streaming manifests (HLS/DASH), generating thumbnails, batch processing images, creating composite images, or implementing media processing pipelines. Supports 100+ formats, hardware acceleration (NVENC, QSV), and complex filtergraphs.
Also in 4 projects that use this
mrgoonieSkilldatabases
Work with MongoDB (document database, BSON documents, aggregation pipelines, Atlas cloud) and PostgreSQL (relational database, SQL queries, psql CLI, pgAdmin). Use when designing database schemas, writing queries and aggregations, optimizing indexes for performance, performing database migrations, configuring replication and sharding, implementing backup and restore strategies, managing database users and permissions, analyzing query performance, or administering production databases.
Also in 5 projects that use this
pproencaSkillrefactoring
Code refactoring best practices based on Martin Fowler's catalog and Clean Code principles. This skill should be used when refactoring existing code, improving code structure, reducing complexity, eliminating code smells, or reviewing code for maintainability. Triggers on tasks involving extract method, rename, decompose conditional, reduce coupling, or improve readability.
Also in 17 projects that use this
ShopifySkillprofiling
Profile Rubydex indexer performance — CPU flamegraphs, memory usage, phase-level timing. Use this skill whenever the user mentions profiling, performance, flamegraphs, benchmarking, "why is X slow", bottlenecks, hot paths, memory usage, or wants to understand where time is spent during indexing/resolution. Also trigger when comparing performance before/after a change.
Also in 3 projects that use this
sarveshtaleleSkilltest-generation
Generate a test strategy and starter test stubs for given modules across unit, integration, and e2e layers (pytest/jest/playwright). Trigger on: generate tests, test plan, test strategy, coverage plan, test scaffolding.
Also in 3 projects that use this
MicrosoftSkillusing-skills
Describes how to use abilities. Read before any conversation.
Also in 3 projects that use this
- +5 more from mrgoonie
Other versions81 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 81
- JetBrains/intellij-community★ 21ksame name
- mrgoonie/claudekit-skills★ 2.2ksame name
- JetBrains/MPS★ 1.7ksame name
- notque/vexjoy-agent★ 424same name
- idavidov13/agentic-playwright★ 222same name
- block/ai-rules★ 137same name
- duongthinh03/portfolio★ 85same name
- matteing/opal★ 61same name
- ratacat/claude-skills★ 56same name
- andreaswasita/copilot-agents-dojo★ 54same name
71 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository76 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/components.mdcCursor rule
- .cursor/rules/currency.mdcCursor rule
- .cursor/rules/design-system.mdcCursor rule
- .cursor/rules/file-structure.mdcCursor rule
- .cursor/rules/forbidden-patterns.mdcCursor rule
- .cursor/rules/mvvm-architecture.mdcCursor rule
- .cursor/rules/pricing-display.mdcCursor rule
- .cursor/rules/scope.mdcCursor rule
- .cursor/rules/swift-conventions.mdcCursor rule
- accessibilitySkill
- animationsSkill
- apple-developer-authSkill
- apple-signinSkill
- app-store-preflightSkill
- asc-app-create-uiSkill
- asc-aso-auditSkill
- asc-build-lifecycleSkill
- asc-cli-usageSkill
- asc-crash-triageSkill
- asc-id-resolverSkill
- asc-localize-metadataSkill
- asc-metadata-syncSkill
- asc-metadata-yamlSkill
- asc-notarizationSkill
- asc-ppp-pricingSkill
- asc-release-flowSkill
- asc-revenuecat-catalog-syncSkill
- asc-screenshot-resizeSkill
- asc-shots-pipelineSkill
- asc-signing-setupSkill
- ascSkill
- asc-submission-healthSkill
- asc-subscription-localizationSkill
- asc-testflight-orchestrationSkill
- asc-wall-submitSkill
- asc-whats-new-writerSkill
- asc-workflowSkill
- asc-xcode-buildSkill
- billing-finance-calculatorSkill
- buildSkill
- business-modelSkill
- chartsSkill
- consolidate-errorsSkill
- content-composerSkill
- crashSkill
- feature-directory-structureSkill
- feedback-statesSkill
- fix-errorSkill
- formsSkill
- foundation-modelsSkill
- hapticsSkill
- healthkitSkill
- layoutSkill
- listsSkill
- navigationSkill
- notificationsSkill
- onboarding-questionnaireSkill
- onboardingSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
12 rules. 0 are common, 6 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 73 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this guide when diagnosing runtime crashes, render errors, or unexpected behavior.
- Distinctive: line 86
If XcodeBuildMCP is available:
- Distinctive: line 92
If only Apple Xcode MCP: ask the user to copy the backtrace from Xcode's Debug Navigator.
- Distinctive: line 95
Read the stack from bottom to top.
- Very specific: line 124
Fix: Use static Color(hex:) instead of Color(light:dark:) with UIColor provider
- Very specific: line 129
Fix: Ensure all UI-bound state is @MainActor.
- Very specific: line 134
Fix: Use AVAudioApplication.requestRecordPermission() (iOS 17+ async).
- Very specific: line 139
Fix: Use @ModelActor for background contexts, @MainActor for UI contexts.
- Very specific: line 144
Fix: Use Identifiable conformance or stable id: keypath.
- Distinctive: line 183
Always get the backtrace first — don't guess
- Distinctive: line 184
Check the crashing thread, not Thread 1
- Very specific: line 186
Use OSLog (not print()) for debugging
“Common” is measured: kept by at least 6 in 10 of the 73 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.
Files
iOS Debugging & Crash Investigation
Use this guide when diagnosing runtime crashes, render errors, or unexpected behavior.
MCP Tool Selection — Check What's Available
At the start of a debugging session, check which MCP servers are loaded. Use ToolSearch to probe:
ToolSearch("XcodeBuildMCP") → if found: full LLDB + simulator + build
ToolSearch("mcp__xcode__") → if found: build + preview + test (no LLDB)Priority order:
- Apple Xcode MCP (
mcp__xcode__*) — use for build, preview, test, issues, build log - XcodeBuildMCP (
mcp__XcodeBuildMCP__*) — use ONLY for what Apple Xcode MCP cannot do: LLDB debugging, simulator log capture, screenshots, UI snapshots, video recording
What Apple Xcode MCP handles (prefer these when available):
| Capability | Tool |
| Build | mcp__xcode__BuildProject |
| Preview | mcp__xcode__RenderPreview |
| Run tests | mcp__xcode__RunSomeTests / RunAllTests |
| Navigator issues | mcp__xcode__XcodeListNavigatorIssues |
| Build log | mcp__xcode__GetBuildLog |
| Read files | mcp__xcode__XcodeRead |
| Search code | mcp__xcode__XcodeGrep |
| Find files | mcp__xcode__XcodeGlob |
| Code diagnostics | mcp__xcode__XcodeRefreshCodeIssuesInFile |
| Execute snippet | mcp__xcode__ExecuteSnippet |
What ONLY XcodeBuildMCP can do (fallback to these):
| Capability | Tool |
| LLDB attach | mcp__XcodeBuildMCP__debugging__attach |
| Backtrace | mcp__XcodeBuildMCP__debugging__stack |
| Frame variables | mcp__XcodeBuildMCP__debugging__variables |
| Run LLDB command | mcp__XcodeBuildMCP__debugging__lldb_command |
| Add breakpoint | mcp__XcodeBuildMCP__debugging__add_breakpoint |
| Remove breakpoint | mcp__XcodeBuildMCP__debugging__remove_breakpoint |
| Continue execution | mcp__XcodeBuildMCP__debugging__continue |
| Detach debugger | mcp__XcodeBuildMCP__debugging__detach |
| Simulator log capture | mcp__XcodeBuildMCP__simulator__start_simulator_log_capture / stop_simulator_log_capture |
| Launch with logs | mcp__XcodeBuildMCP__simulator__launch_app_with_logs |
| Screenshot | mcp__XcodeBuildMCP__simulator__screenshot |
| UI hierarchy snapshot | mcp__XcodeBuildMCP__simulator__snapshot_ui |
| Record video | mcp__XcodeBuildMCP__simulator__record_video |
| Build & run (sim) | mcp__XcodeBuildMCP__simulator__build_and_run |
Install XcodeBuildMCP: claude mcp add XcodeBuildMCP -- npx -y xcodebuildmcp@latest mcp
LLDB Crash Debugging Workflow (XcodeBuildMCP required)
1. Build & run: mcp__XcodeBuildMCP__simulator__build_and_run
2. Set breakpoint: mcp__XcodeBuildMCP__debugging__add_breakpoint
3. When paused: mcp__XcodeBuildMCP__debugging__stack → backtrace
4. Inspect vars: mcp__XcodeBuildMCP__debugging__variables → local state
5. Run LLDB: mcp__XcodeBuildMCP__debugging__lldb_command → "po myVariable"
6. Continue: mcp__XcodeBuildMCP__debugging__continue
7. Detach: mcp__XcodeBuildMCP__debugging__detachIMPORTANT: XcodeBuildMCP manages its OWN debug session. Do NOT run the app from Xcode at the same time — only one debugger can attach. Use build_and_run from XcodeBuildMCP, then attach.
Decision Logic
| Need | Use |
| Build the project | Apple Xcode MCP (BuildProject) |
| Runtime crash / backtrace | XcodeBuildMCP (LLDB) |
| Build errors / diagnostics | Apple Xcode MCP (GetBuildLog, XcodeListNavigatorIssues) |
| UI rendering preview | Apple Xcode MCP (RenderPreview) |
| Run tests | Apple Xcode MCP (RunSomeTests) |
| Console logs at runtime | XcodeBuildMCP (launch_app_with_logs) |
| Screenshot | Apple Xcode MCP or XcodeBuildMCP |
| View hierarchy | XcodeBuildMCP (snapshot_ui) |
Crash Investigation Methodology
Step 1: Get the Backtrace (FIRST thing to do)
If XcodeBuildMCP is available:
→ mcp__XcodeBuildMCP__debugging__stackThis gives the full backtrace from all threads. Find the crashing thread.
If only Apple Xcode MCP: ask the user to copy the backtrace from Xcode's Debug Navigator.
Step 2: Find the First App Frame
Read the stack from bottom to top. The first frame in YOUR code (not Apple/system frames) is the root cause.
Step 3: Inspect State
→ mcp__XcodeBuildMCP__debugging__variables (local vars)
→ mcp__XcodeBuildMCP__debugging__lldb_command "po self"
→ mcp__XcodeBuildMCP__debugging__lldb_command "po someProperty"Step 4: Set Breakpoints for Next Run
→ mcp__XcodeBuildMCP__debugging__add_breakpoint file:line or function name
→ mcp__XcodeBuildMCP__debugging__continueStep 5: Fix and Re-run
Edit the code, rebuild:
→ mcp__xcode__BuildProject (preferred — uses Xcode)
→ mcp__XcodeBuildMCP__simulator__build_and_run (fallback — standalone)Known Crash Patterns
AsyncRenderer Color Crash (CRITICAL)
See reference/async-renderer-crash.md for the full investigation.
Pattern: EXC_BREAKPOINT on com.apple.SwiftUI.AsyncRenderer with _dispatch_assert_queue_fail
Cause: UIKit dynamic color providers (UIColor { traits in ... }) resolved off main queue
Fix: Use static Color(hex:) instead of Color(light:dark:) with UIColor provider
Swift 6 Concurrency Violations
Pattern: EXC_BREAKPOINT with _swift_task_checkIsolatedSwift
Cause: @MainActor-isolated code accessed from non-isolated context
Fix: Ensure all UI-bound state is @MainActor. Snapshot values before crossing isolation boundaries.
AVFoundation on Simulator
Pattern: Crash in AVAudioSession or AVAudioRecorder init
Cause: Deprecated APIs (e.g., requestRecordPermission callback-based), simulator audio routing issues, @Sendable Timer closures capturing @MainActor state
Fix: Use AVAudioApplication.requestRecordPermission() (iOS 17+ async). Use Task loops instead of Timer.scheduledTimer for metering. Guard recorder.record() return value.
SwiftData Thread Safety
Pattern: Crash on ModelContext access from background thread
Cause: ModelContext is not Sendable
Fix: Use @ModelActor for background contexts, @MainActor for UI contexts.
ForEach Identity Crash
Pattern: Index out of bounds during list mutation
Cause: Using .indices or unstable identity with ForEach
Fix: Use Identifiable conformance or stable id: keypath.
Xcode Debugging Tools (Manual)
Breakpoints
- Exception Breakpoint: Catches all runtime exceptions
- Symbolic Breakpoint:
_dispatch_assert_queue_fail— catches queue violations - Swift Error Breakpoint: Catches all thrown Swift errors
Runtime Sanitizers (Scheme → Diagnostics)
| Sanitizer | Detects | Cost |
| Thread Sanitizer | Data races | 2-5x |
| Address Sanitizer | Buffer overflows, use-after-free | 2-3x |
| Main Thread Checker | UIKit calls from background | Minimal |
Always enable Main Thread Checker.
Console Logging
import OSLog
let logger = Logger(subsystem: "com.example.app", category: "debugging")
logger.debug("State: \(String(describing: newValue))")CLI Debugging
# Launch with console output
xcrun simctl launch --console booted com.example.app
# Find crash logs
find ~/Library/Logs/DiagnosticReports -name "<AppName>*" -type f
# Symbolicate
atos -arch arm64 -o <AppName>.app/<AppName> -l 0x100000000 0x100012345Rules
- Always get the backtrace first — don't guess
- Check the crashing thread, not Thread 1
- Trust the first app frame in the stack
- Use
OSLog(notprint()) for debugging - XcodeBuildMCP owns the debug session — don't also run from Xcode
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.

