crash-risk-audit

Detects force unwraps, force casts, and crash-prone Swift patterns before App Store submission.

Updated Aug 14, 2026
One-click install
npx skills add https://github.com/tvh25082004/Badminton --skill crash-risk-audit-tvh25082004
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: crash-risk-audit
Source: https://github.com/tvh25082004/Badminton/tree/main/.claude/skills/apple-app-review/quality/crash-risk-audit
Command: npx skills add https://github.com/tvh25082004/Badminton --skill crash-risk-audit-tvh25082004

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Swift code containing force unwraps, force casts, force try, and reachable fatalError calls can crash during App Store review, causing rejection under Guideline 2.1. This Skill scans an iOS/macOS codebase for these crash-prone patterns and produces a prioritized findings list before submission. ## Core Features & Use Cases - Crash Pattern Detection: Greps Swift sources for force unwrap variants, as! force casts, try!, and fatalError calls, excluding test targets and SwiftUI previews. - Threading Violation Checks: Identifies UI updates such as UILabel.text assignments and reloadData calls made outside DispatchQueue.main blocks. - Prioritized Reporting: Outputs findings grouped by severity (CRITICAL, HIGH, MEDIUM, LOW) with file paths, line numbers, and concrete fix suggestions mapped to Guideline 2.1. - Use Case: Before submitting an app update, run the audit on your project root to catch a force unwrap in NetworkManager.swift that would crash on the reviewer's test data, then replace it with guard let handling. ## Quick Start Ask the assistant to run a crash risk audit on your iOS project root to find force unwraps, force casts, and other crash-prone Swift patterns before App Store submission.

Frequently Asked Questions about crash-risk-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find force unwraps in Swift code before App Store submission?▼

Run grep patterns matching force-unwrap variants such as `value!.property`, `value!,`, and `value!)` across all `.swift` files, excluding test targets and SwiftUI previews. Each occurrence in production code is a crash risk that should be replaced with `guard let`, `if let`, or a `??` fallback.

What Swift patterns cause App Store rejection under Guideline 2.1?▼

Force unwraps, force casts (`as!`), force try (`try!`), and reachable `fatalError` calls cause unrecoverable crashes that reviewers trigger with edge-case test data. UI updates on background threads also produce crashes flagged under Guideline 2.1.

Does this audit work on Objective-C or React Native projects?▼

The audit collects both `.swift` and `.m` source files and states compatibility with Swift, Objective-C, React Native, and Flutter projects. The core grep-based checks target Swift patterns, so Objective-C and cross-platform coverage is more limited.

Why are force unwraps flagged even if my app never crashes in testing?▼

App Store reviewers use test accounts and synthetic data that produce nil values where your own testing did not. A force unwrap on such data triggers an EXC_BAD_INSTRUCTION crash during review, leading to rejection under Guideline 2.1.

Can the audit modify my code to fix the crashes automatically?▼

No. The audit is read-only and makes no file edits or network calls. It reports each finding with a file path, line number, and a suggested fix such as replacing `value!` with `guard let` or wrapping UI updates in `DispatchQueue.main.async`.