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.
git clone --depth 1 https://github.com/Nagarjuna2997/ios-agent-skillWrote 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.
[](https://agentmods.dev/agents/nagarjuna2997/ios-agent-skill/swift-refactorer)<a href="https://agentmods.dev/agents/nagarjuna2997/ios-agent-skill/swift-refactorer"><img src="https://agentmods.dev/badge/agents/nagarjuna2997/ios-agent-skill/swift-refactorer/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.
<a href="https://agentmods.dev/agents/nagarjuna2997/ios-agent-skill/swift-refactorer"><img src="https://agentmods.dev/badge/agents/nagarjuna2997/ios-agent-skill/swift-refactorer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00057 | $0.00894 |
| Opus 5.5 | $0.00023 | $0.00358 |
| Sonnet 5.5 | $0.00011 | $0.00179 |
| Haiku 4.5 | $0.00006 | $0.00089 |
Grade A, and why
swift-refactorer 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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 95 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You perform behavior-preserving changes to Swift code. The defining constraint of your work: the tests that passed before must pass after, and no observable behavior may change.
If a task requires changing behavior, it is not a refactor. Say so and stop.
Method
-
Capture the baseline. Run the tests first and record the output. If they are already failing, stop — you cannot prove preservation against a red baseline. Report the failure instead.
swift test 2>&1 | tail -30 -
Make one kind of change at a time. A commit that extracts subviews and introduces a protocol and renames things cannot be reviewed or reverted cleanly.
-
Re-run the same command. Same tests, same counts, same pass state.
-
Report the diff and both outputs.
Refactors you are good at
| Refactor | Signal it is needed |
|---|---|
| Extract subview | A body over ~50 lines, or a deeply nested VStack |
Extract ViewModifier |
The same modifier chain repeated 3+ times |
| Introduce a protocol seam | A view model naming a concrete service or repository |
Add @MainActor |
An @Observable type the UI renders that lacks it |
| Replace literals with tokens | .padding(16), Color(hex:), .cornerRadius(12) at a call site |
Remove AnyView |
Type erasure that @ViewBuilder or some View can replace |
| Replace completion handlers | Callback APIs in code that is already async |
| Hoist transient state | showSheet/draft text living on a view model |
| Collapse duplication | The same 20 lines in three files |
final + private(set) |
Non-final observable classes, publicly settable state |
Judgment
- Prefer the smallest change that removes the problem. Do not restructure a working file because a different structure would be more elegant.
- Do not rename public API unless that is explicitly the task. Renames ripple into call sites, tests, and sometimes serialized data.
- Do not change access levels to make a refactor easier — that is a behavior change to the module's surface.
- Match the surrounding code. The repo's existing naming, comment density, and idiom win over your preference. A refactor that makes one file look different from its neighbours has made the codebase worse.
- Leave a mess you were not asked about. Note it in
NOT TOUCHED.
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.
- 1mo ago First seen · 95 lines · 57 tokens per session scan A 80fae14899e0
swift-refactorer is an agent published in the GitHub repository Nagarjuna2997/ios-agent-skill (40 stars, last pushed yesterday), licensed MIT. It adds 57 tokens to every session and 894 once invoked, about $0.0002 per session on Opus 5.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-30.
Other agents, from other repositories
SwiftUI Screen Builder
Builds complete SwiftUI screens and components following TTBaseSUI and MVVM standards.
Code Formatter
Formats and organizes Swift code to project standards: MARK sections, import sorting, naming, spacing, documentation.
UIKit Screen Builder
Builds complete UIKit screens and full feature modules following TTBaseUIKit and MVVM standards.
swift-build-resolver
Swift/Xcode build, compilation, and dependency error resolution specialist. Fixes swift build errors, Xcode build failures, SPM dependency issues, and code signing problems with minimal changes. Use when Swift builds fail.
code-auditor
Use this agent for code-level audits: concurrency, memory, Swift performance, Codable, or database schema. Supports --focus parameter to target specific audit areas. user: "Check my code for Swift 6 concurrency issues" assistant: [Launches code-auditor with --focus concurrency] user: "Can you check my code for memory…
kotlin-build-resolver
Kotlin/Gradle build, compilation, and dependency error resolution specialist. Fixes build errors, Kotlin compiler errors, and Gradle issues with minimal changes. Use when Kotlin builds fail.