Best for
- 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), Secur…
dpearson2699/swift-ios-skills/skills/swift-security/SKILL.md
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.
Decision brief
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 complianc…
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/dpearson2699/swift-ios-skills --skill "skills/swift-security"Inspect the Agent Skill "swift-security" from https://github.com/dpearson2699/swift-ios-skills/blob/90c9573272531337962fbb3505036d61ed23389a/skills/swift-security/SKILL.md at commit 90c9573272531337962fbb3505036d61ed23389a. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
Classify the request before loading references.
Use this checklist for code reviews and migration plans. Mark each item pass, fail, or not applicable; for each failure, cite the reference file and severity.
Use separate add, identity, and update dictionaries; handle every OSStatus:
Review the “Reference Loading” section in the pinned source before continuing.
Use directive language only for these security invariants and the matching anti-patterns in common-anti-patterns.md. For architecture choices outside this list, use advisory language.
Permission review
The documentation asks the agent to read local files, directories, or repositories.
Do not load every reference file by default. This skill is intentionally splitEvidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 78/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 933 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
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.
Classify the request before loading references.
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.
Use separate add, identity, and update dictionaries; handle every OSStatus:
func saveSecret(_ data: Data, account: String) throws {
let identity: [CFString: Any] = [
kSecClass: kSecClassGenericPassword,
kSecAttrService: "com.example.app",
kSecAttrAccount: account,
]
var add = identity
add[kSecValueData] = data
add[kSecAttrAccessible] = kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly
switch SecItemAdd(add as CFDictionary, nil) {
case errSecSuccess:
return
case errSecDuplicateItem:
let status = SecItemUpdate(
identity as CFDictionary,
[kSecValueData: data] as CFDictionary
)
guard status == errSecSuccess else { throw KeychainError(status: status) }
case let status:
throw KeychainError(status: status)
}
}
Load keychain-fundamentals.md for read, delete, access-control, locked-device, and test patterns.
| If the task involves | Load |
|---|---|
| General keychain CRUD or OSStatus handling | keychain-fundamentals.md |
Choosing kSecClass or item identity | keychain-item-classes.md |
Accessibility classes or SecAccessControl | keychain-access-control.md |
| Face ID, Touch ID, or biometric-gated secrets | biometric-authentication.md |
| Secure Enclave keys | secure-enclave.md |
| Hashing, HMAC, AES-GCM, ChaChaPoly, HKDF, PBKDF2 | cryptokit-symmetric.md |
| Signing, ECDH, HPKE, ML-KEM, ML-DSA | cryptokit-public-key.md |
| OAuth tokens, API keys, logout, refresh rotation | credential-storage-patterns.md |
| App/extension keychain sharing | keychain-sharing.md |
| Certificate trust, SPKI pinning, mTLS | certificate-trust.md |
| UserDefaults/plist/NSCoding migration | migration-legacy-stores.md |
| Unit, integration, simulator, device, or CI tests | testing-security-code.md |
| OWASP MASVS/MASTG or enterprise audit mapping | compliance-owasp-mapping.md |
| Full security review | common-anti-patterns.md, then each touched domain reference |
Use directive language only for these security invariants and the matching anti-patterns in common-anti-patterns.md. For architecture choices outside this list, use advisory language.
UserDefaults, Info.plist, .xcconfig, source code, logs, files, or
NSCoding archives. Use Keychain or fetch secrets at runtime.OSStatus. Every SecItemAdd, SecItemCopyMatching,
SecItemUpdate, and SecItemDelete path must handle success and expected
failures such as errSecDuplicateItem, errSecItemNotFound, and
errSecInteractionNotAllowed.LAContext.evaluatePolicy() as the only gate for a secret. Bind
protected secrets to keychain items with SecAccessControl, then let
keychain access trigger LocalAuthentication.kSecAttrAccessible or kSecAttrAccessControl explicitly when
adding keychain items.SecItem* work off the main actor. Use an actor or serial queue for
keychain access.kSecUseDataProtectionKeychain: true unless deliberately working with
legacy file-based keychain items.SharedSecret bytes as a symmetric key. Derive with HKDF
or X9.63 derivation.Insecure.MD5 or Insecure.SHA1 for security purposes.This skill owns client-side storage, cryptographic primitives, hardware-backed keys, and trust evaluation. Route adjacent work deliberately:
authentication for Sign in with Apple, passkeys, OAuth UI flows,
ASAuthorizationController, credential state, and account sign-in UX.cryptokit for primitive CryptoKit API syntax and examples when storage,
key lifecycle, protocol/trust design, Secure Enclave policy, certificate
trust, misuse review, or compliance is not part of the task.device-integrity for DeviceCheck and App Attest attestation/assertion
flows.ios-networking for URLSession, request pipelines, ATS configuration,
retries, caching, reachability, and transport architecture.app-store-review for privacy manifests, ATT, App Review guideline
compliance, and submission readiness.This skill may mention those areas only to identify a security handoff.
Use this checklist for code reviews and migration plans. Mark each item pass, fail, or not applicable; for each failure, cite the reference file and severity.
UserDefaults, plists, source, logs, files, or
archives.SecItem* call checks OSStatus and handles common recoverable errors.SecAccessControl, not a
standalone Bool from LAContext.evaluatePolicy().kSecClass matches the item type and primary-key attributes.dataRepresentation, and designs for device-bound keys.SecTrust APIs, validates hostname/policy, and
uses SPKI or CA pinning when pinning is required.errSecItemNotFound handling.kSecAttrAccessibleWhenUnlocked implicitly by omitting the attribute.kSecAttrAccessibleAlways or
kSecAttrAccessibleAlwaysThisDeviceOnly, both deprecated.kSecAttrAccessible and kSecAttrAccessControl on the same add query.OSStatus handling and explicit accessibility in
examples.## Reference Files and
list the loaded references with a one-line purpose.kSecClass selection, primary keys, certificates, identities.SecAccessControl, background access, data protection.LAContext, enrollment-change handling.NSPinnedDomains, client certificates.Alternatives
event4u-app/agent-config
Use when the user says "review the design", "check the UI", or wants a comprehensive UI/UX review. Uses a 7-phase methodology covering interaction, responsiveness, accessibility, and more.
K-Dense-AI/scientific-agent-skills
Distributed computing for larger-than-RAM pandas/NumPy workflows. Use when you need to scale existing pandas/NumPy code beyond memory or across clusters. Best for parallel file processing, distributed ML, integration with existing pandas code. For out-of-core analytics on single machine use vaex; for in-memory speed use polars.
K-Dense-AI/scientific-agent-skills
Medicinal chemistry filters for compound triage. Apply drug-likeness rules (Lipinski, Veber, CNS), structural alert catalogs (PAINS, NIBR, ChEMBL), complexity metrics, and the medchem query language for library filtering.
K-Dense-AI/scientific-agent-skills
Use NeuroKit2 to build or audit reproducible research workflows for physiological time-series preprocessing, event/interval analysis, multimodal alignment, variability, and complexity. Trigger when code imports neurokit2 or needs its current APIs, schemas, and method-aware validation—not for diagnosis or device validation.