apple-intelligence
Apple Intelligence skills for on-device AI features including Foundation Models, Visual Intelligence, App Intents, and intelligent assistants. Use when implementing AI-powered features.
referral-system
Generates referral/invite infrastructure with unique codes, deep link sharing, reward tracking, and fraud prevention. Use when user wants referral codes, invite friends flow, or viral growth mechanics.
Full skill instructions
Generate a production referral/invite system with unique code generation, deep link sharing, reward tracking, fraud prevention, and SwiftUI views for inviting friends and monitoring referral performance.
Use this skill when the user:
Search for existing referral/invite code:
Glob: **/*Referral*.swift, **/*Invite*.swift, **/*InviteCode*.swift
Grep: "referralCode" or "inviteCode" or "ReferralManager"
If existing referral system found:
Search for existing deep link handling:
Glob: **/*DeepLink*.swift, **/*UniversalLink*.swift
Grep: "onOpenURL" or "userActivity" or "NSUserActivity"
If deep link handling exists, integrate with it rather than generating a standalone handler.
Ask user via AskUserQuestion:
Reward type?
Code format?
A7K2M9) -- recommendedMYAPP-A7K2M9)john-A7K2)Sharing method?
Storage?
Read templates.md for production Swift code.
Generate these files:
ReferralCode.swift -- Model with unique code generation, expiration, usage trackingReferralManager.swift -- @Observable manager for code lifecycle and redemptionReferralReward.swift -- Reward configuration, conditions, and fulfillment trackingInviteView.swift -- SwiftUI invite screen with code display and sharingReferralDashboardView.swift -- Stats view for referral performanceReferralDeepLinkHandler.swift -- Deep link parsing and redemption triggeringCheck project structure:
Sources/ exists -> Sources/Referral/App/ exists -> App/Referral/Referral/After generation, provide:
Referral/
├── ReferralCode.swift # Code model with generation and validation
├── ReferralManager.swift # @Observable manager for code lifecycle
├── ReferralReward.swift # Reward config and fulfillment tracking
├── InviteView.swift # Invite screen with share actions
├── ReferralDashboardView.swift # Referral stats dashboard
└── ReferralDeepLinkHandler.swift # Deep link parsing and redemption
Add deep link handling in your App struct:
@main
struct MyApp: App {
@State private var referralManager = ReferralManager()
private let deepLinkHandler = ReferralDeepLinkHandler()
var body: some Scene {
WindowGroup {
ContentView()
.environment(referralManager)
.onOpenURL { url in
if let code = deepLinkHandler.extractCode(from: url) {
Task {
await referralManager.redeemCode(code)
}
}
}
}
}
}
Present the invite screen:
struct ProfileView: View {
@State private var showInvite = false
var body: some View {
Button("Invite Friends") { showInvite = true }
.sheet(isPresented: $showInvite) {
InviteView()
}
}
}
Show referral dashboard:
NavigationLink("My Referrals") {
ReferralDashboardView()
}
@Test
func generatedCodeIsUnique() async throws {
let manager = ReferralManager(store: InMemoryReferralStore())
let code1 = await manager.generateCode(for: "user-1")
let code2 = await manager.generateCode(for: "user-2")
#expect(code1.value != code2.value)
}
@Test
func redemptionGrantsReward() async throws {
let manager = ReferralManager(store: InMemoryReferralStore())
let code = await manager.generateCode(for: "referrer-1")
let result = await manager.redeemCode(code.value, redeemedBy: "invitee-1")
#expect(result == .success)
#expect(manager.rewards(for: "referrer-1").count == 1)
#expect(manager.rewards(for: "invitee-1").count == 1)
}
@Test
func selfReferralIsRejected() async throws {
let manager = ReferralManager(store: InMemoryReferralStore())
let code = await manager.generateCode(for: "user-1")
let result = await manager.redeemCode(code.value, redeemedBy: "user-1")
#expect(result == .fraudDetected(.selfReferral))
}
@Test
func expiredCodeIsRejected() async throws {
let manager = ReferralManager(store: InMemoryReferralStore())
let code = ReferralCode(
value: "EXPIRED1",
ownerID: "user-1",
expiresAt: Date.distantPast
)
let result = await manager.redeemCode(code.value, redeemedBy: "user-2")
#expect(result == .expired)
}
// Generate code for current user
let code = await referralManager.generateCode(for: currentUserID)
// Share via system share sheet
let shareURL = deepLinkHandler.buildShareURL(for: code)
let message = "Join me on MyApp! Use my code \(code.value) for a bonus."
let activityItems: [Any] = [message, shareURL]
// On app launch or deep link open
let result = await referralManager.redeemCode(codeString, redeemedBy: currentUserID)
switch result {
case .success:
showRewardAnimation()
case .alreadyRedeemed:
showAlert("You've already used a referral code.")
case .expired:
showAlert("This referral code has expired.")
case .fraudDetected(let reason):
logger.warning("Fraud detected: \(reason)")
case .invalid:
showAlert("Invalid referral code.")
}
// Check pending rewards
let pending = referralManager.pendingRewards(for: currentUserID)
for reward in pending {
await fulfillReward(reward)
await referralManager.markFulfilled(reward)
}
apple-app-site-association file on your server.generators/deep-linking -- Universal link and deep link infrastructuregenerators/share-card -- Visual share cards for social sharinggenerators/analytics-setup -- Track referral funnel eventsApple Intelligence skills for on-device AI features including Foundation Models, Visual Intelligence, App Intents, and intelligent assistants. Use when implementing AI-powered features.
Senior developer-level release review for macOS/iOS apps. Identifies security, privacy, UX, and distribution issues with actionable fixes. Use when preparing an app for release, want a critical review, or before App Store submission.
Security review and guidance for iOS, macOS, and watchOS apps. Covers secure storage, biometric authentication, network security, and platform-specific patterns. Use when implementing security features or reviewing code for vulnerabilities.
Code generator skills that produce production-ready Swift code for common app components. Use when user wants to add logging, analytics, onboarding, review prompts, networking, authentication, paywalls, settings, persistence, error monitoring, CI/CD pipelines, localization, push notifications, de...
Platform-agnostic skills including skill creation templates and best practices. Use when creating new skills or improving existing ones.
TDD and testing skills for iOS/macOS apps. Covers characterization tests, TDD workflows, test contracts, snapshot tests, and test infrastructure. Use for test-driven development, adding tests to existing code, or building test infrastructure.
Monetization strategy for iOS/macOS apps. Covers readiness assessment, pricing model selection, tier structuring, free trial strategy, and implementation guidance. Use when deciding what to charge, how to price, or planning monetization end-to-end.
Legal document generation and compliance guidance for indie Apple developers. Covers privacy policies, terms of service, EULAs, GDPR/CCPA/DPDP compliance, and Apple App Store legal requirements. Use when user needs legal documents or compliance guidance.
Growth skills for indie Apple developers — user acquisition, analytics interpretation, press/media outreach, community building, and indie business operations. Use when user asks about growing their app, understanding metrics, getting press coverage, or running an indie dev business.
Core ML, Create ML, Vision framework, Natural Language framework, on-device ML integration. Use when user wants image classification, text analysis, object detection, sound classification, model optimization, or custom model integration. Covers Core ML vs Foundation Models decision.
Brainstorm and rank iOS/macOS app ideas tailored to developer skills. Use when user says "what should I build", "give me app ideas", "I don't know what to build", "brainstorm app ideas", or "help me find an app idea".
Swift 6.2 InlineArray and Span types for zero-overhead memory access, fixed-size collections, and safe pointer alternatives. Use when optimizing performance-critical code paths.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience