/ai-swift:swift-verify [path] [--fix] [--no-test] [--destination=<dest>]from ai-swift
Runs the local verification gate for Swift projects: detects XcodeGen, Tuist, plain Xcode, or SwiftPM; regenerates project files; lints with SwiftFormat and SwiftLint; builds and tests on the cheapest valid destination.
Ships in ai-swift. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You run a Swift project's local quality gate, adapting the pipeline to how the project is built. This is the portable analog of a hand-written scripts/verify.sh: it discovers the build system and tools, runs them in the order that does not waste work, and reports each stage honestly.
This is the Swift-native specialization of a generic preflight; it does not duplicate ai-git's /git-preflight (in Codex, ai-git:git-preflight), which covers Node/Python/.NET/Go/Rust. For release-blocker auditing (entitlements, Xcode Cloud, build numbers) use /swift-preflight; for general bug-finding use /code-review.
The text typed after the command holds the arguments. In Claude Code it is inserted here: $ARGUMENTS. In other agents, read it from the user's message. It may be empty.
path - repo root (default cwd).--fix - allow swiftformat to rewrite in place (default is lint-only / non-destructive).--no-test - skip the build/test stage (format + lint only; good for doc-only changes).--destination=<dest> - override the xcodebuild destination (e.g. platform=iOS Simulator,name=iPhone 16).project.yml + command -v xcodegen.Project.swift + command -v tuist.*.xcodeproj / *.xcworkspace, no generator.Package.swift (library or executable).Tool availability: command -v swiftformat swiftlint xcodegen xcodebuild swift. If a required tool is missing, report it and the install hint (brew install swiftformat swiftlint xcodegen) and continue with the stages you can run - do not abort the whole gate for one missing optional tool.
Config presence: .swiftformat, .swiftlint.yml. If absent, run the tool with defaults but note that the project has no pinned config (so local and CI can diverge).
If XcodeGen: xcodegen generate (quiet). If Tuist: tuist generate.
Why first: newly added .swift files are not in the .xcodeproj until regen, and SourceKit diagnostics for them are stale. Regenerating makes xcodebuild authoritative. On a plain .xcodeproj or SwiftPM, skip this stage.
Caution: regeneration rewrites the pbxproj from project.yml. If the working tree has uncommitted pbxproj hand-edits, warn the user that regen will revert them (this is exactly the drift trap - see /swift-preflight Check 1). Do not regen over a dirty pbxproj without noting it.
swiftformat --lint . (reports, exits non-zero on diffs, writes nothing).--fix mode: swiftformat . (rewrites in place).Run format before lint so SwiftLint does not flag issues the formatter would have fixed. Note the known SwiftFormat↔SwiftLint modifier_order standoff (nonisolated(unsafe) private static): if both fire on the same line, that is the documented conflict, not a real defect - prefer moving the helper to file scope, or a scoped per-line disable pair.
swiftlint lint --strict --quiet. Strict = warnings fail the run, matching CI. Report each violation with file:line. Do not suggest // swiftlint:disable as a fix unless the rule genuinely cannot be satisfied (e.g. an override class func that cannot be static); even then require a one-line justification comment. Never suggest --no-verify or blanket disables.
Pick the cheapest valid destination:
swift build then swift test (no simulator needed).xcodebuild -scheme <scheme> -destination "platform=macOS,arch=arm64" test. macOS is cheapest (no simulator boot) and is the right default for pure-Swift logic (models, services, persistence, networking).--destination if given, else pick an available iOS simulator from xcrun simctl list devices available. If no iOS runtime is installed, report it and the non-interactive install path xcodebuild -downloadPlatform iOS rather than failing silently; fall back to building (not testing) if no destination is bootable.For multiplatform unit-test targets generated by XcodeGen, remember the macOS TEST_HOST override is required ($(BUILT_PRODUCTS_DIR)/App.app/Contents/MacOS/App); if xcodebuild test fails to launch the host on macOS, surface that as the likely cause.
Skip this phase entirely if --no-test.
Swift Verify — <repo> (XcodeGen · macOS destination)
xcodegen generate ok
swiftformat --lint 3 files would change (run with --fix to rewrite)
swiftlint --strict 2 violations
App/Services/AuthService.swift:42 force_unwrapping
App/Views/ReaderView.swift:88 modifier_order
xcodebuild test 52 passed, 0 failed
Result: FAIL (format + lint)
Next: /swift-verify --fix to auto-format, then fix the 2 lint violations.
Report the true outcome of every stage, including the exact failing command output (trim to the relevant lines). If a stage was skipped (missing tool, --no-test, no bootable destination), say so explicitly - never imply a skipped stage passed. Exit-code semantics: clean = all stages green; any failing stage = overall FAIL.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub charlesjones-dev/ai-agent-plugins --plugin ai-swift5 skills in this plugin
/swift-ci-scaffoldScaffold the repo side of Xcode Cloud for an XcodeGen or Tuist Swift project: generate ci_scripts/ci_post_clone.sh (regen plus guarded CI_BUILD_NUMBER stamping), propose a unit-test-only CI scheme, print the exact App Store Connect workflow checklist, and optionally install an opt-in .githooks/pre-push gate. Shows diffs and confirms before writing./swift-concurrency-reviewReview Swift 6 strict-concurrency and SwiftUI code for idiom and build-breaking issues: non-Sendable across actor boundaries, @MainActor witness vs nonisolated protocol requirements, Combine/ObservableObject usage, force-unwraps, #Predicate macro limits, the 6.3.x Binding IRGen crash, missing #if os() guards, and unsafe escape hatches. Reports file:line with the fix and the why./swift-diagnoseDiagnose a Swift / Xcode Cloud / TestFlight failure from a pasted red build log, an ITMS App Store rejection email, or a bare error code. Maps symptoms to root cause (ITMS-90242/90296/90683, errSec keychain codes, ad-hoc entitlement rejections, missing ci_scripts, signing errors) and prescribes the exact fix./swift-preflightAudit a Swift, iOS or macOS repo for Xcode Cloud and TestFlight release blockers before upload, from pbxproj drift and static build numbers to signing entitlements and flaky UI tests that gate a release. Reports PASS/WARN/FAIL with file:line and fixes.Other plugins' skills for the same job