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.
npx agentmods add commands/okminlee/everything-claude-code-ios/swift-refactorgit clone --depth 1 https://github.com/OkminLee/everything-claude-code-iosWrote 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/commands/okminlee/everything-claude-code-ios/swift-refactor)<a href="https://agentmods.dev/commands/okminlee/everything-claude-code-ios/swift-refactor"><img src="https://agentmods.dev/badge/commands/okminlee/everything-claude-code-ios/swift-refactor.svg" alt="Measured on agentmods" 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 | $0.00031 | $0.01827 |
| Opus 5 | $0.00015 | $0.00914 |
| Sonnet 5 | $0.00006 | $0.00365 |
| Haiku 4.5 | $0.00003 | $0.00183 |
Grade A, and why
swift-refactor 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 3d 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 — 307 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Swift Refactor Clean
Safely identify and remove dead code with test verification for iOS projects.
This command invokes the swift-refactor-cleaner agent.
What This Command Does
- Analyze Dead Code - Run Periphery to find unused Swift code
- Generate Report - Categorize findings by severity
- Propose Safe Deletions - Start with low-risk items
- Verify with Tests - Run tests before and after each change
- Rollback on Failure - Revert if tests fail
Process
-
Run dead code analysis tools:
- Periphery: Find unused code, protocols, functions
- SPM:
swift package diagnose-dependencies - Xcode: Build with
-Wunusedwarnings
-
Generate report in
.reports/dead-code-analysis.md -
Categorize findings by severity:
- SAFE: Unused private methods, test utilities
- CAUTION: Unused public APIs, ViewModels
- DANGER: Protocol extensions, @objc code, App entry points
-
Propose safe deletions only
-
Before each deletion:
- Run full test suite
- Verify tests pass
- Apply change
- Re-run tests
- Rollback if tests fail
-
Show summary of cleaned items
Running Periphery
Installation
# Homebrew
brew install peripheryapp/periphery/periphery
# Or build from source
git clone https://github.com/peripheryapp/periphery
cd periphery && make install
Configuration
Create .periphery.yml in project root:
# .periphery.yml
project: MyApp.xcodeproj
schemes:
- MyApp
targets:
- MyApp
- MyAppTests
# Exclude patterns
exclude:
- "*.generated.swift"
- "**/Preview Content/**"
- "**/*+Preview.swift"
# Retain patterns (false positives)
retain_public: false
retain_objc_accessible: true
retain_unused_protocol_func_params: true
# Output
format: json
quiet: false
Running Analysis
# Full analysis
periphery scan --project MyApp.xcodeproj --schemes MyApp --targets MyApp
# With JSON output for parsing
periphery scan --format json > dead-code-report.json
# SPM project
periphery scan --setup
# Quick scan (faster, less accurate)
periphery scan --skip-build
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.
- 3d ago First seen · 307 lines · 31 tokens per session scan A bb26fffb2357
swift-refactor is a command published in the GitHub repository OkminLee/everything-claude-code-ios (58 stars, last pushed 5mo ago), licensed MIT. It adds 31 tokens to every session and 1,827 once invoked, about $0.0002 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-30.
Other commands, from other repositories
extract
Extract a composable from amethyst to shared code.
ask
Ask a question about iOS/Swift development - routes to the right Axiom skill or agent.
resolve-deps
Diagnose and resolve Swift Package Manager dependency conflicts (launches spm-conflict-resolver agent).
initialize-ios
Manual override: initialize ast-index for iOS/Swift/ObjC project.
kotlin-review
Comprehensive Kotlin code review for idiomatic patterns, null safety, coroutine safety, and security. Invokes the kotlin-reviewer agent.
swift-build
Validate that the Swift project builds successfully. Run this after any code change before considering work done.