
Swift Security
Use when working with iOS/macOS Keychain Services (SecItem queries, kSecClass, OSStatus...
Install
npx skills add dpearson2699/swift-ios-skills --skill swift-security -g -a claude-code -y- Repository
- dpearson2699/swift-ios-skills1.3k
- Category
- Security
- Updated
- 3mo ago
- License
- MIT
- Context cost
- Mediumabout 3,000 tokens
- Runs scripts
- No, instructions only
What it does
Use when working with iOS/macOS Keychain Services (SecItem queries, kSecClass, OSStatus errors), biometric authentication (LAContext, Face ID, Touch ID), CryptoKit (AES-GCM, ChaChaPoly, ECDSA, ECDH, HPKE, ML-KEM), Secure Enclave, secure credential storage (OAuth tokens, API keys), certificate pinning (SecTrust, SPKI), keychain sharing across apps/extensions, migrating secrets from UserDefaults or plists, or OWASP MASVS/MASTG mobile compliance on Apple platforms.
Swift Security
Use this skill for client-side Apple platform security work: Keychain Services, access control, biometric-gated secrets, CryptoKit, Secure Enclave keys, credential storage, certificate trust, keychain sharing, legacy secret migration, security testing, and OWASP mobile compliance mapping.
Default to iOS 17+ and Swift concurrency examples when the deployment target is unknown. Keep iOS 13+ compatibility notes when the user asks for older targets. Treat iOS 26 CryptoKit post-quantum APIs as availability-gated.
Contents
- Workflow
- Reference Loading
- Security Invariants
- Sibling Boundaries
- Review Checklist
- Common Mistakes
- Output Rules
- References
Workflow
Classify the request before loading references.
- Review existing code: run the Review Checklist, then load common-anti-patterns.md plus the domain reference for each failing area. Report severity, evidence, and the corrected pattern.
- Improve or migrate code: identify the migration type, load the migration and target-domain references, preserve existing data, verify the new item, then remove legacy storage only after success.
- Implement new security code: load the minimum domain references, use the provided correct patterns, include OSStatus handling and tests, then run the relevant checklist.
Do not load every reference file by default. This skill is intentionally split for progressive disclosure; load only the files needed by the user's task.
Minimum Safe Keychain Write
Use separate add, identity, and update dictionaries; handle every OSStatus:

