account-deletion
Generates an Apple-compliant account deletion flow with multi-step confirmation UI, optional data export, configurable grace period, Keychain cleanup, and server-side deletion request. Use when user needs account deletion, right-to-delete, or Apple App Review compliance for account removal.
What this skill does
# Account Deletion Generator
Generate a production account deletion flow compliant with Apple's App Store requirement (effective June 30, 2022) that any app offering account creation must also offer account deletion from within the app. Includes multi-step confirmation UI, optional data export, configurable grace period, Keychain cleanup, and Sign in with Apple token revocation.
## When This Skill Activates
Use this skill when the user:
- Asks to "add account deletion" or "delete account"
- Wants to "remove account" or implement "account removal"
- Mentions "right to delete" or "user data deletion"
- Asks about "Apple account deletion requirement"
- Needs App Store compliance for account management
- Wants to implement GDPR/privacy right-to-erasure
## Pre-Generation Checks
### 1. Project Context Detection
- [ ] Check Swift version (requires Swift 5.9+)
- [ ] Check deployment target (iOS 16+ / macOS 13+)
- [ ] Check for @Observable support (iOS 17+ / macOS 14+)
- [ ] Identify source file locations
### 2. Existing Auth/Account Code
Search for existing account management:
```
Glob: **/*Auth*.swift, **/*Account*.swift, **/*User*.swift, **/*Profile*.swift
Grep: "ASAuthorizationAppleIDProvider" or "SignInWithApple" or "Keychain" or "deleteAccount"
```
If existing deletion flow found:
- Ask if user wants to replace or enhance it
- If enhancing, integrate with existing auth architecture
### 3. Keychain Usage Detection
```
Grep: "SecItemAdd" or "SecItemDelete" or "SecItemCopyMatching" or "KeychainWrapper" or "keychain"
```
If Keychain usage found, ensure cleanup covers all stored items.
### 4. CloudKit / Server Sync Detection
```
Grep: "CKContainer" or "CloudKit" or "CKRecord" or "NSPersistentCloudKitContainer"
Glob: **/*CloudKit*.swift, **/*Sync*.swift
```
If CloudKit or server sync found, include remote data cleanup steps.
## Configuration Questions
Ask user via AskUserQuestion:
1. **Deletion type?**
- Immediate — account deleted right away after confirmation
- Grace period — account scheduled for deletion, user can cancel
2. **Grace period duration?** (if grace period selected)
- 7 days
- 14 days — recommended
- 30 days
3. **Include data export before deletion?**
- Yes — generate DataExportService with JSON/ZIP archive and ShareLink
- No — skip data export
4. **Server-side API call needed?**
- Yes — generate server deletion request with configurable endpoint
- No — local-only deletion (Keychain, UserDefaults, SwiftData/CoreData, files)
## Generation Process
### Step 1: Read Templates
Read `templates.md` for production Swift code.
### Step 2: Create Core Files
Generate these files:
1. `AccountDeletionManager.swift` — @Observable orchestrator for the full deletion lifecycle
2. `DeletionConfirmationView.swift` — Multi-step confirmation UI with NavigationStack
3. `KeychainCleanup.swift` — Utility to remove all app Keychain items
### Step 3: Create Optional Files
Based on configuration:
- `DataExportService.swift` — If data export selected
- `DeletionGracePeriodView.swift` — If grace period selected
- `SignInWithAppleRevocation.swift` — If SIWA detected in project
### Step 4: Determine File Location
Check project structure:
- If `Sources/` exists -> `Sources/AccountDeletion/`
- If `App/` exists -> `App/AccountDeletion/`
- Otherwise -> `AccountDeletion/`
## Output Format
After generation, provide:
### Files Created
```
AccountDeletion/
├── AccountDeletionManager.swift # Orchestrator for deletion lifecycle
├── DeletionConfirmationView.swift # Multi-step confirmation UI
├── KeychainCleanup.swift # Keychain item cleanup
├── DataExportService.swift # Data export before deletion (optional)
├── DeletionGracePeriodView.swift # Grace period countdown UI (optional)
└── SignInWithAppleRevocation.swift # SIWA token revocation (optional)
```
### Integration Steps
**Add to Settings or Account screen:**
```swift
// In your Settings or Account view
struct AccountSettingsView: View {
@State private var showDeletionFlow = false
var body: some View {
Form {
// ... other settings ...
Section {
Button(role: .destructive) {
showDeletionFlow = true
} label: {
Label("Delete Account", systemImage: "person.crop.circle.badge.minus")
}
} footer: {
Text("Permanently removes your account and all associated data.")
}
}
.sheet(isPresented: $showDeletionFlow) {
DeletionConfirmationView()
}
}
}
```
**With grace period (check on app launch):**
```swift
@main
struct MyApp: App {
@State private var deletionManager = AccountDeletionManager()
var body: some Scene {
WindowGroup {
ContentView()
.environment(deletionManager)
.task {
await deletionManager.checkPendingDeletion()
}
}
}
}
```
**With data export:**
```swift
// User can export before deleting
DeletionConfirmationView()
.environment(DataExportService())
```
### Testing
```swift
@Test
func deletionFlowCompletesSuccessfully() async throws {
let manager = AccountDeletionManager(
serverClient: MockDeletionClient(),
keychainCleanup: MockKeychainCleanup()
)
try await manager.confirmWithReauthentication()
try await manager.executeDeletion()
#expect(manager.deletionState == .completed)
}
@Test
func gracePeriodCancellation() async throws {
let manager = AccountDeletionManager()
try await manager.scheduleDeletion(gracePeriodDays: 14)
#expect(manager.scheduledDeletionDate != nil)
try await manager.cancelScheduledDeletion()
#expect(manager.deletionState == .none)
#expect(manager.scheduledDeletionDate == nil)
}
@Test
func keychainItemsRemovedOnDeletion() async throws {
let cleanup = KeychainCleanup()
// Store a test item
let query: [String: Any] = [
kSecClass as String: kSecClassGenericPassword,
kSecAttrAccount as String: "test-account",
kSecValueData as String: Data("secret".utf8)
]
SecItemAdd(query as CFDictionary, nil)
// Delete all items
try cleanup.removeAllItems()
// Verify removal
let searchQuery: [String: Any] = [
kSecClass as String: kSecClassGenericPassword,
kSecAttrAccount as String: "test-account",
kSecReturnData as String: true
]
let status = SecItemCopyMatching(searchQuery as CFDictionary, nil)
#expect(status == errSecItemNotFound)
}
@Test
func dataExportGeneratesArchive() async throws {
let exportService = DataExportService()
let archiveURL = try await exportService.exportAllUserData()
#expect(FileManager.default.fileExists(atPath: archiveURL.path))
// Cleanup
try FileManager.default.removeItem(at: archiveURL)
}
```
## Common Patterns
### Initiate Deletion from Settings
Account deletion must be accessible from within the app — typically in Settings > Account. Apple will reject apps that only offer deletion via website or email.
### Confirm with Password or Biometric
Re-authenticate the user before deletion to prevent accidental or unauthorized account removal. Use LocalAuthentication for biometric or prompt for password.
### Export Data Before Deletion
Offer users the ability to download their data before the account is removed. This is a privacy best practice and builds user trust.
### Schedule Deletion with Grace Period
Instead of immediate deletion, schedule it for 7-30 days out. Allow users to cancel during this window. Many users delete accounts impulsively and appreciate the recovery option.
## Gotchas
- **Apple requires in-app deletion** — App Review will reject apps where account deletion is only available via website, email, or contacting support. The option must be accessible from within the app itself.
- **Keychain items persiRelated in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.