Ns ios distribute

From Melvynx/saveit.now · View interactive version

Ns ios distribute is an AI agent skill from the GitHub repository Melvynx/saveit.now. Prepare and submit NowStack Mobile iOS App Store releases. Use for real 6.5-inch app screenshots, metadata, IAP, review details, validation, and submit.

How to use this skill

Skill file

iOS Distribute - NowStack Mobile

Take a TestFlight-ready app all the way to App Store review submission: store screenshots, metadata, IAP pricing/availability, age rating, review details with demo account, validation, and submit. If no build is on TestFlight yet, run ns-ios-testflight first.

<objective>

Orchestrate the full App Store distribution after a build is on TestFlight. This is the proven end-to-end flow (battle-tested on a real app built from this boilerplate, reaching zero asc validate errors): real app screenshots → store version + metadata → IAP readiness → compliance → review details → validate → submit.

Everything runs with repo tools and public CLIs only:

Sequencing with the rest of the lifecycle:

  1. No processed build yet → run the ns-ios-testflight skill first.
  2. Screenshot capture details → .agents/skills/ns-generate-store-screenshots/SKILL.md.
  3. This file — version, metadata, IAP, compliance, review, submit.

For deep platform specifics use .agents/skills/ns-ios-deploy-app/SKILL.md / .agents/skills/ns-deploy-android-app/SKILL.md.

</objective>

<state_variables>

| Variable | Source |

| --- | --- |

| {asc_app_id} | GET /v1/apps?filter[bundleId]={bundle_id} |

| {version_id} | the appStoreVersions id in PREPARE_FOR_SUBMISSION |

| {version_loc_id} | en-US appStoreVersionLocalizations id |

| {app_info_id} / {app_info_loc_id} | from GET /v1/apps/{asc_app_id}/appInfos (+ its localizations) |

| {build_db_id} | processed build id from GET /v1/builds?filter[app]={asc_app_id} |

| {subscription_id} / {sub_group_id} | if the app sells a subscription |

| {screenshots_dir} | dated output of the screenshot run, e.g. documents/store-screenshots/<date>/ios/iphone-65/en-US |

</state_variables>

<critical_safety>

</critical_safety>

<asc_entity_map>

App Store Connect data model — knowing which entity owns which field saves hours:

| Field | Entity | Endpoint |

| --- | --- | --- |

| description, keywords, promotionalText, supportUrl, marketingUrl | appStoreVersionLocalizations | PATCH /v1/appStoreVersionLocalizations/{id} |

| subtitle, privacyPolicyUrl | appInfoLocalizations | PATCH /v1/appInfoLocalizations/{id} |

| primaryCategory | appInfos | PATCH /v1/appInfos/{id} (relationships) |

| copyright, release type | appStoreVersions | PATCH /v1/appStoreVersions/{id} |

| attached build | appStoreVersions relationship | PATCH /v1/appStoreVersions/{id}/relationships/build |

| age rating answers | ageRatingDeclarations | PATCH /v1/ageRatingDeclarations/{id} |

| contact + demo account | appStoreReviewDetails | POST /v1/appStoreReviewDetails |

| content rights | apps | asc apps update --id {asc_app_id} --content-rights ... |

</asc_entity_map>

<phase n="A" title="Preflight">

export ASC_KEY_ID=... ASC_ISSUER_ID=... ASC_P8_PATH=...
asc auth status --validate
node mobile-app/scripts/asc-api.mjs GET "/v1/apps?filter[bundleId]={bundle_id}"   # -> {asc_app_id}
node mobile-app/scripts/asc-api.mjs GET "/v1/builds?filter[app]={asc_app_id}&limit=3"

</phase>

<phase n="B" title="Store screenshots">

Follow .agents/skills/ns-generate-store-screenshots/SKILL.md for the full workflow, but the rules in this phase override it whenever there is a conflict about device size, dimensions, screenshot routes, or generated marketing/composite screens. The proven recipe:

  1. Real app UI only: capture the application screens as a user would see them: onboarding, auth, signed-in home/dashboard, real feature screen, real paywall, and real settings/account/privacy screen. Demo data is allowed; fake screenshot-only pages, fake cards, marketing layouts, and invented overlay copy are not allowed.
  2. Demo data/session: create/verify a seed function (e.g. convex/seedStoreDemo.ts, app-specific) so real screens show clean demo content. Sign in with the built-in review account appstoretest@email.com / OTP 123456 for auth-gated screens. Never use real personal data.
  3. Paywall capture: temporarily set EXPO_PUBLIC_ALLOW_DEV_PAYMENT_BYPASS=false so the real paywall renders (restore afterwards). The paywall screenshot must be the actual in-app paywall, not a recreated promo screen.
  4. Device: always use the App Store "iPhone 6.5 Display" slot: iPhone 11 Pro Max / XS Max class simulator → native 1242x2688 = Apple display type IPHONE_65. Do not use iPhone 14 Plus / iPhone 15 Pro Max / 6.7-inch screenshots unless the user explicitly asks for another slot.
