From grimoire
Implements data minimization, granular permissions, consent management, and user privacy controls for mobile apps to meet App Store, Play Store, GDPR, and CCPA requirements.
How this skill is triggered — by the user, by Claude, or both
Slash command
/grimoire:design-mobile-privacy-controlsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Implement data minimization, granular permission requests, user-facing privacy controls, and transparent data practices — meeting Apple App Store, Google Play, GDPR, and CCPA requirements while reducing data breach impact.
Implement data minimization, granular permission requests, user-facing privacy controls, and transparent data practices — meeting Apple App Store, Google Play, GDPR, and CCPA requirements while reducing data breach impact.
Adopted by: OWASP Mobile Top 10 2024 M6 (Inadequate Privacy Controls). Apple App Store Guidelines Section 5.1 and Google Play Data Safety policy both require privacy nutrition labels and consent for data collection. GDPR (EU, 2018) and CCPA (California, 2020) mandate data minimization, purpose limitation, and user data rights. Fines: GDPR fines have reached €1.2B (Meta, 2023); CCPA enforcement has resulted in millions in settlements. Impact: Mobile apps are primary vectors for unauthorized data collection. Research by AppCensus (2022) found 70% of top Android apps share data with advertising networks beyond what users expect. Without privacy controls: fines under GDPR (up to 4% of global annual revenue), App Store/Play Store removal, and reputational damage. Apple's App Tracking Transparency (ATT) framework (2021) caused a $10B revenue impact on Facebook due to users opting out of tracking. Why best: Collecting all possible data and deciding later what to use ("data lake" approach) creates regulatory liability and maximizes breach impact. Data minimization — collecting only what's necessary for the stated purpose — reduces both compliance burden and breach damage.
Sources: OWASP Mobile Top 10 2024 M6; Apple App Store Guidelines 5.1; Google Play Data Safety policy; GDPR Articles 5-7; CCPA Section 1798.100
Request permissions at the point of need, not at app launch:
// iOS — request location permission when the feature is triggered
func userTappedFindNearbyButton() {
// DON'T request location in AppDelegate.didFinishLaunching
// DO request when the user triggers the feature
locationManager.requestWhenInUseAuthorization()
}
// Provide usage description that explains WHY before the system dialog
// Info.plist:
// NSLocationWhenInUseUsageDescription: "We show nearby stores when you tap Find Nearby."
// Android — request permission in context
fun onFindNearbyClicked() {
if (checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) != PERMISSION_GRANTED) {
// Show rationale BEFORE requesting if previously denied
if (shouldShowRequestPermissionRationale(Manifest.permission.ACCESS_FINE_LOCATION)) {
showLocationRationaleDialog()
} else {
requestPermissions(arrayOf(Manifest.permission.ACCESS_FINE_LOCATION), REQUEST_CODE)
}
}
}
Implement data minimization — collect only what the feature requires:
// Location: use lowest precision required
locationManager.desiredAccuracy = kCLLocationAccuracyKilometer // not kCLLocationAccuracyBest
// unless GPS-level precision is functionally necessary
// For analytics: anonymize before sending
struct AnalyticsEvent {
let eventName: String
let timestamp: Date
// NOT: userId, deviceId, IP address
}
Implement user-facing privacy controls (required by GDPR Article 17, CCPA Section 1798.105):
// Privacy settings screen — expose all data controls
class PrivacySettingsView {
func showPrivacySettings() -> [PrivacyControl] {
return [
PrivacyControl(title: "Analytics",
description: "Helps us improve the app",
isEnabled: UserDefaults.analyticsEnabled,
onToggle: { enabled in
Analytics.setEnabled(enabled)
}),
PrivacyControl(title: "Delete My Data",
description: "Permanently deletes all your data",
action: { self.requestDataDeletion() }),
PrivacyControl(title: "Export My Data",
description: "Download everything we have about you",
action: { self.requestDataExport() }),
]
}
}
Complete Apple's App Privacy Nutrition Label accurately (App Store requirement):
Checklist for App Privacy disclosure:
□ List all data types collected (location, contacts, identifiers, usage data, etc.)
□ For each type: does it link to identity? Used for tracking?
□ List all third-party SDKs and their data collection (advertising SDKs are major source)
□ Remove analytics/advertising SDKs that collect data not needed for core functionality
Audit third-party SDK data collection:
# iOS — use Emerge Tools or Privacy Manifest audit
# Check PrivacyInfo.xcprivacy in each SDK
# Android — review DATA_SAFETY declarations in play console
# Use Mobile Security Framework (MobSF) to scan for tracking SDKs
mobsf analyze --apk app.apk
Remove or replace SDKs that collect data beyond what you disclose.
Minimize data in crash reports and analytics:
// Configure crash reporter to exclude PII
Crashlytics.crashlytics().setCrashlyticsCollectionEnabled(!isEUUser())
// Scrub PII from logs before sending
func sanitizeForAnalytics(_ event: [String: Any]) -> [String: Any] {
var sanitized = event
sanitized.removeValue(forKey: "email")
sanitized.removeValue(forKey: "userId") // use anonymous session ID instead
return sanitized
}
Implement data retention limits — delete data that's no longer needed:
func enforceDataRetentionPolicy() {
let retentionPeriod: TimeInterval = 90 * 24 * 3600 // 90 days
let cutoff = Date().addingTimeInterval(-retentionPeriod)
CoreDataStack.shared.deleteEvents(before: cutoff)
}
ACCESS_FINE_LOCATION (GPS-level) vs ACCESS_COARSE_LOCATION (city-level) — request the least precise permission that meets the feature requirement.npx claudepluginhub jeffreytse/grimoire --plugin grimoireGuides mobile consent management for iOS ATT framework, Android permissions, in-app flows, SDK propagation, IDFA/GAID handling, and GDPR/ePrivacy compliance.
Embeds privacy protections (data minimization, consent, encryption, retention) into app architecture, databases, and APIs from the start. References GDPR, CCPA, LGPD.
Generates privacy policies and terms of service tailored to project stack, features, and data handling. Audits data practices for GDPR, CCPA, app store compliance.