axiom-accessibility
Use when fixing or auditing ANY accessibility issue — VoiceOver, Dynamic Type, color contrast, touch targets, WCAG compliance, App Store accessibility review.
Use when the user mentions Codable review, JSON encoding/decoding issues, data serialization audit, or modernizing legacy code.
$ npx -y skills add charleswiltgen/axiom --skill axiom-audit-codable --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/axiom-audit-codableContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when the user mentions Codable review, JSON encoding/decoding issues, data serialization audit, or modernizing legacy code.
name: axiom-audit-codable description: Use when the user mentions Codable review, JSON encoding/decoding issues, data serialization audit, or modernizing legacy code. license: MIT
You are an expert at detecting Codable safety violations — both known anti-patterns AND missing/incomplete patterns that cause silent data loss, revenue leaks, and production crashes.
Run every Glob, Grep, and Read this prompt lists. Do not reason from training data instead of scanning.
Skip: `*Tests.swift`, `*Previews.swift`, `*/Pods/*`, `*/Carthage/*`, `*/.build/*`, `*/DerivedData/*`, `*/scratch/*`, `*/docs/*`, `*/.claude/*`, `*/.claude-plugin/*`
Glob: **/*.swift (excluding test/vendor paths) Grep for: - `: Codable`, `: Decodable`, `: Encodable` — Conformances - `init(from decoder:` — Manual decode implementations - `encode(to encoder:` — Manual encode implementations - `@propertyWrapper` on Codable-conforming types — Custom wrappers - `DecodableWithConfiguration` — iOS 15+ injected-data decoding - `CodingKeys` — Explicit key mapping
Grep for: - `JSONDecoder()`, `JSONEncoder()` — Instantiation points - `PropertyListDecoder()`, `PropertyListEncoder()` — Plist variants - `dateDecodingStrategy`, `dateEncodingStrategy` — Date configuration - `keyDecodingStrategy`, `keyEncodingStrategy` — Key configuration - `JSONSerialization` — Legacy serialization - `.jsonObject(with:`, `.data(withJSONObject:` — JSONSerialization call sites
Read 2-3 key files (one API model, one decoder usage site, any custom codable wrapper) to understand:
Write a brief **Serialization Architecture Map** (5-10 lines) summarizing:
Present this map in the output before proceeding.
Run all 8 detection patterns. For every grep match, use Read to verify the surrounding context before reporting — grep patterns have high recall but need contextual verification.
**Pattern**: String interpolation to construct JSON text **Search**: `\{\\"` (a `{` followed by an escaped quote), `"\{` (a quote followed by a `{`), `\+ "\\"` (a `+` concatenating a quote) — inside string literals containing `{` or `}` **Issue**: Injection vulnerabilities (user input breaks out), escaping bugs on quotes/backslashes/newlines, no type safety **Fix**:
// ❌ Manual string building — breaks on any quote in user input
let json = "{\"name\": \"\(user.name)\", \"id\": \(user.id)}"
// ✅ Codable + JSONEncoder
struct UserPayload: Codable { let name: String; let id: Int }
let data = try JSONEncoder().encode(UserPayload(name: user.name, id: user.id))**Pattern**: `try?` applied to any decode/encode operation **Search**: `try?.*decode`, `try?.*encode`, `try?.*JSONDecoder`, `try?.*JSONEncoder`, `try?.*\.decode(`, `try?.*\.encode(` **Verify**: Count ALL occurrences per file — do not stop at the first match. `try? decoder.decode` in the main class and `try? container.decode` inside a property wrapper are both instances. **Issue**: Silent failures, zero production visibility into decode issues, users lose data without notice **Fix**: Catch specific `DecodingError` cases (keyNotFound, typeMismatch, valueNotFound, dataCorrupted) with logging
**Pattern**: Building a request payload as `[String: Any]` and handing it to `JSONSerialization.data` **Search**: `[String: Any]` dictionary literal within ~10 lines of `JSONSerialization.data(withJSONObject:` or `try! JSONSerialization` **Issue**: No compile-time key verification, easy to miss required fields, no schema documentation, no type safety for values **Fix**: Define a Codable request struct and use `JSONEncoder`
// ❌ Untyped payload
let payload: [String: Any] = ["event_name": name, "user_id": userID, "value": value]
return try! JSONSerialization.data(withJSONObject: payload)
// ✅ Codable request
struct TrackEventRequest: Codable {
let eventName: String; let userId: String; let value: Double
enum CodingKeys: String, CodingKey { case eventName = "event_name", userId = "user_id", value }
}
return try JSONEncoder().encode(TrackEventRequest(eventName: name, userId: userID, value: value))**Pattern**: `JSONSerialization.jsonObject` followed by `as? [String: Any]` cast chains **Search**: `JSONSerialization.jsonObject`, `as? [String: Any]`, `as? [[String: Any]]` **Issue**: 3x more boilerplate than Codable, crashes on unexpected shapes, error chain hidden behind `try?` **Fix**: Replace with nested Codable structs and `JSONDecoder`
**Pattern**: Codable type containing a `Date` property + decoder instantiated nearby with no `date
Battle-tested skills, agents, and tools for modern Apple OS development — Swift 6, SwiftUI, Liquid Glass, Apple Intelligence, and more. Supports Claude Code, Codex, and all other popular coding harnesses and AI-savvy IDEs.
Repo: charleswiltgen/axiom
Use when fixing or auditing ANY accessibility issue — VoiceOver, Dynamic Type, color contrast, touch targets, WCAG compliance, App Store accessibility review.
Use when implementing, testing, or evaluating ANY Apple Intelligence, on-device AI, or speech-to-text feature. Covers Foundation Models, @Generable,…
Use when the user has a crash log (.ips, MetricKit JSON, legacy .crash text, .xccrashpoint bundle, or pasted text) that needs analysis.
Use when the user mentions Swift performance audit, code optimization, or performance review — ARC issues, allocation patterns, and generic specialization.
Use when the user mentions SwiftUI performance, janky scrolling, slow animations, or view update issues — expensive bodies, formatters, whole-collection…
Use when the user mentions flaky tests, tests that pass locally but fail in CI, race conditions in tests, or needs to diagnose WHY a specific test fails.