kmshdev/claude-swift-toolkit/code-analyzer

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Review Apple app code read-only for architecture, code quality, security, test coverage, and performance.

Install

npx vskill@latest install kmshdev/claude-swift-toolkit/code-analyzer

SKILL.md

Project Context

  • Recent changes: !git diff --name-only HEAD~3 2>/dev/null || echo "no git history"
  • Swift version: !swift --version 2>&1 | head -1 || echo "swift not found"

Code Analyzer (Read-Only)

Structured Swift/macOS code analysis protocol. Read-only — no file modifications.

Lifecycle Position

Phase 5 (Review). Load before swiftui-view-refactor for architectural overview. For deep line-by-line analysis, use audit-context-building.

Xcode MCP Orientation

When Xcode is available through this plugin's bundled bridge, prefer the MCP tools over shelling out to Xcode directly:

  1. Use XcodeListWindows to identify the active workspace tab.
  2. Use XcodeGlob, XcodeGrep, and XcodeRead to map the codebase you are

reviewing.

  1. Use XcodeRefreshCodeIssuesInFile when compiler diagnostics are relevant to

the review findings.

Analysis Protocol

Step 1 — Map the Entry Point
  1. Find the @main App struct or entry point
  2. Identify window scenes (WindowGroup, Settings, MenuBarExtra)
  3. Trace the root navigation structure (NavigationSplitView, TabView)
Step 2 — Trace the Module Graph
  1. List all Swift source files grouped by directory/feature
  2. Identify dependencies between modules (imports, protocol conformances)
  3. Map state ownership: which types own @Observable models, which receive them
  4. Identify services/repositories and their injection pattern
Step 3 — Identify Architecture Pattern

Classify the codebase:

  • MV (Model-View): Views consume models directly via @State, @Environment, @Query
  • MVVM: Separate ViewModel classes mediate between Model and View
  • TCA: Reducers, Store, Actions, State
  • Hybrid: Mix of patterns across features

Note consistency — are all features using the same pattern?

Review Checklist

1. Code Organization — PASS / WARN / FAIL
CheckWhat to Look For
File structureFeatures grouped by domain, not by type (Views/, Models/, etc.)
File sizeSwift files under 300 lines; views under 100 lines
NamingTypes are nouns, methods are verbs, booleans read as questions
Access controlprivate by default, internal where needed, public only for API surface
ExtensionsUsed to group protocol conformances and // MARK: sections
2. State Management — PASS / WARN / FAIL
CheckWhat to Look For
@Observable vs ObservableObjectNew code uses @Observable; legacy ObservableObject flagged
@State visibilityAll @State and @StateObject are private
OwnershipViews don't create models they should receive via injection
@MainActorObservable classes and view models are @MainActor
Binding direction@Binding only where child modifies parent state
Nested observablesNo nested ObservableObject (pass directly or use @Observable)
3. Error Handling — PASS / WARN / FAIL
CheckWhat to Look For
try without catchUnhandled throws that could crash
Force unwrap (!)Every ! must have justification comment or precondition
Result vs throwsConsistent error propagation strategy
User-facing errorsErrors surfaced to UI with actionable messages
Network errorsRetry logic, timeout handling, offline state
4. Performance — PASS / WARN / FAIL
CheckWhat to Look For
View body complexityNo object creation, heavy computation, or side effects in body
Lazy containersLazyVStack/LazyHStack for lists with >20 items
ForEach identityStable id (never .indices for dynamic content)
GeometryReaderGuarded with > 0 and .isFinite; prefer containerRelativeFrame()
Image loadingAsyncImage or downsampled thumbnails, not raw UIImage(data:)
Glass effectsMultiple glass views wrapped in GlassEffectContainer
5. Concurrency — PASS / WARN / FAIL
CheckWhat to Look For
@MainActorUI-bound classes and properties are main actor isolated
SendableTypes crossing isolation boundaries conform to Sendable
.task modifierAsync work uses .task {} (auto-cancels on disappear)
Actor isolationMutable shared state protected by actors
Data racesNo unprotected mutable state accessed from multiple contexts
6. Security — PASS / WARN / FAIL
CheckWhat to Look For
Hardcoded secretsNo API keys, tokens, or passwords in source
Keychain usageSensitive data stored in Keychain, not UserDefaults
Sandbox entitlementsMinimal entitlements; no unnecessary capabilities
Input validationUser input validated before use
URL handlingExternal URLs validated before opening
7. Test Coverage — PASS / WARN / FAIL
CheckWhat to Look For
Test file existenceEvery feature has corresponding test file
Model testsBusiness logic and data transformations tested
Edge casesEmpty states, nil values, boundary conditions covered
Async testsasync test methods with proper expectations
SwiftData testsIn-memory ModelContainer for persistence tests

Output Format

For each section, provide:

### [Section Name] — [PASS/WARN/FAIL]
**Summary:** One-line assessment.
**Findings:**
- [file_path:line] Description of issue
- [file_path:line] Description of issue
**Recommendation:** What to fix and in what order.

Cross-References

  • If the apple-design-system plugin is installed, use its swiftui-ui-patterns

review checklist for SwiftUI-specific review

  • For view structure refactoring, load swiftui-view-refactor
  • For deep line-by-line analysis, load audit-context-building

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
1
7-day trend score
0

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/kmshdev/claude-swift-toolkit/code-analyzer/badge)](https://verified-skill.com/skills/kmshdev/claude-swift-toolkit/code-analyzer)

Something wrong with this skill or its page? Tell us.