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 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 — 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.
- 1mo 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 9mo 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.
Other skills, from other repositories
kotlin-specialist
Provides idiomatic Kotlin implementation patterns including coroutine concurrency, Flow stream handling, multiplatform architecture, Compose UI construction, Ktor server setup, and type-safe DSL design. Use when building Kotlin applications requiring coroutines, multiplatform development, or Android with Compose.…
swiftui-dev
Use this skill for SwiftUI development, architecture, structure, performance, and Apple native app profiling. It combines.
axiom-concurrency
Use when writing ANY async code, actors, or threads in an Apple-platform app, or seeing ANY concurrency error. Covers Swift 6 concurrency, @MainActor, Sendable, data races, async/await patterns.
mobiai-kmp
Use when working on a Kotlin Multiplatform project — shared code, expect/actual declarations, platform-specific implementations, building and testing.
wax
Swift client guidance for Wax's public Memory, PhotoMemory, and VideoMemory APIs. Use only when writing or changing Swift app code that imports Wax. Do not use at session start. Do not use for MCP remember/recall/stats — those follow the live MCP server instructions. Do not use for waxmcp install or doctor (that is…
re-swift
A guide to examining compiled Swift programs, including their symbols, protocol data, closures, and links to Objective-C code. It covers Swift binaries on macOS and Linux with tools such as swift-demangle.