Audits iOS/macOS Swift codebases for bugs, dead code, duplication, concurrency issues, deprecated APIs, security, performance, and SwiftUI quality. Produces a single CODE_AUDIT.md report with file:line findings.
Ships in iOS Code Audit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
CODE_AUDIT.md at the repo root.path/to/file.swift:LINE (or a line range). "Throughout the codebase" is never acceptable for a Critical or High item.@MainActor annotation triggers seven warnings, that's one finding listing the seven sites, not seven findings.Dead/ (or any explicitly-archived directory) is excluded. Check CLAUDE.md / project README for any "do not edit" directories before launching agents.Quick measurements to brief the agents:
find . -name "*.swift" -not -path "./.git/*" -not -path "./Dead/*" -not -path "*/Pods/*" -not -path "*/.build/*" | xargs wc -l 2>/dev/null | tail -1
find . -name "*.swift" -not -path "./.git/*" -not -path "./Dead/*" 2>/dev/null | wc -l
find . -name "*.metal" 2>/dev/null | wc -l
Also identify the hot-spot files (largest LOC, central state):
find . -name "*.swift" -not -path "./.git/*" -not -path "./Dead/*" -exec wc -l {} \; | sort -rn | head -10
Read CLAUDE.md if present — it usually flags central state files (e.g., AppState.swift, CaptureState.swift), the rendering pipeline, and any intentionally-excluded directories.
Run a build and extract every warning. This becomes the canonical input for the concurrency / deprecation portions of the audit — you should never have to guess whether concurrency warnings exist.
Preferred (Xcode MCP, if connected):
mcp__xcode__XcodeListNavigatorIssues(tabIdentifier, severity: "warning")
This returns a structured list with path, line, message, severity. Deduplicate (multi-target compilation produces duplicates) and bucket by root cause.
Fallback (xcodebuild from CLI):
xcodebuild -project <Project>.xcodeproj -scheme "<Dev scheme>" -configuration Debug build 2>&1 \
| grep -E "warning:" | sort -u
If the build is incremental (returned in <2s), it likely skipped most files. Touch a Swift file under each target or run clean build to get a complete warning set.
One message, three tool calls. Each agent gets a focused brief from references/agent-prompts.md:
CLAUDE.md.Each brief enforces the per-finding template (see below). Do not let agents return summaries — insist on specific file:line findings.
If the project has SwiftUI views, invoke the swiftui-expert-skill separately after the agents return, scoped to Views/ (or wherever the SwiftUI surfaces live) plus shared UI helpers. Ask specifically for:
@State / @Bindable / @Observable misuseEquatable on hot leaf viewsYou may need to read a few view files yourself to confirm patterns the skill identifies.
Before writing the report, open the cited lines for every Critical-flagged finding and confirm:
This step has caught hallucinated severity in prior runs. Demote or drop items that don't pan out. Never propagate a Critical you haven't personally verified.
CODE_AUDIT.mdUse the skeleton in references/report-template.md.
Mandatory: the rendered report must include section numbers in every heading. This is not cosmetic — it is the report's primary interface. Users file issues like "fix §5.4" and "is §3.1 done?", and they cannot do that if headings are unnumbered. Generating an unnumbered report is a defect, not a stylistic choice. Reports without numbers will be rejected.
The numbering rules:
## 1. through ## 12. — exactly as listed below, in this order, even if a section has no findings (in which case write "No findings." under the heading rather than omitting the section).### N.M <short title> where N is the parent section number and M increments from 1. Example: ### 5.1 Force-unwrap on Bundle.main.url, ### 5.2 Missing .limited Photos auth handling. Never emit a finding as ### <short title> without the N.M prefix._REMOVED: <reason>_ as the body — do not renumber the surviving findings, or every external reference to "§5.4" breaks.1., 2., … referencing the underlying numbered finding (e.g., "[Critical] Force-unwrap on Bundle.main.url — §5.1 — path:line").- **§5.1** — open \path`, lines 42-47.. Do not leave <N.M>` placeholders from the template — fill them in.Top-level sections, in order:
prints, fix unused-let warnings, add accessibility labels).Per-finding template (note the leading N.M):
### N.M <short title>
- **Location:** `path/to/file.swift:LINE-LINE`
- **What:** <observed problem in one sentence>
- **Why:** <impact / why it matters>
- **Action:** <recommended fix; no code, reference patterns>
- **Severity:** Critical | High | Medium | Low
Total length is comprehensive but scannable — aim for 50-100 findings. Group similar occurrences under one heading if a category has many instances (list the top 5-10 specific examples plus a count of the rest).
## 1. through ## 12. and every finding is a numbered subsection ### N.M <title>. Skim the rendered report — if any heading is missing its number, fix it before delivering. Reports without numbers will be rejected as defective.<N.M> placeholders survived from the template.Always write to CODE_AUDIT.md at the repo root (the user's project working directory). Overwrite if it already exists — this skill produces a snapshot, not an append log. If the user wants history they can git mv previous versions before invoking.
swiftui-expert-skill and its trace tooling separately.references/agent-prompts.md — The three Explore-agent briefs (copy-paste-ready, fill in the project context).references/report-template.md — Full skeleton for CODE_AUDIT.md.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/ios-code-audit:ios-code-auditfrom iOS Code Audit
ios-code-audit@art-of-technology is listed by art-of-technology/claude-mobile-skills — review the source before installing
npx claudepluginhub art-of-technology/claude-mobile-skills --plugin ios-code-auditOther plugins' skills for the same job