swift-architecture-audit

swift-architecture-audit is a skill for Claude Code, Codex from jeremieb/swift-unit-test-instructions. It costs 88 tokens per session (1,366 once invoked), scanned A, original, MIT.

A review guide for examining the structure of an existing Swift, SwiftUI, or UIKit codebase. It checks MVVM organization, testability, concurrency, dependencies, and common design problems.

In plain words
What is it for?
Use it to review feature folders, Views, ViewModels, protocols, services, test targets, network and storage access, and concurrency patterns.
Why use it?
It helps explain why a project is difficult to change or test by finding logic in the wrong places and other structural issues. It also compares the project with a defined folder and naming structure.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents.

Good fit Use it to review feature folders, Views, ViewModels, protocols, services, test targets, network and storage access, and concurrency patterns.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jeremieb/swift-unit-test-instructions/swift-architecture-audit
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add jeremieb/swift-unit-test-instructions --skill swift-architecture-audit
Clone the repo
git clone --depth 1 https://github.com/jeremieb/swift-unit-test-instructions

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for swift-architecture-audit

README.md
[![agentmods](https://agentmods.dev/badge/skills/jeremieb/swift-unit-test-instructions/swift-architecture-audit/github.svg)](https://agentmods.dev/skills/jeremieb/swift-unit-test-instructions/swift-architecture-audit)
Your own site
<a href="https://agentmods.dev/skills/jeremieb/swift-unit-test-instructions/swift-architecture-audit"><img src="https://agentmods.dev/badge/skills/jeremieb/swift-unit-test-instructions/swift-architecture-audit/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for swift-architecture-audit

Your own site · 80×15
<a href="https://agentmods.dev/skills/jeremieb/swift-unit-test-instructions/swift-architecture-audit"><img src="https://agentmods.dev/badge/skills/jeremieb/swift-unit-test-instructions/swift-architecture-audit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 88 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,366 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00088 $0.01366
Opus 5 $0.00044 $0.00683
Sonnet 5 $0.00018 $0.00273
Haiku 4.5 $0.00009 $0.00137

Measured 11d ago against content hash 4900ea632540, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

swift-architecture-audit scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/swift-architecture-audit/SKILL.md · 147 lines

How it starts

The opening of the file, as written. The whole thing — 147 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Swift Architecture Audit

Instructions

Step 1: Explore the Project Structure

Identify the UI framework in use (SwiftUI, UIKit, or Mixed) by scanning the project — look for @main, UIApplicationDelegate, or UIHostingController. Then load the matching structure reference from ../swift-project-setup/references/ and use it as the baseline when identifying structural deviations.

Use subagents to parallelize exploration of large codebases.

Scan for:

  • All feature folders and their naming patterns
  • Number of UIViewController subclasses vs ViewModel types
  • Number of SwiftUI View types
  • Presence of protocol files in Core/ or Protocols/
  • Existing test targets and approximate test count

Step 2: MVVM Compliance Check

Read representative files from 3-5 key features. Look for:

Red flags (report each with file:line):

  • Business logic, network calls, or storage access directly inside SwiftUI View bodies
  • Business logic inside UIViewController subclasses
  • URLSession.shared or UserDefaults.standard called from Views or ViewControllers
  • Missing ViewModel for any screen with non-trivial state
  • @State or @StateObject holding data that belongs in a ViewModel or service

Green flags (note these):

  • ObservableObject or @Observable ViewModels with clear state
  • Services and repositories injected via initializer or @Environment
  • Thin View layer (only layout and presentation)
  • Coordinator / navigation layer separate from ViewModels

Step 3: Testability Assessment

For each audited type, check:

  • Are dependencies hardcoded (let service = NetworkService()) instead of injected?
  • Do networking/storage types hide behind protocols?
  • Are global singletons used without injection support?
  • Is there any existing test coverage? How much?
  • Are ViewModels testable in isolation (no UIKit/SwiftUI imports)?

Scoring:

  • High testability: Protocols + DI everywhere, existing tests
  • Medium testability: Some DI, some singletons, few tests
  • Low testability: No protocols, no DI, no tests — refactoring needed before testing is possible

Read the full file on GitHub · 147 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 147 lines · 88 tokens per session scan A 4900ea632540

Subscribe to this mod's changes

swift-architecture-audit is a skill published in the GitHub repository jeremieb/swift-unit-test-instructions (5 stars, last pushed 6mo ago), licensed MIT. It adds 88 tokens to every session and 1,366 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

code-reviewer

Code review practices including review checklists, refactoring patterns, PR best practices, and team conventions. Trigger for code review guidance, refactoring advice, or PR process design.

FutureJJ/claude-skills · 39 tokens

offensive-mobile

Mobile (Android + iOS) application penetration testing methodology. Covers static analysis (apktool/jadx for Android, class-dump/Hopper/IDA for iOS), dynamic instrumentation with Frida and Objection, SSL pinning bypass strategies, root/jailbreak detection bypass, deep-link / URL-scheme abuse, exported component…

SnailSploit/Claude-Red · 185 tokens

paywall-pricing-optimizer

Design effective paywalls, structure subscription tiers, and optimize pricing for mobile apps. Covers monetization model selection, paywall screen design, pricing psychology, A/B testing strategy, and RevenueCat/StoreKit/Google Billing integration. Use when the user wants to monetize an app, design a paywall, choose…

robertguss/claude-code-toolkit · 143 tokens

app-store-listing-optimizer

Optimize iOS App Store and Google Play Store listings for maximum discoverability and conversion. Perform competitive keyword research, craft keyword-optimized titles/subtitles/descriptions, design screenshot sequences, and generate A/B test variants. Use when the user has a built app and needs to write or improve…

robertguss/claude-code-toolkit · 137 tokens

app-creator

Orchestrate iOS/macOS app scaffolding and optional skill adoption for existing projects. Use when users want a guided wizard that can scaffold with XcodeGen and optionally install xcode-makefiles and simple-tasks.

robertguss/claude-code-toolkit · 49 tokens

xcode-makefiles

Install strict Xcode Makefile tooling for iOS/macOS projects, including build/run/test scripts with AGENTNAME-based per-agent isolation under build/. Use when a project needs reproducible local CLI builds without full app scaffolding.

robertguss/claude-code-toolkit · 52 tokens