swift-codable — Claude Code skill: what it does, how to install
This skill guides an agent through Swift Codable models for JSON and property lists. Use it for API payloads, nested data, key mapping, and date handling.
npx skills add dpearson2699/swift-ios-skills --skill swift-codable -a claude-codeWhat swift-codable does
The skill covers Swift Codable work around JSONDecoder and JSONEncoder. It helps an agent shape API response models, map external names with CodingKeys, and write custom init(from:) or encode(to:) logic when compiler synthesis is insufficient. The material also addresses nested containers, flattened structures, mixed-type arrays, and strategies for dates, Data, and keys.
It connects these models with URLSession, SwiftData, and UserDefaults, then checks failures through DecodingError, codingPath, and the raw payload. The suggested workflow tests valid, missing, null, malformed, acronym-key, and date fixtures before checking round trips where both directions matter.
The skill targets Swift 6.3 and iOS 26+. Projects on another version pairing need their APIs checked against these examples.
What it helps with
- decode API payloads into Swift models
- map external JSON names to Swift properties
- flatten nested response objects
- handle date and Data decoding rules
- trace Codable failures through codingPath
Example prompts for the agent
- Create Swift Codable models for this API response and explain the decoder setup.
- Map
user_nameandimage_urlto Swift property names with CodingKeys. - Decode the nested payload and turn its Unix timestamp into
Date.
How to install swift-codable
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swift-codable -a claude-code2Manually: put the files in place
~/.claude/skills/swift-codable/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/swift-codable/
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swift-codable -a codex2Manually: put the files in place
.agents/skills/swift-codable/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swift-codable -a cursor2Manually: put the files in place
.cursor/skills/swift-codable/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install dpearson2699/swift-ios-skills swift-codable2Manually: put the files in place
.github/skills/swift-codable/SKILL.md1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swift-codable -a gemini-cli2Platform CLI
gemini skills install https://github.com/dpearson2699/swift-ios-skills --path skills/swift-codableManually: put the files in place
.devin/skills/swift-codable/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swift-codable -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about swift-codable
How do I install swift-codable in Claude Code?
Run npx skills add dpearson2699/swift-ios-skills --skill swift-codable -a claude-code, then check ~/.claude/skills/swift-codable/SKILL.md.
What does swift-codable do?
It guides an agent through Codable models for JSON and property lists, including custom key mapping, nested data, date strategies, and encoder or decoder setup.
Which Swift and iOS versions does swift-codable target?
The material targets Swift 6.3 and iOS 26+.