Skip to main content
Glama

Review iOS architecture boundaries

review_swift_architecture

Find Swift architecture and testability defects: live deps, singletons in view models, UI imports in domain, nested NavigationStacks. Use for MVVM/Clean Architecture or previewing without network.

Instructions

Check a Swift project for architecture and testability defects: dependencies defaulting to live implementations, the presentation layer naming concrete data-layer types (URLSession, APIClient, ModelContext), singletons resolved inside view models, the domain layer importing UI frameworks, nested NavigationStacks, and deprecated NavigationView. Use when reviewing MVVM or Clean Architecture code, or when a screen cannot be previewed without a network.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to the Swift project root (the folder containing Package.swift or the .xcodeproj).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
scoreYes0-100 defect density. 100 = no findings. penalty = 10*blockers + 3*serious + 1*minor; capacity = files*10. Comparable across runs on ONE project, not between projects.
countsYes
issuesYesEvery finding, most severe first.
summaryYesOne-line plain-language result.
suggestionsYesPrioritized next actions, deduplicated by rule — not a restatement of every issue's fix.
files_checkedYesSwift files actually scanned.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.7.0

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden and does well by listing six specific defect patterns the tool detects. However, it does not explicitly state whether the operation is read-only, whether a build is required, or how results are returned; the existing output schema partially covers the result behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with no filler, but the first sentence is a dense, long enumeration of defects. The colon-delimited list makes it scannable and the usage guidance is front-loaded at the end, so it remains efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with one parameter and an output schema, the description covers what it checks, when to use it, and the meaning of the project path. It could add explicit sibling differentiation or exclusions, but an agent has enough to select and invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The sole parameter 'path' has 100% schema description coverage, so the schema already documents the meaning. The description's phrase 'Swift project root' largely mirrors the schema and adds no format, example, or edge-case guidance beyond it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('Check') and resource ('a Swift project') and enumerates concrete defect categories, such as live default dependencies, presentation-layer naming of concrete data-layer types, singletons in view models, and UI framework imports. This level of specificity clearly differentiates it from sibling review tools like review_swiftui or review_swift_concurrency.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly provides two trigger conditions: use when reviewing MVVM or Clean Architecture code, or when a screen cannot be previewed without a network. It does not explicitly mention when not to use it or name alternative tools, which keeps it from a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.