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.
116 other projects use a version of this.
Adopted by
Most recently taken up by
- thistleknot/skillstheir own version, first seen Nov 8, 2026
- DevNewbie1826/skillstheir own version, first seen Nov 8, 2026
- MasihMoafi/skillstheir own version, first seen Nov 8, 2026
- ishandutta2007/Awesome-Claude-Skillstheir own version, first seen Nov 8, 2026
- idavidov13/agentic-playwrighttheir own version, first seen Nov 8, 2026
- profdorly/ultimate-dev-skillstheir own version, first seen Nov 8, 2026
Used with
Projects with it also use Problem-Solving Techniques, media-processing 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.
truongtv22SkillProblem-Solving Techniques
Apply systematic problem-solving techniques for complexity spirals (simplification cascades), innovation blocks (collision-zone thinking), recurring patterns (meta-pattern recognition), assumption constraints (inversion exercise), scale uncertainty (scale game), and dispatch when stuck. Techniques derived from Microsoft Amplifier project patterns adapted for immediate application.
Also in 4 projects that use this
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 6 projects that use this
JetBrainsSkillssr
Guide for using Structural Search and Replace in IntelliJ. Use when creating or modifying SSR inspections or search patterns.
Also in 3 projects that use this
mrgoonieSkillweb-frameworks
Build modern full-stack web applications with Next.js (App Router, Server Components, RSC, PPR, SSR, SSG, ISR), Turborepo (monorepo management, task pipelines, remote caching, parallel execution), and RemixIcon (3100+ SVG icons in outlined/filled styles). Use when creating React applications, implementing server-side rendering, setting up monorepos with multiple packages, optimizing build performance and caching strategies, adding icon libraries, managing shared dependencies, or working with TypeScript full-stack projects.
Also in 6 projects that use this
DevNewbie1826Skillremove-ai-slops
Remove AI-generated code slop from branch changes or an explicit file list while preserving behavior, including junk tests (prose pins, source greps, copied inventories, mock echoes), each proven by its class rule before a cut. Use when asked to remove slop, clean AI code, deslop, clean up generated code, strip slop, prune junk tests, or review generated-code cleanup. Start by locking behavior with regression tests, then use the category and workflow references.
Also in 3 projects that use this
DevNewbie1826Skillprogramming
MUST USE for work on Python, Rust, TypeScript, JavaScript, or Go source files and project manifests, and whenever a test or spec file is written, reshaped, reviewed, or deleted. Triggers: write or edit code; add, change, or delete a test; test authoring gate; junk tests; new project; Go HTTP service (gin lane); Bubble Tea TUI; CJK IME; Connect-Go RPC; sqlc or pgx; branded IDs; exhaustive matching; unsafe Rust; Miri; oversized file; refactoring; logging, log levels, structured logging, or observability; arena, allocator, bumpalo, const fn, const generics, compile-time programming, zero-allocation APIs, bitfields, repr, scope guards, errdefer-style cleanup, Zig-like patterns, zero-copy parsing, packed data, or FFI; Rust public API design or macros.
Also in 3 projects that use this
- +6 more from mrgoonie
Other versions116 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 116
- tursodatabase/turso★ 25ksame name
- JetBrains/intellij-community★ 21ksame name
- DetachHead/rebased★ 6.5ksame name
- mrgoonie/claudekit-skills★ 2.2ksame name
- JetBrains/MPS★ 1.7ksame name
- danieleteti/delphimvcframework★ 1.4ksame name
- glommer/pgmicro★ 1.2ksame name
- karrioapi/karrio★ 799same name
- rapidaai/voice-ai★ 755same name
- i-am-manware/Manware-s-AI-Learning-Toolkit★ 717same name
106 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 104 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 104 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.