xcrun simctl create "store-iphone-65" "com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro-Max" <runtime>
cd mobile-app && npm run screenshots:store:ios            # dry-run first, always
npm run screenshots:store:ios -- --execute                # after user confirms
  1. Maestro flows live in mobile-app/maestro/store/ (Maestro needs JDK 17: export JAVA_HOME=/opt/homebrew/opt/openjdk@17). Robust flow patterns: extendedWaitUntil: {visible: "<text>", timeout: 10000} before every tap; conditional paywall dismissal with runFlow: when: visible:.
  2. Validate: sips -g pixelWidth -g pixelHeight *.png — every file must be exactly 1242x2688. Then visual QA each PNG (read the images): real app screen, no fake route, no dev overlays, no status-bar clutter, no placeholder copy, no invented claims.

</phase>

<phase n="C" title="Version, build, metadata">

# attach the processed build to the version
node -e "require('fs').writeFileSync('/tmp/build-rel.json',JSON.stringify({data:{type:'builds',id:'{build_db_id}'}}))"
node mobile-app/scripts/asc-api.mjs PATCH /v1/appStoreVersions/{version_id}/relationships/build /tmp/build-rel.json

Write metadata (draft it from docs/templates/app-store-metadata.example.json + site-config.ts, show the user for approval first):

Upload screenshots:

asc screenshots upload --version-localization "{version_loc_id}" \
  --path "{screenshots_dir}" --device-type "IPHONE_65"

</phase>

<phase n="D" title="IAP / subscription readiness" optional="skip if the app sells nothing on iOS">

The product/subscription must exist in App Store Connect with the EXACT id from site-config.ts > payment.productIds.apple.

# names + descriptions testers/reviewers see
asc subscriptions groups localizations create --group {sub_group_id} --locale en-US --name "<group display name>"
asc subscriptions localizations create --subscription-id {subscription_id} --app {asc_app_id} \
  --locale en-US --name "<plan name>" --description "<one-line benefit>"

# pricing: set one base price, propagate everywhere
asc subscriptions pricing equalize --subscription-id {subscription_id} \
  --base-price "<price>" --base-territory "<ISO3>" --confirm

# availability: if "app availability not found", initialize via the v2 API with ALL territory ids
node mobile-app/scripts/asc-api.mjs GET "/v1/territories?limit=200"   # collect ids
# POST /v2/appAvailabilities with app relationship + territoryAvailabilities for every territory

# review screenshot for the subscription/IAP (use the real in-app paywall capture)
asc subscriptions review screenshots create --subscription-id {subscription_id} \
  --file "{screenshots_dir}/<paywall>.png"

Target state: subscription shows READY_TO_SUBMIT. If a screenshot asset gets stuck in processing, delete it and re-upload.

</phase>

<phase n="E" title="Compliance">

# content rights (no third-party content is the common case)
asc apps update --id {asc_app_id} --content-rights DOES_NOT_USE_THIRD_PARTY_CONTENT

# age rating: fetch, then PATCH honest answers (everything NONE/false except what the app has)
node mobile-app/scripts/asc-api.mjs GET "/v1/appInfos/{app_info_id}/ageRatingDeclaration"
node mobile-app/scripts/asc-api.mjs PATCH /v1/ageRatingDeclarations/<id> /tmp/age-req.json

</phase>

<phase n="F" title="Review details, validate, submit">

# review details — the demo account is built into the boilerplate auth
node mobile-app/scripts/asc-api.mjs POST /v1/appStoreReviewDetails /tmp/review-req.json

review-req.json: contact name/email/phone from the user, demoAccountName: "appstoretest@email.com", demoAccountPassword: "123456", demoAccountRequired: true, and notes explaining the OTP flow: "Sign in with the email OTP flow: enter appstoretest@email.com, the one-time code is fixed to 123456 for this account." Describe the core flow in 2-3 sentences.

asc validate --app {asc_app_id} --version "<version>" --platform IOS --output json

Fix every severity: error (the phases above cover all standard ones). When clean AND the user confirms App Privacy is published:

asc review submit --app {asc_app_id} --version "<version>" --dry-run --output table
asc review submit --app {asc_app_id} --version "<version>" --confirm     # only after explicit user confirmation

Report: version, build number, what was submitted, expected review timeline, and how to monitor (asc status --app {asc_app_id}).

</phase>

<failure_modes>

</failure_modes>

<success_metrics>

</success_metrics>

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.