swift-security
Use when working with iOS/macOS Keychain Services (SecItem queries, kSecClass, OSStatus errors), biometric authentication (LAContext, Face ID, Touch ID)…
Skill by ducko-im
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/ducko-im-swift-security
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: backend, ml, security
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/swift-security
What's inside
- Skill name
swift-security- Description
- 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 and trust (SecTrust, SPKI, Secure Transport SSLContext), keychain sharing across apps/extensions, migrating secrets from UserDefaults or plists, or OWASP MASVS/MASTG mobile compliance on Apple platforms.
- License
- MIT
- Instructions
- 468 lines in SKILL.md · view on GitHub
Files (17)
- SKILL.md
- biometric-authentication.md · references/
- certificate-trust.md · references/
- common-anti-patterns.md · references/
- compliance-owasp-mapping.md · references/
- credential-storage-patterns.md · references/
- cryptokit-ed25519-x25519.md · references/
- cryptokit-public-key.md · references/
- cryptokit-symmetric.md · references/
- fail-closed-enum-resolution.md · references/
- keychain-access-control.md · references/
- keychain-fundamentals.md · references/
- keychain-item-classes.md · references/
- keychain-sharing.md · references/
- migration-legacy-stores.md · references/
- secure-enclave.md · references/
- testing-security-code.md · references/
SKILL.md (first lines)
# Keychain & Security Expert Skill
> **Philosophy:** Non-opinionated, correctness-focused. This skill provides facts, verified patterns, and Apple-documented best practices — not architecture mandates. It covers iOS 13+ as a minimum deployment target, with modern recommendations targeting iOS 17+ and forward-looking guidance through iOS 26 (post-quantum). Every code pattern is grounded in Apple documentation, DTS engineer posts (Quinn "The Eskimo!"), WWDC sessions, and OWASP MASTG — never from memory alone.
>
> **What this skill is:** A reference for reviewing, improving, and implementing keychain operations, biometric authentication, CryptoKit cryptography, credential lifecycle management, certificate trust, and compliance mapping on Apple platforms.
>
> **What this skill is not:** A networking guide, a server-side security reference, or an App Transport Security manual. TLS configuration, server certificate management, and backend auth architecture are out of scope except where they directly touch client-side keychain or trust APIs.
---
## Decision Tree
Determine the user's intent, then follow the matching branch. If ambiguous, ask.
```
┌─────────────────────┐
│ What is the task? │
└─────────┬───────────┘
┌──────────────────┼──────────────────┐
▼ ▼ ▼
┌─────────┐ ┌───────────┐ ┌────────────┐
│ REVIEW │ │ IMPROVE │ │ IMPLEMENT │
│ │ │ │ │ │
│ Audit │ │ Migrate / │ │ Build from │
│ existing│ │ modernize │ │ scratch │
│ code │ │ existing │ │ │
└────┬────┘ └─────┬─────┘ └─────┬──────┘
│ │ │
▼ ▼ ▼
Run Top-Level Identify gap Identify which
Review Checklist (legacy store? domain(s) apply,
(§ below) against wrong API? load reference
the code. missing auth?) file(s), follow
Flag each item Load migration + ✅ patterns.
as ✅ / ❌ / domain-specific Implement with
⚠️ N/A. reference files. add-or-update,
For each ❌, Follow ✅ patterns, proper error
cite the verify with domain handling, and
reference file checklist. correct access
and specific control from
section. the start.
```
---
### Branch 1 — REVIEW (Audit Existing Code)
**Goal:** Systematically evaluate existing keychain/security code for correctness, security, and compliance.
**Procedure:**
1. **Run the Top-Level Review Checklist** (below) against the code under review. Score each item ✅ / ❌ / ⚠️ N/A.
2. **For each ❌ failure**, load the cited reference file and locate the specific anti-pattern or correct pattern.
3. **Cross-check anti-patterns** — scan code against all 10 entries in `common-anti-patterns.md`. Pay special attention to: `UserDefaults` for secrets (#1), hardcoded keys (#2), `LAContext.evaluatePolicy()` as sole auth gate (#3), ignored `OSStatus` (#4).
4. **Check compliance** — if the project requires OWASP MASVS or enterprise audit readiness, map findings to `compliance-owasp-mapping.md` categories M1, M3, M9, M10.
5. **Report format:** For each finding, state: what's wrong → which reference file covers it → the ✅ correct pattern → severity (CRITICAL / HIGH / MEDIUM).
**Key reference files for review:**
- Start with: `common-anti-patterns.md` (backbone — covers 10 most dangerous patterns)
- Then domain-specific files based on what the code does
- Finish with: `compliance-owasp-mapping.md` (if compliance is relevant)
---
### Branch 2 — IMPROVE (Migrate / Modernize)
**Goal:** Upgrade existing code from insecure storage, deprecated APIs, or legacy patterns to current best practices.
**Procedure:**
1. **Identify the migration type:**
- Insecure storage → Keychain: Load `migration-legacy-stores.md` + `credential-storage-patterns.md`
- Legacy Security framework → CryptoKit: Load `cryptokit-symmetric.md` or `cryptokit-public-key.md` + `migration-legacy-stores.md`
- RSA → Elliptic Curve: Load `cryptokit-public-key.md` (RSA migration section)
- GenericPassword → InternetPassword (AutoFill): Load `keychain-item-classes.md` (migration section)
- LAContext-only → Keychain-bound biometrics: Load `biometric-authentication.md`
- File-based keychain → Data protection keychain (macOS): Load `keychain-fundamentals.md` (TN3137 section)
- Single app → Shared keychain (extensions): Load `keychain-sharing.md`
- Leaf pinning → SPKI/CA pinning: Load `certificate-trust.md`
2. **Follow the migration pattern** in the relevant reference file. Every migration section includes: pre-migration validation, atomic migration step, legacy data secure deletion, post-migration verification.
3. **Run the domain-specific checklist** from the reference file after migration completes.
4. **Verify no regressions** using guidance from `testing-security-code.md`.
---
### Branch 3 — IMPLEMENT (Build from Scratch)
**Goal:** Build new keychain/security functionality correctly from the start.
**Procedure:**
1. **Identify which domain(s) the task touches.** Use the Domain Selection Guide below.
2. **Load the relevant reference file(s).** Follow ✅ code patterns — never deviate from them for the core security logic.
3. **Apply Core Guidelines** (below) to every implementation.
4. **Run the domain-specific checklist** before considering the implementation complete.
5. **Add tests** following `testing-security-code.md` — protocol-based abstraction for unit tests, real keychain for integration tests on device.
**Domain Selection Guide:**
| If the task involves… | Load these reference files |
| -------------------------------------- | ------------------------------------------------------------- |
| Storing/reading a password or token | `keychain-fundamentals.md` + `credential-storage-patterns.md` |
| Choosing which `kSecClass` to use | `keychain-item-classes.md` |
| Setting when items are accessible | `keychain-access-control.md` |
| Face ID / Touch ID gating | `biometric-authentication.md` + `keychain-access-control.md` |
| Hardware-backed keys | `secure-enclave.md` |
| Encrypting / hashing data | `cryptokit-symmetric.md` |
| Signing / key exchange / HPKE | `cryptokit-public-key.md` |
| OAuth tokens / API keys / logout | `credential-storage-patterns.md` |
| Sharing between app and extension | `keychain-sharing.md` |
| TLS pinning / client certificates | `certificate-trust.md` |
| Replacing UserDefaults / plist secrets | `migration-legacy-stores.md` |
| Writing tests for security code | `testing-security-code.md` |
| Enterprise audit / OWASP compliance | `compliance-owasp-mapping.md` |From ducko-im/ducko, MIT.
More from ducko-im/ducko
- 0.629score
swift-testing
ducko-im
Expert guidance on Swift Testing for writing, reviewing, migrating, and debugging tests.
SkillAFreshness: A★ 7Claude Code +9 - 0.629score
accessibility
ducko-im
Apply platform accessibility best practices to SwiftUI, UIKit, and AppKit code.
SkillAFreshness: A★ 7Claude Code +9 - 0.629score
macos-ui-testing
ducko-im
Background-safe macOS app UI testing using Peekaboo CLI and osascript.
SkillAFreshness: A★ 7Claude Code +9 - 0.629score
swiftui
ducko-im
Write, review, or improve SwiftUI code across state management, view composition, performance, modern APIs, navigation, animation, accessibility, Liquid Glass…
SkillAFreshness: A★ 7Claude Code +9 - 0.629score
swiftui-performance-audit
ducko-im
Audit and improve SwiftUI runtime performance from code review and architecture.
SkillAFreshness: A★ 7Claude Code +9 - 0.629score
writing-for-interfaces
ducko-im
Use when someone asks to write, rewrite, review, or improve text that appears inside a product or interface.
SkillAFreshness: A★ 7Claude Code +9 - 0.629score
macos-spm-app-packaging
ducko-im
Scaffold, build, and package SwiftPM-based macOS apps without an Xcode project.
SkillAFreshness: A★ 7Claude Code +9 - 0.629score
release
ducko-im
Cut a Ducko release: update CHANGELOG.md on main, then push the X.Y.Z tag that triggers the release.yml CI workflow (build, sign, notarize, DMG, Sparkle…
SkillAFreshness: A★ 7Claude Code +9 - 0.629score
swift-concurrency
ducko-im
Expert guidance on Swift Concurrency correctness, modern API usage, and async/await pitfalls in Swift 6.2+.
SkillAFreshness: A★ 7Claude Code +9 - 0.629score
swift-language
ducko-im
Write, review, or improve Swift APIs and value-display formatting.
SkillAFreshness: A★ 7Claude Code +9 - 0.629score
swiftdata
ducko-im
Expert guidance for designing, writing, reviewing, and debugging SwiftData persistence in Swift and SwiftUI apps.
SkillAFreshness: A★ 7Claude Code +9 - 0.625score
lume-vm
ducko-im
Run Ducko UI work inside a disposable Lume macOS VM instead of on the host desktop: start and stop the VM, run commands in its logged-in GUI session…
SkillAFreshness: A★ 7Claude Code +9
Signals
- Stars
- 7
- Forks
- 0
- Open issues
- 4
- Last commit (this folder)
- Sep 15, 2026 (1 month ago)
- Last release
- Oct 23, 2026 (6 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/ducko-im/ducko
- Website
- ducko.im
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from ducko-im
- 0.629score
swiftdata
ducko-im
Expert guidance for designing, writing, reviewing, and debugging SwiftData persistence in Swift and SwiftUI apps.
SkillAFreshness: A★ 7Claude Code +9 - 0.629score
swift-language
ducko-im
Write, review, or improve Swift APIs and value-display formatting.
SkillAFreshness: A★ 7Claude Code +9 - 0.629score
swift-concurrency
ducko-im
Expert guidance on Swift Concurrency correctness, modern API usage, and async/await pitfalls in Swift 6.2+.
SkillAFreshness: A★ 7Claude Code +9 - 0.629score
macos-spm-app-packaging
ducko-im
Scaffold, build, and package SwiftPM-based macOS apps without an Xcode project.
SkillAFreshness: A★ 7Claude Code +9 - 0.629score
release
ducko-im
Cut a Ducko release: update CHANGELOG.md on main, then push the X.Y.Z tag that triggers the release.yml CI workflow (build, sign, notarize, DMG, Sparkle…
SkillAFreshness: A★ 7Claude Code +9 - 0.629score
swiftui
ducko-im
Write, review, or improve SwiftUI code across state management, view composition, performance, modern APIs, navigation, animation, accessibility, Liquid Glass…
SkillAFreshness: A★ 7Claude Code +9
Cite this page
swift-security skill. Agent Mart. https://agentmart.dev/skills/ducko-im-swift-security (last updated 2026-10-24)