iap-implementation

iap-implementation is an agent for Claude Code from CharlesWiltgen/Axiom. It costs 152 tokens per session (1,393 once invoked), scanned A, original, MIT.

An implementation agent for adding in-app purchases and subscriptions to Apple apps with StoreKit 2, Apple's purchase framework.

In plain words
What is it for?
Use it to implement consumables, non-consumables, or subscriptions, including a StoreKit configuration, purchase manager, transaction listener, and restore-purchases flow.
Why use it?
It organizes product setup, purchase handling, transaction verification, subscription support, restoration, and testing into a testing-first workflow.

Agent for Claude Code

Part of the axiom plugin — 16 commands, 42 agents shipped together

About the project

Axiom is a toolkit of instructions, agents, commands, and development tools that give coding assistants specialized guidance for Apple operating-system development. It covers Swift, SwiftUI, interface design, data, concurrency, performance, networking, accessibility, logging, crash analysis, simulator testing, and profiling for iOS, iPadOS, watchOS, and tvOS. The catalogue contains 42 agents, 16 commands, and one plugin from this toolkit.

CharlesWiltgen/Axiom · 1,146 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/charleswiltgen/axiom/iap-implementation
Clone the repo
git clone --depth 1 https://github.com/CharlesWiltgen/Axiom

Made for: Claude Code.

Or install axiom, the plugin that ships this one along with the rest of its 16 commands, 42 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for iap-implementation

README.md
[![agentmods](https://agentmods.dev/badge/agents/charleswiltgen/axiom/iap-implementation.svg)](https://agentmods.dev/agents/charleswiltgen/axiom/iap-implementation)
Your own site
<a href="https://agentmods.dev/agents/charleswiltgen/axiom/iap-implementation"><img src="https://agentmods.dev/badge/agents/charleswiltgen/axiom/iap-implementation.svg" alt="Measured on agentmods" height="20"></a>
Per session 152 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,393 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00152 $0.01393
Opus 5 $0.00076 $0.00696
Sonnet 5 $0.00030 $0.00279
Haiku 4.5 $0.00015 $0.00139

Measured 5d ago against content hash 73e0eda95dc7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

iap-implementation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude-plugin/plugins/axiom/agents/iap-implementation.md · 196 lines

How it starts

The opening of the file, as written. The whole thing — 196 lines — stays where its author put it; the contents beside it link to each section on GitHub.

In-App Purchase Implementation Agent

You are an expert at implementing production-ready in-app purchases using StoreKit 2.

Your Mission

Implement complete IAP following testing-first workflow:

  1. Create StoreKit configuration FIRST
  2. Implement centralized StoreManager
  3. Add transaction listener and verification
  4. Implement purchase flows
  5. Add subscription management (if applicable)
  6. Implement restore purchases
  7. Provide testing instructions

Phase 1: Gather Requirements

Ask the user:

  1. Product types: Consumables, non-consumables, subscriptions?
  2. Product IDs: Format com.company.app.product_name
  3. Server backend: For appAccountToken integration?
  4. Subscription details: Group ID, tiers, trial duration?

Phase 2: Create StoreKit Configuration (FIRST!)

CRITICAL: Create .storekit file BEFORE any Swift code!

  1. Create via Xcode: File → New → File → StoreKit Configuration File
  2. Add products with ID, name, price
  3. Configure scheme: Edit Scheme → Run → Options → StoreKit Configuration
  4. Test products load before proceeding

Phase 3: Implement StoreManager

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()
    }
}

Read the full file on GitHub · 196 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 196 lines · 152 tokens per session scan A 73e0eda95dc7

Subscribe to this mod's changes

iap-implementation is an agent published in the GitHub repository CharlesWiltgen/Axiom (1,146 stars, last pushed 6d ago), licensed MIT. It adds 152 tokens to every session and 1,393 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

monetization-expert

Mobil uygulama monetizasyon uzmani (Kerem Bozkurt). Tam paywall pipeline orchestration - strateji, fiyatlama, RevenueCat kodu, A/B test, churn azaltma, pazarlama. paywall-planner + growth + ai-engineer koordinasyonu.

vibeeval/vibecosystem · 63 tokens

paywall-planner

AI paywall strategy planner. Analyzes app category and features, recommends subscription model (hard/soft/freemium), pricing tiers, trial configuration, paywall placement, feature gating, and generates RevenueCat/Adapty-ready config.

vibeeval/vibecosystem · 54 tokens

product-manager

Bạn là Product Manager với 8+ năm kinh nghiệm phát triển sản phẩm số tại thị trường VN, bao gồm B2B SaaS, mobile app và e-commerce. Cầu nối giữa business, user và engineering. Mục tiêu: deliver features đúng value, đúng thời điểm, đo lường bằng product metrics thực tế — không phải feature count.

andyluu98/vn-opc-claude · 0 tokens

gem-mobile-tester

Mobile E2E testing: Detox, Maestro, iOS/Android simulators.

mubaidr/gem-team · 22 tokens

strategy-consultant

You are a management and startup consultant for Korean founders, small-business owners, and startup operators. You turn a goal (validate business idea X, size market Y, win grant program Z, assess this storefront location) into concrete, evidence-based deliverables: business plans, business model canvases, market…

modu-ai/moai-cowork · 106 tokens

flutter-integration-analyzer

Use this agent for Flutter-backend integration analysis: trace protocols, data models, event flows, or cross-end consistency. Also use for LOG-DRIVEN ROOT CAUSE ANALYSIS — when the user provides a server log and asks why a specific misbehavior occurred (e.g. "why did it stop responding"), this agent parses the log…

JayCRL/MobileVC · 429 tokens