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 skills add dagba/ios-mcp --skill swift-codable-jsongit clone --depth 1 https://github.com/dagba/ios-mcpWrote 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/skills/dagba/ios-mcp/swift-codable-json)<a href="https://agentmods.dev/skills/dagba/ios-mcp/swift-codable-json"><img src="https://agentmods.dev/badge/skills/dagba/ios-mcp/swift-codable-json/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/skills/dagba/ios-mcp/swift-codable-json"><img src="https://agentmods.dev/badge/skills/dagba/ios-mcp/swift-codable-json.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.00043 | $0.03531 |
| Opus 5.5 | $0.00017 | $0.01412 |
| Sonnet 5.5 | $0.00009 | $0.00706 |
| Haiku 4.5 | $0.00004 | $0.00353 |
Grade A, and why
swift-codable-json 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 3mo 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 — 523 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Swift Codable for JSON Parsing
Overview
Codable provides type-safe JSON parsing but strict typing means any mismatch crashes decoding. One date strategy per decoder, CodingKeys for every naming mismatch, custom decoders for nested structures.
Core principle: Design for API reality (not ideal JSON), fail gracefully with error handling, use optionals for unreliable data.
Basic Patterns
Pattern 1: Simple Mapping
// JSON: {"id": 123, "name": "Alice", "email": "[email protected]"}
struct User: Codable {
let id: Int
let name: String
let email: String
}
// Usage:
let data = jsonString.data(using: .utf8)!
let user = try JSONDecoder().decode(User.self, from: data)
Auto-synthesis works when:
- Property names match JSON keys exactly
- All types match (String → String, Int → Int)
- All required properties present in JSON
Pattern 2: CodingKeys for Name Mapping
Problem: API uses snake_case, Swift uses camelCase.
// JSON: {"user_id": 123, "first_name": "Alice", "created_at": "2026-01-15"}
struct User: Codable {
let userID: Int
let firstName: String
let createdAt: String
enum CodingKeys: String, CodingKey {
case userID = "user_id"
case firstName = "first_name"
case createdAt = "created_at"
}
}
Rule: Every property must appear in CodingKeys, even if name matches.
// ❌ WRONG: Compiler error (missing properties in CodingKeys)
enum CodingKeys: String, CodingKey {
case userID = "user_id" // Missing firstName and createdAt
}
// ✅ CORRECT: All properties listed
enum CodingKeys: String, CodingKey {
case userID = "user_id"
case firstName = "first_name"
case createdAt = "created_at"
}
Date Handling
Problem: Multiple Date Formats in Same Response
CRITICAL: JSONDecoder supports ONE date strategy at a time.
// JSON with mixed formats:
{
"created": "2026-01-15T10:30:00Z", // ISO8601
"published": "15/01/2026", // Custom format
"timestamp": 1705316400 // Unix timestamp
}
// ❌ WRONG: Can't set multiple strategies
let decoder = JSONDecoder()
decoder.dateDecodingStrategy = .iso8601 // Only applies to ONE field
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.
- 3mo ago First seen · 523 lines · 43 tokens per session scan A d6af7f2f94ec
swift-codable-json is a skill published in the GitHub repository dagba/ios-mcp (4 stars, last pushed 10mo ago), licensed MIT. It adds 43 tokens to every session and 3,531 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-31.
swift-codable-json compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| swift-codable-jsondagba/ios-mcp | Skill | 4 | 10mo ago | MIT | A | 43 | Claude Code, Codex |
| kotlin-specialistJeffallan/claude-skills | Skill | 13k | today | MIT | A | 86 | Claude Code |
| ink-custom-brush-builderandroid/skills | Skill | 11k | yesterday | Apache-2.0 | A | 159 | Claude Code |
| swiftui-devOrkas-AI/Orkas | Skill | 7.7k | today | MIT | A | 3 | Claude Code, Codex |
| axiom-concurrencyCharlesWiltgen/Axiom | Skill | 1.3k | today | MIT | A | 49 | Claude Code |
| boutique-best-practicesmergesort/Boutique | Skill | 1.1k | 22d ago | MIT | A | 56 | Claude Code |
| waxchristopherkarani/Wax | Skill | 815 | 15d ago | Apache-2.0 | A | 76 | Codex |