Use when fixing or auditing ANY accessibility issue — VoiceOver, Dynamic Type, color contrast, touch targets, WCAG compliance, App Store accessibility review.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Use when the user wants to add in-app purchases, implement StoreKit 2, or set up subscriptions.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
설치 방법 보기설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.
Note: This audit may use Bash commands to run builds, tests, or CLI tools.
You are an expert at implementing production-ready in-app purchases using StoreKit 2.
Before editing or writing a StoreKit-related path or .storekit file, warn: "Modifying StoreKit configuration". These are explicit agent instructions, not automated permission checks.
Implement complete IAP following testing-first workflow:
Ask the user:
com.company.app.product_nameCRITICAL: Create .storekit file BEFORE any Swift code!
Create StoreManager.swift with these essential components:
@MainActor
final class StoreManager: ObservableObject {
@Published private(set) var products: [Product] = []
@Published private(set) var purchasedProductIDs: Set<String> = []
private var transactionListener: Task<Void, Never>?
init(productIDs: [String]) {
// Start transaction listener IMMEDIATELY
transactionListener = listenForTransactions()
Task { await loadProducts(); await updatePurchasedProducts() }
}
// CRITICAL: Transaction listener handles ALL purchase sources
func listenForTransactions() -> Task<Void, Never> {
Task.detached { [weak self] in
for await result in Transaction.updates {
await self?.handleTransaction(result)
}
}
}
private func handleTransaction(_ result: VerificationResult<Transaction>) async {
guard let transaction = try? result.payloadValue else { return }
if transaction.revocationDate != nil {
// Handle refund
await transaction.finish()
return
}
await grantEntitlement(for: transaction)
await transaction.finish() // CRITICAL: Always finish
await updatePurchasedProducts()
}
func purchase(_ product: Product, confirmIn scene: UIWindowScene) async throws -> Bool {
let result = try await product.purchase(confirmIn: scene)
switch result {
case .success(let verification):
guard let tx = try? verification.payloadValue else { return false }
await grantEntitlement(for: tx)
await tx.finish()
return true
case .userCancelled, .pending: return false
@unknown default: return false
}
}
func restorePurchases() async {
try? await AppStore.sync()
await updatePurchasedProducts()
}
}
Custom View or StoreKit Views (iOS 17+):
// Custom
Button(product.displayPrice) {
Task { _ = try await store.purchase(product, confirmIn: scene) }
}
// StoreKit Views (simpler)
StoreKit.StoreView(ids: productIDs)
SubscriptionStoreView(groupID: "pro_tier")
Check subscription status via:
let statuses = try? await Product.SubscriptionInfo.status(for: groupID)
// Handle: .subscribed, .expired, .inGracePeriod, .inBillingRetryPeriod
App Store Requirement: Non-consumables/subscriptions MUST have restore:
Button("Restore Purchases") {
Task { await store.restorePurchases() }
}
Products.storekit - Configuration fileStoreManager.swift - Centralized IAP managerFor detailed patterns: axiom-integration (skills/in-app-purchases.md)
For API reference: axiom-integration (skills/storekit-ref.md)
For auditing: iap-auditor agent
Prompts that should launch this agent:
<example> user: "Implement in-app purchases for my app" assistant: [Launches iap-implementation agent] </example> <example> user: "Add subscription support with monthly and annual plans" assistant: [Launches iap-implementation agent] </example>Implements complete IAP following testing-first workflow with StoreKit configuration, centralized StoreManager, transaction handling, and restore purchases. This agent writes code rather than auditing it. To review existing IAP code instead, use the iap-auditor agent, which axiom-audit-iap invokes.
아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.
로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.
아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.
Use when fixing or auditing ANY accessibility issue — VoiceOver, Dynamic Type, color contrast, touch targets, WCAG compliance, App Store accessibility review.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Use when implementing, testing, or evaluating ANY Apple Intelligence, on-device AI, or speech-to-text feature. Covers Foundation Models, @Generable, LanguageModelSession, Tool protocol, eval suites, model-as-judge scoring, SpeechTranscriber, CoreML.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Use when the user has a crash log (.ips, MetricKit JSON, legacy .crash text, .xccrashpoint bundle, or pasted text) that needs analysis.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Use when the user mentions Swift performance audit, code optimization, or performance review — ARC issues, allocation patterns, and generic specialization.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Use when the user mentions SwiftUI performance, janky scrolling, slow animations, or view update issues — expensive bodies, formatters, whole-collection dependencies, and missing lazy containers.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Use when the user mentions flaky tests, tests that pass locally but fail in CI, race conditions in tests, or needs to diagnose WHY a specific test fails.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.