Skip to main content
Glama

Review SwiftUI views and state

review_swiftui

Review SwiftUI code for accessibility and state-management defects: fixed sizes that break Dynamic Type, AnyView, deprecated modifiers, hard-coded spacing, and legacy state patterns. Use when building or reviewing screens.

Instructions

Check SwiftUI code for view and state defects: fixed font sizes and heights that break Dynamic Type, AnyView, deprecated .cornerRadius, literal spacing values instead of design tokens, materials applied over solid backgrounds, transient presentation state stored on models, legacy ObservableObject and @EnvironmentObject, and try!. Use when reviewing or building SwiftUI screens.

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.2/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It describes the operation as checking/analyzing code and lists exactly what categories of defects it looks for, strongly implying a non-mutating review. It could be more explicit about read-only behavior and traversal scope, but it is still substantive and transparent.

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

Conciseness5/5

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

The description is a single dense sentence with a clear lead clause and a compact list of specific defect categories, followed by a short, useful usage sentence. Every item earns its place and there is no filler or repetition.

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 one-parameter review tool with an output schema present, the description covers the target domain and the full set of checks without needing to explain return values. It does not explicitly discuss project-wide traversal or compare itself to sibling review tools, but the scope and usage are sufficiently clear for correct invocation.

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?

There is only one parameter, path, and the schema describes it fully as the absolute path to the Swift project root. The description adds no additional parameter semantics, but 100% schema description coverage means the schema already carries that burden, so the baseline 3 applies.

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?

Uses the explicit verb 'Check' with the resource 'SwiftUI code for view and state defects' and then enumerates concrete defect categories such as Dynamic Type issues, AnyView, deprecated .cornerRadius, and try!. This makes the tool's purpose unmistakable and differentiates it clearly from sibling review tools focused on concurrency, architecture, or memory.

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 ends with 'Use when reviewing or building SwiftUI screens', giving a clear context for when the tool applies. It does not explicitly name alternatives or state exclusions, but the SwiftUI-specific defect list makes the boundary versus sibling review tools reasonably obvious.

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