Skip to main content
Glama

Review SwiftUI and Swift performance

review_swift_performance

Identify SwiftUI runtime costs that cause dropped frames, slow launches, or stutter in list-heavy screens. Scans the render path for expensive allocations, non-lazy stacks, index-based ForEach, and blocking I/O before shipping.

Instructions

Check for runtime cost that shows up as dropped frames: DateFormatter and JSONDecoder allocated inside body, collections sorted or filtered on every render, ForEach over indices instead of stable identity, non-lazy stacks inside a ScrollView, AsyncImage with no frame, blocking file or network I/O on the render path, and GeometryReader wrapping an entire body. Use when scrolling stutters, launch is slow, or before shipping a list-heavy screen.

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

A3.9/5.0
Behavior3/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 lists the specific checks it performs, which gives insight into its scope (e.g., it checks for certain performance anti-patterns). However, it does not explicitly state that this is a read-only static analysis, whether it modifies files, or any limitations (e.g., it only catches these patterns, not all performance issues). This ambiguity leaves some risk of the agent misjudging side effects.

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 front-loaded with the core purpose ('check for runtime cost that shows up as dropped frames') and then lists specific checks in a comma-separated enumeration. This is efficient and well-structured. It is slightly long due to the detailed list, but each item is distinct and adds value, so it earns its length.

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?

The tool has an output schema (though not shown in detail), so the description correctly omits return-value specifics. It covers the purpose, the specific checks, and the appropriate usage context. A minor gap is the absence of a note that this is a static analysis tool that does not build or modify the project, but this is a relatively small omission given the clear scope.

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 single parameter 'path' is fully described in the schema with 'Absolute path to the Swift project root (the folder containing Package.swift or the .xcodeproj).' Schema description coverage is 100%, so the schema already provides complete parameter semantics. The description adds no additional parameter-level information, which is acceptable per the baseline of 3 for high coverage.

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 for runtime cost') and a clear resource ('SwiftUI and Swift performance'). It enumerates concrete anti-patterns (DateFormatter in body, non-lazy stacks, etc.), which makes its scope precise. This clearly distinguishes it from sibling review tools like review_swift_architecture or review_swift_concurrency, which target different concerns.

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 usage triggers: 'Use when scrolling stutters, launch is slow, or before shipping a list-heavy screen.' This gives clear context for when to invoke the tool. It doesn't explicitly name alternatives or state when not to use it, but the triggers are specific enough to guide an agent.

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