Skip to content
SwiftSkills

iOS code review and quality gates for AI-written Swift code

Don't let the agent mark its own homework. Lock tests before it implements, require build, the right Xcode test plan and lint rules to pass before it says "done", and run a separate review pass on the diff. Use one gate (locked tests or fail-the-commit checks), one rule linter and one PR review skill.

Last updated:

This page is about checking what a coding agent changed in a Swift/iOS project before it lands. Writing tests is in Swift Testing with AI agents; naming and style in Swift API design.

What Apple gives you to gate a change

  1. Test plans per stage. Apple's test plan article suggests one test plan "to run only the unit tests for a module while developing and debugging that module, and a second test plan to run all unit, integration, and UI tests before submitting your app to the App Store." In Xcode 16 and later, test plans can include tests by Swift Testing tags (for example a presubmission cadence).

  2. Sanitizers. Diagnosing memory, thread, and crash issues early lists Address Sanitizer, Thread Sanitizer, Main Thread Checker and Undefined Behavior Sanitizer. For the Test action, enable them in the active test plan's configuration. UBSan supports only C-based languages.

Rules for AGENTS.md

markdown

## Done means
- Never edit, skip or delete an existing test to make a build pass. Ask first.
- Before saying "done": build, run the module's test plan, run the linter; paste the results.
- Run the full test plan (with Thread Sanitizer) before any PR.
- Keep diffs small: one concern per change, no drive-by refactors.

Step 1: add a gate the agent cannot talk past

Use Swift Bylaws (brew install theblixguy/tap/bylaws) to write project rules in Swift (naming, API use, folder layout, allowed dependencies) and enforce them via Swift Testing, the CLI or a SwiftPM plugin. ios-quality-gate locks tests and blocks the agent from stopping until build, tests and mutation testing pass.

Step 2: wire the test plans

Have the agent run the module test plan after each change and the full plan before a PR. Ask it to paste the result summary, not describe it.

Step 3: review the diff in a separate pass

Run iOS Ultrareview (npx skills add ImtiazDipto01/ios-ultrareview --skill ios-ultrareview) in a fresh session, so the reviewer didn't write the code. Swift Code Reviewer is the alternative with a /review command.

Step 4: decide what blocks a merge

Treat edited or deleted tests, a failing test plan, sanitizer reports and linter violations as blockers. Review findings are input for a human, not an approval.

Tools compared (5)

ToolBest forAgents (README)Install (README)LicenseStarsLast push
Swift Bylaws (theblixguy)Project rules written in Swift, enforced via Swift Testing, CLI or SwiftPM pluginCoding agents in general (no host named); editor checks in Xcode, VS Code, Cursor, Zed, Neovim, Emacsbrew install theblixguy/tap/bylawsMIT525 Nov 2026
iOS Ultrareview (ImtiazDipto01)Evidence-based iOS PR review with blocker IDs and merge confidenceClaude Code, Cursor, Codexnpx skills add ImtiazDipto01/ios-ultrareview --skill ios-ultrareviewMIT029 Sep 2026 ⚠
ios-quality-gate (MatiasPC)Locked failing tests, hook-blocked test edits, mutation testing on changed linesClaude Codeclaude plugin marketplace add MatiasPC/ios-quality-gate then claude plugin install ios-quality-gate@matiaspc-localMIT024 Oct 2026 ⚠
Swift Code Reviewer (Viniciuscarvalho)Multi-layer Swift/SwiftUI review with project-standards checks and a /review commandClaude Code, Codex CLI, Gemini CLInpx skills add Viniciuscarvalho/swift-code-reviewer-skillMIT3913 May 2026 ⚠
Quality Gates (CapitalCantrip)Fail-the-commit gates for AI-built projects with a cc-swift skillClaude Codeuv tool install from the README, then qg-skillsMIT15 Nov 2026

⚠ = no push for more than 4 weeks.

Which one to pick:

  • Rules the build enforces: Swift Bylaws.

  • PR review pass: iOS Ultrareview.

  • Agent keeps editing tests: ios-quality-gate.

  • Commit-level gates across projects: Quality Gates.

A prompt that keeps the agent honest

Setting up the agent itself: Claude Code for iOS development, Codex for iOS development. UI tests: iOS UI testing with AI agents.

Review the current diff as if someone else wrote it. Do not edit files. List every changed, skipped or deleted test first. Then build, run the module's test plan and the linter, and paste the result lines. Report each finding with file and line, severity (blocker / should fix / consider) and the evidence. End with: merge-blocking yes or no.

FAQ

How do I stop an AI agent from editing tests to make them pass?
Lock the tests before the agent implements. ios-quality-gate (after the next catalog merge) has the agent write failing tests first, hashes and freezes them, blocks edits to test files with a hook, and won't let the agent finish until build, tests and mutation testing on changed lines pass.
Can an AI agent review a Swift pull request?
Yes, as a first pass. iOS Ultrareview walks an agent through an evidence-based iOS PR review with blocker IDs and a merge-confidence score, and Swift Code Reviewer adds a /review command for Claude Code and Gemini CLI. A human still approves the merge.
What should an agent run before it says a Swift change is done?
Build, the relevant test plan and your lint rules. Apple suggests a test plan for the module you are working on and a second one with all unit, integration and UI tests before submitting to the App Store; for the Test action, sanitizers are set in the active test plan's configuration.
Which Xcode checks catch bugs that AI-written code often hides?
Xcode's runtime sanitizers. Apple lists Address Sanitizer for memory corruption, Thread Sanitizer for race conditions, Main Thread Checker for main-thread-only APIs, and Undefined Behavior Sanitizer; UBSan supports only C-based languages, the others also support Swift.
Which code review tool should I install for iOS?
Start with Swift Bylaws if you want rules the build enforces, and iOS Ultrareview for PR reviews. Add ios-quality-gate after the next merge if your agent edits tests, or Quality Gates if you want fail-the-commit checks across projects. Pick one reviewer, not several.