{
  "skill_name": "passkit-wallet",
  "evals": [
    {
      "id": 1,
      "name": "apple-pay-checkout-setup",
      "prompt": "We sell bicycle parts and want Apple Pay in our SwiftUI app. Right now we draw our own black button with the Apple logo, compute prices as Double, present PKPaymentAuthorizationController from a local variable, and dismiss it inside didAuthorizePayment. A teammate also suggests using StoreKit instead. Walk us through a correct setup.",
      "expected_output": "Lists the capability, Merchant ID, Payment Processing Certificate and entitlement; checks canMakePayments and canMakePayments(usingNetworks:capabilities:); uses PayWithApplePayButton or PKPaymentButton; uses NSDecimalNumber for items and shipping with the business-name total last; retains the controller and clears it after dismissing in didFinish; sends the token to the server and replies with PKPaymentAuthorizationResult; keeps physical goods on Apple Pay rather than StoreKit.",
      "files": [],
      "assertions": [
        "Covers the Apple Pay capability, a Merchant ID, the Payment Processing Certificate and the merchant entitlement",
        "Performs both canMakePayments checks before showing the button",
        "Replaces the custom button with PayWithApplePayButton or PKPaymentButton",
        "Uses NSDecimalNumber for summary items and shipping, with a final total labelled with the business name",
        "Stores the controller (its delegate is weak), dismisses only in paymentAuthorizationControllerDidFinish and then releases it",
        "Sends payment.token to the server and completes with a PKPaymentAuthorizationResult carrying errors on failure",
        "Explains that physical goods use Apple Pay and StoreKit is for digital goods"
      ]
    },
    {
      "id": 2,
      "name": "wallet-pass-add-and-update",
      "prompt": "Our concert app downloads a .pkpass from the server and shows a custom 'Save to Wallet' button. We gate it with PKPassLibrary.isPassLibraryAvailable(), parse with try? PKPass(data:), and when a ticket changes we create a new serial number. Sometimes replacePass seems to do nothing. What should we fix?",
      "expected_output": "Uses AddPassToWalletButton or PKAddPassButton/PKAddPassesViewController, gates adding on canAddPasses and library work on isPassLibraryAvailable, surfaces invalid-data and invalid-signature errors from signed data, notes passes() is limited by entitlements, keeps the same pass type and serial number for updates, and checks the Bool from replacePass(with:).",
      "files": [],
      "assertions": [
        "Replaces the custom button with AddPassToWalletButton, PKAddPassButton or PKAddPassesViewController",
        "Uses canAddPasses() to decide whether adding is possible and keeps isPassLibraryAvailable() for library operations",
        "Requires signed pass data and reports invalid-data and invalid-signature errors instead of a bare try?",
        "Notes that passes() only returns passes the app's entitlements allow",
        "Keeps passTypeIdentifier and serialNumber unchanged when updating a pass",
        "Checks the Bool returned by replacePass(with:) and handles false"
      ]
    },
    {
      "id": 3,
      "name": "advanced-payment-requests",
      "prompt": "For our furniture marketplace we need: a monthly protection plan, promo codes at checkout, separate payouts to each workshop in a basket, and pay-on-delivery for custom pieces. Can one PKPaymentRequest do all of that? We are also wondering whether FinanceKit or StoreKit should be involved.",
      "expected_output": "Explains that only one advanced type fits per request; shows a PKRecurringPaymentRequest with a recurring item, interval, billing agreement and management URL; enables coupon codes with the delegate reply including shipping methods; uses PKPaymentTokenContext entries with merchant ids, name, domain and decimal amounts; builds a PKDeferredPaymentRequest with deferred date, free cancellation details and management URL; keeps FinanceKit and StoreKit out.",
      "files": [],
      "assertions": [
        "Builds a PKRecurringPaymentRequest with a PKRecurringPaymentSummaryItem, interval, billing agreement and management URL",
        "States the one-advanced-type-per-request rule and splits the checkout into several requests",
        "Sets supportsCouponCode and implements didChangeCouponCode",
        "Replies with PKPaymentRequestCouponCodeUpdate including shippingMethods",
        "Uses PKPaymentTokenContext with merchant identifier, external identifier, name, domain and NSDecimalNumber amounts",
        "Uses PKDeferredPaymentRequest with a deferred date, free cancellation date and time zone, and a management URL",
        "Does not implement FinanceKit or StoreKit for this flow"
      ]
    }
  ]
}