flows, listing translate, scan 2.2 + --originality, prices export with subscriptions, site sections

- storebound flow list|validate|run: repo-local workflows (store/workflows/*.yml, storebound.workflows.*), writes dry unless --apply, owner steps never run, --from / --resume; init templates for app and game; MCP flow_list + dry flow_run; release-flows skill
- storebound listing translate|check|reviewed: per-language listing drafts with store limits and keyword rules, agent or --translate hook, marked until reviewed; MCP listing_translate / listing_check; listing-localization skill
- scan: Apple 2.2 beta/demo/test wording rule; scan --originality [--against]
- prices export includes subscriptions; prices import skips their rows
- site: rejection scan section, Desktop app section with fixture-mode screenshots, Everything else grid, FAQ 4.3 answer
- README, CHANGELOG, adapters, API tables
This commit is contained in:
CRTkafa 2026-10-12 01:24:21 +08:00
parent 8fcc78bb52
commit 236977940e
45 changed files with 2176 additions and 53 deletions

View file

@ -53,12 +53,14 @@ These rules apply to every AI tool that uses storebound (skills, MCP server or t
- `skills/build-and-sign/SKILL.md`: Sign, build and upload a mobile app or game from the terminal - `skills/build-and-sign/SKILL.md`: Sign, build and upload a mobile app or game from the terminal
- `skills/console-autofill/SKILL.md`: AI-assisted autofill of App Store Connect and Google Play Console forms that have no API (the New App dialog, App Privacy, the Play IARC content rating questionnaire, Target audience and content plus the Ads declaration; the App Store age rating is shown as guidance because the API sets it) in a visible Chromium the owner signs in to. Answers come only from storebound.config.ts; anything the config does not prove stays empty and highlighted. storebound never signs in, never saves, submits or publishes - `skills/console-autofill/SKILL.md`: AI-assisted autofill of App Store Connect and Google Play Console forms that have no API (the New App dialog, App Privacy, the Play IARC content rating questionnaire, Target audience and content plus the Ads declaration; the App Store age rating is shown as guidance because the API sets it) in a visible Chromium the owner signs in to. Answers come only from storebound.config.ts; anything the config does not prove stays empty and highlighted. storebound never signs in, never saves, submits or publishes
- `skills/export-compliance/SKILL.md`: Answer App Store export compliance (encryption) for a mobile app or game correctly - `skills/export-compliance/SKILL.md`: Answer App Store export compliance (encryption) for a mobile app or game correctly
- `skills/listing-localization/SKILL.md`: Translate the store listing of a mobile app or game into more languages
- `skills/migrate-from-fastlane/SKILL.md`: Move a mobile app or game from fastlane (deliver, supply, snapshot / screengrab, Appfile, Deliverfile) to storebound with `storebound import fastlane` - `skills/migrate-from-fastlane/SKILL.md`: Move a mobile app or game from fastlane (deliver, supply, snapshot / screengrab, Appfile, Deliverfile) to storebound with `storebound import fastlane`
- `skills/play-first-release/SKILL.md`: Step-by-step first (and later) Google Play release of a mobile app or game - `skills/play-first-release/SKILL.md`: Step-by-step first (and later) Google Play release of a mobile app or game
- `skills/portfolio-originality/SKILL.md`: Originality gate for studios and developers that ship many similar mobile apps or games (templates, white-label apps, reskins) - `skills/portfolio-originality/SKILL.md`: Originality gate for studios and developers that ship many similar mobile apps or games (templates, white-label apps, reskins)
- `skills/ppp-pricing/SKILL.md`: Propose purchasing power parity (PPP) prices for a mobile app's or game's in-app products in every App Store territory and Google Play region with `storebound prices ppp` - `skills/ppp-pricing/SKILL.md`: Propose purchasing power parity (PPP) prices for a mobile app's or game's in-app products in every App Store territory and Google Play region with `storebound prices ppp`
- `skills/privacy-manifest/SKILL.md`: Add and check Apple privacy manifests (PrivacyInfo.xcprivacy) for an iOS app or game - `skills/privacy-manifest/SKILL.md`: Add and check Apple privacy manifests (PrivacyInfo.xcprivacy) for an iOS app or game
- `skills/privacy-policy/SKILL.md`: Write and host one studio-wide privacy policy page for all of a developer's mobile apps and games - `skills/privacy-policy/SKILL.md`: Write and host one studio-wide privacy policy page for all of a developer's mobile apps and games
- `skills/release-flows/SKILL.md`: Repo-local workflows for a mobile app or game
- `skills/release-management/SKILL.md`: Ship updates safely after the first release - `skills/release-management/SKILL.md`: Ship updates safely after the first release
- `skills/revenuecat-sync/SKILL.md`: Optional adapter that keeps a RevenueCat project's catalog in step with the storebound config - `skills/revenuecat-sync/SKILL.md`: Optional adapter that keeps a RevenueCat project's catalog in step with the storebound config
- `skills/review-access/SKILL.md`: Give App Store and Google Play reviewers working access to an app behind a sign-in - `skills/review-access/SKILL.md`: Give App Store and Google Play reviewers working access to an app behind a sign-in

View file

@ -55,12 +55,14 @@ These rules apply to every AI tool that uses storebound (skills, MCP server or t
| `build-and-sign` | Sign, build and upload a mobile app or game from the terminal | | `build-and-sign` | Sign, build and upload a mobile app or game from the terminal |
| `console-autofill` | AI-assisted autofill of App Store Connect and Google Play Console forms that have no API (the New App dialog, App Privacy, the Play IARC content rating questionnaire, Target audience and content plus the Ads declaration; the App Store age rating is shown as guidance because the API sets it) in a visible Chromium the owner signs in to. Answers come only from storebound.config.ts; anything the config does not prove stays empty and highlighted. storebound never signs in, never saves, submits or publishes | | `console-autofill` | AI-assisted autofill of App Store Connect and Google Play Console forms that have no API (the New App dialog, App Privacy, the Play IARC content rating questionnaire, Target audience and content plus the Ads declaration; the App Store age rating is shown as guidance because the API sets it) in a visible Chromium the owner signs in to. Answers come only from storebound.config.ts; anything the config does not prove stays empty and highlighted. storebound never signs in, never saves, submits or publishes |
| `export-compliance` | Answer App Store export compliance (encryption) for a mobile app or game correctly | | `export-compliance` | Answer App Store export compliance (encryption) for a mobile app or game correctly |
| `listing-localization` | Translate the store listing of a mobile app or game into more languages |
| `migrate-from-fastlane` | Move a mobile app or game from fastlane (deliver, supply, snapshot / screengrab, Appfile, Deliverfile) to storebound with `storebound import fastlane` | | `migrate-from-fastlane` | Move a mobile app or game from fastlane (deliver, supply, snapshot / screengrab, Appfile, Deliverfile) to storebound with `storebound import fastlane` |
| `play-first-release` | Step-by-step first (and later) Google Play release of a mobile app or game | | `play-first-release` | Step-by-step first (and later) Google Play release of a mobile app or game |
| `portfolio-originality` | Originality gate for studios and developers that ship many similar mobile apps or games (templates, white-label apps, reskins) | | `portfolio-originality` | Originality gate for studios and developers that ship many similar mobile apps or games (templates, white-label apps, reskins) |
| `ppp-pricing` | Propose purchasing power parity (PPP) prices for a mobile app's or game's in-app products in every App Store territory and Google Play region with `storebound prices ppp` | | `ppp-pricing` | Propose purchasing power parity (PPP) prices for a mobile app's or game's in-app products in every App Store territory and Google Play region with `storebound prices ppp` |
| `privacy-manifest` | Add and check Apple privacy manifests (PrivacyInfo.xcprivacy) for an iOS app or game | | `privacy-manifest` | Add and check Apple privacy manifests (PrivacyInfo.xcprivacy) for an iOS app or game |
| `privacy-policy` | Write and host one studio-wide privacy policy page for all of a developer's mobile apps and games | | `privacy-policy` | Write and host one studio-wide privacy policy page for all of a developer's mobile apps and games |
| `release-flows` | Repo-local workflows for a mobile app or game |
| `release-management` | Ship updates safely after the first release | | `release-management` | Ship updates safely after the first release |
| `revenuecat-sync` | Optional adapter that keeps a RevenueCat project's catalog in step with the storebound config | | `revenuecat-sync` | Optional adapter that keeps a RevenueCat project's catalog in step with the storebound config |
| `review-access` | Give App Store and Google Play reviewers working access to an app behind a sign-in | | `review-access` | Give App Store and Google Play reviewers working access to an app behind a sign-in |

View file

@ -54,12 +54,14 @@ These rules apply to every AI tool that uses storebound (skills, MCP server or t
- `skills/build-and-sign/SKILL.md`: Sign, build and upload a mobile app or game from the terminal - `skills/build-and-sign/SKILL.md`: Sign, build and upload a mobile app or game from the terminal
- `skills/console-autofill/SKILL.md`: AI-assisted autofill of App Store Connect and Google Play Console forms that have no API (the New App dialog, App Privacy, the Play IARC content rating questionnaire, Target audience and content plus the Ads declaration; the App Store age rating is shown as guidance because the API sets it) in a visible Chromium the owner signs in to. Answers come only from storebound.config.ts; anything the config does not prove stays empty and highlighted. storebound never signs in, never saves, submits or publishes - `skills/console-autofill/SKILL.md`: AI-assisted autofill of App Store Connect and Google Play Console forms that have no API (the New App dialog, App Privacy, the Play IARC content rating questionnaire, Target audience and content plus the Ads declaration; the App Store age rating is shown as guidance because the API sets it) in a visible Chromium the owner signs in to. Answers come only from storebound.config.ts; anything the config does not prove stays empty and highlighted. storebound never signs in, never saves, submits or publishes
- `skills/export-compliance/SKILL.md`: Answer App Store export compliance (encryption) for a mobile app or game correctly - `skills/export-compliance/SKILL.md`: Answer App Store export compliance (encryption) for a mobile app or game correctly
- `skills/listing-localization/SKILL.md`: Translate the store listing of a mobile app or game into more languages
- `skills/migrate-from-fastlane/SKILL.md`: Move a mobile app or game from fastlane (deliver, supply, snapshot / screengrab, Appfile, Deliverfile) to storebound with `storebound import fastlane` - `skills/migrate-from-fastlane/SKILL.md`: Move a mobile app or game from fastlane (deliver, supply, snapshot / screengrab, Appfile, Deliverfile) to storebound with `storebound import fastlane`
- `skills/play-first-release/SKILL.md`: Step-by-step first (and later) Google Play release of a mobile app or game - `skills/play-first-release/SKILL.md`: Step-by-step first (and later) Google Play release of a mobile app or game
- `skills/portfolio-originality/SKILL.md`: Originality gate for studios and developers that ship many similar mobile apps or games (templates, white-label apps, reskins) - `skills/portfolio-originality/SKILL.md`: Originality gate for studios and developers that ship many similar mobile apps or games (templates, white-label apps, reskins)
- `skills/ppp-pricing/SKILL.md`: Propose purchasing power parity (PPP) prices for a mobile app's or game's in-app products in every App Store territory and Google Play region with `storebound prices ppp` - `skills/ppp-pricing/SKILL.md`: Propose purchasing power parity (PPP) prices for a mobile app's or game's in-app products in every App Store territory and Google Play region with `storebound prices ppp`
- `skills/privacy-manifest/SKILL.md`: Add and check Apple privacy manifests (PrivacyInfo.xcprivacy) for an iOS app or game - `skills/privacy-manifest/SKILL.md`: Add and check Apple privacy manifests (PrivacyInfo.xcprivacy) for an iOS app or game
- `skills/privacy-policy/SKILL.md`: Write and host one studio-wide privacy policy page for all of a developer's mobile apps and games - `skills/privacy-policy/SKILL.md`: Write and host one studio-wide privacy policy page for all of a developer's mobile apps and games
- `skills/release-flows/SKILL.md`: Repo-local workflows for a mobile app or game
- `skills/release-management/SKILL.md`: Ship updates safely after the first release - `skills/release-management/SKILL.md`: Ship updates safely after the first release
- `skills/revenuecat-sync/SKILL.md`: Optional adapter that keeps a RevenueCat project's catalog in step with the storebound config - `skills/revenuecat-sync/SKILL.md`: Optional adapter that keeps a RevenueCat project's catalog in step with the storebound config
- `skills/review-access/SKILL.md`: Give App Store and Google Play reviewers working access to an app behind a sign-in - `skills/review-access/SKILL.md`: Give App Store and Google Play reviewers working access to an app behind a sign-in

View file

@ -2,6 +2,24 @@
## Unreleased ## Unreleased
- `storebound flow list | validate | run <name>`: repo-local workflows in `store/workflows/*.yml` (or
`storebound.workflows.yml|json|ts`): named steps run in order with progress, `${VAR}` params and captures, `if:`
conditions, sub-flows, before / after / onError hooks. Writes run as dry runs unless `--apply`; owner steps (submit,
release, rollout ...) are listed as "your click" and never run; `--from <step>` and `--resume` continue after a
failure. `init` writes `release.yml` and `beta.yml` for the app and game profiles. A small YAML subset reader keeps
zero runtime dependencies. MCP: `flow_list`, `flow_run` (dry mode). Skill: `release-flows`.
- `storebound listing translate --to <langs>`: per-language listing drafts in both listing files (App Store name,
subtitle, promotional text, keywords, description; Play title, short, full) for the agent to translate, or a
`--translate "<command>"` hook per field; store limits and keyword rules (commas, duplicates, name words, 100) are
enforced, drafts stay marked until `listing reviewed`; `listing check`, and `check` warns about drafts. No LLM call
in the CLI. MCP: `listing_translate`, `listing_check`. Skill: `listing-localization`.
- `scan`: Apple 2.2 "beta / demo / trial / test" wording in the app name and the App Store text (`beta-wording`);
`scan --originality [--against <folders>]` puts the 4.3 / Play repetitive content check into the scan report.
- `prices export` includes auto-renewable subscriptions (Apple current and scheduled prices, Play base plan regional
prices; `--no-subscriptions` leaves them out); `prices import` skips those rows and names the subscription commands.
- Site: "Catch rejections before you submit", a Desktop app section with real fixture-mode screenshots, an "Everything
else" command grid and the FAQ on `storebound originality`.
- Growth extras, each with `--dry`, `--json`, tests on sanitized fixtures and a skill: - Growth extras, each with `--dry`, `--json`, tests on sanitized fixtures and a skill:
- `prices ppp`: purchasing power price sheets from a bundled, dated World Bank ICP PPP dataset (CC BY 4.0, - `prices ppp`: purchasing power price sheets from a bundled, dated World Bank ICP PPP dataset (CC BY 4.0,
`tools/update-ppp.ts` refreshes it), the Big Mac index or a CSV; clamped, snapped to store price points, written `tools/update-ppp.ts` refreshes it), the Big Mac index or a CSV; clamped, snapped to store price points, written

View file

@ -54,12 +54,14 @@ These rules apply to every AI tool that uses storebound (skills, MCP server or t
| `build-and-sign` | Sign, build and upload a mobile app or game from the terminal | | `build-and-sign` | Sign, build and upload a mobile app or game from the terminal |
| `console-autofill` | AI-assisted autofill of App Store Connect and Google Play Console forms that have no API (the New App dialog, App Privacy, the Play IARC content rating questionnaire, Target audience and content plus the Ads declaration; the App Store age rating is shown as guidance because the API sets it) in a visible Chromium the owner signs in to. Answers come only from storebound.config.ts; anything the config does not prove stays empty and highlighted. storebound never signs in, never saves, submits or publishes | | `console-autofill` | AI-assisted autofill of App Store Connect and Google Play Console forms that have no API (the New App dialog, App Privacy, the Play IARC content rating questionnaire, Target audience and content plus the Ads declaration; the App Store age rating is shown as guidance because the API sets it) in a visible Chromium the owner signs in to. Answers come only from storebound.config.ts; anything the config does not prove stays empty and highlighted. storebound never signs in, never saves, submits or publishes |
| `export-compliance` | Answer App Store export compliance (encryption) for a mobile app or game correctly | | `export-compliance` | Answer App Store export compliance (encryption) for a mobile app or game correctly |
| `listing-localization` | Translate the store listing of a mobile app or game into more languages |
| `migrate-from-fastlane` | Move a mobile app or game from fastlane (deliver, supply, snapshot / screengrab, Appfile, Deliverfile) to storebound with `storebound import fastlane` | | `migrate-from-fastlane` | Move a mobile app or game from fastlane (deliver, supply, snapshot / screengrab, Appfile, Deliverfile) to storebound with `storebound import fastlane` |
| `play-first-release` | Step-by-step first (and later) Google Play release of a mobile app or game | | `play-first-release` | Step-by-step first (and later) Google Play release of a mobile app or game |
| `portfolio-originality` | Originality gate for studios and developers that ship many similar mobile apps or games (templates, white-label apps, reskins) | | `portfolio-originality` | Originality gate for studios and developers that ship many similar mobile apps or games (templates, white-label apps, reskins) |
| `ppp-pricing` | Propose purchasing power parity (PPP) prices for a mobile app's or game's in-app products in every App Store territory and Google Play region with `storebound prices ppp` | | `ppp-pricing` | Propose purchasing power parity (PPP) prices for a mobile app's or game's in-app products in every App Store territory and Google Play region with `storebound prices ppp` |
| `privacy-manifest` | Add and check Apple privacy manifests (PrivacyInfo.xcprivacy) for an iOS app or game | | `privacy-manifest` | Add and check Apple privacy manifests (PrivacyInfo.xcprivacy) for an iOS app or game |
| `privacy-policy` | Write and host one studio-wide privacy policy page for all of a developer's mobile apps and games | | `privacy-policy` | Write and host one studio-wide privacy policy page for all of a developer's mobile apps and games |
| `release-flows` | Repo-local workflows for a mobile app or game |
| `release-management` | Ship updates safely after the first release | | `release-management` | Ship updates safely after the first release |
| `revenuecat-sync` | Optional adapter that keeps a RevenueCat project's catalog in step with the storebound config | | `revenuecat-sync` | Optional adapter that keeps a RevenueCat project's catalog in step with the storebound config |
| `review-access` | Give App Store and Google Play reviewers working access to an app behind a sign-in | | `review-access` | Give App Store and Google Play reviewers working access to an app behind a sign-in |

View file

@ -56,7 +56,7 @@ your own click.
| 2 | **App records and bundle id** | `apple bundle` registers the bundle id, `apple status` finds the app record | App Store Connect > New App (no API); Play Console > Create app; the very first AAB upload when Play needs it from the Console | the declarations you accept when creating the Play app | | 2 | **App records and bundle id** | `apple bundle` registers the bundle id, `apple status` finds the app record | App Store Connect > New App (no API); Play Console > Create app; the very first AAB upload when Play needs it from the Console | the declarations you accept when creating the Play app |
| 3 | **Builds and testers** | `play next-version-code`, `play build`, `play upload --track internal`, `apple signing ensure`, `apple build`, `apple upload` (waits for processing), `apple encryption`, `apple testflight groups / what-to-test / info / distribute` (internal groups) | Play internal testers list, Apple sandbox testers (`play-first-release`, `testflight`) | `apple testflight testers` (Apple emails the invitations), external groups and Beta App Review (`distribute --submit-review`) | | 3 | **Builds and testers** | `play next-version-code`, `play build`, `play upload --track internal`, `apple signing ensure`, `apple build`, `apple upload` (waits for processing), `apple encryption`, `apple testflight groups / what-to-test / info / distribute` (internal groups) | Play internal testers list, Apple sandbox testers (`play-first-release`, `testflight`) | `apple testflight testers` (Apple emails the invitations), external groups and Beta App Review (`distribute --submit-review`) |
| 4 | **In-app products and subscriptions** | `play products` (regional prices from USD + your overrides, activated), `apple iap` (consumable, non-consumable, non-renewing; localizations, price schedule, availability), `apple iap-review`, `apple subscriptions` (groups, levels, equalized prices, intro and promotional offers, offer codes), `play subscriptions` (base plans, regional prices, offers), `catalog diff` (both stores against one catalog) | Play license testers, Apple sandbox testers, "Add for Review" of the first IAPs and subscriptions into the version's submission, Play promo codes (`store-iap-setup`, `store-subscriptions`) | custom offer codes (`apple subscriptions --codes` asks first) | | 4 | **In-app products and subscriptions** | `play products` (regional prices from USD + your overrides, activated), `apple iap` (consumable, non-consumable, non-renewing; localizations, price schedule, availability), `apple iap-review`, `apple subscriptions` (groups, levels, equalized prices, intro and promotional offers, offer codes), `play subscriptions` (base plans, regional prices, offers), `catalog diff` (both stores against one catalog) | Play license testers, Apple sandbox testers, "Add for Review" of the first IAPs and subscriptions into the version's submission, Play promo codes (`store-iap-setup`, `store-subscriptions`) | custom offer codes (`apple subscriptions --codes` asks first) |
| 5 | **Store listings, every language** | `play listing` (title, short / full description, contact email + website, promo video URL), `apple listing --version x --build N` (name, subtitle, description, keywords, promo text, URLs, privacy URL, manual release), `whats-new`, `check` (limits), `check --aso` | Play store settings: category and tags (`play-first-release`) | | | 5 | **Store listings, every language** | `play listing` (title, short / full description, contact email + website, promo video URL), `apple listing --version x --build N` (name, subtitle, description, keywords, promo text, URLs, privacy URL, manual release), `listing translate` (drafts per language), `whats-new`, `check` (limits), `check --aso` | Play store settings: category and tags (`play-first-release`) | |
| 6 | **Play questionnaires** | `play data-safety`: the whole Data safety form from `dataSafety` in the config (CSV import through the API) | Policy and programs > App content, answers prepared in `store/declarations.md` (`store-declarations`): privacy policy, app access with the demo account (`review-access`), delete-account URL (`account-deletion`), ads, content rating (IARC), target audience and content, advertising ID, news, government, financial and health features; Data safety summary check | the answers themselves are your statements: the agent asks when the code does not prove them | | 6 | **Play questionnaires** | `play data-safety`: the whole Data safety form from `dataSafety` in the config (CSV import through the API) | Policy and programs > App content, answers prepared in `store/declarations.md` (`store-declarations`): privacy policy, app access with the demo account (`review-access`), delete-account URL (`account-deletion`), ads, content rating (IARC), target audience and content, advertising ID, news, government, financial and health features; Data safety summary check | the answers themselves are your statements: the agent asks when the code does not prove them |
| 7 | **App Store questionnaires** | `apple appinfo` (categories, age rating declaration, content rights, Free price, availability), `apple encryption` (export compliance from `apple.usesNonExemptEncryption`, never guessed), `apple review-details` (contact, demo account from `.storebound/`, notes) | App Privacy nutrition labels from `store/app-privacy.md`, then **Publish** (`store-declarations`); encryption documentation when the answer is yes (`export-compliance`); the first availability record if the API refuses it | the export compliance answer (a legal statement, set once in the config) | | 7 | **App Store questionnaires** | `apple appinfo` (categories, age rating declaration, content rights, Free price, availability), `apple encryption` (export compliance from `apple.usesNonExemptEncryption`, never guessed), `apple review-details` (contact, demo account from `.storebound/`, notes) | App Privacy nutrition labels from `store/app-privacy.md`, then **Publish** (`store-declarations`); encryption documentation when the answer is yes (`export-compliance`); the first availability record if the API refuses it | the export compliance answer (a legal statement, set once in the config) |
| 8 | **Privacy and accounts** | privacy policy page template (`init`), `privacy-manifest --ios <path>` (PrivacyInfo.xcprivacy, required-reason APIs, SDK manifests), `validate` checks the policy, delete-account and terms URLs answer | host the pages, link them in both consoles and inside the app; in-app account deletion (`privacy-policy`, `privacy-manifest`, `account-deletion`) | | | 8 | **Privacy and accounts** | privacy policy page template (`init`), `privacy-manifest --ios <path>` (PrivacyInfo.xcprivacy, required-reason APIs, SDK manifests), `validate` checks the policy, delete-account and terms URLs answer | host the pages, link them in both consoles and inside the app; in-app account deletion (`privacy-policy`, `privacy-manifest`, `account-deletion`) | |
@ -158,6 +158,8 @@ app shows them on the Checks tab. A finding you decided is fine goes into the co
| `metadata-keywords`, `kids-terms`, `play-metadata` | 2.3.7, 2.3.8 | Metadata | other apps' names, prices and "best / #1" in name, subtitle or keywords; keyword lists; "For Kids" outside the Kids Category. Play title over 30 characters, emoji, ALL CAPS, rank / price / promotion terms; other apps in the title or short description; repeated keywords or keyword lists in the full description | | `metadata-keywords`, `kids-terms`, `play-metadata` | 2.3.7, 2.3.8 | Metadata | other apps' names, prices and "best / #1" in name, subtitle or keywords; keyword lists; "For Kids" outside the Kids Category. Play title over 30 characters, emoji, ALL CAPS, rank / price / promotion terms; other apps in the title or short description; repeated keywords or keyword lists in the full description |
| `play-impersonation` | | Impersonation | a well-known brand in the package name or app name (low: a check, not a verdict) | | `play-impersonation` | | Impersonation | a well-known brand in the package name or app name (low: a check, not a verdict) |
| `placeholder-text` | 2.1(a) | Metadata | lorem ipsum, TODO, template lines in the listings | | `placeholder-text` | 2.1(a) | Metadata | lorem ipsum, TODO, template lines in the listings |
| `beta-wording` | 2.2 | | "beta", "demo", "trial version", "test build", "early access" in the app name (config, CFBundleDisplayName) or the App Store name, subtitle, keywords, promotional text and description ("demo account" is fine) |
| `originality` (with `--originality`) | 4.3 | Repetitive content | a near-duplicate of one of your own apps (`storebound originality` scores: name, listing text, icon and screenshot hashes, project structure) |
| `min-functionality` | 4.2 | | Capacitor `server.url` / Cordova `<content src>` on a remote site; a few native files around a remote WKWebView | | `min-functionality` | 4.2 | | Capacitor `server.url` / Cordova `<content src>` on a remote site; a few native files around a remote WKWebView |
| `deprecated-api`, `private-api` | 2.5.1 (ITMS-90809) | | UIWebView; `App-Prefs:` / `prefs:root` URL schemes | | `deprecated-api`, `private-api` | 2.5.1 (ITMS-90809) | | UIWebView; `App-Prefs:` / `prefs:root` URL schemes |
| `ipv6`, `ats` | 2.5.5, App Transport Security | | IPv4 literals in server URLs; NSAllowsArbitraryLoads | | `ipv6`, `ats` | 2.5.5, App Transport Security | | IPv4 literals in server URLs; NSAllowsArbitraryLoads |
@ -166,6 +168,10 @@ app shows them on the Checks tab. A finding you decided is fine goes into the co
| `play-target-sdk` | | Target API level | below API 36 (Wear OS / Automotive 35, TV / XR 34) for new apps and updates since 2026-08-31 | | `play-target-sdk` | | Target API level | below API 36 (Wear OS / Automotive 35, TV / XR 34) for new apps and updates since 2026-08-31 |
| `play-package-name` | | Play Console upload | the reserved `com.example` prefix | | `play-package-name` | | Play Console upload | the reserved `com.example` prefix |
`storebound scan --originality [--against <folders>]` adds the Guideline 4.3 / Play repetitive content check against
your other apps to the same report (folders default to `originality.against` in the config; `storebound originality`
stays the command with every score and suggestion).
Rules cite Apple's App Review Guidelines and the Play Policy Center / Play Console Help pages they come from (checked Rules cite Apple's App Review Guidelines and the Play Policy Center / Play Console Help pages they come from (checked
2026-10-11, in the code comments of `cli/lib/scan/rules.ts` and `cli/lib/scan/play-rules.ts`); the SDK table with each 2026-10-11, in the code comments of `cli/lib/scan/rules.ts` and `cli/lib/scan/play-rules.ts`); the SDK table with each
vendor's data disclosure page and Google's Families self-certified ads SDK list is `cli/lib/scan/sdks.ts`. Play config vendor's data disclosure page and Google's Families self-certified ads SDK list is `cli/lib/scan/sdks.ts`. Play config
@ -311,11 +317,14 @@ run in the background with a log (`storebound shots render > .storebound/render.
| `check` | local | config, copy limits, data safety, products, subscriptions, profile (delete-account URL, demo account, terms URL), files; warns on untranslated release notes | | `check` | local | config, copy limits, data safety, products, subscriptions, profile (delete-account URL, demo account, terms URL), files; warns on untranslated release notes |
| `catalog diff [--store] [--threshold 10]` | API, read-only | one catalog vs both stores: missing / extra / mismatched products and subscriptions, US and override prices, locales, offers, per-region price differences between the stores; exit 1 on mismatches | | `catalog diff [--store] [--threshold 10]` | API, read-only | one catalog vs both stores: missing / extra / mismatched products and subscriptions, US and override prices, locales, offers, per-region price differences between the stores; exit 1 on mismatches |
| `check --aso` | local | keyword audit: App Store keyword field rules, Play stuffing / claims | | `check --aso` | local | keyword audit: App Store keyword field rules, Play stuffing / claims |
| `scan [--store apple\|play] [--json] [--write]` | local, read-only | rejection risks in the project itself (stack, SDKs, Info.plist, manifest, listings) with guideline, evidence file:line, fix and skill; Data safety / App Privacy / ATT / privacy manifest proposal as a diff (`--write` adds the detected answers to the config); exit 1 on blockers | | `scan [--store apple\|play] [--json] [--write] [--originality --against <folders>]` | local, read-only | rejection risks in the project itself (stack, SDKs, Info.plist, manifest, listings) with guideline, evidence file:line, fix and skill; Data safety / App Privacy / ATT / privacy manifest proposal as a diff (`--write` adds the detected answers to the config); exit 1 on blockers |
| `validate [--apple] [--play]` | API, read-only | readiness report with ordered blockers plus the local renders checks (`--no-local` skips); exit 1 while any blocker is left | | `validate [--apple] [--play]` | API, read-only | readiness report with ordered blockers plus the local renders checks (`--no-local` skips); exit 1 while any blocker is left |
| `originality --against <folders> [--json]` | local, read-only | Guideline 4.3 check vs your other apps: name, listing text, icon and screenshot perceptual hashes, project structure; scores, near-duplicate flags, suggestions; exit 1 when flagged | | `originality --against <folders> [--json]` | local, read-only | Guideline 4.3 check vs your other apps: name, listing text, icon and screenshot perceptual hashes, project structure; scores, near-duplicate flags, suggestions; exit 1 when flagged |
| `whats-new [--since <tag>]` | local | draft player-facing release notes from git log into both listing files | | `whats-new [--since <tag>]` | local | draft player-facing release notes from git log into both listing files |
| `whats-new --languages en,de,tr` / `check` / `apply` | local | one file per language (`store/whats-new/`) for your agent (or a `--translate` hook of yours) to translate, per-store limits (Play 500, App Store 4000), then into both listing files | | `whats-new --languages en,de,tr` / `check` / `apply` | local | one file per language (`store/whats-new/`) for your agent (or a `--translate` hook of yours) to translate, per-store limits (Play 500, App Store 4000), then into both listing files |
| `listing translate --to de,ja [--from en] [--translate "<cmd>"]` | local | per-language listing sections in both listing files (App Store name, subtitle, promotional text, keywords, description; Play title, short, full) for your agent (or a hook) to translate, marked as drafts until reviewed; keywords cleaned up |
| `listing check` / `listing reviewed --lang <ids>` | local | every language section against the store limits and keyword rules, untranslated and unreviewed drafts (exit 1 on a problem) / remove the draft marker after a human read it |
| `flow list \| validate \| run <name> [NAME=value] [--dry \| --apply] [--from <step> \| --resume]` | local + whatever the steps call | repo-local workflows (`store/workflows/*.yml`): steps in order with progress; writes run as dry runs unless `--apply`, owner steps are listed as your click and never run (see [Repo-local workflows](#repo-local-workflows)) |
| `catalog pull [--write]` | API, read-only + local | IAP and subscription texts on the stores vs the config: a proposal diff (`.storebound/pull/catalog.json`); the config is never rewritten | | `catalog pull [--write]` | API, read-only + local | IAP and subscription texts on the stores vs the config: a proposal diff (`.storebound/pull/catalog.json`); the config is never rewritten |
| `ads scan --ios <path>` | local | AdAttributionKit / SKAdNetwork: ad network ids, postback copy endpoints, attribution windows and cooldown, conversion value updates; exit 1 on a blocker | | `ads scan --ios <path>` | local | AdAttributionKit / SKAdNetwork: ad network ids, postback copy endpoints, attribution windows and cooldown, conversion value updates; exit 1 on a blocker |
| `privacy-manifest --ios <path>` | local | PrivacyInfo.xcprivacy, required-reason APIs, SDKs without manifests | | `privacy-manifest --ios <path>` | local | PrivacyInfo.xcprivacy, required-reason APIs, SDKs without manifests |
@ -405,7 +414,7 @@ run in the background with a log (`storebound shots render > .storebound/render.
| `reviews list [--unanswered]` | API, read-only | recent reviews of both stores | | `reviews list [--unanswered]` | API, read-only | recent reviews of both stores |
| `reviews draft` | API + local | one reply draft per unanswered review in `.storebound/replies/` | | `reviews draft` | API + local | one reply draft per unanswered review in `.storebound/replies/` |
| `reviews send` | API | sends drafts with `approved: true` (checks length and incentives, asks first) | | `reviews send` | API | sends drafts with `approved: true` (checks length and incentives, asks first) |
| `prices export` | API + local | current prices of every product, both stores, as `store/prices.csv` | | `prices export [--no-subscriptions]` | API + local | current prices of every product and subscription (Apple current + scheduled, Play base plan regions), both stores, as `store/prices.csv`; subscription rows feed `apple subscriptions --csv` / `play subscriptions --csv` |
| `prices import [--reconvert]` | API | diff table, then (asks first) Apple price schedules incl. future-dated changes and Play regional prices | | `prices import [--reconvert]` | API | diff table, then (asks first) Apple price schedules incl. future-dated changes and Play regional prices |
| `analytics setup` | API | App Store analytics report request (once, Admin key) | | `analytics setup` | API | App Store analytics report request (once, Admin key) |
| `analytics snapshot [--days 28]` | API + local | impressions, page views, downloads (App Store), visitors, acquisitions, installs (Play reports bucket) -> `.storebound/analytics/` | | `analytics snapshot [--days 28]` | API + local | impressions, page views, downloads (App Store), visitors, acquisitions, installs (Play reports bucket) -> `.storebound/analytics/` |
@ -558,6 +567,75 @@ submitted), the next move and the warnings. Owner steps (submit for review, prom
version, raise or complete a rollout) are named with where the owner does them; storebound does not do them. A store version, raise or complete a rollout) are named with where the owner does them; storebound does not do them. A store
it cannot read is "unknown", never "not there". Both commands work in an app folder (that app) and in a workspace it cannot read is "unknown", never "not there". Both commands work in an app folder (that app) and in a workspace
(every app, or `--app a,b`); `--json` gives the structured result. MCP: `release_status`, `release_plan` (read-only). (every app, or `--app a,b`); `--json` gives the structured result. MCP: `release_status`, `release_plan` (read-only).
## Repo-local workflows
Your release routine as a file in the repo, run step by step. `storebound init` writes two to start from
(`store/workflows/release.yml`, `beta.yml`; app and game versions):
```yaml
# store/workflows/release.yml (app profile, shortened)
params:
VERSION: "1.0.0"
steps:
- id: next-build
if: apple
run: apple next-build
capture: BUILD
- id: build
if: apple
run: apple build --version ${VERSION} --build-number ${BUILD}
- id: upload
if: apple
run: apple upload --no-wait
# wait, play-build, play-upload, whats-new, listing, validate, scan, plan ...
- id: submit
owner: "App Store Connect: Submit for Review (version ${VERSION}, build ${BUILD}) ..."
```
The plan of that file (`--dry`: nothing runs; without it the reads run and `${BUILD}` is filled in):
```
$ storebound flow run release VERSION=1.2.0 --dry
[flow] 1/12 next-build: storebound apple next-build (plan only)
[flow] 2/12 build: storebound apple build --version 1.2.0 --build-number ${BUILD} --dry (plan only)
[flow] 3/12 upload: storebound apple upload --no-wait --dry (plan only)
[flow] 4/12 wait: storebound apple testflight wait --build ${BUILD} --version 1.2.0 --dry (plan only)
[flow] 5/12 play-build: storebound play build --version-name 1.2.0 --dry (plan only)
[flow] 6/12 play-upload: storebound play upload --track internal --dry (plan only)
[flow] 7/12 whats-new: storebound whats-new apply (if exists store/whats-new: false)
[flow] 8/12 listing: storebound apple listing --version 1.2.0 --build ${BUILD} --dry (plan only)
[flow] 9/12 validate: storebound validate (plan only)
[flow] 10/12 scan: storebound scan (plan only)
[flow] 11/12 plan: storebound release plan 1.2.0 (plan only)
[flow] 12/12 submit: YOUR CLICK App Store Connect: Submit for Review (version 1.2.0, build ${BUILD}). Play Console: promote the internal release and Send changes for review
```
- Read steps (check, validate, scan, release plan, next-build, status) run; **write steps run with `--dry`** unless
`--apply`, and even then each command asks its own confirmation; wait steps check once; `sh:` steps (your own build
commands) run only with `--apply`. `--dry` prints the plan without running anything.
- Owner steps (submit, release, phased release, rollout, review replies, price imports, tester invitations, Beta App
Review) are never executed, also when written as `run:`; the flow ends with the list of your clicks.
- `capture:` turns a step's last output line into a variable (`${BUILD}`), `if:` skips a step (`apple`, `play`,
`exists <path>`, `${VAR} == x`), `flow:` reuses another flow (`private: true` sub-flows), `before` / `after` /
`onError` are hooks, `continueOnError` keeps going.
- A failed step stops the flow; `--resume` starts again at that step with the captured variables
(`.storebound/flows/<name>.json`), `--from <step>` anywhere. `flow validate` checks commands, variables, duplicate ids
and sub-flow cycles. Several flows can also live in `storebound.workflows.yml|json|ts`.
- MCP: `flow_list` and `flow_run` (the dry mode only; `--apply` stays a terminal command). Skill: `release-flows`.
## Listing in more languages
`storebound listing translate --to de,ja` adds a section per language to `store/appstore.md` (name, subtitle,
promotional text, keywords, description) and `store/listing.md` (title, short and full description) with the source
text and a marker, `<!-- storebound-translation from=en-US status=translate -->`. Your agent translates in place
(`listing-localization` skill: native wording, researched keywords, the store limits) and sets `status=draft`; or
`--translate "<command>"` runs a command of yours once per field (source text on stdin, `STOREBOUND_TARGET_LANG`,
`STOREBOUND_FIELD`, `STOREBOUND_LIMIT` in the environment). storebound itself calls no translation service.
`listing check` enforces each store's limits (App Store subtitle 30, promotional text 170, keywords 100 without
duplicates or name words, description 4000; Play title 30, short 80, full 4000) and lists drafts; `storebound check`
warns while one is left. After a human read a draft, `listing reviewed --lang de` removes the marker. Reviewed sections
are never overwritten without `--force`. MCP: `listing_translate`, `listing_check`.
## Every endpoint ## Every endpoint
The commands above cover the journey. For anything else, `storebound api` calls **every operation** of the App Store The commands above cover the journey. For anything else, `storebound api` calls **every operation** of the App Store
@ -672,6 +750,8 @@ navigation.
| `review-replies` | reply drafts, tone, no incentives, store limits, the owner approves and sends | | `review-replies` | reply drafts, tone, no incentives, store limits, the owner approves and sends |
| `store-analytics` | App Store analytics reports, Play reports bucket, before / after listing changes, sales / finance / earnings reports | | `store-analytics` | App Store analytics reports, Play reports bucket, before / after listing changes, sales / finance / earnings reports |
| `whats-new` | player-facing release notes from git, one file per language for your agent to translate, store limits checked | | `whats-new` | player-facing release notes from git, one file per language for your agent to translate, store limits checked |
| `listing-localization` | the listing in more languages: drafts per language, native wording and keyword research, store limits, review before push |
| `release-flows` | repo-local workflows (`store/workflows/*.yml`): release and beta routines with dry runs, resume and the owner's clicks |
| `review-rejections` | triage a rejection (fix / clarify / push back / appeal), reply template, the guidelines apps and games hit | | `review-rejections` | triage a rejection (fix / clarify / push back / appeal), reply template, the guidelines apps and games hit |
| `ads-mediation-checks` | AdMob, AppLovin MAX and LevelPlay: ids, debug tools, adapters, app-ads.txt, SKAdNetwork, AdAttributionKit (`ads scan`), no-fill (`ads-levelplay-checks` stays as a pointer) | | `ads-mediation-checks` | AdMob, AppLovin MAX and LevelPlay: ids, debug tools, adapters, app-ads.txt, SKAdNetwork, AdAttributionKit (`ads scan`), no-fill (`ads-levelplay-checks` stays as a pointer) |
| `portfolio-originality` | Guideline 4.3 gate for developers shipping many similar apps or games, with `storebound originality` scores | | `portfolio-originality` | Guideline 4.3 gate for developers shipping many similar apps or games, with `storebound originality` scores |
@ -686,7 +766,7 @@ per-request `_meta`, `resultType`, cacheable `tools/list`) and, on the same proc
- One tool per command. Read-only: `scan`, `check`, `check_aso`, `validate`, `catalog_diff`, `health`, `reviews_list`, `prices_diff`, - One tool per command. Read-only: `scan`, `check`, `check_aso`, `validate`, `catalog_diff`, `health`, `reviews_list`, `prices_diff`,
`analytics_compare`, `apple_status`, `apple_next_build`, `apple_testflight_status`, `apple_ppo_status`, `analytics_compare`, `apple_status`, `apple_next_build`, `apple_testflight_status`, `apple_ppo_status`,
`play_status`, `play_next_version_code`, `privacy_manifest`, `shots_check`, `workspace_list`, `workspace_status`, `play_status`, `play_next_version_code`, `privacy_manifest`, `shots_check`, `workspace_list`, `workspace_status`,
`release_status`, `release_plan`. Local writes: `import_fastlane`, `whats_new`, `icons`, `release_status`, `release_plan`, `flow_list`, `flow_run` (dry mode only), `listing_check`. Local writes: `import_fastlane`, `whats_new`, `listing_translate`, `icons`,
`play_status`, `play_next_version_code`, `privacy_manifest`, `shots_check`, `api_get` (any App Store Connect or `play_status`, `play_next_version_code`, `privacy_manifest`, `shots_check`, `api_get` (any App Store Connect or
Google Play GET operation by id). Local writes: `import_fastlane`, `whats_new`, `icons`, Google Play GET operation by id). Local writes: `import_fastlane`, `whats_new`, `icons`,
`health_report`, `reviews_draft`, `prices_export`, `analytics_snapshot`, `shots_capture`, `shots_render`, `health_report`, `reviews_draft`, `prices_export`, `analytics_snapshot`, `shots_capture`, `shots_render`,
@ -792,7 +872,7 @@ in 0.4.0. 0.5.0 made storebound app-first (profiles, app screenshot style, accou
brought the full in-app catalog: subscriptions on both stores with offers and offer codes, non-renewing products and brought the full in-app catalog: subscriptions on both stores with offers and offer codes, non-renewing products and
the cross-store `catalog diff`. Next, roughly in this order: the cross-store `catalog diff`. Next, roughly in this order:
- Play prepaid base plans for `non_renewing`, and a `prices export` that includes subscriptions. - Play prepaid base plans for `non_renewing`.
- The App Asset Library (API 4.5.1) for screenshots, custom product pages and in-app events once the screenshot sets - The App Asset Library (API 4.5.1) for screenshots, custom product pages and in-app events once the screenshot sets
it replaces stop working. it replaces stop working.
- Play store listing experiments and their results, as soon as Google offers an API. - Play store listing experiments and their results, as soon as Google offers an API.

View file

@ -81,7 +81,7 @@ export const WRAPPED: { apple: Record<string, string>; play: Record<string, stri
'apps_perfPowerMetrics_getToManyRelated': 'health', 'apps_perfPowerMetrics_getToManyRelated': 'health',
'apps_promotedPurchases_getToManyRelated': 'apple/promoted', 'apps_promotedPurchases_getToManyRelated': 'apple/promoted',
'apps_promotedPurchases_replaceToManyRelationship': 'lib/offers', 'apps_promotedPurchases_replaceToManyRelationship': 'lib/offers',
'apps_subscriptionGroups_getToManyRelated': 'apple/iap-submit apple/promoted apple/subscriptions apple/win-back catalog validate', 'apps_subscriptionGroups_getToManyRelated': 'apple/iap-submit apple/promoted apple/subscriptions apple/win-back catalog prices validate',
'apps_updateInstance': 'apple/appinfo', 'apps_updateInstance': 'apple/appinfo',
'betaAppLocalizations_createInstance': 'lib/testflight', 'betaAppLocalizations_createInstance': 'lib/testflight',
'betaAppLocalizations_updateInstance': 'lib/testflight', 'betaAppLocalizations_updateInstance': 'lib/testflight',
@ -164,7 +164,7 @@ export const WRAPPED: { apple: Record<string, string>; play: Record<string, stri
'subscriptionGroupLocalizations_createInstance': 'apple/subscriptions', 'subscriptionGroupLocalizations_createInstance': 'apple/subscriptions',
'subscriptionGroups_createInstance': 'apple/subscriptions', 'subscriptionGroups_createInstance': 'apple/subscriptions',
'subscriptionGroups_subscriptionGroupLocalizations_getToManyRelated': 'apple/subscriptions validate', 'subscriptionGroups_subscriptionGroupLocalizations_getToManyRelated': 'apple/subscriptions validate',
'subscriptionGroups_subscriptions_getToManyRelated': 'apple/iap-submit apple/promoted apple/subscriptions apple/win-back catalog validate', 'subscriptionGroups_subscriptions_getToManyRelated': 'apple/iap-submit apple/promoted apple/subscriptions apple/win-back catalog prices validate',
'subscriptionGroups_versions_getToManyRelated': 'apple/iap-submit', 'subscriptionGroups_versions_getToManyRelated': 'apple/iap-submit',
'subscriptionLocalizations_createInstance': 'apple/subscriptions', 'subscriptionLocalizations_createInstance': 'apple/subscriptions',
'subscriptionOfferCodeCustomCodes_createInstance': 'apple/subscriptions', 'subscriptionOfferCodeCustomCodes_createInstance': 'apple/subscriptions',
@ -178,7 +178,7 @@ export const WRAPPED: { apple: Record<string, string>; play: Record<string, stri
'subscriptions_introductoryOffers_getToManyRelated': 'apple/subscriptions catalog', 'subscriptions_introductoryOffers_getToManyRelated': 'apple/subscriptions catalog',
'subscriptions_offerCodes_getToManyRelated': 'apple/subscriptions catalog', 'subscriptions_offerCodes_getToManyRelated': 'apple/subscriptions catalog',
'subscriptions_pricePoints_getToManyRelated': 'apple/subscriptions apple/win-back', 'subscriptions_pricePoints_getToManyRelated': 'apple/subscriptions apple/win-back',
'subscriptions_prices_getToManyRelated': 'apple/subscriptions apple/win-back catalog', 'subscriptions_prices_getToManyRelated': 'apple/subscriptions apple/win-back catalog prices',
'subscriptions_promotionalOffers_getToManyRelated': 'apple/subscriptions catalog', 'subscriptions_promotionalOffers_getToManyRelated': 'apple/subscriptions catalog',
'subscriptions_subscriptionAvailability_getToOneRelated': 'apple/subscriptions', 'subscriptions_subscriptionAvailability_getToOneRelated': 'apple/subscriptions',
'subscriptions_subscriptionLocalizations_getToManyRelated': 'apple/subscriptions catalog validate', 'subscriptions_subscriptionLocalizations_getToManyRelated': 'apple/subscriptions catalog validate',
@ -219,6 +219,7 @@ export const WRAPPED: { apple: Record<string, string>; play: Record<string, stri
'androidpublisher.monetization.subscriptions.basePlans.offers.create': 'play/subscriptions', 'androidpublisher.monetization.subscriptions.basePlans.offers.create': 'play/subscriptions',
'androidpublisher.monetization.subscriptions.basePlans.offers.list': 'catalog play/subscriptions', 'androidpublisher.monetization.subscriptions.basePlans.offers.list': 'catalog play/subscriptions',
'androidpublisher.monetization.subscriptions.create': 'play/subscriptions', 'androidpublisher.monetization.subscriptions.create': 'play/subscriptions',
'androidpublisher.monetization.subscriptions.get': 'prices',
'androidpublisher.monetization.subscriptions.list': 'catalog play/subscriptions validate', 'androidpublisher.monetization.subscriptions.list': 'catalog play/subscriptions validate',
'androidpublisher.monetization.subscriptions.patch': 'play/subscriptions', 'androidpublisher.monetization.subscriptions.patch': 'play/subscriptions',
'androidpublisher.reviews.list': 'reviews', 'androidpublisher.reviews.list': 'reviews',

View file

@ -65,6 +65,14 @@ export async function run(ctx: Ctx): Promise<void> {
if (missing.length) note(`appstore listing has no section for ${missing.join(', ')}`); if (missing.length) note(`appstore listing has no section for ${missing.join(', ')}`);
return `${Object.keys(copy).length} locales`; return `${Object.keys(copy).length} locales`;
}); });
// listing translation drafts (storebound listing translate): fine to keep working on, not to push unreviewed
for (const f of [config.apple ? resolve(config.apple.listing ?? 'store/appstore.md') : '', config.play ? resolve(config.play.listing ?? 'store/listing.md') : ''].filter(Boolean)) {
if (!existsSync(f)) continue;
const marks = [...readFileSync(f, 'utf8').matchAll(/^## (\S+)[^\n]*\n(?:<!--\s*play:[^\n]*\n)?<!--\s*storebound-translation\s+from=\S+\s+status=(translate|draft)/gm)];
const todo = marks.filter(m => m[2] === 'translate').map(m => m[1]!), drafts = marks.filter(m => m[2] === 'draft').map(m => m[1]!);
if (todo.length) note(`${relative(process.cwd(), f) || f}: not translated yet (status=translate): ${todo.join(', ')}`);
if (drafts.length) note(`${relative(process.cwd(), f) || f}: machine-translated drafts not reviewed: ${drafts.join(', ')} (storebound listing check, then listing reviewed --lang <ids>)`);
}
if (config.dataSafety) tryDo('data safety', () => `${dataSafetyRows(config.dataSafety!).length - 1} CSV rows`); if (config.dataSafety) tryDo('data safety', () => `${dataSafetyRows(config.dataSafety!).length - 1} CSV rows`);
for (const p of config.products ?? []) for (const [lang, l] of Object.entries(p.listings)) { for (const p of config.products ?? []) for (const [lang, l] of Object.entries(p.listings)) {
if (config.apple && len(l.description) > APPLE_IAP_LIMITS.description) problems.push(`product ${p.id} ${lang}: description ${len(l.description)} > ${APPLE_IAP_LIMITS.description} (App Store limit)`); if (config.apple && len(l.description) > APPLE_IAP_LIMITS.description) problems.push(`product ${p.id} ${lang}: description ${len(l.description)} > ${APPLE_IAP_LIMITS.description} (App Store limit)`);

220
cli/flow.ts Normal file
View file

@ -0,0 +1,220 @@
// Repo-local workflows: named, ordered storebound steps kept in the project (definitions and rules: lib/flow.ts).
// storebound flow list [--json] the flows of this project and their steps
// storebound flow validate [--json] definitions, sub-flow cycles, commands, variables; exit 1 on a problem
// storebound flow run <name> [NAME=value ...] [--dry | --apply] [--from <step> | --resume] [--json]
// default: read steps run, write steps run with --dry (nothing changes), wait steps check once, shell steps are
// skipped, owner steps (submit, release, rollout ...) are shown as "your click" and never run
// --dry: only the plan: nothing runs at all
// --apply: write steps and shell steps run for real; every write command still asks the owner itself
// --from <step>: start at that step (variables captured by the last run are reused); --resume: from the first step
// the last run did not finish (.storebound/flows/<name>.json)
// Progress: "[flow] 3/9 upload: storebound apple upload --no-wait --dry" before each step, the step's own output
// indented, then ok / failed with the time. Exit 1 when a step failed (and had no continueOnError).
import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';
import { dirname, join, relative } from 'node:path';
import type { Args } from './lib/args';
import { CONFIG_NAMES, loadConfig } from './lib/config';
import {
type CondCtx, expand, type Flow, flowsOfFile, kindOf, type Mode, parseParams, planStep, type PlannedStep, resumePoint, type RunState, startIndex,
type StepResult, validateFlows,
} from './lib/flow';
import { done, log, printJson, step, warn } from './lib/log';
import { childEnv, pump, selfCommand } from './lib/runner';
import { parseYaml } from './lib/yaml';
const TAG = 'flow';
const EXT = ['.yml', '.yaml', '.json', '.ts'];
/** Project folder: the folder of the nearest storebound.config.* above the working directory, else the working directory. */
export function projectRoot(start = process.cwd()): string {
for (let d = start; ; d = dirname(d)) {
if (CONFIG_NAMES.some(n => existsSync(join(d, n))) || existsSync(join(d, 'store', 'workflows'))) return d;
if (dirname(d) === d) return start;
}
}
async function readData(path: string): Promise<unknown> {
if (path.endsWith('.ts')) { const m = await import(path) as { default?: unknown }; return m.default; }
const text = readFileSync(path, 'utf8');
if (path.endsWith('.json')) return JSON.parse(text);
return parseYaml(text);
}
/** Every flow file of a project, read and checked. */
export async function loadFlows(root: string): Promise<{ flows: Flow[]; errors: string[]; files: string[] }> {
const flows: Flow[] = [], errors: string[] = [], files: string[] = [];
const add = async (path: string, single: string | null) => {
const rel = relative(root, path);
files.push(rel);
try { const r = flowsOfFile(rel, await readData(path), single); flows.push(...r.flows); errors.push(...r.errors); }
catch (e) { errors.push(`${rel}: ${(e as Error).message}`); }
};
for (const ext of EXT) { const p = join(root, `storebound.workflows${ext}`); if (existsSync(p)) await add(p, null); }
const dir = join(root, 'store', 'workflows');
if (existsSync(dir)) for (const f of readdirSync(dir).sort()) { const ext = EXT.find(x => f.endsWith(x)); if (ext) await add(join(dir, f), f.slice(0, -ext.length)); }
return { flows, errors, files };
}
/** Command names of this storebound (from `storebound help`), for `flow validate`. */
function commandNames(): Set<string> {
const r = Bun.spawnSync([...selfCommand(), 'help'], { stdout: 'pipe', stderr: 'pipe' });
const names = new Set<string>(['help', 'version']);
for (const l of r.stdout.toString().split('\n')) if (/^ {2}[a-z]/.test(l)) { const n = l.slice(2, 27).trim(); if (n && !n.includes(':')) names.add(n); }
return names;
}
function statePath(root: string, name: string): string { return join(root, '.storebound', 'flows', `${name}.json`); }
function readState(root: string, name: string): RunState | null {
try { return JSON.parse(readFileSync(statePath(root, name), 'utf8')) as RunState; } catch { return null; }
}
async function condCtx(root: string): Promise<CondCtx> {
let apple = false, play = false;
try { const { config } = await loadConfig(undefined, root); apple = !!config.apple; play = !!config.play; } catch { /* no config: store conditions are false */ }
return { apple, play, exists: p => existsSync(join(root, p)) };
}
const KIND_LABEL: Record<string, string> = { read: 'read', write: 'write', wait: 'wait', owner: 'your click', shell: 'shell' };
function describe(p: PlannedStep): string {
if (p.owner !== undefined) return p.owner;
if (p.shell !== undefined) return `sh: ${p.shell}`;
return `storebound ${p.argv!.join(' ')}`;
}
/** Runs one storebound step (or shell line) with stdin attached, so the command's own confirmation works; output indented. */
async function exec(p: PlannedStep, root: string, quiet: boolean): Promise<{ code: number; last: string; out: string }> {
const cmd = p.shell !== undefined ? ['sh', '-c', p.shell] : [...selfCommand(), ...p.argv!];
const proc = Bun.spawn(cmd, { cwd: root, stdin: 'inherit', stdout: 'pipe', stderr: 'pipe', env: childEnv() });
const lines: string[] = [];
let last = '';
const each = (line: string, kind: 'stdout' | 'stderr') => {
lines.push(line);
if (kind === 'stdout' && line.trim()) last = line.trim();
if (!quiet) (kind === 'stderr' ? console.error : console.log)(` ${line}`);
};
await Promise.all([pump(proc.stdout, 'stdout', each), pump(proc.stderr, 'stderr', each)]);
return { code: await proc.exited, last, out: lines.join('\n') };
}
async function list(args: Args, root: string): Promise<void> {
const { flows, errors, files } = await loadFlows(root);
const all = new Map(flows.map(f => [f.name, f] as const));
const shown = flows.filter(f => !f.private);
const rows = shown.map(f => ({ name: f.name, file: f.file, description: f.description ?? '', params: f.params,
steps: expand(f, all).steps.map(s => ({ id: s.id, kind: kindOf(s), what: s.run ?? s.sh ?? s.owner ?? '' })) }));
if (args.has('json')) { printJson({ root, files, flows: rows, errors }); return; }
if (!files.length) { log(TAG, 'no flows here: storebound init --profile app|game writes store/workflows/release.yml and beta.yml, or add storebound.workflows.yml'); return; }
for (const f of rows) {
console.log(`\n${f.name} (${f.file})${f.description ? ` ${f.description}` : ''}`);
if (Object.keys(f.params).length) console.log(` params: ${Object.entries(f.params).map(([k, v]) => `${k}=${v || '""'}`).join(' ')}`);
f.steps.forEach((s, i) => console.log(` ${String(i + 1).padStart(2)}. ${s.id.padEnd(18)} ${KIND_LABEL[s.kind]!.padEnd(10)} ${s.what}`));
}
for (const e of errors) warn(TAG, e);
if (errors.length) process.exitCode = 1;
}
async function validate(args: Args, root: string): Promise<void> {
const { flows, errors, files } = await loadFlows(root);
const problems = [...errors, ...validateFlows(flows, { commands: commandNames() })];
if (args.has('json')) printJson({ root, files, flows: flows.map(f => f.name), problems, ok: !problems.length });
else {
for (const p of problems) warn(TAG, p);
done(TAG, problems.length ? `${problems.length} problem(s) in ${files.length} file(s)` : `${flows.length} flow(s) in ${files.length} file(s): ok`);
}
if (problems.length) process.exitCode = 1;
}
async function runFlow(args: Args, root: string): Promise<void> {
const name = args._[1];
if (!name) throw new Error('usage: storebound flow run <name> [NAME=value ...] [--dry | --apply] [--from <step> | --resume]');
if (args.has('dry') && args.has('apply')) throw new Error('--dry or --apply, not both');
const { flows, errors } = await loadFlows(root);
const problems = [...errors, ...validateFlows(flows)];
if (problems.length) throw new Error(`flow definitions have problems (storebound flow validate):\n ${problems.join('\n ')}`);
const all = new Map(flows.map(f => [f.name, f] as const));
const flow = all.get(name);
if (!flow || flow.private) throw new Error(`no flow "${name}" (${flows.filter(f => !f.private).map(f => f.name).join(', ') || 'none: storebound flow list'})`);
const mode: Mode = args.has('apply') ? 'apply' : args.has('dry') ? 'plan' : 'dry';
const json = args.has('json');
const parts = { before: expand(flow, all, 'before').steps, steps: expand(flow, all, 'steps').steps, after: expand(flow, all, 'after').steps, onError: expand(flow, all, 'onError').steps };
const last = readState(root, name);
if (args.has('resume') && args.has('from')) throw new Error('--from or --resume, not both');
const from = args.has('resume') ? resumePoint(parts.steps, last) : args.get('from');
if (args.has('resume') && !from) throw new Error(last ? `the last run of ${name} finished every step; nothing to resume` : `no earlier run of ${name} to resume`);
const begin = startIndex(parts.steps, from);
const params = parseParams(args._.slice(2));
const subParams = expand(flow, all, 'steps').params;
const vars: Record<string, string> = { ...subParams, ...flow.params, ...(from ? last?.vars ?? {} : {}), ...params };
const c = await condCtx(root);
const state: RunState = { flow: name, mode, startedAt: new Date().toISOString(), vars, results: [], ok: true };
const env = process.env as Record<string, string | undefined>;
const save = () => { if (mode === 'plan') return; mkdirSync(dirname(statePath(root, name)), { recursive: true }); writeFileSync(statePath(root, name), JSON.stringify(state, null, 2) + '\n'); };
if (!json) {
log(TAG, `${name}${flow.description ? `: ${flow.description}` : ''}`);
log(TAG, mode === 'plan' ? 'plan only (--dry): nothing runs' : mode === 'dry' ? 'reads run, writes run as dry runs (--apply runs them for real), owner steps are yours' : '--apply: writes run for real; each command asks before it changes a store');
if (from) log(TAG, `starting at ${parts.steps[begin]!.id}${args.has('resume') ? ' (--resume)' : ''}`);
}
// results of the steps before --from carry over, so a later --resume knows they are done
if (from && last) state.results.push(...last.results.filter(r => r.part === 'steps' && parts.steps.slice(0, begin).some(s => s.id === r.id)));
const runPart = async (part: PlannedStep['part'], steps: typeof parts.steps, offset = 0): Promise<boolean> => {
for (let i = offset; i < steps.length; i++) {
const s = steps[i]!;
const p = planStep(s, part, mode, vars, c, env);
const label = `${part === 'steps' ? '' : `${part} `}${step(i + 1, steps.length, s.id)}`;
const r: StepResult = { id: s.id, part, kind: p.kind, status: 'planned', command: describe(p) };
if (p.skip) {
r.status = p.kind === 'owner' && !p.skip.startsWith('if ') ? 'owner' : mode === 'plan' && !p.skip.startsWith('if ') && p.kind !== 'shell' ? 'planned' : 'skipped';
r.detail = p.skip;
if (!json) log(TAG, `${label}: ${p.kind === 'owner' && r.status === 'owner' ? `YOUR CLICK ${describe(p)}` : `${describe(p)} (${p.skip})`}`);
state.results.push(r); save();
continue;
}
if (!json) log(TAG, `${label}: ${describe(p)}${p.dryAdded ? ' (dry run)' : ''}`);
const t = Date.now();
const x = await exec(p, root, json);
r.exitCode = x.code; r.ms = Date.now() - t;
if (x.code === 0) {
r.status = 'ok';
if (p.capture) {
if (/^[\w.:/@+-]{1,200}$/.test(x.last)) { vars[p.capture] = x.last; r.detail = `${p.capture}=${x.last}`; }
else warn(TAG, `${s.id}: capture ${p.capture}: the last output line is not a single value ("${x.last.slice(0, 60)}")`);
}
if (!json) log(TAG, `${label}: ok (${(r.ms / 1000).toFixed(1)}s)${r.detail ? ` ${r.detail}` : ''}`);
} else {
r.status = 'failed';
r.detail = x.out.split('\n').filter(Boolean).slice(-1)[0]?.slice(0, 300);
if (!json) warn(TAG, `${label}: failed (exit ${x.code})${p.continueOnError ? ', continueOnError: going on' : ''}`);
}
state.vars = vars; state.results.push(r); save();
if (r.status === 'failed' && !p.continueOnError) return false;
}
return true;
};
let ok = (await runPart('before', parts.before)) && (await runPart('steps', parts.steps, begin));
if (ok) ok = await runPart('after', parts.after);
else if (parts.onError.length) await runPart('onError', parts.onError);
state.ok = ok; state.finishedAt = new Date().toISOString(); save();
const owner = state.results.filter(r => r.status === 'owner');
if (json) printJson({ ...state, stateFile: mode === 'plan' ? null : relative(root, statePath(root, name)) });
else {
if (owner.length) { console.log('\nYour clicks (storebound never does these):'); for (const r of owner) console.log(` - ${r.command}`); }
const failed = state.results.find(r => r.status === 'failed' && r.part === 'steps');
if (!ok && failed) log(TAG, `stopped at ${failed.id}. Fix it, then: storebound flow run ${name} --resume${mode === 'apply' ? ' --apply' : ''}`);
done(TAG, `${name}: ${ok ? 'done' : 'failed'} (${mode === 'plan' ? 'plan only' : mode === 'dry' ? 'dry run: nothing changed' : 'applied'})`);
}
if (!ok) process.exitCode = 1;
}
export async function run(args: Args): Promise<void> {
const root = projectRoot();
const sub = args._[0] ?? 'list';
if (sub === 'list') return list(args, root);
if (sub === 'validate') return validate(args, root);
if (sub === 'run') return runFlow(args, root);
throw new Error('usage: storebound flow list | validate | run <name> [NAME=value ...] [--dry | --apply] [--from <step> | --resume]');
}

View file

@ -23,6 +23,7 @@ const PLAIN: Record<string, [() => Promise<Plain>, string]> = {
'privacy-manifest': [() => import('./privacy-manifest'), 'iOS PrivacyInfo.xcprivacy + required-reason API + SDK manifest scan (--ios <path>)'], 'privacy-manifest': [() => import('./privacy-manifest'), 'iOS PrivacyInfo.xcprivacy + required-reason API + SDK manifest scan (--ios <path>)'],
'ws': [() => import('./workspace'), 'many apps and studios (storebound.workspace.json): init | list | status (apps x stores, parallel) | check | validate | run <command> --apps a,b|--all (writes dry unless --apply) | apps import --account <profile> | desktop export|import'], 'ws': [() => import('./workspace'), 'many apps and studios (storebound.workspace.json): init | list | status (apps x stores, parallel) | check | validate | run <command> --apps a,b|--all (writes dry unless --apply) | apps import --account <profile> | desktop export|import'],
'release': [() => import('./release'), 'status [--app a,b] [--versions]: both stores on one train per version (build > testing > review > live > rollout %) | plan <version>: what is left on each store, in fix order; read-only, --json'], 'release': [() => import('./release'), 'status [--app a,b] [--versions]: both stores on one train per version (build > testing > review > live > rollout %) | plan <version>: what is left on each store, in fix order; read-only, --json'],
'flow': [() => import('./flow'), 'repo-local workflows (store/workflows/*.yml, storebound.workflows.*): list | validate | run <name> [NAME=value] [--dry plan only | --apply] [--from <step> | --resume]; writes run as dry runs unless --apply, owner steps (submit, release, rollout) are never run'],
'ads': [() => import('./ads'), 'scan --ios <path>: AdAttributionKit / SKAdNetwork checks of Info.plist (network ids, postback copy endpoints, attribution windows, cooldown) and sources; --json'], 'ads': [() => import('./ads'), 'scan --ios <path>: AdAttributionKit / SKAdNetwork checks of Info.plist (network ids, postback copy endpoints, attribution windows, cooldown) and sources; --json'],
}; };
const COMMANDS: Record<string, [() => Promise<Mod>, string]> = { const COMMANDS: Record<string, [() => Promise<Mod>, string]> = {
@ -42,6 +43,7 @@ const COMMANDS: Record<string, [() => Promise<Mod>, string]> = {
'console fill': [() => import('./console/fill'), '<form> [--store apple|play]: AI-assisted autofill of console forms without an API in a visible Chromium you sign in to yourself; stops before Save / Submit'], 'console fill': [() => import('./console/fill'), '<form> [--store apple|play]: AI-assisted autofill of console forms without an API in a visible Chromium you sign in to yourself; stops before Save / Submit'],
'reviews': [() => import('./reviews'), 'list | draft (local reply drafts in .storebound/replies) | send (approved drafts only, asks first)'], 'reviews': [() => import('./reviews'), 'list | draft (local reply drafts in .storebound/replies) | send (approved drafts only, asks first)'],
'originality': [() => import('./originality'), 'Guideline 4.3 check vs your other apps (--against <folders>): listing text, name, icon and screenshot perceptual hashes, project structure; scores, flags, suggestions; offline, exit 1 on a near-duplicate'], 'originality': [() => import('./originality'), 'Guideline 4.3 check vs your other apps (--against <folders>): listing text, name, icon and screenshot perceptual hashes, project structure; scores, flags, suggestions; offline, exit 1 on a near-duplicate'],
'listing': [() => import('./listing'), 'translate --to de-DE,ja [--from en-US] [--translate "<command>"]: listing translation drafts per language (App Store name, subtitle, promo text, keywords, description; Play title, short, full) with store limits and keyword rules, marked until reviewed | check | reviewed --lang <ids>; local files only'],
'whats-new': [() => import('./whats-new'), 'draft user-facing release notes from git log into the listing files (--since <tag>); --languages a,b: one file per language to translate | check | apply'], 'whats-new': [() => import('./whats-new'), 'draft user-facing release notes from git log into the listing files (--since <tag>); --languages a,b: one file per language to translate | check | apply'],
'play products': [() => import('./play/products'), 'one-time products: create / update, regional prices, activate'], 'play products': [() => import('./play/products'), 'one-time products: create / update, regional prices, activate'],
'play subscriptions': [() => import('./play/subscriptions'), 'auto-renewable subscriptions: listings, base plan, regional prices, intro offer, activate (--csv prices sheet; asks first)'], 'play subscriptions': [() => import('./play/subscriptions'), 'auto-renewable subscriptions: listings, base plan, regional prices, intro offer, activate (--csv prices sheet; asks first)'],

View file

@ -23,6 +23,8 @@ export const FILES: [string, string][] = [
['privacy-policy.html', 'store/privacy-policy.html'], ['privacy-policy.html', 'store/privacy-policy.html'],
['credentials.example.json', '.storebound/credentials.json'], ['credentials.example.json', '.storebound/credentials.json'],
['testers.csv', '.storebound/testers.csv'], ['testers.csv', '.storebound/testers.csv'],
['workflows/release.yml', 'store/workflows/release.yml'],
['workflows/beta.yml', 'store/workflows/beta.yml'],
]; ];
/** Template folders a profile reads from (relative to templates/), most specific first. game = the root templates. */ /** Template folders a profile reads from (relative to templates/), most specific first. game = the root templates. */
@ -67,5 +69,5 @@ export async function run(args: Args): Promise<void> {
else writeFileSync(gi, '# storebound: credentials, fonts, temp files\n.storebound/\n'); else writeFileSync(gi, '# storebound: credentials, fonts, temp files\n.storebound/\n');
log('init', '.gitignore: added .storebound/'); log('init', '.gitignore: added .storebound/');
} }
log('init', 'next: edit storebound.config.ts, store/*.md and .storebound/credentials.json, then `storebound check`'); log('init', 'next: edit storebound.config.ts, store/*.md and .storebound/credentials.json, then `storebound check`; store/workflows/*.yml: storebound flow list');
} }

View file

@ -15,7 +15,7 @@ export function parseArgs(argv: string[], booleans: string[] = []): Args {
const repeated = new Map<string, string[]>(); const repeated = new Map<string, string[]>();
const set = (k: string, v: string) => { flags.set(k, v); repeated.set(k, [...(repeated.get(k) ?? []), v]); }; const set = (k: string, v: string) => { flags.set(k, v); repeated.set(k, [...(repeated.get(k) ?? []), v]); };
const _: string[] = []; const _: string[] = [];
const bool = new Set(['dry', 'yes', 'help', 'json', 'verbose', 'all-pages', ...booleans]); const bool = new Set(['dry', 'yes', 'help', 'json', 'verbose', 'all-pages', 'apply', 'resume', 'force', ...booleans]);
for (let i = 0; i < argv.length; i++) { for (let i = 0; i < argv.length; i++) {
const a = argv[i]!; const a = argv[i]!;
if (!a.startsWith('--')) { _.push(a); continue; } if (!a.startsWith('--')) { _.push(a); continue; }

320
cli/lib/flow.ts Normal file
View file

@ -0,0 +1,320 @@
// Repo-local workflows (`storebound flow`): named, ordered storebound steps kept in the project, e.g. a release flow
// next-build -> build -> upload -> wait -> whats-new apply -> validate -> scan -> plan -> your Submit click. Pure parts:
// reading and checking the definitions, classifying each step (read / write / owner / shell / wait), variables, `if`
// conditions and the run plan. The runner is cli/flow.ts.
//
// Where flows live (all are read; a name defined twice is an error):
// storebound.workflows.(yml|yaml|json|ts) several flows: { flows: { <name>: Flow } } or { <name>: Flow }
// store/workflows/<name>.(yml|yaml|json|ts) one flow per file, named after the file
// A flow:
// description: text
// params: { VERSION: "1.0.0" } defaults; `flow run release VERSION=1.2.0` overrides
// before: [steps] steps: [steps] after: [steps] onError: [steps] (hooks: before / after the steps, on a failure)
// private: true only usable as a sub-flow (`flow: <name>` step), not listed or run directly
// A step (exactly one of run / sh / owner / flow):
// id: next-build unique in the flow; `--from <id>` resumes there
// run: apple next-build a storebound command line (no "storebound" prefix); ${VAR} substituted
// sh: npm run build:web a shell command of yours: only runs with --apply
// owner: "App Store Connect: Submit for Review" never run: shown as "your click"
// flow: beta the steps of another flow (ids prefixed "beta.")
// capture: BUILD the last stdout line becomes ${BUILD} for later steps
// if: apple | play | exists <path> | ${VAR} | !${VAR} | ${A} == x | ${A} != x
// continueOnError: true a failure is reported and the flow goes on
// Safety: write steps run with --dry unless `flow run --apply`; `--yes` is refused in any step (the commands ask the
// owner themselves); owner steps (submit, release, rollout, sending replies, price changes, inviting testers, starting
// experiments ...) are never executed, also when written as `run:`.
export type StepKind = 'read' | 'write' | 'wait' | 'owner' | 'shell';
export interface FlowStep {
id: string;
run?: string;
sh?: string;
owner?: string;
flow?: string;
capture?: string;
if?: string;
continueOnError?: boolean;
/** Free text shown next to the step. */
note?: string;
}
export interface Flow {
name: string;
file: string;
description?: string;
params: Record<string, string>;
before: FlowStep[];
steps: FlowStep[];
after: FlowStep[];
onError: FlowStep[];
private: boolean;
}
/** Commands that only read (stores or local files); they run for real in every mode except a --dry plan. */
const READ: string[][] = [
['check'], ['validate'], ['scan'], ['inspect'], ['doctor'], ['apps'], ['release', 'status'], ['release', 'plan'], ['originality'],
['apple', 'next-build'], ['play', 'next-version-code'], ['apple', 'status'], ['play', 'status'], ['health'], ['catalog', 'diff'], ['triage'],
['shots', 'check'], ['whats-new', 'check'], ['listing', 'check'], ['apple', 'testflight', 'status'], ['apple', 'testflight', 'groups'],
['apple', 'signing', 'status'], ['apple', 'preorder', 'status'], ['apple', 'cpp', 'list'], ['apple', 'events', 'list'], ['ads', 'scan'],
['privacy-manifest'], ['apple', 'encryption'], ['ws', 'list'], ['ws', 'status'], ['ws', 'check'], ['ws', 'validate'], ['apple', 'adhoc', 'devices'],
['revenuecat', 'diff'], ['ads', 'apple', 'status'], ['ads', 'apple', 'campaigns'], ['ads', 'apple', 'report'], ['analytics', 'compare'],
];
/** Waits for a store (build processing): with --dry it checks once instead of waiting. */
const WAIT: string[][] = [['apple', 'testflight', 'wait']];
/** Never executed by a flow: the owner does these (AGENTS.md rule 1). */
const OWNER: string[][] = [
['apple', 'release'], ['play', 'rollout'], ['reviews', 'send'], ['prices', 'import'], ['apple', 'iap-submit'], ['apple', 'ppo', 'start'], ['apple', 'ppo', 'stop'],
['apple', 'cpp', 'submit'], ['apple', 'cpp', 'visible'], ['apple', 'events', 'submit'], ['apple', 'preorder', 'enable'], ['apple', 'preorder', 'end'],
['apple', 'testflight', 'testers'], ['apple', 'testflight', 'expire'], ['apple', 'offer-codes'], ['apple', 'win-back'], ['ads', 'apple', 'bid'],
['ads', 'apple', 'budget'], ['ads', 'apple', 'pause'], ['apple', 'adhoc', 'register'],
];
const OWNER_ARGS = ['--submit-review', '--manual-release', '--cancel-submission', '--production', '--phased', 'submit', 'publish', '--remove', '--invite'];
/** Never allowed inside a flow step. */
const REFUSED_ARGS = ['--yes', '--apply'];
/** Words of a command line, honouring "double" and 'single' quotes. */
export function splitArgs(line: string): string[] {
const out: string[] = [];
let cur = '', q: string | null = null, any = false;
for (const c of line.trim()) {
if (q) { if (c === q) q = null; else cur += c; continue; }
if (c === '"' || c === '\'') { q = c; any = true; continue; }
if (/\s/.test(c)) { if (cur || any) out.push(cur); cur = ''; any = false; continue; }
cur += c;
}
if (q) throw new Error(`unterminated quote in: ${line}`);
if (cur || any) out.push(cur);
return out;
}
const words = (argv: string[]): string[] => { const w: string[] = []; for (const a of argv) { if (a.startsWith('-')) break; w.push(a); } return w; };
const starts = (w: string[], p: string[]) => p.length <= w.length && p.every((x, i) => w[i] === x);
/** What a `run:` step is. */
export function classify(argv: string[]): StepKind {
const w = words(argv);
if (OWNER.some(p => starts(w, p)) || argv.some(a => OWNER_ARGS.includes(a))) return argv.includes('--dry') && !argv.some(a => OWNER_ARGS.includes(a)) ? 'read' : 'owner';
if (WAIT.some(p => starts(w, p))) return 'wait';
if (READ.some(p => starts(w, p))) return 'read';
// `api` reads run, writes stay dry inside the command itself; treat it as a write so it gets --dry
return 'write';
}
export const kindOf = (s: FlowStep, argv?: string[]): StepKind =>
s.owner !== undefined ? 'owner' : s.sh !== undefined ? 'shell' : classify(argv ?? splitArgs(s.run ?? ''));
// ---- loading ----
const ID_RE = /^[a-z0-9][a-z0-9._-]{0,62}$/;
const VAR_RE = /^[A-Z][A-Z0-9_]{0,40}$/;
const STEP_KEYS = ['id', 'run', 'sh', 'owner', 'flow', 'capture', 'if', 'continueOnError', 'note'];
const FLOW_KEYS = ['description', 'params', 'before', 'steps', 'after', 'onError', 'private'];
function asSteps(v: unknown, where: string, e: string[]): FlowStep[] {
if (v === undefined || v === null) return [];
if (!Array.isArray(v)) { e.push(`${where}: must be a list of steps`); return []; }
const out: FlowStep[] = [];
v.forEach((x, i) => {
const at = `${where}[${i}]`;
if (typeof x !== 'object' || x === null || Array.isArray(x)) { e.push(`${at}: a step is a map (id, run | sh | owner | flow, ...)`); return; }
const o = x as Record<string, unknown>;
for (const k of Object.keys(o)) if (!STEP_KEYS.includes(k)) e.push(`${at}: unknown key "${k}" (${STEP_KEYS.join(', ')})`);
const kinds = ['run', 'sh', 'owner', 'flow'].filter(k => o[k] !== undefined);
if (kinds.length !== 1) e.push(`${at}: exactly one of run, sh, owner, flow`);
for (const k of ['id', 'run', 'sh', 'owner', 'flow', 'capture', 'if', 'note']) if (o[k] !== undefined && typeof o[k] !== 'string') e.push(`${at}.${k}: must be a string`);
const id = typeof o.id === 'string' ? o.id : typeof o.flow === 'string' ? o.flow : '';
if (!ID_RE.test(id)) e.push(`${at}.id: "${id}" (lowercase letters, digits, . _ -)`);
if (o.capture !== undefined && !VAR_RE.test(String(o.capture))) e.push(`${at}.capture: an UPPER_CASE name`);
if (o.continueOnError !== undefined && typeof o.continueOnError !== 'boolean') e.push(`${at}.continueOnError: true or false`);
out.push({ ...(o as unknown as FlowStep), id });
});
return out;
}
/** One flow definition (already parsed from YAML / JSON / TS) -> Flow, with every problem. */
export function toFlow(name: string, file: string, v: unknown): { flow: Flow | null; errors: string[] } {
const e: string[] = [];
const at = `${file}: ${name}`;
if (!ID_RE.test(name)) e.push(`${at}: flow name must be lowercase letters, digits, . _ -`);
if (typeof v !== 'object' || v === null || Array.isArray(v)) return { flow: null, errors: [...e, `${at}: a flow is a map (description, params, steps, ...)`] };
const o = v as Record<string, unknown>;
for (const k of Object.keys(o)) if (!FLOW_KEYS.includes(k)) e.push(`${at}: unknown key "${k}" (${FLOW_KEYS.join(', ')})`);
const params: Record<string, string> = {};
if (o.params !== undefined) {
if (typeof o.params !== 'object' || o.params === null || Array.isArray(o.params)) e.push(`${at}.params: a map of NAME: default`);
else for (const [k, val] of Object.entries(o.params)) {
if (!VAR_RE.test(k)) e.push(`${at}.params.${k}: UPPER_CASE names`);
params[k] = val === null || val === undefined ? '' : String(val);
}
}
const flow: Flow = {
name, file, ...(typeof o.description === 'string' ? { description: o.description } : {}), params,
before: asSteps(o.before, `${at}.before`, e), steps: asSteps(o.steps, `${at}.steps`, e), after: asSteps(o.after, `${at}.after`, e),
onError: asSteps(o.onError, `${at}.onError`, e), private: o.private === true,
};
if (!flow.steps.length) e.push(`${at}: no steps`);
return { flow, errors: e };
}
/** Flows of one file: a single-flow file (store/workflows/<name>.*) or a multi-flow file (storebound.workflows.*). */
export function flowsOfFile(file: string, data: unknown, single: string | null): { flows: Flow[]; errors: string[] } {
if (single) { const r = toFlow(single, file, data); return { flows: r.flow ? [r.flow] : [], errors: r.errors }; }
if (typeof data !== 'object' || data === null || Array.isArray(data)) return { flows: [], errors: [`${file}: expected a map of flows`] };
const d = data as Record<string, unknown>;
const map = (d.flows && typeof d.flows === 'object' && !Array.isArray(d.flows) ? d.flows : d) as Record<string, unknown>;
const flows: Flow[] = [], errors: string[] = [];
for (const [n, v] of Object.entries(map)) { const r = toFlow(n, file, v); if (r.flow) flows.push(r.flow); errors.push(...r.errors); }
return { flows, errors };
}
/** Steps with `flow:` sub-flows expanded (ids prefixed), with cycle and unknown-flow errors. */
export function expand(flow: Flow, all: Map<string, Flow>, part: 'before' | 'steps' | 'after' | 'onError' = 'steps', stack: string[] = []): { steps: FlowStep[]; errors: string[]; params: Record<string, string> } {
const errors: string[] = [];
const out: FlowStep[] = [];
const params: Record<string, string> = {};
for (const s of flow[part]) {
if (s.flow === undefined) { out.push(s); continue; }
const sub = all.get(s.flow);
if (!sub) { errors.push(`${flow.name}: step ${s.id}: no flow "${s.flow}"`); continue; }
if ([...stack, flow.name].includes(sub.name)) { errors.push(`${flow.name}: cycle ${[...stack, flow.name, sub.name].join(' -> ')}`); continue; }
const r = expand(sub, all, 'steps', [...stack, flow.name]);
errors.push(...r.errors);
for (const [k, v] of Object.entries({ ...sub.params, ...r.params })) if (!(k in params)) params[k] = v;
for (const x of r.steps) out.push({ ...x, id: `${s.id}.${x.id}`, ...(s.if && x.if ? { if: `${s.if} && ${x.if}` } : s.if ? { if: s.if } : {}) });
}
return { steps: out, errors, params };
}
/** Everything wrong with a set of flows: duplicate names and ids, refused args, unknown commands and variables. */
export function validateFlows(flows: Flow[], o: { commands?: Set<string> } = {}): string[] {
const e: string[] = [];
const all = new Map<string, Flow>();
for (const f of flows) { if (all.has(f.name)) e.push(`flow "${f.name}" is defined in ${all.get(f.name)!.file} and ${f.file}`); else all.set(f.name, f); }
for (const f of all.values()) {
const vars = new Set(Object.keys(f.params));
for (const part of ['before', 'steps', 'after', 'onError'] as const) {
const r = expand(f, all, part);
e.push(...r.errors);
for (const k of Object.keys(r.params)) vars.add(k);
const ids = new Set<string>();
for (const s of r.steps) {
const at = `${f.name}: ${part === 'steps' ? '' : `${part} `}step ${s.id}`;
if (ids.has(s.id)) e.push(`${at}: id used twice`);
ids.add(s.id);
for (const t of [s.run, s.sh, s.owner, s.if].filter((x): x is string => typeof x === 'string'))
for (const m of t.matchAll(/\$\{([^}]*)\}/g)) if (!vars.has(m[1]!) && !/^env\.[A-Z0-9_]+$/.test(m[1]!)) e.push(`${at}: \${${m[1]}} is not a param or an earlier capture`);
if (s.capture) vars.add(s.capture);
if (s.run !== undefined) {
let argv: string[] = [];
try { argv = splitArgs(s.run); } catch (x) { e.push(`${at}: ${(x as Error).message}`); continue; }
if (!argv.length) { e.push(`${at}: empty run`); continue; }
if (argv[0] === 'storebound') e.push(`${at}: write the command without "storebound" (run: ${argv.slice(1).join(' ')})`);
if (argv[0] === 'flow') e.push(`${at}: use a "flow: <name>" step instead of run: flow ...`);
const bad = argv.find(a => REFUSED_ARGS.includes(a.split('=')[0]!));
if (bad) e.push(`${at}: ${bad} is not allowed in a flow (writes are confirmed by the owner, --apply is for flow run)`);
if (o.commands) {
const w = words(argv);
const known = o.commands.has(`${w[0]} ${w[1]}`) || o.commands.has(`${w[0]} ${w[1]} ${w[2]}`) || o.commands.has(w[0] ?? '');
if (!known && argv[0] !== 'storebound' && argv[0] !== 'flow') e.push(`${at}: "${w.slice(0, 2).join(' ')}" is not a storebound command`);
}
}
if (s.if !== undefined && !/\S/.test(s.if)) e.push(`${at}: empty if`);
}
}
}
return e;
}
// ---- variables, conditions ----
/** ${VAR} and ${env.NAME} substituted; unknown ones stay as written (the plan shows them). */
export function substitute(text: string, vars: Record<string, string>, env: Record<string, string | undefined> = {}): string {
return text.replace(/\$\{([^}]*)\}/g, (m, k: string) => (k.startsWith('env.') ? env[k.slice(4)] ?? m : vars[k] ?? m));
}
export interface CondCtx { apple: boolean; play: boolean; exists(path: string): boolean }
/** `if:` after substitution: apple | play | exists <path> | !x | a == b | a != b | x (non-empty, not false / 0); && joins. */
export function evalIf(expr: string, c: CondCtx): boolean {
return expr.split('&&').every(part => {
const s = part.trim();
if (s.startsWith('!')) return !evalIf(s.slice(1), c);
if (s === 'apple') return c.apple;
if (s === 'play') return c.play;
const ex = /^exists\s+(.+)$/.exec(s);
if (ex) return c.exists(ex[1]!.trim());
const cmp = /^(.*?)\s*(==|!=)\s*(.*)$/.exec(s);
if (cmp) { const eq = cmp[1]!.trim() === cmp[3]!.trim(); return cmp[2] === '==' ? eq : !eq; }
return s !== '' && s !== 'false' && s !== '0' && !/^\$\{[^}]*\}$/.test(s);
});
}
/** `KEY=value` positionals of `flow run <name> KEY=value ...`. */
export function parseParams(args: string[]): Record<string, string> {
const out: Record<string, string> = {};
for (const a of args) {
const i = a.indexOf('=');
if (i < 1 || !VAR_RE.test(a.slice(0, i))) throw new Error(`"${a}": parameters are NAME=value (UPPER_CASE name)`);
out[a.slice(0, i)] = a.slice(i + 1);
}
return out;
}
// ---- the plan ----
export type Mode = 'plan' | 'dry' | 'apply';
export interface PlannedStep {
id: string;
part: 'before' | 'steps' | 'after' | 'onError';
kind: StepKind;
/** What runs: storebound argv (run steps), the shell line (sh), the owner's click text (owner). */
argv?: string[];
shell?: string;
owner?: string;
/** Not run in this mode, and why. */
skip?: string;
/** --dry was added (write steps without --apply, wait steps without --apply). */
dryAdded: boolean;
capture?: string;
continueOnError: boolean;
note?: string;
}
/** How one step runs in a mode, with the variables known so far. Pure. */
export function planStep(s: FlowStep, part: PlannedStep['part'], mode: Mode, vars: Record<string, string>, c: CondCtx, env: Record<string, string | undefined> = {}): PlannedStep {
const base = { id: s.id, part, continueOnError: !!s.continueOnError, ...(s.capture ? { capture: s.capture } : {}), ...(s.note ? { note: s.note } : {}) };
if (s.if !== undefined && !evalIf(substitute(s.if, vars, env), c)) {
const what = s.owner !== undefined ? { owner: substitute(s.owner, vars, env) } : s.sh !== undefined ? { shell: substitute(s.sh, vars, env) } : { argv: splitArgs(substitute(s.run ?? '', vars, env)) };
return { ...base, ...what, kind: kindOf(s), dryAdded: false, skip: `if ${s.if}: false` };
}
if (s.owner !== undefined) return { ...base, kind: 'owner', owner: substitute(s.owner, vars, env), dryAdded: false, skip: 'your click' };
if (s.sh !== undefined) {
const shell = substitute(s.sh, vars, env);
return { ...base, kind: 'shell', shell, dryAdded: false, ...(mode === 'apply' ? {} : { skip: 'shell step: runs with --apply' }) };
}
const argv = splitArgs(substitute(s.run ?? '', vars, env));
const kind = classify(argv);
if (kind === 'owner') return { ...base, kind, owner: `storebound ${argv.join(' ')}`, dryAdded: false, skip: 'your click (owner step: run it yourself after checking)' };
const addDry = (kind === 'write' || kind === 'wait') && mode !== 'apply' && !argv.includes('--dry');
return { ...base, kind, argv: addDry ? [...argv, '--dry'] : argv, dryAdded: addDry, ...(mode === 'plan' ? { skip: 'plan only' } : {}) };
}
/** Index of the step to start from: --from <id> (exact, or the first id under a sub-flow prefix). */
export function startIndex(steps: FlowStep[], from: string | undefined): number {
if (!from) return 0;
const i = steps.findIndex(s => s.id === from || s.id.startsWith(`${from}.`));
if (i < 0) throw new Error(`--from ${from}: no such step (${steps.map(s => s.id).join(', ')})`);
return i;
}
export interface StepResult { id: string; part: PlannedStep['part']; kind: StepKind; status: 'ok' | 'failed' | 'skipped' | 'owner' | 'planned'; exitCode?: number; ms?: number; detail?: string; command?: string }
export interface RunState { flow: string; mode: Mode; startedAt: string; finishedAt?: string; vars: Record<string, string>; results: StepResult[]; ok: boolean }
/** First step of the last run that did not finish (failed, or never reached): where `--resume` starts. */
export function resumePoint(steps: FlowStep[], last: RunState | null): string | undefined {
if (!last) return undefined;
const done = new Set(last.results.filter(r => r.part === 'steps' && (r.status === 'ok' || r.status === 'skipped' || r.status === 'owner')).map(r => r.id));
return steps.find(s => !done.has(s.id))?.id;
}

View file

@ -0,0 +1,158 @@
// Listing localization: per-language sections of the two listing files (store/appstore.md, store/listing.md) as
// translation drafts. Pure. The CLI never calls a translation service: your agent translates the status=translate
// sections (listing-localization skill), or `storebound listing translate --translate "<command>"` runs a command of
// yours once per field. Every generated section carries a marker line until a human reviewed it:
// <!-- storebound-translation from=en-US status=translate --> source text copied in, still to translate
// <!-- storebound-translation from=en-US status=draft --> machine-translated: review, then `listing reviewed`
// Limits per store field (characters; App Store keywords also 100 bytes, as the existing listing check counts them):
// App Store (appStoreVersionLocalizations / appInfoLocalizations): name 30, subtitle 30, promotionalText 170,
// keywords 100, description 4000. https://developer.apple.com/help/app-store-connect/reference/app-information
// Google Play (edits.listings): title 30, shortDescription 80, fullDescription 4000.
// https://support.google.com/googleplay/android-developer/answer/9859152
// Keyword rules (App Store): comma separated, no spaces around commas, no duplicates, no words already in the name or
// subtitle (they are indexed anyway), whole keywords cut at the limit.
import { APPLE_LIMITS, len, PLAY_LIMITS } from './copy';
export type TStatus = 'translate' | 'draft';
export const MARK_RE = /^<!--\s*storebound-translation\s+from=(\S+)\s+status=(translate|draft)\s*-->\s*$/m;
export const mark = (from: string, status: TStatus): string => `<!-- storebound-translation from=${from} status=${status} -->`;
export const APPLE_FIELDS = ['name', 'subtitle', 'promotionalText', 'keywords', 'description'] as const;
export type AppleTField = typeof APPLE_FIELDS[number];
export const PLAY_FIELDS = ['title', 'short', 'full'] as const;
export type PlayTField = typeof PLAY_FIELDS[number];
export const FIELD_LIMITS = {
apple: Object.fromEntries(APPLE_FIELDS.map(f => [f, APPLE_LIMITS[f]])) as Record<AppleTField, number>,
play: { title: PLAY_LIMITS.title, short: PLAY_LIMITS.short, full: PLAY_LIMITS.full } as Record<PlayTField, number>,
};
const fence = (t: string) => '```\n' + t + '\n```';
/** "## " sections of a listing file (index 0 = the preamble). */
export const sections = (md: string): string[] => md.split(/^(?=## )/m);
/** "### heading" -> first fenced block text, in order. */
export function blocksOf(sec: string): { heading: string; text: string }[] {
const out: { heading: string; text: string }[] = [];
for (const part of sec.split(/^### /m).slice(1)) {
const heading = part.split('\n')[0]!.trim();
const m = /^```[^\n]*\n([\s\S]*?)\n```/m.exec(part);
if (m) out.push({ heading, text: m[1]!.trim() });
}
return out;
}
export const appleLocaleOf = (sec: string): string | null => {
if (!sec.startsWith('## ')) return null;
const l = sec.slice(3).split(/[\s·]/)[0]!.trim();
return /^[a-z]{2,3}(-[A-Za-z]{2,4})?$/.test(l) ? l : null;
};
export const playCodesOf = (sec: string): string[] => {
const m = /^<!--\s*play:\s*([^>]+?)\s*-->$/m.exec(sec);
return m ? m[1]!.split(',').map(s => s.trim()).filter(Boolean) : [];
};
export function markerOf(sec: string): { from: string; status: TStatus } | null {
const m = MARK_RE.exec(sec);
return m ? { from: m[1]!, status: m[2] as TStatus } : null;
}
export function appleFields(sec: string): Partial<Record<AppleTField | 'whatsNew', string>> {
const out: Partial<Record<AppleTField | 'whatsNew', string>> = {};
for (const b of blocksOf(sec)) if ((APPLE_FIELDS as readonly string[]).includes(b.heading) || b.heading === 'whatsNew') out[b.heading as AppleTField] = b.text;
return out;
}
export function playFields(sec: string): Partial<Record<PlayTField | 'whatsNew', string>> {
const out: Partial<Record<PlayTField | 'whatsNew', string>> = {};
for (const b of blocksOf(sec)) {
const k = /what'?s new|release notes/i.test(b.heading) ? 'whatsNew' : /\btitle\b/i.test(b.heading) ? 'title' : /\bshort\b/i.test(b.heading) ? 'short' : /\bfull\b/i.test(b.heading) ? 'full' : null;
if (k && out[k] === undefined) out[k] = b.text;
}
return out;
}
export const findAppleSection = (md: string, locale: string): string | undefined => sections(md).find(s => appleLocaleOf(s) === locale);
export const findPlaySection = (md: string, codes: string[]): string | undefined => sections(md).find(s => playCodesOf(s).some(c => codes.includes(c)));
export function appleSectionText(locale: string, label: string, f: Partial<Record<AppleTField | 'whatsNew', string>>, marker: string | null): string {
const parts = [`## ${locale}${label ? ` · ${label}` : ''}`, ...(marker ? [marker] : []), ''];
for (const k of [...APPLE_FIELDS, 'whatsNew'] as const) if (f[k] !== undefined && f[k] !== '') parts.push(`### ${k}`, fence(f[k]!), '');
return parts.join('\n') + '\n';
}
const PLAY_HEAD: Record<PlayTField | 'whatsNew', string> = { title: 'Play title (max 30)', short: 'Play short description (max 80)', full: 'Play full description (max 4000)', whatsNew: 'What\'s new (max 500)' };
export function playSectionText(codes: string[], label: string, f: Partial<Record<PlayTField | 'whatsNew', string>>, marker: string | null): string {
const parts = [`## ${label || codes[0]} (${codes.join(', ')})`, `<!-- play: ${codes.join(', ')} -->`, ...(marker ? [marker] : []), ''];
for (const k of [...PLAY_FIELDS, 'whatsNew'] as const) if (f[k] !== undefined && f[k] !== '') parts.push(`### ${PLAY_HEAD[k]}`, fence(f[k]!), '');
return parts.join('\n') + '\n';
}
/** Replaces the section `old` (exact text) with `text`, or appends `text` at the end. */
export function putSection(md: string, old: string | undefined, text: string): string {
if (old !== undefined) {
const parts = sections(md);
const i = parts.indexOf(old);
// keep what ended the old section (blank lines, a --- rule)
let body = old.replace(/\s+$/, '');
while (/\n---$/.test(body)) body = body.slice(0, -4).replace(/\s+$/, '');
const tail = old.slice(body.length);
parts[i] = text.replace(/\s+$/, '') + (tail || '\n');
return parts.join('');
}
return md.replace(/\s*$/, '') + '\n\n' + text;
}
/** Removes the translation marker of one section (after review). */
export const unmark = (sec: string): string => sec.replace(/^<!--\s*storebound-translation[^>]*-->[ \t]*\n/m, '');
// ---- keyword rules ----
/** App Store keywords: split on commas (also 、,،), trimmed, deduplicated (case-insensitive), words of the name /
* subtitle dropped, joined with "," and cut at whole keywords to fit 100 characters and 100 bytes. Pure. */
export function normalizeKeywords(text: string, o: { name?: string; subtitle?: string; limit?: number } = {}): { text: string; dropped: { kw: string; why: string }[] } {
const limit = o.limit ?? APPLE_LIMITS.keywords;
const taken = new Set(`${o.name ?? ''} ${o.subtitle ?? ''}`.toLocaleLowerCase().split(/[\s,.:;!?·|/–-]+/).filter(w => w.length > 1));
const seen = new Set<string>();
const dropped: { kw: string; why: string }[] = [];
const kept: string[] = [];
for (const raw of text.split(/[,、,،;\n]/)) {
const kw = raw.trim().replace(/\s+/g, ' ');
if (!kw) continue;
const key = kw.toLocaleLowerCase();
if (seen.has(key)) { dropped.push({ kw, why: 'duplicate' }); continue; }
seen.add(key);
if (taken.has(key)) { dropped.push({ kw, why: 'already in the name or subtitle' }); continue; }
const next = [...kept, kw].join(',');
if (len(next) > limit || Buffer.byteLength(next) > limit) { dropped.push({ kw, why: `over ${limit}` }); continue; }
kept.push(kw);
}
return { text: kept.join(','), dropped };
}
export interface FieldCheck { store: 'apple' | 'play'; field: string; chars: number; limit: number; problems: string[] }
/** Limits and rules of one translated section. `source` = the source language's fields (identical text is flagged). */
export function checkFields(store: 'apple' | 'play', f: Record<string, string | undefined>, source: Record<string, string | undefined> = {}, status?: TStatus): FieldCheck[] {
const fields = store === 'apple' ? APPLE_FIELDS : PLAY_FIELDS;
const out: FieldCheck[] = [];
for (const k of fields) {
const v = f[k];
if (v === undefined) continue;
const limit = (FIELD_LIMITS[store] as Record<string, number>)[k]!;
const c: FieldCheck = { store, field: k, chars: len(v), limit, problems: [] };
if (len(v) > limit) c.problems.push(`${len(v)} > ${limit} characters`);
if (store === 'apple' && k === 'keywords') {
if (Buffer.byteLength(v) > limit) c.problems.push(`${Buffer.byteLength(v)} bytes > ${limit}`);
if (/,\s|\s,/.test(v)) c.problems.push('spaces around commas');
const words = v.split(',').map(w => w.trim().toLocaleLowerCase()).filter(Boolean);
const dup = words.filter((w, i) => words.indexOf(w) !== i);
if (dup.length) c.problems.push(`duplicates: ${[...new Set(dup)].join(', ')}`);
if (/,,|^,|,$/.test(v)) c.problems.push('empty keyword');
}
if (!v.trim() && k !== 'title' && k !== 'name') c.problems.push('empty');
if (status === 'translate') c.problems.push('not translated yet (status=translate)');
else if (source[k] !== undefined && v.trim() === source[k]!.trim() && v.trim().length > 12) c.problems.push('identical to the source language');
out.push(c);
}
return out;
}

View file

@ -6,7 +6,8 @@ import { CONFIG_NAMES, loadConfig, type ShipConfig } from '../config';
import { reviewDemoAccount } from '../credentials'; import { reviewDemoAccount } from '../credentials';
import { proposeDeclarations, type Proposal } from './declare'; import { proposeDeclarations, type Proposal } from './declare';
import { detectProject, ECO_LABEL, type ProjectFacts, type Stack, where } from './project'; import { detectProject, ECO_LABEL, type ProjectFacts, type Stack, where } from './project';
import { type ScanFinding, scanRules, type Severity } from './rules'; import type { OriginalityReport } from '../originality';
import { APPLE_GUIDELINES, type ScanFinding, scanRules, type Severity, sortScan } from './rules';
import type { SdkCategory } from './sdks'; import type { SdkCategory } from './sdks';
export interface ScanReport { export interface ScanReport {
@ -23,6 +24,8 @@ export interface ScanReport {
declarations: Proposal; declarations: Proposal;
scanned: number; scanned: number;
notes: string[]; notes: string[];
/** `scan --originality`: the 4.3 / repetitive content comparison with the owner's other apps. */
originality?: { compared: number; flagged: number; threshold: number; pairs: { app: string; folder: string; overall: number; flagged: boolean }[] } | { error: string };
} }
export interface ScanRun { report: ScanReport; facts: ProjectFacts; config: ShipConfig | null; configPath: string | null } export interface ScanRun { report: ScanReport; facts: ProjectFacts; config: ShipConfig | null; configPath: string | null }
@ -122,7 +125,34 @@ export function formatScan(r: ScanReport, o: { declarations?: boolean } = {}): s
if (d.appPrivacyChange) L.push(` ~ appPrivacy.tracking: ${d.appPrivacyChange.from ?? 'unset'} -> ${d.appPrivacyChange.to}`); if (d.appPrivacyChange) L.push(` ~ appPrivacy.tracking: ${d.appPrivacyChange.from ?? 'unset'} -> ${d.appPrivacyChange.to}`);
} else if (r.config) L.push('', ` No changes to ${r.config}: the dataSafety / appPrivacy blocks already cover what was detected.`); } else if (r.config) L.push('', ` No changes to ${r.config}: the dataSafety / appPrivacy blocks already cover what was detected.`);
} }
if (r.originality) {
if ('error' in r.originality) L.push('', `Originality (4.3): not run: ${r.originality.error}`);
else L.push('', `Originality (4.3 / Play repetitive content): ${r.originality.compared} app(s) compared, ${r.originality.flagged} near-duplicate(s) at ${r.originality.threshold}${r.originality.pairs.length ? ` · ${r.originality.pairs.map(p => `${p.app} ${Math.round(p.overall * 100)}%`).join(', ')}` : ''}`);
}
if (r.notes.length) L.push('', ...r.notes.map(n => `note: ${n}`)); if (r.notes.length) L.push('', ...r.notes.map(n => `note: ${n}`));
L.push('', 'Checked at review, not by scan: crashes and bugs on the reviewer\'s device, broken links (storebound validate checks the URLs), screenshots that do not match the app, minimum functionality and spam judgement (4.2, 4.3), local law (5.2). See the review-rejections skill.'); L.push('', 'Checked at review, not by scan: crashes and bugs on the reviewer\'s device, broken links (storebound validate checks the URLs), screenshots that do not match the app, minimum functionality and spam judgement (4.2, 4.3: scan --originality compares your own apps), local law (5.2). See the review-rejections skill.');
return L.join('\n'); return L.join('\n');
} }
/**
* `scan --originality`: the near-duplicates of an originality report as scan findings (App Store 4.3 spam, Google
* Play repetitive content), owner-accepted through `scan.ignore` like every rule (rule id "originality"). Pure.
*/
export function addOriginality(r: ScanReport, o: OriginalityReport, stores: { apple: boolean; play: boolean }, config: ShipConfig | null, rel: (p: string) => string): void {
const ignore = config?.scan?.ignore ?? [];
for (const p of o.pairs.filter(x => x.flagged)) {
const evidence = [{ file: rel(p.other.dir) || '.', line: 1, text: `${p.other.name}: ${Math.round(p.overall * 100)}% overall (${p.reasons.slice(0, 2).join('; ')})` }];
const fix = `${p.suggestions.slice(0, 2).join(' ') || 'Make the app different in mechanic, content and listing.'} Run storebound originality --against ${rel(p.other.dir) || '.'} for every axis; the portfolio-originality skill has the checklist.`;
const base = { rule: 'originality', severity: 'high' as const, title: `Near-duplicate of your app ${p.other.name} (${Math.round(p.overall * 100)}% similar)`, evidence, fix, skill: 'portfolio-originality' };
if (stores.apple) r.findings.push({ ...base, guideline: '4.3', store: 'apple', ref: APPLE_GUIDELINES });
if (stores.play) r.findings.push({ ...base, guideline: 'Play: Repetitive content', store: 'play', ref: 'https://support.google.com/googleplay/android-developer/answer/9898783' });
}
for (const f of r.findings) if (f.rule === 'originality' && !f.accepted) {
const hit = ignore.find(i => i.rule === f.rule && (!i.store || i.store === f.store));
if (hit) f.accepted = hit.reason;
}
r.findings = sortScan(r.findings);
r.counts = { blocker: 0, high: 0, medium: 0, low: 0, accepted: 0 };
for (const f of r.findings) { if (f.accepted) r.counts.accepted++; else r.counts[f.severity]++; }
r.originality = { compared: o.pairs.length, flagged: o.flagged, threshold: o.threshold, pairs: o.pairs.map(p => ({ app: p.other.name, folder: rel(p.other.dir) || '.', overall: Math.round(p.overall * 1000) / 1000, flagged: p.flagged })) };
}

View file

@ -5,7 +5,7 @@
// //
// Sources, checked 2026-10-11: // Sources, checked 2026-10-11:
// - Apple App Review Guidelines: https://developer.apple.com/app-store/review/guidelines/ // - Apple App Review Guidelines: https://developer.apple.com/app-store/review/guidelines/
// 2.1(a) app completeness (demo account, placeholder text), 2.3.7 metadata (names, keywords, no prices or other // 2.1(a) app completeness (demo account, placeholder text), 2.2 betas, demos and trial versions (TestFlight), 2.3.7 metadata (names, keywords, no prices or other
// apps' names), 2.3.8 ("For Kids" is reserved for the Kids Category), 2.3.10 other mobile platforms, 2.5.1 public // apps' names), 2.3.8 ("For Kids" is reserved for the Kids Category), 2.3.10 other mobile platforms, 2.5.1 public
// APIs, 2.5.5 IPv6-only networks, 3.1.1 restore mechanism, 3.1.2(c) subscription information (+ Schedule 2 of the // APIs, 2.5.5 IPv6-only networks, 3.1.1 restore mechanism, 3.1.2(c) subscription information (+ Schedule 2 of the
// Developer Program License Agreement: Terms of Use and privacy policy links), 4.2 minimum functionality // Developer Program License Agreement: Terms of Use and privacy policy links), 4.2 minimum functionality
@ -324,6 +324,19 @@ export function scanRules(inp: ScanInput): ScanFinding[] {
const stuffed = listingHits(inp.listings.apple, /^([^,|]{1,24}[,|]){5,}/, { field: /^(name|subtitle)$/ }); const stuffed = listingHits(inp.listings.apple, /^([^,|]{1,24}[,|]){5,}/, { field: /^(name|subtitle)$/ });
if (stuffed.length) if (stuffed.length)
add({ rule: 'metadata-keywords', guideline: '2.3.7', store: 'apple', severity: 'medium', title: 'Keyword list in the name or subtitle', evidence: stuffed.slice(0, 2), fix: 'Name and subtitle are a short phrase; keywords belong in the keywords field.', skill: 'aso-basics' }); add({ rule: 'metadata-keywords', guideline: '2.3.7', store: 'apple', severity: 'medium', title: 'Keyword list in the name or subtitle', evidence: stuffed.slice(0, 2), fix: 'Name and subtitle are a short phrase; keywords belong in the keywords field.', skill: 'aso-basics' });
// 2.2: demos, betas and trial versions belong on TestFlight, not on the App Store (the name and the listing say so)
const BETA = /\b(beta|demo|trial version|test (version|build|app)|testing build|early access|prototype|preview (build|version)|alpha (build|version))\b/i;
const betaName: Hit[] = [];
if (c?.app?.name && BETA.test(c.app.name)) betaName.push(...cfg(c.app.name, `app.name: ${c.app.name}`));
for (const k of ['CFBundleDisplayName', 'CFBundleName']) {
const v = plistVal(k);
if (typeof v?.value === 'string' && BETA.test(v.value) && !/\$\(/.test(v.value)) betaName.push({ ...v.at, text: `${k}: ${v.value}` });
}
const betaText = listingHits(inp.listings.apple, BETA, { field: /^(name|subtitle|promotionalText|keywords|description)$/ })
.filter(h => !/\bdemo account\b|\bdemo (video|mode)\b/i.test(h.text));
if (betaName.length || betaText.length)
add({ rule: 'beta-wording', guideline: '2.2', store: 'apple', severity: betaName.length ? 'high' : 'medium', title: '"Beta", "demo", "trial" or "test" wording in the app name or App Store text', evidence: [...betaName, ...betaText].slice(0, 4),
fix: 'Apple 2.2: demos, betas and trial versions do not belong on the App Store (use TestFlight). Remove the word from the name, subtitle, keywords and description; a free tier or a trial of a subscription is fine when it is described as such ("free trial of Pro").', skill: 'review-rejections' });
const kids = [...listingHits(inp.listings.apple, /\bfor (kids|children|toddlers)\b/i), ...listingHits(inp.listings.captions, /\bfor (kids|children|toddlers)\b/i, { fenced: false })]; const kids = [...listingHits(inp.listings.apple, /\bfor (kids|children|toddlers)\b/i), ...listingHits(inp.listings.captions, /\bfor (kids|children|toddlers)\b/i, { fenced: false })];
const kidsBand = c?.apple?.info?.ageRating?.kidsAgeBand; const kidsBand = c?.apple?.info?.ageRating?.kidsAgeBand;
if (kids.length && !kidsBand) if (kids.length && !kidsBand)

View file

@ -19,7 +19,7 @@
import type { IntroOffer, Language, OfferCodeDef, PriceOverride, Subscription, SubscriptionGroup, SubscriptionOfferDef, SubscriptionPeriod } from './config'; import type { IntroOffer, Language, OfferCodeDef, PriceOverride, Subscription, SubscriptionGroup, SubscriptionOfferDef, SubscriptionPeriod } from './config';
import { playCodes } from './config'; import { playCodes } from './config';
import { ALPHA3, fromMoney, type Money, toMoney } from './money'; import { ALPHA3, fromMoney, type Money, toMoney } from './money';
import type { PriceRow } from './prices'; import { alpha2, type PriceRow } from './prices';
// ---- mappings ---- // ---- mappings ----
@ -505,3 +505,16 @@ export function pickPoint(points: ApplePoint[], territory: string, price: number
const near = [...inT].sort((a, b) => Math.abs(a.price - price) - Math.abs(b.price - price)).slice(0, 3).map(p => p.price); const near = [...inT].sort((a, b) => Math.abs(a.price - price) - Math.abs(b.price - price)).slice(0, 3).map(p => p.price);
throw new Error(`${territory} has no subscription price point ${price}${near.length ? ` (nearest ${near.join(', ')})` : ''}`); throw new Error(`${territory} has no subscription price point ${price}${near.length ? ` (nearest ${near.join(', ')})` : ''}`);
} }
// ---- the prices sheet (storebound prices export) ----
/** App Store prices of one subscription (in effect today + scheduled) as price sheet rows. Pure. */
export function appleSubPriceRows(product: string, resp: JsonApi, today?: string): PriceRow[] {
return appleSubPrices(resp, today).map(p => ({ product, store: 'apple' as const, region: alpha2(p.territory), territory: p.territory, currency: p.currency ?? '', price: p.price, ...(p.startDate ? { startDate: p.startDate } : {}) }));
}
/** Google Play regional prices of one subscription's base plan as price sheet rows. Pure. */
export function playSubPriceRows(sub: PlaySubscription, basePlan: string): PriceRow[] {
const bp = sub.basePlans?.find(b => b.basePlanId === basePlan) ?? sub.basePlans?.[0];
return (bp?.regionalConfigs ?? []).filter(r => r.price).map(r => ({ product: sub.productId, store: 'play' as const, region: r.regionCode, currency: r.price!.currencyCode, price: fromMoney(r.price!) }));
}

View file

@ -26,6 +26,10 @@ import t21 from '../../templates/testers.csv' with { type: 'text' };
import tWebAppstore from '../../templates/web/appstore.svg' with { type: 'text' }; import tWebAppstore from '../../templates/web/appstore.svg' with { type: 'text' };
import tWebGoogleplay from '../../templates/web/googleplay.svg' with { type: 'text' }; import tWebGoogleplay from '../../templates/web/googleplay.svg' with { type: 'text' };
import tWebLanding from '../../templates/web/landing.html' with { type: 'text' }; import tWebLanding from '../../templates/web/landing.html' with { type: 'text' };
import tWfAppRelease from '../../templates/profiles/app/workflows/release.yml' with { type: 'text' };
import tWfAppBeta from '../../templates/profiles/app/workflows/beta.yml' with { type: 'text' };
import tWfRelease from '../../templates/workflows/release.yml' with { type: 'text' };
import tWfBeta from '../../templates/workflows/beta.yml' with { type: 'text' };
/** Template text by its path under templates/ (forward slashes). */ /** Template text by its path under templates/ (forward slashes). */
export const TEMPLATE_TEXT: Record<string, string> = { export const TEMPLATE_TEXT: Record<string, string> = {
@ -54,4 +58,8 @@ export const TEMPLATE_TEXT: Record<string, string> = {
'web/appstore.svg': tWebAppstore as unknown as string, 'web/appstore.svg': tWebAppstore as unknown as string,
'web/googleplay.svg': tWebGoogleplay as unknown as string, 'web/googleplay.svg': tWebGoogleplay as unknown as string,
'web/landing.html': tWebLanding as unknown as string, 'web/landing.html': tWebLanding as unknown as string,
'profiles/app/workflows/release.yml': tWfAppRelease as unknown as string,
'profiles/app/workflows/beta.yml': tWfAppBeta as unknown as string,
'workflows/release.yml': tWfRelease as unknown as string,
'workflows/beta.yml': tWfBeta as unknown as string,
}; };

171
cli/lib/yaml.ts Normal file
View file

@ -0,0 +1,171 @@
// A small YAML subset reader for repo-local files (store/workflows/*.yml), so storebound stays at zero runtime
// dependencies. Pure. Supported: block maps (`key: value`), block lists (`- item`, `- key: value` with the rest of the
// map indented below), nested by indentation (spaces only), plain / 'single' / "double" quoted scalars, inline lists
// `[a, b]`, `#` comments, `|` and `>` block scalars, true / false / null / numbers. Not supported (an error names the
// line): anchors, aliases, tags, multi-document files, inline maps `{...}`, tabs for indentation.
export type YamlValue = string | number | boolean | null | YamlValue[] | { [k: string]: YamlValue };
interface Line { n: number; indent: number; text: string }
function stripComment(s: string): string {
let q: string | null = null;
for (let i = 0; i < s.length; i++) {
const c = s[i]!;
if (q) { if (c === q && !(q === '"' && s[i - 1] === '\\')) q = null; continue; }
if (c === '"' || c === '\'') { if (i === 0 || /[\s:[,-]/.test(s[i - 1]!)) q = c; continue; }
if (c === '#' && (i === 0 || /\s/.test(s[i - 1]!))) return s.slice(0, i).trimEnd();
}
return s.trimEnd();
}
function scalar(raw: string, n: number): YamlValue {
const s = raw.trim();
if (s === '' || s === '~' || s === 'null') return s === '' ? '' : null;
if (s.startsWith('"')) {
if (!s.endsWith('"') || s.length < 2) throw new Error(`line ${n}: unterminated "string"`);
try { return JSON.parse(s) as string; } catch { throw new Error(`line ${n}: bad "string"`); }
}
if (s.startsWith('\'')) {
if (!s.endsWith('\'') || s.length < 2) throw new Error(`line ${n}: unterminated 'string'`);
return s.slice(1, -1).replace(/''/g, '\'');
}
if (s.startsWith('[')) {
if (!s.endsWith(']')) throw new Error(`line ${n}: unterminated [list]`);
const inner = s.slice(1, -1).trim();
if (!inner) return [];
const parts: string[] = [];
let q: string | null = null, cur = '';
for (const c of inner) {
if (q) { cur += c; if (c === q) q = null; continue; }
if (c === '"' || c === '\'') { q = c; cur += c; continue; }
if (c === ',') { parts.push(cur); cur = ''; continue; }
cur += c;
}
parts.push(cur);
return parts.map(p => scalar(p, n));
}
if (s.startsWith('{')) throw new Error(`line ${n}: inline maps {...} are not supported; use one key per line`);
if (/^[&*!]/.test(s)) throw new Error(`line ${n}: anchors, aliases and tags are not supported`);
if (s === 'true') return true;
if (s === 'false') return false;
if (/^-?\d+(\.\d+)?$/.test(s) && !/^0\d/.test(s)) return Number(s);
return s;
}
/** Index of the `:` that separates a map key from its value (outside quotes), or -1. */
function keyColon(s: string): number {
let q: string | null = null;
for (let i = 0; i < s.length; i++) {
const c = s[i]!;
if (q) { if (c === q) q = null; continue; }
if ((c === '"' || c === '\'') && i === 0) { q = c; continue; }
if (c === ':' && (i === s.length - 1 || s[i + 1] === ' ')) return i;
}
return -1;
}
export function parseYaml(text: string): YamlValue {
const lines: Line[] = [];
const raw = text.replace(/\r\n?/g, '\n').split('\n');
for (let i = 0; i < raw.length; i++) {
const l = raw[i]!;
if (/^\t/.test(l) || /^ *\t/.test(l)) throw new Error(`line ${i + 1}: tabs are not allowed for indentation`);
if (/^(---|\.\.\.)\s*$/.test(l)) { if (lines.length) throw new Error(`line ${i + 1}: one document per file`); continue; }
lines.push({ n: i + 1, indent: l.length - l.trimStart().length, text: l.trim() });
}
let pos = 0;
const content = (l: Line) => l.text !== '' && !l.text.startsWith('#');
const skip = () => { while (pos < lines.length && !content(lines[pos]!)) pos++; };
/** Block scalar (| or >) below a key at `parentIndent`. */
function block(style: string, parentIndent: number): string {
const out: string[] = [];
let ind = -1;
while (pos < lines.length) {
const l = lines[pos]!;
const rawLine = raw[l.n - 1]!;
if (l.text === '') { out.push(''); pos++; continue; }
if (l.indent <= parentIndent) break;
if (ind < 0) ind = l.indent;
out.push(rawLine.slice(Math.min(ind, l.indent)));
pos++;
}
while (out.length && out[out.length - 1] === '') out.pop();
const keep = style.endsWith('-') ? '' : '\n';
return (style.startsWith('>') ? out.join('\n').replace(/([^\n])\n(?=[^\n])/g, '$1 ') : out.join('\n')) + (out.length ? keep : '');
}
function value(indent: number): YamlValue {
skip();
if (pos >= lines.length) return null;
const first = lines[pos]!;
if (first.indent < indent) return null;
return first.text.startsWith('- ') || first.text === '-' ? list(first.indent) : map(first.indent);
}
function entry(rest: string, n: number, ownIndent: number): [string, YamlValue] {
const c = keyColon(rest);
if (c < 0) throw new Error(`line ${n}: expected "key: value"`);
const key = String(scalar(rest.slice(0, c), n));
const v = stripComment(rest.slice(c + 1)).trim();
if (v === '') {
skip();
const next = lines[pos];
// a list may sit at the key's own indentation ("steps:\n- id: a")
if (next && next.indent === ownIndent && (next.text.startsWith('- ') || next.text === '-')) return [key, list(ownIndent)];
return [key, value(ownIndent + 1) ?? null];
}
if (/^[|>][+-]?$/.test(v)) return [key, block(v, ownIndent)];
return [key, scalar(v, n)];
}
function map(indent: number): { [k: string]: YamlValue } {
const out: { [k: string]: YamlValue } = {};
for (;;) {
skip();
if (pos >= lines.length) break;
const l = lines[pos]!;
if (l.indent < indent) break;
if (l.indent > indent) throw new Error(`line ${l.n}: unexpected indentation`);
if (l.text.startsWith('- ')) throw new Error(`line ${l.n}: a list item where a "key: value" was expected`);
pos++;
const [k, v] = entry(stripComment(l.text), l.n, indent);
if (k in out) throw new Error(`line ${l.n}: "${k}" twice`);
out[k] = v;
}
return out;
}
function list(indent: number): YamlValue[] {
const out: YamlValue[] = [];
for (;;) {
skip();
if (pos >= lines.length) break;
const l = lines[pos]!;
if (l.indent < indent) break;
if (l.indent > indent) throw new Error(`line ${l.n}: expected a list item "- ..."`);
if (!(l.text.startsWith('- ') || l.text === '-')) break;
pos++;
const rest = stripComment(l.text.slice(1)).trim();
if (rest === '') { out.push(value(indent + 1)); continue; }
const itemIndent = indent + (l.text.length - l.text.slice(1).trimStart().length);
if (keyColon(rest) >= 0 && !/^["'[]/.test(rest)) {
// "- key: value" starts a map whose other keys are indented to the item's text column
const [k, v] = entry(rest, l.n, itemIndent);
const m: { [k: string]: YamlValue } = { [k]: v };
skip();
if (pos < lines.length && lines[pos]!.indent === itemIndent && !lines[pos]!.text.startsWith('- ')) {
for (const [k2, v2] of Object.entries(map(itemIndent))) { if (k2 in m) throw new Error(`line ${l.n}: "${k2}" twice`); m[k2] = v2; }
}
out.push(m);
} else out.push(scalar(rest, l.n));
}
return out;
}
const v = value(0);
skip();
if (pos < lines.length) throw new Error(`line ${lines[pos]!.n}: unexpected content`);
return v;
}

214
cli/listing.ts Normal file
View file

@ -0,0 +1,214 @@
// Listing localization: translation drafts of the listing fields in both listing files (rules: lib/listing-translate.ts).
// storebound listing translate --to de-DE,ja [--from en-US] [--store apple|play] [--translate "<command>"] [--force] [--dry] [--json]
// per target language: the App Store section (name, subtitle, promotionalText, keywords, description) in
// store/appstore.md and the Play section (title, short, full) in store/listing.md. Without --translate the source
// text is copied in with status=translate for your agent to translate in place (listing-localization skill); with
// --translate your command runs once per field with the source text on stdin and STOREBOUND_SOURCE_LANG,
// STOREBOUND_TARGET_LANG, STOREBOUND_STORE, STOREBOUND_FIELD, STOREBOUND_LIMIT in the environment; its stdout is
// the translation (status=draft). Keywords are cleaned up (commas, duplicates, name / subtitle words, 100 limit).
// Reviewed sections (no marker) are kept unless --force; a section's What's new is kept.
// storebound listing check [--json] limits, keyword rules, untranslated and draft sections; exit 1 on a problem
// storebound listing reviewed --lang de-DE[,ja] | --all [--dry] a human read the draft: remove its marker
// --to / --from / --lang take config language ids, App Store locales or Play codes. Local files only: nothing is sent
// to a store (apple listing / play listing push them after `storebound check`).
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
import type { Language } from './lib/config';
import { playCodes } from './lib/config';
import type { Ctx } from './lib/ctx';
import { done, log, printJson, warn } from './lib/log';
import {
APPLE_FIELDS, appleFields, appleLocaleOf, appleSectionText, checkFields, FIELD_LIMITS, type FieldCheck, findAppleSection, findPlaySection, mark,
markerOf, normalizeKeywords, PLAY_FIELDS, playCodesOf, playFields, playSectionText, putSection, sections, unmark,
} from './lib/listing-translate';
import { textTable } from './lib/table';
import { resolveLanguages } from './lib/whats-new';
const TAG = 'listing';
const storeCode = (l: Language): string => l.apple ?? playCodes(l)[0] ?? l.id;
interface Files { apple?: { path: string; md: string }; play?: { path: string; md: string } }
function readFiles(ctx: Ctx, store?: string): Files {
const { config, resolve } = ctx.loaded;
const out: Files = {};
if (config.apple && store !== 'play') { const p = resolve(config.apple.listing ?? 'store/appstore.md'); if (existsSync(p)) out.apple = { path: p, md: readFileSync(p, 'utf8') }; else warn(TAG, `${p} missing: App Store skipped`); }
if (config.play && store !== 'apple') { const p = resolve(config.play.listing ?? 'store/listing.md'); if (existsSync(p)) out.play = { path: p, md: readFileSync(p, 'utf8') }; else warn(TAG, `${p} missing: Google Play skipped`); }
if (!out.apple && !out.play) throw new Error('no listing file to work on (store/appstore.md, store/listing.md; storebound init creates them)');
return out;
}
function sourceLanguage(ctx: Ctx): Language {
const { config } = ctx.loaded;
const want = ctx.args.get('from');
if (want) return resolveLanguages(config.languages, [want])[0]!;
const primary = config.apple?.primaryLocale ?? config.play?.defaultLanguage;
return config.languages.find(l => l.apple === primary || playCodes(l).includes(primary ?? '')) ?? config.languages[0]!;
}
interface Row { lang: string; store: 'apple' | 'play'; action: string; checks: FieldCheck[] }
async function translate(ctx: Ctx): Promise<void> {
const { config } = ctx.loaded;
const a = ctx.args;
const store = a.get('store');
if (store && store !== 'apple' && store !== 'play') throw new Error('--store apple | play');
const targets = resolveLanguages(config.languages, a.list('to'));
if (!targets.length) throw new Error('--to <languages>: config language ids, App Store locales or Play codes (add a language to languages[] in the config first)');
const src = sourceLanguage(ctx);
const files = readFiles(ctx, store);
const hook = a.get('translate');
const dry = a.has('dry');
const rows: Row[] = [];
const runHook = (text: string, l: Language, st: 'apple' | 'play', field: string, limit: number): string | null => {
const r = Bun.spawnSync(['sh', '-c', hook!], { stdin: new TextEncoder().encode(text), stdout: 'pipe', stderr: 'pipe',
env: { ...process.env, STOREBOUND_SOURCE_LANG: storeCode(src), STOREBOUND_TARGET_LANG: st === 'apple' ? l.apple ?? l.id : playCodes(l)[0] ?? l.id, STOREBOUND_TARGET_LANG_ID: l.id,
STOREBOUND_STORE: st, STOREBOUND_FIELD: field, STOREBOUND_LIMIT: String(limit) } });
const out = r.stdout.toString().trim();
if (r.exitCode !== 0 || !out) { warn(TAG, `${l.id} ${st}.${field}: --translate failed (exit ${r.exitCode}): ${r.stderr.toString().trim().slice(0, 200)}`); return null; }
return out;
};
for (const l of targets) {
if (l === src) { warn(TAG, `${l.id} is the source language: skipped`); continue; }
// ---- App Store ----
if (files.apple && l.apple && src.apple) {
const srcSec = findAppleSection(files.apple.md, src.apple);
const cur = findAppleSection(files.apple.md, l.apple);
if (!srcSec) warn(TAG, `${files.apple.path}: no ${src.apple} section to translate from`);
else if (cur && !markerOf(cur) && !a.has('force')) rows.push({ lang: l.id, store: 'apple', action: 'kept (reviewed; --force replaces it)', checks: [] });
else {
const s = appleFields(srcSec);
const f: Record<string, string> = {};
let failed = false;
for (const k of APPLE_FIELDS) {
if (s[k] === undefined) continue;
if (hook && !dry) { const t = runHook(s[k]!, l, 'apple', k, FIELD_LIMITS.apple[k]); if (t === null) failed = true; f[k] = t ?? s[k]!; }
else f[k] = s[k]!;
}
const status = hook && !dry && !failed ? 'draft' : 'translate';
if (f.keywords && status === 'draft') {
const n = normalizeKeywords(f.keywords, { name: f.name, subtitle: f.subtitle });
for (const d of n.dropped) log(TAG, `${l.apple} keywords: dropped "${d.kw}" (${d.why})`);
f.keywords = n.text;
}
const keep = cur ? appleFields(cur).whatsNew : undefined;
const text = appleSectionText(l.apple, l.id, { ...f, ...(keep ? { whatsNew: keep } : {}) }, mark(src.apple, status));
files.apple.md = putSection(files.apple.md, cur, text);
rows.push({ lang: l.id, store: 'apple', action: `${cur ? 'replaced' : 'added'} (status=${status})`, checks: checkFields('apple', f, s, status) });
}
}
// ---- Google Play ----
const codes = playCodes(l), srcCodes = playCodes(src);
if (files.play && codes.length && srcCodes.length) {
const srcSec = findPlaySection(files.play.md, srcCodes);
const cur = findPlaySection(files.play.md, codes);
if (!srcSec) warn(TAG, `${files.play.path}: no ${srcCodes.join(', ')} section to translate from`);
else if (cur && !markerOf(cur) && !a.has('force')) rows.push({ lang: l.id, store: 'play', action: 'kept (reviewed; --force replaces it)', checks: [] });
else {
const s = playFields(srcSec);
const f: Record<string, string> = {};
let failed = false;
for (const k of PLAY_FIELDS) {
if (s[k] === undefined) continue;
if (hook && !dry) { const t = runHook(s[k]!, l, 'play', k, FIELD_LIMITS.play[k]); if (t === null) failed = true; f[k] = t ?? s[k]!; }
else f[k] = s[k]!;
}
const status = hook && !dry && !failed ? 'draft' : 'translate';
const keep = cur ? playFields(cur).whatsNew : undefined;
// the section keeps serving every Play code it served (es-ES, es-419), plus the language's own
const allCodes = [...new Set([...(cur ? playCodesOf(cur) : []), ...codes])];
const text = playSectionText(allCodes, l.id, { ...f, ...(keep ? { whatsNew: keep } : {}) }, mark(srcCodes[0]!, status));
files.play.md = putSection(files.play.md, cur, text);
rows.push({ lang: l.id, store: 'play', action: `${cur ? 'replaced' : 'added'} (status=${status})`, checks: checkFields('play', f, s, status) });
}
}
}
const problemsOf = (r: Row) => r.checks.flatMap(c => c.problems.filter(p => !p.startsWith('not translated')).map(p => `${c.field}: ${p}`));
if (a.has('json')) printJson({ source: src.id, dryRun: dry, hook: !!hook, files: { apple: files.apple?.path ?? null, play: files.play?.path ?? null }, results: rows.map(r => ({ ...r, problems: problemsOf(r) })) });
else {
console.log(textTable(['language', 'store', 'section', 'fields', 'problems'], rows.map(r => [r.lang, r.store === 'apple' ? 'App Store' : 'Google Play', r.action,
r.checks.map(c => `${c.field} ${c.chars}/${c.limit}`).join(', '), problemsOf(r).join('; ')])));
}
const json = a.has('json');
if (dry) { if (!json) done(TAG, 'dry run: listing files not written'); return; }
if (files.apple) writeFileSync(files.apple.path, files.apple.md);
if (files.play) writeFileSync(files.play.path, files.play.md);
if (json) return;
const todo = rows.filter(r => r.action.includes('status=translate')).length;
done(TAG, todo ? `${todo} section(s) to translate in place (keep the marker line, set status=draft), then storebound listing check` : 'drafts written: review them, storebound listing check, then storebound listing reviewed --lang <ids>');
}
interface SecReport { file: string; store: 'apple' | 'play'; lang: string; status: 'reviewed' | 'translate' | 'draft'; from: string | null; checks: FieldCheck[] }
function report(files: Files): SecReport[] {
const out: SecReport[] = [];
if (files.apple) for (const sec of sections(files.apple.md)) {
const loc = appleLocaleOf(sec);
if (!loc) continue;
const m = markerOf(sec);
const srcSec = m ? findAppleSection(files.apple.md, m.from) : undefined;
out.push({ file: files.apple.path, store: 'apple', lang: loc, status: m?.status ?? 'reviewed', from: m?.from ?? null, checks: checkFields('apple', appleFields(sec), srcSec ? appleFields(srcSec) : {}, m?.status) });
}
if (files.play) for (const sec of sections(files.play.md)) {
const codes = playCodesOf(sec);
if (!codes.length) continue;
const m = markerOf(sec);
const srcSec = m ? findPlaySection(files.play.md, [m.from]) : undefined;
out.push({ file: files.play.path, store: 'play', lang: codes.join(', '), status: m?.status ?? 'reviewed', from: m?.from ?? null, checks: checkFields('play', playFields(sec), srcSec ? playFields(srcSec) : {}, m?.status) });
}
return out;
}
function check(ctx: Ctx): void {
const files = readFiles(ctx);
const r = report(files);
const bad = r.filter(x => x.checks.some(c => c.problems.length));
const drafts = r.filter(x => x.status === 'draft');
if (ctx.args.has('json')) printJson({ sections: r, ok: !bad.length, drafts: drafts.map(d => `${d.store}:${d.lang}`) });
else {
console.log(textTable(['store', 'language', 'status', 'fields', 'problems'], r.map(x => [x.store === 'apple' ? 'App Store' : 'Google Play', x.lang,
x.status === 'draft' ? 'DRAFT (review)' : x.status === 'translate' ? 'TO TRANSLATE' : 'reviewed', x.checks.map(c => `${c.field} ${c.chars}/${c.limit}`).join(', '),
x.checks.flatMap(c => c.problems.map(p => `${c.field}: ${p}`)).join('; ')])));
if (drafts.length) warn(TAG, `${drafts.length} machine-translated draft(s) not reviewed yet: ${drafts.map(d => `${d.store}:${d.lang}`).join(', ')} (storebound listing reviewed --lang <ids> after reading them)`);
done(TAG, bad.length ? `${bad.length} section(s) with problems` : `${r.length} section(s) within the store limits`);
}
if (bad.length) process.exitCode = 1;
}
function reviewed(ctx: Ctx): void {
const { config } = ctx.loaded;
const a = ctx.args;
const files = readFiles(ctx);
const all = a.has('all');
const langs = all ? [] : resolveLanguages(config.languages, a.list('lang'));
if (!all && !langs.length) throw new Error('--lang <ids> | --all');
const changed: string[] = [], refused: string[] = [];
const pick = (sec: string, store: 'apple' | 'play'): boolean => {
if (all) return true;
return store === 'apple' ? langs.some(l => l.apple && appleLocaleOf(sec) === l.apple) : langs.some(l => playCodes(l).some(c => playCodesOf(sec).includes(c)));
};
for (const store of ['apple', 'play'] as const) {
const f = files[store];
if (!f) continue;
f.md = sections(f.md).map(sec => {
const m = markerOf(sec);
if (!m || !pick(sec, store)) return sec;
const label = `${store}:${store === 'apple' ? appleLocaleOf(sec) : playCodesOf(sec).join(',')}`;
if (m.status === 'translate') { refused.push(label); return sec; }
changed.push(label);
return unmark(sec);
}).join('');
}
for (const r of refused) warn(TAG, `${r}: still status=translate (translate it first)`);
if (a.has('dry')) { done(TAG, `dry run: would mark ${changed.length} section(s) reviewed: ${changed.join(', ') || 'none'}`); return; }
for (const store of ['apple', 'play'] as const) if (files[store]) writeFileSync(files[store]!.path, files[store]!.md);
done(TAG, `${changed.length} section(s) marked reviewed${changed.length ? `: ${changed.join(', ')}` : ''}`);
}
export async function run(ctx: Ctx): Promise<void> {
const sub = ctx.args._[0];
if (sub === 'translate') return translate(ctx);
if (sub === 'check') return check(ctx);
if (sub === 'reviewed') return reviewed(ctx);
throw new Error('usage: storebound listing translate --to <languages> [--from <language>] [--translate "<command>"] [--dry] | check | reviewed --lang <ids>');
}

View file

@ -41,8 +41,10 @@ export const TOOLS: ToolDef[] = [
args: i => ['--aso', ...opt('storefront', i.storefront)] }, args: i => ['--aso', ...opt('storefront', i.storefront)] },
{ name: 'scan', title: 'Rejection-risk scan of the project', command: ['scan'], write: false, network: false, { name: 'scan', title: 'Rejection-risk scan of the project', command: ['scan'], write: false, network: false,
description: 'Offline, read-only scan of the project itself before submitting: detects the stack (iOS, Android, React Native, Expo, Capacitor, Cordova, Flutter, Unity, Godot) and SDKs (ads, analytics, crash, sign-in, payments, push) with versions and file:line, then reports App Store and Google Play rejection risks with the guideline, evidence, fix, severity and skill (demo account 2.1, account deletion 5.1.1(v), Sign in with Apple 4.8, Restore Purchases 3.1.1, subscription info 3.1.2, ATT 5.1.2, purpose strings, privacy manifest, other platforms 2.3.10, keywords 2.3.7, placeholder text, web wrappers 4.2, UIWebView, ATS, IPv6, export compliance, kids ads, Play target SDK, delete-account URL, restricted permissions and their declarations (background location, photo / video, All files access, accessibility, install packages, Health Connect, full-screen intent, VPN, foreground services, exact alarms, QUERY_ALL_PACKAGES, SMS / call log), prominent disclosure, Families, AD_ID, 16 KB page sizes, testing for personal accounts, Play metadata, ads at launch, payments, impersonation) and proposes the Data safety / App Privacy / ATT / privacy manifest answers as a diff against the config. Never writes (the owner runs `storebound scan --write` in a terminal).', description: 'Offline, read-only scan of the project itself before submitting: detects the stack (iOS, Android, React Native, Expo, Capacitor, Cordova, Flutter, Unity, Godot) and SDKs (ads, analytics, crash, sign-in, payments, push) with versions and file:line, then reports App Store and Google Play rejection risks with the guideline, evidence, fix, severity and skill (demo account 2.1, account deletion 5.1.1(v), Sign in with Apple 4.8, Restore Purchases 3.1.1, subscription info 3.1.2, ATT 5.1.2, purpose strings, privacy manifest, other platforms 2.3.10, keywords 2.3.7, placeholder text, web wrappers 4.2, UIWebView, ATS, IPv6, export compliance, kids ads, Play target SDK, delete-account URL, restricted permissions and their declarations (background location, photo / video, All files access, accessibility, install packages, Health Connect, full-screen intent, VPN, foreground services, exact alarms, QUERY_ALL_PACKAGES, SMS / call log), prominent disclosure, Families, AD_ID, 16 KB page sizes, testing for personal accounts, Play metadata, ads at launch, payments, impersonation) and proposes the Data safety / App Privacy / ATT / privacy manifest answers as a diff against the config. Never writes (the owner runs `storebound scan --write` in a terminal).',
props: { store: { type: 'string', enum: ['apple', 'play'], description: 'Only this store\'s findings (default: both)' } }, props: { store: { type: 'string', enum: ['apple', 'play'], description: 'Only this store\'s findings (default: both)' },
args: i => opt('store', i.store) }, originality: { type: 'boolean', default: false, description: 'Also the 4.3 / Play repetitive content check against your other apps (folders from against, else originality.against in the config)' },
against: { type: 'string', description: 'Comma-separated folders of your other apps (with originality)' } },
args: i => [...opt('store', i.store), ...flag('originality', i.originality), ...(i.originality ? opt('against', i.against) : [])] },
{ name: 'validate', title: 'Store readiness report', command: ['validate'], write: false, network: true, { name: 'validate', title: 'Store readiness report', command: ['validate'], write: false, network: true,
description: 'Read-only readiness report for App Store Connect and/or Google Play with ordered blockers (build, encryption, metadata, screenshots, review details and demo account, age rating, prices, IAPs, subscriptions, privacy, delete-account and terms URLs, app-ads.txt, tracks, products, base plans).', description: 'Read-only readiness report for App Store Connect and/or Google Play with ordered blockers (build, encryption, metadata, screenshots, review details and demo account, age rating, prices, IAPs, subscriptions, privacy, delete-account and terms URLs, app-ads.txt, tracks, products, base plans).',
props: { store: { type: 'string', enum: ['both', 'apple', 'play'], default: 'both' } }, props: { store: { type: 'string', enum: ['both', 'apple', 'play'], default: 'both' } },
@ -283,6 +285,18 @@ export const TOOLS: ToolDef[] = [
no_validate: { type: 'boolean', default: false, description: 'Skip the store readiness read' }, json: { type: 'boolean', default: false } }, no_validate: { type: 'boolean', default: false, description: 'Skip the store readiness read' }, json: { type: 'boolean', default: false } },
required: ['version'], args: i => [String(i.version), ...opt('app', i.app), ...flag('no-validate', i.no_validate), ...flag('json', i.json)] }, required: ['version'], args: i => [String(i.version), ...opt('app', i.app), ...flag('no-validate', i.no_validate), ...flag('json', i.json)] },
{ name: 'flow_list', title: 'Repo-local workflows', command: ['flow', 'list'], write: false, network: false,
description: 'The named workflows of this project (store/workflows/*.yml, storebound.workflows.*) with their params and steps, each step classified as read, write (runs as a dry run), wait, shell or "your click" (owner steps such as Submit for Review, never run).',
args: () => ['--json'] },
{ name: 'flow_run', title: 'Run a workflow as a dry run', command: ['flow', 'run'], write: false, network: true,
description: 'Run one workflow step by step: read steps run, every write step runs with --dry (nothing changes on a store or in files), wait steps check once, shell steps are skipped, owner steps are listed as the owner\'s clicks. plan_only shows the plan without running anything. Running the writes for real is a terminal command the owner runs (storebound flow run <name> --apply).',
props: { name: { type: 'string', pattern: '^[a-z0-9][a-z0-9._-]{0,62}$', description: 'Flow name (flow_list)' },
params: { type: 'object', additionalProperties: { type: 'string' }, description: 'Flow params, e.g. {"VERSION": "1.2.0"}' },
from: { type: 'string', pattern: '^[a-z0-9][a-z0-9._-]{0,62}$', description: 'Start at this step id' },
plan_only: { type: 'boolean', default: false } },
required: ['name'],
args: i => [String(i.name), ...Object.entries((i.params ?? {}) as Record<string, unknown>).filter(([k]) => /^[A-Z][A-Z0-9_]{0,40}$/.test(k)).map(([k, v]) => `${k}=${String(v)}`), ...opt('from', i.from), ...flag('dry', i.plan_only), '--json'] },
// ---- store operations (read-only plans, local pulls and reports; submits, codes, offers and pre-orders stay terminal-only) ---- // ---- store operations (read-only plans, local pulls and reports; submits, codes, offers and pre-orders stay terminal-only) ----
{ name: 'apple_testflight_wait', title: 'Wait for a TestFlight build', command: ['apple', 'testflight', 'wait'], write: false, network: true, { name: 'apple_testflight_wait', title: 'Wait for a TestFlight build', command: ['apple', 'testflight', 'wait'], write: false, network: true,
description: 'Poll one uploaded build (exact number) until processing ends: exit 0 VALID, 1 FAILED / INVALID, 7 timeout. Read-only. check_once reads the state once without waiting.', description: 'Poll one uploaded build (exact number) until processing ends: exit 0 VALID, 1 FAILED / INVALID, 7 timeout. Read-only. check_once reads the state once without waiting.',
@ -313,6 +327,14 @@ export const TOOLS: ToolDef[] = [
{ name: 'whats_new_apply', title: 'Apply release notes per language', command: ['whats-new', 'apply'], write: true, network: false, idempotent: true, { name: 'whats_new_apply', title: 'Apply release notes per language', command: ['whats-new', 'apply'], write: true, network: false, idempotent: true,
description: 'Write the checked per-language release notes into both listing files (Play "What\'s new" per Play code, App Store whatsNew per locale). Refuses while a language is over a limit or untranslated. Local files only; nothing is sent to a store.', description: 'Write the checked per-language release notes into both listing files (Play "What\'s new" per Play code, App Store whatsNew per locale). Refuses while a language is over a limit or untranslated. Local files only; nothing is sent to a store.',
args: () => ['--json'] }, args: () => ['--json'] },
{ name: 'listing_translate', title: 'Listing translation drafts', command: ['listing', 'translate'], write: true, network: false, idempotent: true,
description: 'Add a section per target language to both listing files (App Store: name, subtitle, promotionalText, keywords, description; Google Play: title, short, full) with the source language\'s text and a status=translate marker. Then translate each field in place within the store limits (App Store subtitle 30, promotional text 170, keywords 100 comma-separated without duplicates or name words, description 4000; Play title 30, short 80, full 4000), set the marker to status=draft and run listing_check. The owner reviews the drafts (storebound listing reviewed). Reviewed sections are kept. Local files only.',
props: { to: { type: 'string', pattern: '^[A-Za-z0-9_-]+(,[A-Za-z0-9_-]+)*$', description: 'Comma-separated target languages (config ids, App Store locales or Play codes)' },
from: { type: 'string', pattern: '^[A-Za-z0-9_-]+$', description: 'Source language (default: the primary one)' }, store: { type: 'string', enum: ['apple', 'play'] } },
required: ['to'], args: i => [...opt('to', i.to), ...opt('from', i.from), ...opt('store', i.store), '--json'] },
{ name: 'listing_check', title: 'Check listing translations', command: ['listing', 'check'], write: false, network: false,
description: 'Offline: every language section of both listing files against the store limits and keyword rules, with untranslated (status=translate) and unreviewed machine-translated (status=draft) sections.',
args: () => ['--json'] },
{ name: 'reports', title: 'Sales and finance reports', command: ['reports'], write: true, network: true, idempotent: true, { name: 'reports', title: 'Sales and finance reports', command: ['reports'], write: true, network: true, idempotent: true,
description: 'Download a sales or finance report into .storebound/reports/ (gitignored) and print a summary per product and currency (amounts never added across currencies) plus a summary CSV. Apple needs ASC_VENDOR_NUMBER and a team key; Play needs play.reportsBucket and "View financial data". dry_run shows the request only.', description: 'Download a sales or finance report into .storebound/reports/ (gitignored) and print a summary per product and currency (amounts never added across currencies) plus a summary CSV. Apple needs ASC_VENDOR_NUMBER and a team key; Play needs play.reportsBucket and "View financial data". dry_run shows the request only.',
props: { kind: { type: 'string', enum: ['apple-sales', 'apple-finance', 'play-earnings', 'play-sales'] }, month: { type: 'string', pattern: '^\\d{4}-\\d{2}$', description: 'YYYY-MM (apple-finance: Apple fiscal month; Play reports)' }, props: { kind: { type: 'string', enum: ['apple-sales', 'apple-finance', 'play-earnings', 'play-sales'] }, month: { type: 'string', pattern: '^\\d{4}-\\d{2}$', description: 'YYYY-MM (apple-finance: Apple fiscal month; Play reports)' },

View file

@ -7,35 +7,42 @@
// (mechanic, content, differentiator sentence) is the portfolio-originality skill. // (mechanic, content, differentiator sentence) is the portfolio-originality skill.
import { realpathSync } from 'node:fs'; import { realpathSync } from 'node:fs';
import { relative } from 'node:path'; import { relative } from 'node:path';
import { loadConfig } from './lib/config'; import { loadConfig, type ShipConfig } from './lib/config';
import type { Ctx } from './lib/ctx'; import type { Ctx } from './lib/ctx';
import { done, log, printJson, warn } from './lib/log'; import { done, log, printJson, warn } from './lib/log';
import { DEFAULT_THRESHOLD, findApps, fingerprint, report } from './lib/originality'; import { type AppFingerprint, DEFAULT_THRESHOLD, findApps, fingerprint, type OriginalityReport, report } from './lib/originality';
import { textTable } from './lib/table'; import { textTable } from './lib/table';
const TAG = 'originality'; const TAG = 'originality';
export async function run(ctx: Ctx): Promise<void> { /** The 4.3 comparison of one app against the apps in `against` (also used by `storebound scan --originality`). */
const { config, root, resolve } = ctx.loaded; export async function compareAgainst(o: { config: ShipConfig; root: string; resolve(p: string): string }, against: string[], thresholdArg?: number, onSkip: (msg: string) => void = () => {}): Promise<{ report: OriginalityReport; me: AppFingerprint; others: number }> {
const a = ctx.args; const { config, root, resolve } = o;
const folders = (a.list('against').length ? a.list('against') : config.originality?.against ?? []).map(f => resolve(f)); const folders = (against.length ? against : config.originality?.against ?? []).map(f => resolve(f));
if (!folders.length) throw new Error('nothing to compare with: --against <folder of another app, or a folder holding several> (or originality.against in the config)'); if (!folders.length) throw new Error('nothing to compare with: --against <folder of another app, or a folder holding several> (or originality.against in the config)');
const threshold = a.has('threshold') ? a.num('threshold', DEFAULT_THRESHOLD) : config.originality?.threshold ?? DEFAULT_THRESHOLD; const threshold = thresholdArg ?? config.originality?.threshold ?? DEFAULT_THRESHOLD;
if (!(threshold > 0 && threshold < 1)) throw new Error('--threshold: between 0 and 1'); if (!(threshold > 0 && threshold < 1)) throw new Error('--threshold: between 0 and 1');
const self = realpathSync(root); const self = realpathSync(root);
const configs = findApps(folders.map(f => { try { return realpathSync(f); } catch { return f; } }), self); const configs = findApps(folders.map(f => { try { return realpathSync(f); } catch { return f; } }), self);
if (!configs.length) throw new Error(`no other app (storebound.config.ts) in ${folders.map(f => relative(root, f) || '.').join(', ')}`); if (!configs.length) throw new Error(`no other app (storebound.config.ts) in ${folders.map(f => relative(root, f) || '.').join(', ')}`);
const json = a.has('json');
if (!json) log(TAG, `${config.app.name} vs ${configs.length} app(s), offline`);
const me = fingerprint(config, root); const me = fingerprint(config, root);
const others = []; const others = [];
for (const p of configs) { for (const p of configs) {
try { try {
const l = await loadConfig(p); const l = await loadConfig(p);
others.push(fingerprint(l.config, l.root)); others.push(fingerprint(l.config, l.root));
} catch (e) { warn(TAG, `${p}: skipped (${(e as Error).message.split('\n')[0]?.slice(0, 160)})`); } } catch (e) { onSkip(`${p}: skipped (${(e as Error).message.split('\n')[0]?.slice(0, 160)})`); }
} }
const r = report(me, others, threshold); return { report: report(me, others, threshold), me, others: configs.length };
}
export async function run(ctx: Ctx): Promise<void> {
const { config, root } = ctx.loaded;
const a = ctx.args;
const json = a.has('json');
const { report: r, me, others } = await compareAgainst(ctx.loaded, a.list('against'), a.has('threshold') ? a.num('threshold', DEFAULT_THRESHOLD) : undefined, m => warn(TAG, m));
if (!json) log(TAG, `${config.app.name} vs ${others} app(s), offline`);
const threshold = r.threshold;
if (json) { printJson(r); if (r.flagged) process.exitCode = 1; return; } if (json) { printJson(r); if (r.flagged) process.exitCode = 1; return; }
for (const n of me.notes) warn(TAG, `${config.app.name}: ${n}`); for (const n of me.notes) warn(TAG, `${config.app.name}: ${n}`);
const pct = (x: number | null) => (x === null ? '-' : `${Math.round(x * 100)}%`); const pct = (x: number | null) => (x === null ? '-' : `${Math.round(x * 100)}%`);

View file

@ -1,5 +1,8 @@
// In-app product prices for many products and regions from one CSV (both stores). // In-app product prices for many products and regions from one CSV (both stores).
// storebound prices export [--out store/prices.csv] [--store apple|play] [--only ids] [--with-automatic] [--dry] [--json] // storebound prices export [--out store/prices.csv] [--store apple|play] [--only ids] [--with-automatic] [--no-subscriptions] [--dry] [--json]
// one-time products and (unless --no-subscriptions) auto-renewable subscriptions: Apple's current and scheduled
// subscription prices per territory, Play's regional prices of the base plan. Subscription rows use the same
// columns; `apple subscriptions --csv` / `play subscriptions --csv` read them back (prices import skips them).
// storebound prices import [--csv store/prices.csv] [--store apple|play] [--only ids] [--reconvert] [--all] [--dry] [--yes] // storebound prices import [--csv store/prices.csv] [--store apple|play] [--only ids] [--reconvert] [--all] [--dry] [--yes]
// storebound prices ppp [--base <USD>] [...] purchasing power price sheet (prices-ppp.ts) // storebound prices ppp [--base <USD>] [...] purchasing power price sheet (prices-ppp.ts)
// CSV columns: product, store (apple | play | both), region (ISO alpha-2), currency, price, start_date (App Store // CSV columns: product, store (apple | play | both), region (ISO alpha-2), currency, price, start_date (App Store
@ -21,6 +24,7 @@ import {
pointKey, type PriceRow, pricesCsv, sameSchedule, pointKey, type PriceRow, pricesCsv, sameSchedule,
} from './lib/prices'; } from './lib/prices';
import { playClient, type PlayClient } from './play/client'; import { playClient, type PlayClient } from './play/client';
import { allSubscriptions, appleSubPriceRows, basePlanId, type PlaySubscription, playSubPriceRows } from './lib/subscriptions';
const TAG = 'prices'; const TAG = 'prices';
@ -60,7 +64,9 @@ export async function run(ctx: Ctx): Promise<void> {
const useApple = (!store || store === 'apple') && !!config.apple; const useApple = (!store || store === 'apple') && !!config.apple;
const usePlay = (!store || store === 'play') && !!config.play; const usePlay = (!store || store === 'play') && !!config.play;
const only = a.list('only'); const only = a.list('only');
const products = need(config.products, 'products').filter(p => !only.length || only.includes(p.id)); const products = (config.products ?? []).filter(p => !only.length || only.includes(p.id));
const subs = sub === 'export' && !a.has('no-subscriptions') ? allSubscriptions(config.subscriptions).map(x => x.sub).filter(s => !only.length || only.includes(s.id)) : [];
if (!products.length && !subs.length) need(undefined, sub === 'export' ? 'products or subscriptions' : 'products');
const csvPath = resolve(a.get(sub === 'export' ? 'out' : 'csv') ?? config.prices?.csv ?? 'store/prices.csv'); const csvPath = resolve(a.get(sub === 'export' ? 'out' : 'csv') ?? config.prices?.csv ?? 'store/prices.csv');
const dry = a.has('dry'); const dry = a.has('dry');
@ -87,22 +93,46 @@ export async function run(ctx: Ctx): Promise<void> {
} }
} }
if (sub === 'export' && subs.length) {
const appleSubs = new Map<string, string>();
if (c) for (const g of await c.all(`/v1/apps/${appId}/subscriptionGroups?limit=200`))
for (const x of await c.all(`/v1/subscriptionGroups/${g.id}/subscriptions?limit=200`)) appleSubs.set(String(x.attributes.productId), x.id);
for (const [i, s] of subs.entries()) {
log(TAG, `${step(i + 1, subs.length, s.id)}: reading subscription prices`);
if (c) {
const id = appleSubs.get(s.id);
if (!id) { warn(TAG, `${s.id}: subscription not on App Store Connect (storebound apple subscriptions creates it)`); missing.push({ product: s.id, store: 'apple' }); }
else current.push(...appleSubPriceRows(s.id, await pages(c, `/v1/subscriptions/${id}/prices?include=subscriptionPricePoint,territory&limit=200`)));
}
if (play) {
let ps: PlaySubscription | null = null;
try { ps = await play.call<PlaySubscription>('GET', `${play.API}/subscriptions/${encodeURIComponent(s.id)}`); } catch (e) { if (!/-> 404/.test(String(e))) throw e; }
if (!ps) { warn(TAG, `${s.id}: subscription not on Google Play (storebound play subscriptions creates it)`); missing.push({ product: s.id, store: 'play' }); }
else current.push(...playSubPriceRows(ps, basePlanId(s)));
}
}
}
if (sub === 'export') { if (sub === 'export') {
// --json: the current prices as data (the desktop price view); read-only, never writes the CSV // --json: the current prices as data (the desktop price view); read-only, never writes the CSV
if (a.has('json')) { if (a.has('json')) {
printJson({ csv: csvPath, products: products.map(p => p.id), stores: [...(useApple ? ['apple'] : []), ...(usePlay ? ['play'] : [])], missing, printJson({ csv: csvPath, products: products.map(p => p.id), subscriptions: subs.map(s => s.id), stores: [...(useApple ? ['apple'] : []), ...(usePlay ? ['play'] : [])], missing,
rows: current.map(({ pointId: _p, ...r }) => r) }); rows: current.map(({ pointId: _p, ...r }) => r) });
return; return;
} }
const csv = pricesCsv(current); const csv = pricesCsv(current);
if (dry) { console.log(csv); done(TAG, `dry run: would write ${current.length} rows to ${csvPath}`); return; } if (dry) { console.log(csv); done(TAG, `dry run: would write ${current.length} rows to ${csvPath}`); return; }
writeFileSync(csvPath, csv); writeFileSync(csvPath, csv);
done(TAG, `${current.length} rows -> ${csvPath} (edit, then storebound prices import --dry)`); done(TAG, `${current.length} rows -> ${csvPath} (edit, then storebound prices import --dry${subs.length ? '; subscription rows: apple subscriptions --csv / play subscriptions --csv' : ''})`);
return; return;
} }
if (!existsSync(csvPath)) throw new Error(`no prices CSV at ${csvPath} (storebound prices export writes one)`); if (!existsSync(csvPath)) throw new Error(`no prices CSV at ${csvPath} (storebound prices export writes one)`);
const wantedAll = parsePriceCsv(readFileSync(csvPath, 'utf8'), { products: config.products!.map(p => p.id) }) const subIds = allSubscriptions(config.subscriptions).map(x => x.sub.id);
const sheet = parsePriceCsv(readFileSync(csvPath, 'utf8'), { products: [...(config.products ?? []).map(p => p.id), ...subIds] });
const subRows = sheet.filter(r => subIds.includes(r.product));
if (subRows.length) log(TAG, `${subRows.length} subscription row(s) skipped here: storebound apple subscriptions --csv ${a.get('csv') ?? config.prices?.csv ?? 'store/prices.csv'} --dry (and play subscriptions --csv) apply them`);
const wantedAll = sheet
.filter(r => products.some(p => p.id === r.product) && ((r.store === 'apple' && useApple) || (r.store === 'play' && usePlay))); .filter(r => products.some(p => p.id === r.product) && ((r.store === 'apple' && useApple) || (r.store === 'play' && usePlay)));
const diff = diffPrices(current, wantedAll); const diff = diffPrices(current, wantedAll);
const changed = new Set(diff.filter(d => d.change !== 'same').map(d => `${d.product}|${d.store}`)); const changed = new Set(diff.filter(d => d.change !== 'same').map(d => `${d.product}|${d.store}`));

View file

@ -1,6 +1,8 @@
// Offline, read-only scan of the project itself for App Store and Google Play rejection risks, before you submit. // Offline, read-only scan of the project itself for App Store and Google Play rejection risks, before you submit.
// storebound scan [--dir <project>] [--config <file>] [--store apple|play] [--json] [--no-declarations] // storebound scan [--dir <project>] [--config <file>] [--store apple|play] [--json] [--no-declarations]
// storebound scan --write also write the detected dataSafety / appPrivacy answers into the config // storebound scan --write also write the detected dataSafety / appPrivacy answers into the config
// storebound scan --originality [--against <folders>] [--threshold 0.7] also the 4.3 / Play repetitive content
// check against your other apps (storebound originality; folders default to originality.against in the config)
// Reads the project files (Xcode project, Info.plist, entitlements, privacy manifests, Podfile.lock, Package.resolved, // Reads the project files (Xcode project, Info.plist, entitlements, privacy manifests, Podfile.lock, Package.resolved,
// Gradle files, AndroidManifest.xml and a local build's merged manifest, res/xml and strings.xml, CMake / ndk-build // Gradle files, AndroidManifest.xml and a local build's merged manifest, res/xml and strings.xml, CMake / ndk-build
// files, package.json, app.json, capacitor.config, pubspec, Unity and Godot settings and ProjectVersion.txt), the // files, package.json, app.json, capacitor.config, pubspec, Unity and Godot settings and ProjectVersion.txt), the
@ -9,12 +11,13 @@
// answers as a diff against the config. Nothing is written without --write (and --dry always wins). No network. // answers as a diff against the config. Nothing is written without --write (and --dry always wins). No network.
// Exit 1 while an open blocker is left. // Exit 1 while an open blocker is left.
import { existsSync, readFileSync, writeFileSync } from 'node:fs'; import { existsSync, readFileSync, writeFileSync } from 'node:fs';
import { dirname, join, resolve } from 'node:path'; import { dirname, join, relative, resolve } from 'node:path';
import type { Args } from './lib/args'; import type { Args } from './lib/args';
import { CONFIG_NAMES } from './lib/config'; import { CONFIG_NAMES } from './lib/config';
import { log, printJson, warn } from './lib/log'; import { log, printJson, warn } from './lib/log';
import { upsertBlock } from './lib/scan/config-edit'; import { upsertBlock } from './lib/scan/config-edit';
import { formatScan, runScan } from './lib/scan'; import { addOriginality, formatScan, runScan } from './lib/scan';
import { compareAgainst } from './originality';
/** Project folder: --dir, else the folder of the nearest storebound.config.* above the working directory, else it. */ /** Project folder: --dir, else the folder of the nearest storebound.config.* above the working directory, else it. */
function projectDir(args: Args): string { function projectDir(args: Args): string {
@ -28,7 +31,17 @@ function projectDir(args: Args): string {
export async function run(args: Args): Promise<void> { export async function run(args: Args): Promise<void> {
const dir = projectDir(args); const dir = projectDir(args);
if (!existsSync(dir)) throw new Error(`${dir} does not exist`); if (!existsSync(dir)) throw new Error(`${dir} does not exist`);
const { report, configPath } = await runScan(dir, { config: args.get('config') }); const { report, configPath, config } = await runScan(dir, { config: args.get('config') });
if (args.has('originality')) {
if (!config || !configPath) report.originality = { error: 'no storebound.config.ts loaded in this project' };
else {
const base = dirname(configPath);
try {
const { report: o } = await compareAgainst({ config, root: base, resolve: p => resolve(base, p) }, args.list('against'), args.has('threshold') ? args.num('threshold', 0.7) : undefined, m => warn('scan', m));
addOriginality(report, o, { apple: !!config.apple, play: !!config.play }, config, p => relative(dir, p));
} catch (e) { report.originality = { error: (e as Error).message }; }
}
}
const store = args.get('store'); const store = args.get('store');
if (store === 'apple' || store === 'play') { if (store === 'apple' || store === 'play') {
report.findings = report.findings.filter(f => f.store === store); report.findings = report.findings.filter(f => f.store === store);

View file

@ -3,3 +3,4 @@ declare module '*.md' { const text: string; export default text; }
declare module '*.csv' { const text: string; export default text; } declare module '*.csv' { const text: string; export default text; }
declare module '*.html' { const text: string; export default text; } declare module '*.html' { const text: string; export default text; }
declare module '*.svg' { const text: string; export default text; } declare module '*.svg' { const text: string; export default text; }
declare module '*.yml' { const text: string; export default text; }

View file

@ -13,7 +13,7 @@ Specs: Apple [App Store Connect API 4.5.1](https://developer.apple.com/sample-co
| API | operations | GET | other | wrapped by a command | owner only | | API | operations | GET | other | wrapped by a command | owner only |
|---|---:|---:|---:|---:|---:| |---|---:|---:|---:|---:|---:|
| App Store Connect API 4.5.1 | 1303 | 826 | 477 | 186 | 166 | | App Store Connect API 4.5.1 | 1303 | 826 | 477 | 186 | 166 |
| Google Play Android Developer API v3 (revision 20261008) | 145 | 45 | 100 | 33 | 49 | | Google Play Android Developer API v3 (revision 20261008) | 145 | 45 | 100 | 34 | 49 |
| Google Play Developer Reporting API v1beta1 (revision 20261008) | 25 | 15 | 10 | 6 | 0 | | Google Play Developer Reporting API v1beta1 (revision 20261008) | 25 | 15 | 10 | 6 | 0 |
## App Store Connect API 4.5.1 ## App Store Connect API 4.5.1
@ -479,7 +479,7 @@ Specs: Apple [App Store Connect API 4.5.1](https://developer.apple.com/sample-co
| `apps_searchKeywords_getToManyRelationship` | GET | `/v1/apps/{id}/relationships/searchKeywords` | read | | | `apps_searchKeywords_getToManyRelationship` | GET | `/v1/apps/{id}/relationships/searchKeywords` | read | |
| `apps_subscriptionGracePeriod_getToOneRelated` | GET | `/v1/apps/{id}/subscriptionGracePeriod` | read | | | `apps_subscriptionGracePeriod_getToOneRelated` | GET | `/v1/apps/{id}/subscriptionGracePeriod` | read | |
| `apps_subscriptionGracePeriod_getToOneRelationship` | GET | `/v1/apps/{id}/relationships/subscriptionGracePeriod` | read | | | `apps_subscriptionGracePeriod_getToOneRelationship` | GET | `/v1/apps/{id}/relationships/subscriptionGracePeriod` | read | |
| `apps_subscriptionGroups_getToManyRelated` | GET | `/v1/apps/{id}/subscriptionGroups` | read | apple/iap-submit, apple/promoted, apple/subscriptions, apple/win-back, catalog, validate | | `apps_subscriptionGroups_getToManyRelated` | GET | `/v1/apps/{id}/subscriptionGroups` | read | apple/iap-submit, apple/promoted, apple/subscriptions, apple/win-back, catalog, prices, validate |
| `apps_subscriptionGroups_getToManyRelationship` | GET | `/v1/apps/{id}/relationships/subscriptionGroups` | read | | | `apps_subscriptionGroups_getToManyRelationship` | GET | `/v1/apps/{id}/relationships/subscriptionGroups` | read | |
| `apps_updateInstance` | PATCH | `/v1/apps/{id}` | write (dry by default) | apple/appinfo | | `apps_updateInstance` | PATCH | `/v1/apps/{id}` | write (dry by default) | apple/appinfo |
| `apps_webhooks_getToManyRelated` | GET | `/v1/apps/{id}/webhooks` | read | | | `apps_webhooks_getToManyRelated` | GET | `/v1/apps/{id}/webhooks` | read | |
@ -1377,7 +1377,7 @@ Specs: Apple [App Store Connect API 4.5.1](https://developer.apple.com/sample-co
| `subscriptionGroups_getInstance` | GET | `/v1/subscriptionGroups/{id}` | read | | | `subscriptionGroups_getInstance` | GET | `/v1/subscriptionGroups/{id}` | read | |
| `subscriptionGroups_subscriptionGroupLocalizations_getToManyRelated` | GET | `/v1/subscriptionGroups/{id}/subscriptionGroupLocalizations` | read | apple/subscriptions, validate | | `subscriptionGroups_subscriptionGroupLocalizations_getToManyRelated` | GET | `/v1/subscriptionGroups/{id}/subscriptionGroupLocalizations` | read | apple/subscriptions, validate |
| `subscriptionGroups_subscriptionGroupLocalizations_getToManyRelationship` | GET | `/v1/subscriptionGroups/{id}/relationships/subscriptionGroupLocalizations` | read | | | `subscriptionGroups_subscriptionGroupLocalizations_getToManyRelationship` | GET | `/v1/subscriptionGroups/{id}/relationships/subscriptionGroupLocalizations` | read | |
| `subscriptionGroups_subscriptions_getToManyRelated` | GET | `/v1/subscriptionGroups/{id}/subscriptions` | read | apple/iap-submit, apple/promoted, apple/subscriptions, apple/win-back, catalog, validate | | `subscriptionGroups_subscriptions_getToManyRelated` | GET | `/v1/subscriptionGroups/{id}/subscriptions` | read | apple/iap-submit, apple/promoted, apple/subscriptions, apple/win-back, catalog, prices, validate |
| `subscriptionGroups_subscriptions_getToManyRelationship` | GET | `/v1/subscriptionGroups/{id}/relationships/subscriptions` | read | | | `subscriptionGroups_subscriptions_getToManyRelationship` | GET | `/v1/subscriptionGroups/{id}/relationships/subscriptions` | read | |
| `subscriptionGroups_updateInstance` | PATCH | `/v1/subscriptionGroups/{id}` | write (dry by default) | | | `subscriptionGroups_updateInstance` | PATCH | `/v1/subscriptionGroups/{id}` | write (dry by default) | |
| `subscriptionGroups_versions_getToManyRelated` | GET | `/v1/subscriptionGroups/{id}/versions` | read | apple/iap-submit | | `subscriptionGroups_versions_getToManyRelated` | GET | `/v1/subscriptionGroups/{id}/versions` | read | apple/iap-submit |
@ -1474,7 +1474,7 @@ Specs: Apple [App Store Connect API 4.5.1](https://developer.apple.com/sample-co
| `subscriptions_pricePoints_getToManyRelated` | GET | `/v1/subscriptions/{id}/pricePoints` | read | apple/subscriptions, apple/win-back | | `subscriptions_pricePoints_getToManyRelated` | GET | `/v1/subscriptions/{id}/pricePoints` | read | apple/subscriptions, apple/win-back |
| `subscriptions_pricePoints_getToManyRelationship` | GET | `/v1/subscriptions/{id}/relationships/pricePoints` | read | | | `subscriptions_pricePoints_getToManyRelationship` | GET | `/v1/subscriptions/{id}/relationships/pricePoints` | read | |
| `subscriptions_prices_deleteToManyRelationship` | DELETE | `/v1/subscriptions/{id}/relationships/prices` | owner only (typed confirm) | | | `subscriptions_prices_deleteToManyRelationship` | DELETE | `/v1/subscriptions/{id}/relationships/prices` | owner only (typed confirm) | |
| `subscriptions_prices_getToManyRelated` | GET | `/v1/subscriptions/{id}/prices` | read | apple/subscriptions, apple/win-back, catalog | | `subscriptions_prices_getToManyRelated` | GET | `/v1/subscriptions/{id}/prices` | read | apple/subscriptions, apple/win-back, catalog, prices |
| `subscriptions_prices_getToManyRelationship` | GET | `/v1/subscriptions/{id}/relationships/prices` | read | | | `subscriptions_prices_getToManyRelationship` | GET | `/v1/subscriptions/{id}/relationships/prices` | read | |
| `subscriptions_promotedPurchase_getToOneRelated` | GET | `/v1/subscriptions/{id}/promotedPurchase` | read | | | `subscriptions_promotedPurchase_getToOneRelated` | GET | `/v1/subscriptions/{id}/promotedPurchase` | read | |
| `subscriptions_promotedPurchase_getToOneRelationship` | GET | `/v1/subscriptions/{id}/relationships/promotedPurchase` | read | | | `subscriptions_promotedPurchase_getToOneRelationship` | GET | `/v1/subscriptions/{id}/relationships/promotedPurchase` | read | |
@ -1663,7 +1663,7 @@ Specs: Apple [App Store Connect API 4.5.1](https://developer.apple.com/sample-co
| `androidpublisher.monetization.subscriptions.batchUpdate` | POST | `androidpublisher/v3/applications/{packageName}/subscriptions:batchUpdate` | write (dry by default) | | | `androidpublisher.monetization.subscriptions.batchUpdate` | POST | `androidpublisher/v3/applications/{packageName}/subscriptions:batchUpdate` | write (dry by default) | |
| `androidpublisher.monetization.subscriptions.create` | POST | `androidpublisher/v3/applications/{packageName}/subscriptions` | write (dry by default) | play/subscriptions | | `androidpublisher.monetization.subscriptions.create` | POST | `androidpublisher/v3/applications/{packageName}/subscriptions` | write (dry by default) | play/subscriptions |
| `androidpublisher.monetization.subscriptions.delete` | DELETE | `androidpublisher/v3/applications/{packageName}/subscriptions/{productId}` | owner only (typed confirm) | | | `androidpublisher.monetization.subscriptions.delete` | DELETE | `androidpublisher/v3/applications/{packageName}/subscriptions/{productId}` | owner only (typed confirm) | |
| `androidpublisher.monetization.subscriptions.get` | GET | `androidpublisher/v3/applications/{packageName}/subscriptions/{productId}` | read | | | `androidpublisher.monetization.subscriptions.get` | GET | `androidpublisher/v3/applications/{packageName}/subscriptions/{productId}` | read | prices |
| `androidpublisher.monetization.subscriptions.list` | GET | `androidpublisher/v3/applications/{packageName}/subscriptions` | read | catalog, play/subscriptions, validate | | `androidpublisher.monetization.subscriptions.list` | GET | `androidpublisher/v3/applications/{packageName}/subscriptions` | read | catalog, play/subscriptions, validate |
| `androidpublisher.monetization.subscriptions.patch` | PATCH | `androidpublisher/v3/applications/{packageName}/subscriptions/{productId}` | write (dry by default) | play/subscriptions | | `androidpublisher.monetization.subscriptions.patch` | PATCH | `androidpublisher/v3/applications/{packageName}/subscriptions/{productId}` | write (dry by default) | play/subscriptions |
| **androidpublisher.monetization.subscriptions.basePlans** (6) | | | | | | **androidpublisher.monetization.subscriptions.basePlans** (6) | | | | |

View file

@ -0,0 +1,23 @@
#!/usr/bin/env bun
// The home page's "Desktop app" screenshots (site/img/desktop/*.webp) from the same headless fixture-mode capture as
// the teaser (desktop.ts: Vite dev server of apps/desktop with VITE_FIXTURES=1, dev markers hidden), scaled to 1280 px
// and encoded with cwebp (quality 75). Run after a desktop UI change: bun media/teaser/site-shots.ts
import { existsSync, mkdirSync, statSync } from 'node:fs';
import { join } from 'node:path';
import { captureDesktop } from './desktop';
const ROOT = join(import.meta.dir, '../..');
const SRC = join(import.meta.dir, 'out/desktop');
const OUT = join(ROOT, 'site/img/desktop');
const NAMES = ['portfolio', 'releases', 'checks'];
if (process.argv.includes('--fresh') || !NAMES.every(n => existsSync(join(SRC, `${n}.jpg`)))) await captureDesktop();
mkdirSync(OUT, { recursive: true });
for (const n of NAMES) {
const out = join(OUT, `${n}.webp`);
const p = Bun.spawnSync(['cwebp', '-quiet', '-q', '75', '-m', '6', '-resize', '1280', '0', join(SRC, `${n}.jpg`), '-o', out]);
if (p.exitCode !== 0) throw new Error(`cwebp ${n}: ${p.stderr.toString()}`);
const kb = statSync(out).size / 1024;
if (kb > 150) throw new Error(`${n}.webp is ${kb.toFixed(0)} KB (limit 150)`);
console.log(`${n}.webp ${kb.toFixed(0)} KB`);
}

View file

@ -18,7 +18,7 @@
<meta property="og:title" content="storebound desktop · download"> <meta property="og:title" content="storebound desktop · download">
<meta property="og:description" content="Every app and game on both stores in one window. macOS, Windows, Linux."> <meta property="og:description" content="Every app and game on both stores in one window. macOS, Windows, Linux.">
<meta property="og:image" content="https://storebound.dev/og.png?v=2"> <meta property="og:image" content="https://storebound.dev/og.png?v=2">
<link rel="stylesheet" href="../style.css?v=a23e9a4"> <link rel="stylesheet" href="../style.css?v=20261012">
<script>document.documentElement.classList.add('js')</script> <script>document.documentElement.classList.add('js')</script>
<style> <style>
/* page-only parts; colours and type come from ../style.css tokens (fallbacks keep the page readable alone) */ /* page-only parts; colours and type come from ../style.css tokens (fallbacks keep the page readable alone) */

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View file

@ -25,7 +25,7 @@
<meta name="twitter:title" content="storebound · take your app or game from zero to Submit for review"> <meta name="twitter:title" content="storebound · take your app or game from zero to Submit for review">
<meta name="twitter:description" content="For mobile apps and games: app records, in-app products and subscriptions, listings in every language, every questionnaire, privacy, icons, screenshots. One config and your AI coding agent."> <meta name="twitter:description" content="For mobile apps and games: app records, in-app products and subscriptions, listings in every language, every questionnaire, privacy, icons, screenshots. One config and your AI coding agent.">
<meta name="twitter:image" content="https://storebound.dev/og.png?v=2"> <meta name="twitter:image" content="https://storebound.dev/og.png?v=2">
<link rel="stylesheet" href="style.css?v=f4a8d5f"> <link rel="stylesheet" href="style.css?v=20261012">
<script>document.documentElement.classList.add('js')</script> <script>document.documentElement.classList.add('js')</script>
<script src="main.js?v=0ac6422" defer></script> <script src="main.js?v=0ac6422" defer></script>
</head> </head>
@ -43,6 +43,7 @@
<a href="#journey">Journey</a> <a href="#journey">Journey</a>
<a href="#start">Quick start</a> <a href="#start">Quick start</a>
<a href="#faq">FAQ</a> <a href="#faq">FAQ</a>
<a href="desktop/">Desktop</a>
<a class="nav-git" href="https://git.crt.fyi/CRT/storebound" target="_blank" rel="noopener">git<span class="ext" aria-hidden="true">↗</span><span class="sr-only"> (opens in a new tab)</span></a> <a class="nav-git" href="https://git.crt.fyi/CRT/storebound" target="_blank" rel="noopener">git<span class="ext" aria-hidden="true">↗</span><span class="sr-only"> (opens in a new tab)</span></a>
</nav> </nav>
</div> </div>
@ -489,7 +490,52 @@
</div> </div>
</section> </section>
<section class="sec alt" id="split" aria-labelledby="split-h"> <section class="sec alt" id="scan" aria-labelledby="scan-h">
<div class="wrap">
<p class="kicker">Rejection scan</p>
<h2 id="scan-h">Catch rejections before you submit.</h2>
<p class="sub"><code>storebound scan</code> reads your project offline and read-only: Xcode and Gradle files, Info.plist, manifests, entitlements, lockfiles and engine settings, plus your config and listings. It works out the stack and the SDKs, then reports every rejection risk it can prove, each with the guideline, the evidence as <code>file:line</code>, the fix, a severity and the skill to open.</p>
<div class="term scan-term">
<div class="term-bar" aria-hidden="true"><span></span><span></span><span></span><em>tests/fixtures/scan/teaser</em></div>
<pre><code><span class="p">$</span> storebound scan
Rejection risks: 2 blocker, 3 high, 0 medium, 0 low
1. BLOCKER 2.1(a) · App Store · Sign-in is required but there is no demo account for App Review
at storebound.config.ts:12 reviewAccess: { signInRequired: true, instructions: 'Sign in with the demo account.' },
at storebound.config.ts:11 accounts: { enabled: true },
at Podfile.lock:3 Google Sign-In: GoogleSignIn 7.1.0
2. BLOCKER 5.1.1(v) · App Store · Accounts can be created but no in-app account deletion was found
at storebound.config.ts:11 accounts: { enabled: true },
at Planner/LoginView.swift:11 Button("Create account") { Task { try await AccountApi.signUp() } }
at Planner/LoginView.swift:17 static func signUp() async throws {
3. HIGH 4.8 · App Store · Third-party login (Google / Facebook / ...) without Sign in with Apple or another equivalent login option
at Podfile.lock:3 Google Sign-In: GoogleSignIn 7.1.0
at Planner/LoginView.swift:9 GIDSignIn.sharedInstance.signIn(withPresenting: rootViewController()) { _, _ in }
<span class="c"> ... 2 more findings; every finding also has a fix: line and the skill</span></code></pre>
</div>
<h3 class="rules-h">What it proves, on both stores</h3>
<ul class="rules" aria-label="Scan rules, summarized">
<li><span class="rg"><b>2.1(a)</b><i>App access</i></span><p>A sign-in with no demo account for the reviewer.</p></li>
<li><span class="rg"><b>5.1.1(v)</b><i>Account deletion</i></span><p>Sign-up or social login without an in-app deletion path or a deletion URL.</p></li>
<li><span class="rg"><b>4.8</b></span><p>Google or Facebook login without Sign in with Apple or another equivalent option.</p></li>
<li><span class="rg"><b>3.1.1, 3.1.2</b><i>Payments</i></span><p>No Restore Purchases path, card SDKs next to in-app products, missing subscription terms.</p></li>
<li><span class="rg"><b>5.1.2</b><i>Data safety</i></span><p>Tracking SDKs without ATT; SDK data types missing from App Privacy or Data safety.</p></li>
<li><span class="rg"><b>5.1.1, ITMS-91053</b></span><p>Permissions without purpose strings; a missing or incomplete privacy manifest.</p></li>
<li><span class="rg"><i>Restricted permissions</i></span><p>Background location, photos, all files, accessibility, exact alarms, foreground services, and the Console declaration each one needs.</p></li>
<li><span class="rg"><b>1.3</b><i>Families</i></span><p>Ad or analytics SDKs in a Kids Category or child-directed app.</p></li>
<li><span class="rg"><i>Target API, 16 KB pages</i></span><p>targetSdk below 36; Unity, React Native, NDK or AGP versions without 16 KB page support.</p></li>
<li><span class="rg"><b>2.3.7, 2.3.10</b><i>Metadata</i></span><p>Other apps' names, "best / #1", keyword lists, other stores in App Store text, placeholder text.</p></li>
<li><span class="rg"><b>2.2</b></span><p>"Beta", "demo" or "test" wording in the app name and the listing.</p></li>
<li><span class="rg"><b>4.3</b><i>Repetitive content</i></span><p><code>scan --originality --against &lt;folders&gt;</code> adds the near-duplicate check against your other apps.</p></li>
</ul>
<ul class="legend" aria-label="Legend">
<li><span class="rg"><b>4.8</b></span> App Store guideline</li>
<li><span class="rg"><i>Families</i></span> Google Play policy</li>
</ul>
<p class="note">Below the risks comes a proposal for Data safety, App Privacy, ATT and the privacy manifest from the detected SDKs, each answer marked detected or ask owner. Nothing is written unless you run <code>scan --write</code>. <code>validate</code> includes the open findings, and the desktop app shows them on its Checks tab.</p>
</div>
</section>
<section class="sec" id="split" aria-labelledby="split-h">
<div class="wrap"> <div class="wrap">
<p class="kicker">API or console, honestly</p> <p class="kicker">API or console, honestly</p>
<h2 id="split-h">What it automates, what your agent walks through, what stays your click.</h2> <h2 id="split-h">What it automates, what your agent walks through, what stays your click.</h2>
@ -540,7 +586,7 @@
</div> </div>
</section> </section>
<section class="sec" id="apps" aria-labelledby="apps-h"> <section class="sec alt" id="apps" aria-labelledby="apps-h">
<div class="wrap"> <div class="wrap">
<p class="kicker">Apps and games</p> <p class="kicker">Apps and games</p>
<h2 id="apps-h">Not just for games. Pick a profile, start from honest templates.</h2> <h2 id="apps-h">Not just for games. Pick a profile, start from honest templates.</h2>
@ -574,7 +620,7 @@
</div> </div>
</section> </section>
<section class="sec alt" id="questionnaires" aria-labelledby="q-h"> <section class="sec" id="questionnaires" aria-labelledby="q-h">
<div class="wrap"> <div class="wrap">
<p class="kicker">Questionnaires</p> <p class="kicker">Questionnaires</p>
<h2 id="q-h">Every store form, prepared. The ones with an API, filled.</h2> <h2 id="q-h">Every store form, prepared. The ones with an API, filled.</h2>
@ -621,7 +667,7 @@
</div> </div>
</section> </section>
<section class="sec" id="works-with" aria-labelledby="w-h"> <section class="sec alt" id="works-with" aria-labelledby="w-h">
<div class="wrap"> <div class="wrap">
<p class="kicker">Works with</p> <p class="kicker">Works with</p>
<h2 id="w-h">Your AI coding agent. Or none.</h2> <h2 id="w-h">Your AI coding agent. Or none.</h2>
@ -639,7 +685,7 @@
</div> </div>
</section> </section>
<section class="sec alt" id="store-art" aria-labelledby="art-h"> <section class="sec" id="store-art" aria-labelledby="art-h">
<div class="wrap"> <div class="wrap">
<p class="kicker">Store art</p> <p class="kicker">Store art</p>
<h2 id="art-h">Screenshots and previews, every size, every language.</h2> <h2 id="art-h">Screenshots and previews, every size, every language.</h2>
@ -671,7 +717,7 @@
</div> </div>
</section> </section>
<section class="sec" id="after-launch" aria-labelledby="after-h"> <section class="sec alt" id="after-launch" aria-labelledby="after-h">
<div class="wrap"> <div class="wrap">
<p class="kicker">After launch</p> <p class="kicker">After launch</p>
<h2 id="after-h">The app is live. storebound keeps going.</h2> <h2 id="after-h">The app is live. storebound keeps going.</h2>
@ -717,7 +763,54 @@
</div> </div>
</section> </section>
<section class="sec alt" id="start" aria-labelledby="start-h"> <section class="sec" id="more" aria-labelledby="more-h">
<div class="wrap">
<p class="kicker">Everything else</p>
<h2 id="more-h">The rest of the toolbox, one line each.</h2>
<p class="sub">Same rules as everywhere else: reads run, writes show a dry run first, and public steps stay your click. <code>storebound help</code> lists every command.</p>
<ul class="more">
<li><span class="more-cmd"><code>ws</code><code>release status|plan</code></span><p>Many apps and studios at once; one release train per version across both stores, and what is left on each.</p></li>
<li><span class="more-cmd"><code>api</code></span><p>Every App Store Connect and Google Play API operation. GET runs; writes stay dry.</p></li>
<li><span class="more-cmd"><code>apple build</code><code>apple upload</code><code>play build</code><code>play upload</code><code>apple signing</code></span><p>Build, sign and upload with the next free build number, from the terminal.</p></li>
<li><span class="more-cmd"><code>console fill</code></span><p>AI-assisted autofill of console-only forms in a visible browser you sign in to. Stops before Save or Submit.</p></li>
<li><span class="more-cmd"><code>apple testflight</code><code>apple cpp</code><code>apple events</code><code>apple offer-codes</code><code>apple win-back</code><code>apple preorder</code><code>reports</code><code>triage</code></span><p>Store operations: betas, custom product pages, in-app events, offers, pre-orders, sales reports and crash feedback.</p></li>
<li><span class="more-cmd"><code>prices ppp</code></span><p>A purchasing-power price sheet, snapped to each store's price points.</p></li>
<li><span class="more-cmd"><code>ads apple</code></span><p>Apple Ads campaigns and reports: spend, taps, installs and CPA per campaign or keyword.</p></li>
<li><span class="more-cmd"><code>web init|check</code></span><p>Smart App Banner, apple-app-site-association, assetlinks.json and a landing page, then a live check.</p></li>
<li><span class="more-cmd"><code>apple adhoc</code><code>play share</code></span><p>Ad-hoc builds for registered devices and Play internal app sharing links.</p></li>
<li><span class="more-cmd"><code>revenuecat diff|sync</code></span><p>Keep a RevenueCat catalog, entitlements and offering in step with your config.</p></li>
<li><span class="more-cmd"><code>flow list|run</code><span class="new">new</span></span><p>Repo-local workflows in <code>store/workflows/*.yml</code>, e.g. next build, build, upload, wait, What's new, validate, scan, plan. Writes stay dry unless <code>--apply</code>; submit and release steps show as your click; <code>--from</code> resumes.</p></li>
<li><span class="more-cmd"><code>listing translate --to de-DE,ja</code><span class="new">new</span></span><p>Listing drafts per language with each store's limits and keyword rules, translated by your agent or a <code>--translate</code> hook, marked as drafts until reviewed.</p></li>
</ul>
</div>
</section>
<section class="sec alt" id="desktop" aria-labelledby="desktop-h">
<div class="wrap">
<p class="kicker">Desktop app · preview</p>
<h2 id="desktop-h">Every app on both stores, in one window.</h2>
<p class="sub">storebound desktop shows every app and game you ship: releases on both stores, catalog parity, listings, crash health, reviews and TestFlight. It drives the same open source CLI, keeps store keys in the system keychain, shows a dry run before every change, and never presses Submit.</p>
<figure class="shot shot-wide">
<img src="img/desktop/portfolio.webp?v=1" width="1280" height="800" alt="storebound desktop, Portfolio: every app of every studio grouped by studio, with its state on Google Play and the App Store" loading="lazy" decoding="async">
<figcaption>Portfolio: every app of every studio, both stores side by side.</figcaption>
</figure>
<div class="desk2">
<figure class="shot">
<img src="img/desktop/releases.webp?v=1" width="1280" height="800" alt="storebound desktop, Releases: the release timeline of the demo game Prism Puddle, both stores rolling out at 20 percent" loading="lazy" decoding="async">
<figcaption>Releases: one timeline per version, both stores rolling out.</figcaption>
</figure>
<figure class="shot">
<img src="img/desktop/checks.webp?v=1" width="1280" height="800" alt="storebound desktop, Checks: the Rejection risks card with the scan findings of the demo game" loading="lazy" decoding="async">
<figcaption>Checks: the rejection scan findings, with evidence and the fix.</figcaption>
</figure>
</div>
<div class="ctas">
<a class="btn btn-primary" href="desktop/">Download the desktop app<span class="ic ic-caret-right" aria-hidden="true"></span></a>
</div>
</div>
</section>
<section class="sec" id="start" aria-labelledby="start-h">
<div class="wrap"> <div class="wrap">
<p class="kicker">Quick start</p> <p class="kicker">Quick start</p>
<h2 id="start-h">Five minutes to a checked config.</h2> <h2 id="start-h">Five minutes to a checked config.</h2>
@ -815,7 +908,7 @@ bunx storebound check <span class="c"># offline: config, copy limits, Data saf
</div> </div>
</section> </section>
<section class="sec" id="safety" aria-labelledby="safety-h"> <section class="sec alt" id="safety" aria-labelledby="safety-h">
<div class="wrap"> <div class="wrap">
<p class="kicker">Safety model</p> <p class="kicker">Safety model</p>
<h2 id="safety-h">Built to be handed to an agent.</h2> <h2 id="safety-h">Built to be handed to an agent.</h2>
@ -829,7 +922,7 @@ bunx storebound check <span class="c"># offline: config, copy limits, Data saf
</div> </div>
</section> </section>
<section class="sec alt" id="faq" aria-labelledby="faq-h"> <section class="sec" id="faq" aria-labelledby="faq-h">
<div class="wrap faq-in"> <div class="wrap faq-in">
<div class="faq-side"> <div class="faq-side">
<p class="kicker">FAQ</p> <p class="kicker">FAQ</p>
@ -867,7 +960,7 @@ bunx storebound check <span class="c"># offline: config, copy limits, Data saf
</details> </details>
<details> <details>
<summary><h3>Can I use it for many apps?</h3></summary> <summary><h3>Can I use it for many apps?</h3></summary>
<div class="faq-a"><p>Yes. Each app or game gets its own config in its own repo, so the same checks and store art pipeline run for every title. If you ship many similar apps, the <code>portfolio-originality</code> skill checks them against Apple's spam guideline (4.3) and Play's repetitive content policy before review.</p></div> <div class="faq-a"><p>Yes. Each app or game gets its own config in its own repo, so the same checks and store art pipeline run for every title. If you ship many similar apps, <code>storebound originality --against &lt;folders&gt;</code> compares one against the others offline (listing text, name, icon and screenshot perceptual hashes, project structure) for Apple's spam guideline (4.3) and Play's repetitive content policy, and exits with 1 on a near-duplicate. <code>storebound scan --originality</code> runs the same check as part of the scan, and the <code>portfolio-originality</code> skill walks your agent through the fixes.</p></div>
</details> </details>
<details> <details>
<summary><h3>Does it run on Windows or Linux?</h3></summary> <summary><h3>Does it run on Windows or Linux?</h3></summary>

View file

@ -2,6 +2,10 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url> <url>
<loc>https://storebound.dev/</loc> <loc>https://storebound.dev/</loc>
<lastmod>2026-10-10</lastmod> <lastmod>2026-10-12</lastmod>
</url>
<url>
<loc>https://storebound.dev/desktop/</loc>
<lastmod>2026-10-12</lastmod>
</url> </url>
</urlset> </urlset>

View file

@ -180,6 +180,34 @@ h2 { font-size: clamp(26px, 4.4vw, 38px); font-weight: 750; max-width: 22em; }
.facts li { font-size: 15px; color: var(--ink-2); padding-left: 14px; border-left: 2px solid var(--accent); } .facts li { font-size: 15px; color: var(--ink-2); padding-left: 14px; border-left: 2px solid var(--accent); }
.facts b { color: var(--ink); } .facts b { color: var(--ink); }
/* rejection scan */
.scan-term { margin-top: 36px; }
.scan-term pre { font-size: 12.5px; line-height: 1.7; }
.rules-h { font-size: 20px; margin-top: 40px; }
.rules { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 12px; }
@media (min-width: 640px) { .rules { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 980px) { .rules { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rules > li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.rules p { margin-top: 8px; font-size: 14.5px; color: var(--ink-2); }
.rg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.rg b, .rg i { font: 700 11.5px/1 var(--mono); font-style: normal; padding: 5px 8px; border-radius: 999px; }
.rg b { background: var(--accent-soft); color: var(--accent); }
.rg i { background: var(--api-bg); color: var(--api-ink); }
/* everything else */
.more { list-style: none; padding: 0; margin: 36px 0 0; display: grid; gap: 12px; }
@media (min-width: 760px) { .more { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.more > li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.more-cmd { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.more-cmd code { font-size: 12.5px; }
.more p { margin-top: 8px; font-size: 14.5px; color: var(--ink-2); }
.more p code { white-space: nowrap; }
.new { font: 700 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; padding: 4px 7px; border-radius: 999px; background: var(--you-bg); color: var(--you-ink); }
/* desktop app */
.desk2 { display: grid; gap: 20px; margin-top: 24px; }
@media (min-width: 760px) { .desk2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* quick start */ /* quick start */
.start { display: grid; gap: 40px; margin-top: 36px; } .start { display: grid; gap: 40px; margin-top: 36px; }
.step { min-width: 0; } .step { min-width: 0; }

View file

@ -0,0 +1,45 @@
---
name: listing-localization
description: Translate the store listing of a mobile app or game into more languages - App Store name, subtitle, promotional text, keywords and description, Google Play title, short and full description - as per-language drafts in store/appstore.md and store/listing.md, translated by the agent (or a provider hook the owner sets), checked against each store's character limits and keyword rules, and marked as machine-translated until a human reviewed them. Use when the user wants the listing in new languages, asks to localize or translate the store page, or adds a language to the config.
---
# Listing localization
CLI: `storebound listing translate --to <languages> [--from <language>] [--store apple|play] [--translate "<command>"] [--force] [--dry]`,
`storebound listing check`, `storebound listing reviewed --lang <ids>`. MCP: `listing_translate`, `listing_check`.
Local files only: nothing is sent to a store until the owner pushes with `apple listing` / `play listing`.
## Steps
1. The target language must be in `languages[]` of `storebound.config.ts` (id, Play code, App Store locale). Add it
there first; ask the owner which stores the language goes on.
2. `storebound listing translate --to de,ja --dry`, then without `--dry`. Values are config ids or store codes; the
source is `--from` or the primary language. Per target it writes the App Store section (`## de-DE · de`) and the
Play section (`<!-- play: de-DE -->`) with the **source text** and the marker
`<!-- storebound-translation from=en-US status=translate -->`. A section without a marker (reviewed) is kept
unless `--force`; a section's What's new block is kept (release notes: whats-new skill).
3. **You translate** every field of each `status=translate` section in place, then set the marker to `status=draft`:
- Natural, native wording for that market, the app's own terms; not word by word. Keep product names and numbers.
- Limits (characters): App Store name 30, subtitle 30, promotional text 170, keywords 100, description 4000;
Google Play title 30, short description 80, full description 4000. Shorten, never cut mid-word.
- **Keywords are researched, not translated:** the words people in that market search for, comma separated,
no spaces after commas, no duplicates, no words already in the name or subtitle (they are indexed anyway), no
competitor or trademark names, 100 characters (bytes for CJK) used well (aso-basics).
- Subtitle and short description: the benefit in plain words, no "best / #1 / free", no prices, no other platforms.
- Arabic and Hebrew stay RTL; Chinese / Japanese / Korean need no spaces in keywords.
4. Optional provider hook (the owner's choice): `--translate "<command>"` runs the command once per field with the
source text on stdin and `STOREBOUND_SOURCE_LANG`, `STOREBOUND_TARGET_LANG`, `STOREBOUND_STORE` (apple | play),
`STOREBOUND_FIELD` and `STOREBOUND_LIMIT` in the environment; stdout becomes the field and the section gets
`status=draft`. Keywords from a hook are cleaned up (duplicates, name / subtitle words, the 100 limit). Any key the
hook needs lives in the owner's environment, never in the config.
5. `storebound listing check` (MCP `listing_check`): every section against the limits and keyword rules, untranslated
sections, text identical to the source; exit 1 on a problem. `storebound check` also warns about drafts.
6. **The owner reviews** each draft (ideally a native speaker), then `storebound listing reviewed --lang de,ja`
removes the markers. Only then push: `storebound apple listing --version x` / `storebound play listing`.
## Gotchas
- Machine-translated store text that reads badly costs conversion; keep the draft marker until a human read it.
- The App Store keyword field of one locale also counts in other storefronts of that language (aso-basics: free
keyword room), so do not repeat the same keywords across en-US / en-GB / en-AU.
- Screenshots captions are separate (`store/shots/copy.json`, store-screenshots skill); in-app product texts are in
the config (`products[].listings`).
- A store rejects the whole listing update when one field is over its limit: run `listing check` before pushing.

View file

@ -0,0 +1,60 @@
---
name: release-flows
description: Repo-local workflows for a mobile app or game - named multi-step flows in store/workflows/*.yml (release, beta, or your own) that run storebound steps in order (next build number, build, upload, wait for processing, release notes, validate, scan, release plan) with progress, dry runs by default, resume after a failure and the owner's clicks (Submit for Review, release, rollout) listed but never executed. Use when the user wants to automate a release or beta routine, replace fastlane lanes, asks for a "one command" release, or wants to resume a failed release run.
---
# Release flows
CLI: `storebound flow list | validate | run <name> [NAME=value ...] [--dry | --apply] [--from <step> | --resume]`.
MCP: `flow_list`, `flow_run` (always the safe mode: writes as dry runs; `--apply` is a terminal command the owner runs).
## Where flows live
- `store/workflows/<name>.yml` (one flow per file, named after the file; `.yaml`, `.json` and `.ts` work too), or
- `storebound.workflows.yml|json|ts` with several flows (`flows: { release: {...}, beta: {...} }`).
- `storebound init --profile app|game` writes `release.yml` and `beta.yml` as starting points.
## A flow
```yaml
description: Build, upload and check one version on both stores
params:
VERSION: "1.0.0" # flow run release VERSION=1.2.0 overrides
steps:
- id: next-build
if: apple # apple | play | exists <path> | ${VAR} | !${VAR} | ${A} == x; && joins
run: apple next-build # a storebound command line, without "storebound"
capture: BUILD # the last stdout line becomes ${BUILD}
- id: build
run: apple build --version ${VERSION} --build-number ${BUILD}
- id: web
sh: npm run build:web # your own shell command: only runs with --apply
- id: submit
owner: "App Store Connect: Submit for Review" # never run: listed as your click
- id: beta
flow: beta # the steps of another flow (ids become beta.<id>); `private: true` hides a sub-flow
before: [] # hooks: before / after the steps, onError when a step failed
after: []
onError: []
```
`continueOnError: true` lets a step fail without stopping the flow.
## Modes
- `flow run release VERSION=1.2.0` (default): read steps (check, validate, scan, release plan, next-build, status ...)
run for real; **every write step runs with `--dry`**; wait steps check once; shell steps are skipped. Nothing
changes. Show this output to the owner.
- `--dry`: the plan only, nothing runs.
- `--apply`: writes and shell steps run for real, **only after the owner agreed in chat**; each write command still
asks its own confirmation in the terminal. Never add `--yes` (flow validate refuses it).
- Owner steps never run in any mode: submit, release, phased release, rollout, sending review replies, price
imports, inviting testers, Beta App Review, starting experiments, offer codes (AGENTS.md rule 1). They print as
"YOUR CLICK" with the exact text, also when written as `run:`.
- A failed step stops the flow and names it; after the fix `storebound flow run release --resume [--apply]` starts at
that step with the captured variables of the last run (`.storebound/flows/<name>.json`). `--from <step>` starts
anywhere.
## Writing flows for the owner
1. Start from the init templates; keep one store concern per step so a resume is cheap.
2. Pick builds by the captured number (`${BUILD}`), never "the latest" (AGENTS.md rule 6).
3. Long uploads: run the flow in a terminal with a log (`storebound flow run release --apply > .storebound/flow.log 2>&1 &`)
and report the progress lines.
4. `storebound flow validate` before committing a flow: unknown commands, `${VAR}` that no param or earlier capture
sets, duplicate ids, sub-flow cycles.

View file

@ -0,0 +1,36 @@
# storebound flow "beta": a TestFlight / internal testing build for your testers.
# storebound flow run beta VERSION=1.2.0 [--apply]
description: Next build to TestFlight and Play internal testing
params:
VERSION: "1.0.0"
GROUP: "Internal"
steps:
- id: check
run: check
- id: next-build
if: apple
run: apple next-build
capture: BUILD
- id: build
if: apple
run: apple build --version ${VERSION} --build-number ${BUILD}
- id: upload
if: apple
run: apple upload --no-wait
- id: wait
if: apple
run: apple testflight wait --build ${BUILD} --version ${VERSION}
- id: what-to-test
if: apple
run: apple testflight what-to-test --build ${BUILD}
- id: distribute
if: apple
run: apple testflight distribute --build ${BUILD} --group ${GROUP}
- id: play-build
if: play
run: play build --version-name ${VERSION}
- id: play-upload
if: play
run: play upload --track internal
- id: external
owner: "External testers: storebound apple testflight distribute --build ${BUILD} --group <external group> --submit-review (Beta App Review is your call)"

View file

@ -0,0 +1,43 @@
# storebound flow "release": one version of the app on both stores, up to your Submit click.
# storebound flow run release VERSION=1.2.0 reads run, writes run as dry runs (nothing changes)
# storebound flow run release VERSION=1.2.0 --apply writes run for real; each command still asks you first
# storebound flow run release --resume --apply continue after fixing a failed step
# Steps are storebound commands (no "storebound" prefix). `if: apple` / `if: play` skip a store the config does not
# have; `owner:` steps are never run, they list what you click. Edit freely: this file is yours.
description: Build, upload and check one version on both stores, then your Submit click
params:
VERSION: "1.0.0"
steps:
- id: next-build
if: apple
run: apple next-build
capture: BUILD
- id: build
if: apple
run: apple build --version ${VERSION} --build-number ${BUILD}
- id: upload
if: apple
run: apple upload --no-wait
- id: wait
if: apple
run: apple testflight wait --build ${BUILD} --version ${VERSION}
- id: play-build
if: play
run: play build --version-name ${VERSION}
- id: play-upload
if: play
run: play upload --track internal
- id: whats-new
if: exists store/whats-new
run: whats-new apply
- id: listing
if: apple
run: apple listing --version ${VERSION} --build ${BUILD}
- id: validate
run: validate
- id: scan
run: scan
- id: plan
run: release plan ${VERSION}
- id: submit
owner: "App Store Connect: Submit for Review (version ${VERSION}, build ${BUILD}). Play Console: promote the internal release and Send changes for review"

View file

@ -0,0 +1,37 @@
# storebound flow "beta" for a game: a playtest build on TestFlight and Play internal testing.
# storebound flow run beta VERSION=1.2.0 [--apply]
description: Next game build to TestFlight and Play internal testing
params:
VERSION: "1.0.0"
GROUP: "Playtesters"
steps:
- id: check
run: check
- id: ads
if: exists ios
run: ads scan --ios ios
continueOnError: true
- id: next-build
if: apple
run: apple next-build
capture: BUILD
- id: build
if: apple
run: apple build --version ${VERSION} --build-number ${BUILD}
- id: upload
if: apple
run: apple upload --no-wait
- id: wait
if: apple
run: apple testflight wait --build ${BUILD} --version ${VERSION}
- id: distribute
if: apple
run: apple testflight distribute --build ${BUILD} --group ${GROUP}
- id: play-build
if: play
run: play build --version-name ${VERSION}
- id: play-upload
if: play
run: play upload --track internal
- id: external
owner: "External playtesters: storebound apple testflight distribute --build ${BUILD} --group <external group> --submit-review (Beta App Review is your call)"

View file

@ -0,0 +1,46 @@
# storebound flow "release" for a game: one version on both stores, up to your Submit click.
# storebound flow run release VERSION=1.2.0 reads run, writes run as dry runs (nothing changes)
# storebound flow run release VERSION=1.2.0 --apply writes run for real; each command still asks you first
# storebound flow run release --resume --apply continue after fixing a failed step
# Steps are storebound commands (no "storebound" prefix). `if: apple` / `if: play` skip a store the config does not
# have; `owner:` steps are never run, they list what you click. `sh:` runs your own build command (only with --apply).
description: Build, upload and check one game version on both stores, then your Submit click
params:
VERSION: "1.0.0"
steps:
- id: shots
if: exists store/renders
run: shots check
- id: next-build
if: apple
run: apple next-build
capture: BUILD
- id: build
if: apple
run: apple build --version ${VERSION} --build-number ${BUILD}
- id: upload
if: apple
run: apple upload --no-wait
- id: wait
if: apple
run: apple testflight wait --build ${BUILD} --version ${VERSION}
- id: play-build
if: play
run: play build --version-name ${VERSION}
- id: play-upload
if: play
run: play upload --track internal
- id: whats-new
if: exists store/whats-new
run: whats-new apply
- id: listing
if: apple
run: apple listing --version ${VERSION} --build ${BUILD}
- id: validate
run: validate
- id: scan
run: scan
- id: plan
run: release plan ${VERSION}
- id: submit
owner: "App Store Connect: Submit for Review (version ${VERSION}, build ${BUILD}). Play Console: promote the internal release and Send changes for review"

205
tests/flow.test.ts Normal file
View file

@ -0,0 +1,205 @@
// storebound flow: the YAML subset, step classification (owner steps never run, writes dry unless --apply), checks,
// the plan, and real runs in a temp project (progress, capture, failure and --resume, the init templates).
import { afterAll, describe, expect, test } from 'bun:test';
import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { classify, evalIf, expand, type Flow, flowsOfFile, parseParams, planStep, resumePoint, splitArgs, startIndex, substitute, toFlow, validateFlows } from '../cli/lib/flow';
import { parseYaml } from '../cli/lib/yaml';
import { FORBIDDEN_ARGS, TOOLS, toArgv, validateInput } from '../cli/mcp-tools';
const ROOT = join(import.meta.dir, '..');
const CLI = join(ROOT, 'cli', 'index.ts');
const tmp = mkdtempSync(join(tmpdir(), 'storebound-flow-'));
afterAll(() => rmSync(tmp, { recursive: true, force: true }));
const sb = (cwd: string, ...args: string[]) => Bun.spawnSync([process.execPath, CLI, ...args], { cwd, stdout: 'pipe', stderr: 'pipe', stdin: 'ignore' });
const C = { apple: true, play: false, exists: (p: string) => p === 'store/whats-new' };
const flow = (name: string, steps: unknown[], extra: Record<string, unknown> = {}): Flow => toFlow(name, 'test.yml', { steps, ...extra }).flow!;
describe('yaml subset', () => {
test('maps, lists of maps, lists at the key indentation, scalars, quotes, comments, inline lists, block scalars', () => {
const v = parseYaml(`# a flow
description: Ship it # trailing comment
params:
VERSION: "1.0.0"
N: 3
ON: true
steps:
- id: a
run: apple next-build
capture: BUILD
- id: b
run: 'say "hi" # not a comment'
continueOnError: false
tags: [one, "two", 3]
note: |
line one
line two
fold: >
a
b
`);
expect(v).toEqual({ description: 'Ship it', params: { VERSION: '1.0.0', N: 3, ON: true },
steps: [{ id: 'a', run: 'apple next-build', capture: 'BUILD' }, { id: 'b', run: 'say "hi" # not a comment', continueOnError: false }],
tags: ['one', 'two', 3], note: 'line one\nline two\n', fold: 'a b\n' });
expect(parseYaml('steps:\n - id: x\n run: check\n - plain\n')).toEqual({ steps: [{ id: 'x', run: 'check' }, 'plain'] });
});
test('errors name the line', () => {
expect(() => parseYaml('a: 1\na: 2')).toThrow('line 2: "a" twice');
expect(() => parseYaml('a:\n\tb: 1')).toThrow('tabs');
expect(() => parseYaml('a: {b: 1}')).toThrow('inline maps');
expect(() => parseYaml('a: &x 1')).toThrow('anchors');
expect(() => parseYaml('a: "open')).toThrow('line 1');
});
});
describe('steps', () => {
test('classification: reads, writes, waits, owner steps', () => {
expect(classify(['validate'])).toBe('read');
expect(classify(['release', 'plan', '1.2.0'])).toBe('read');
expect(classify(['apple', 'next-build'])).toBe('read');
expect(classify(['apple', 'upload', '--no-wait'])).toBe('write');
expect(classify(['whats-new', 'apply'])).toBe('write');
expect(classify(['apple', 'testflight', 'wait', '--build', '7'])).toBe('wait');
for (const owner of [['apple', 'release', '--phased', 'on'], ['play', 'rollout', '--complete'], ['reviews', 'send'], ['prices', 'import'],
['apple', 'testflight', 'distribute', '--build', '7', '--group', 'x', '--submit-review'], ['apple', 'iap-submit'], ['apple', 'ppo', 'start'], ['play', 'release', '--production', 'completed']])
expect(classify(owner)).toBe('owner');
expect(classify(['prices', 'import', '--dry'])).toBe('read');
expect(splitArgs(`apple testflight what-to-test --text "New levels, fewer bugs" --build 7`)).toEqual(['apple', 'testflight', 'what-to-test', '--text', 'New levels, fewer bugs', '--build', '7']);
});
test('plan per mode: writes get --dry unless --apply, owner steps never run, shell only with --apply, if conditions', () => {
const vars = { VERSION: '1.2.0', BUILD: '42' };
const up = { id: 'upload', run: 'apple upload --no-wait' };
expect(planStep(up, 'steps', 'dry', vars, C)).toMatchObject({ kind: 'write', argv: ['apple', 'upload', '--no-wait', '--dry'], dryAdded: true });
expect(planStep(up, 'steps', 'apply', vars, C)).toMatchObject({ argv: ['apple', 'upload', '--no-wait'], dryAdded: false });
expect(planStep(up, 'steps', 'plan', vars, C).skip).toContain('plan only');
expect(planStep({ id: 'w', run: 'apple testflight wait --build ${BUILD}' }, 'steps', 'dry', vars, C).argv).toEqual(['apple', 'testflight', 'wait', '--build', '42', '--dry']);
expect(planStep({ id: 'v', run: 'validate' }, 'steps', 'dry', vars, C)).toMatchObject({ argv: ['validate'], dryAdded: false });
for (const mode of ['plan', 'dry', 'apply'] as const) {
expect(planStep({ id: 'r', run: 'apple release --phased on' }, 'steps', mode, vars, C)).toMatchObject({ kind: 'owner', skip: expect.stringContaining('your click') });
expect(planStep({ id: 's', owner: 'Submit ${VERSION}' }, 'steps', mode, vars, C)).toMatchObject({ kind: 'owner', owner: 'Submit 1.2.0' });
}
expect(planStep({ id: 'sh', sh: 'npm run build' }, 'steps', 'dry', vars, C).skip).toContain('--apply');
expect(planStep({ id: 'sh', sh: 'npm run build' }, 'steps', 'apply', vars, C).skip).toBeUndefined();
expect(planStep({ id: 'p', run: 'play build', if: 'play' }, 'steps', 'apply', vars, C).skip).toBe('if play: false');
expect(planStep({ id: 'n', run: 'whats-new apply', if: 'exists store/whats-new' }, 'steps', 'apply', vars, C).skip).toBeUndefined();
});
test('conditions, variables, params', () => {
expect(evalIf('apple && !play', C)).toBe(true);
expect(evalIf('1.2 == 1.2', C)).toBe(true);
expect(evalIf('a != a', C)).toBe(false);
expect(evalIf('${UNSET}', C)).toBe(false);
expect(evalIf('false', C)).toBe(false);
expect(substitute('v${VERSION} ${env.HOME_X} ${NOPE}', { VERSION: '2' }, { HOME_X: 'h' })).toBe('v2 h ${NOPE}');
expect(parseParams(['VERSION=1.2.0', 'GROUP=a=b'])).toEqual({ VERSION: '1.2.0', GROUP: 'a=b' });
expect(() => parseParams(['version=1'])).toThrow('NAME=value');
});
test('validation: --yes refused, unknown variables, duplicate ids, cycles, unknown commands, storebound prefix', () => {
const f = flow('bad', [{ id: 'a', run: 'apple upload --yes' }, { id: 'a', run: 'check ${NOPE}' }, { id: 'c', run: 'storebound check' }, { id: 'd', run: 'frobnicate now' }, { id: 'e', flow: 'loop' }]);
const loop = flow('loop', [{ id: 'x', flow: 'bad' }]);
const e = validateFlows([f, loop], { commands: new Set(['check', 'apple upload']) }).join('\n');
expect(e).toContain('--yes is not allowed');
expect(e).toContain('${NOPE} is not a param');
expect(e).toContain('id used twice');
expect(e).toContain('without "storebound"');
expect(e).toContain('"frobnicate now" is not a storebound command');
expect(e).toContain('cycle');
expect(toFlow('x', 'f.yml', { steps: [{ id: 'a', run: 'check', sh: 'ls' }], extra: 1 }).errors.join()).toContain('exactly one of run, sh, owner, flow');
expect(flowsOfFile('w.yml', { flows: { a: { steps: [{ id: 's', run: 'check' }] } } }, null).flows.map(x => x.name)).toEqual(['a']);
});
test('sub-flows expand with prefixed ids; --from and --resume points', () => {
const beta = flow('beta', [{ id: 'build', run: 'apple build' }, { id: 'upload', run: 'apple upload' }], { private: true, params: { GROUP: 'qa' } });
const rel = flow('release', [{ id: 'check', run: 'check' }, { id: 'beta', flow: 'beta', if: 'apple' }, { id: 'plan', run: 'release plan 1.0' }]);
const all = new Map([['beta', beta], ['release', rel]]);
const x = expand(rel, all);
expect(x.steps.map(s => s.id)).toEqual(['check', 'beta.build', 'beta.upload', 'plan']);
expect(x.steps[1]!.if).toBe('apple');
expect(x.params).toEqual({ GROUP: 'qa' });
expect(startIndex(x.steps, 'beta')).toBe(1);
expect(() => startIndex(x.steps, 'nope')).toThrow('no such step');
expect(resumePoint(x.steps, { flow: 'release', mode: 'dry', startedAt: '', vars: {}, ok: false,
results: [{ id: 'check', part: 'steps', kind: 'read', status: 'ok' }, { id: 'beta.build', part: 'steps', kind: 'write', status: 'failed' }] })).toBe('beta.build');
});
});
describe('flow command', () => {
const app = join(tmp, 'app');
mkdirSync(join(app, 'store', 'workflows'), { recursive: true });
test('init writes release and beta flows per profile; they validate and plan', () => {
for (const profile of ['app', 'game']) {
const dir = join(tmp, `init-${profile}`);
mkdirSync(dir);
expect(sb(dir, 'init', '--profile', profile).exitCode).toBe(0);
expect(existsSync(join(dir, 'store/workflows/release.yml'))).toBe(true);
expect(existsSync(join(dir, 'store/workflows/beta.yml'))).toBe(true);
const v = sb(dir, 'flow', 'validate');
expect(v.stderr.toString() + v.stdout.toString()).toContain('2 flow(s) in 2 file(s): ok');
const l = JSON.parse(sb(dir, 'flow', 'list', '--json').stdout.toString());
const steps = l.flows.find((f: { name: string }) => f.name === 'release').steps.map((s: { id: string }) => s.id);
expect(steps.slice(0, 4)).toEqual(profile === 'app' ? ['next-build', 'build', 'upload', 'wait'] : ['shots', 'next-build', 'build', 'upload']);
expect(steps.slice(-4)).toEqual(['validate', 'scan', 'plan', 'submit']);
const p = sb(dir, 'flow', 'run', 'release', 'VERSION=2.0.0', '--dry', '--json');
expect(p.exitCode).toBe(0);
const r = JSON.parse(p.stdout.toString());
expect(r.mode).toBe('plan');
expect(r.results.find((x: { id: string }) => x.id === 'submit').status).toBe('owner');
expect(r.results.find((x: { id: string }) => x.id === 'upload').command).toBe('storebound apple upload --no-wait --dry');
expect(r.results.find((x: { id: string }) => x.id === 'build').command).toContain('--version 2.0.0');
}
});
test('a real run: progress, capture, dry writes, owner click, failure, --resume', () => {
writeFileSync(join(app, 'store', 'workflows', 'ship.yml'), `description: test flow
params:
NAME: demo
steps:
- id: version
run: version
capture: V
- id: marker
sh: test -f ok.txt
- id: after
sh: echo "got \${V} \${NAME}" > out.txt
- id: submit
owner: "Submit \${NAME} \${V}"
`);
const dry = sb(app, 'flow', 'run', 'ship');
const out = dry.stdout.toString();
expect(dry.exitCode).toBe(0);
expect(out).toContain('1/4 version: storebound version --dry (dry run)');
expect(out).toContain('V=');
expect(out).toContain('shell step: runs with --apply');
expect(out).toContain('YOUR CLICK Submit demo');
expect(out).toContain('dry run: nothing changed');
expect(existsSync(join(app, 'out.txt'))).toBe(false);
const fail = sb(app, 'flow', 'run', 'ship', '--apply', 'NAME=x');
expect(fail.exitCode).toBe(1);
expect(fail.stdout.toString()).toContain('stopped at marker');
const state = JSON.parse(readFileSync(join(app, '.storebound/flows/ship.json'), 'utf8'));
expect(state.results.map((r: { id: string; status: string }) => `${r.id}:${r.status}`)).toEqual(['version:ok', 'marker:failed']);
writeFileSync(join(app, 'ok.txt'), '');
const res = sb(app, 'flow', 'run', 'ship', '--resume', '--apply', 'NAME=x');
expect(res.exitCode).toBe(0);
expect(res.stdout.toString()).toContain('starting at marker (--resume)');
expect(res.stdout.toString()).not.toContain('version: storebound version');
const pkg = JSON.parse(readFileSync(join(ROOT, 'package.json'), 'utf8')).version;
expect(readFileSync(join(app, 'out.txt'), 'utf8').trim()).toBe(`got ${pkg} x`);
expect(sb(app, 'flow', 'run', 'ship', '--resume').stderr.toString()).toContain('nothing to resume');
expect(sb(app, 'flow', 'run', 'ship', '--from', 'after', '--apply').exitCode).toBe(0);
expect(sb(app, 'flow', 'run', 'nope').stderr.toString()).toContain('no flow "nope"');
});
test('MCP: flow_list and a dry flow_run that never applies', () => {
const list = TOOLS.find(t => t.name === 'flow_list')!;
const run = TOOLS.find(t => t.name === 'flow_run')!;
expect(list.write).toBe(false);
expect(run.write).toBe(false);
expect(validateInput(run, { name: 'release', params: { VERSION: '1.2.0' }, from: 'build' })).toEqual([]);
expect(validateInput(run, { name: '--apply' }).join()).toContain('name');
const argv = toArgv(run, { name: 'release', params: { VERSION: '1.2.0', bad: 'x' }, plan_only: true }).argv;
expect(argv).toEqual(['flow', 'run', 'release', 'VERSION=1.2.0', '--dry', '--json']);
expect(argv.some(a => FORBIDDEN_ARGS.includes(a) || a === '--apply')).toBe(false);
});
});

View file

@ -0,0 +1,99 @@
// storebound listing translate / check / reviewed: per-language listing drafts in both listing files, store limits,
// keyword rules, the --translate hook and the review marker.
import { afterAll, describe, expect, test } from 'bun:test';
import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { parseAppStoreListing, parsePlayListing } from '../cli/lib/copy';
import { appleFields, checkFields, findAppleSection, findPlaySection, markerOf, normalizeKeywords, playFields, putSection, unmark } from '../cli/lib/listing-translate';
const ROOT = join(import.meta.dir, '..');
const CLI = join(ROOT, 'cli', 'index.ts');
const tmp = mkdtempSync(join(tmpdir(), 'storebound-listing-'));
afterAll(() => rmSync(tmp, { recursive: true, force: true }));
const sb = (cwd: string, ...args: string[]) => Bun.spawnSync([process.execPath, CLI, ...args], { cwd, stdout: 'pipe', stderr: 'pipe', stdin: 'ignore' });
describe('rules', () => {
test('keywords: commas, duplicates, name / subtitle words, whole keywords cut at 100', () => {
const r = normalizeKeywords('Liste , notizen,liste、 planer,Aufgaben,,familie', { name: 'Listen App', subtitle: 'Notizen und mehr' });
expect(r.text).toBe('Liste,planer,Aufgaben,familie');
expect(r.dropped).toEqual([{ kw: 'notizen', why: 'already in the name or subtitle' }, { kw: 'liste', why: 'duplicate' }]);
const long = normalizeKeywords(Array.from({ length: 30 }, (_, i) => `keyword${i}`).join(','));
expect(long.text.length).toBeLessThanOrEqual(100);
expect(long.text.endsWith(',')).toBe(false);
expect(long.dropped.at(-1)!.why).toBe('over 100');
// multi-byte: 100 bytes, not characters
expect(Buffer.byteLength(normalizeKeywords(Array.from({ length: 20 }, (_, i) => `日本語${i}`).join(',')).text)).toBeLessThanOrEqual(100);
});
test('limits per store field, keyword rules, untranslated and identical text', () => {
const c = checkFields('apple', { subtitle: 'x'.repeat(31), keywords: 'a, b,a', description: 'Same long description text' }, { description: 'Same long description text' }, 'draft');
expect(c.find(x => x.field === 'subtitle')!.problems).toEqual(['31 > 30 characters']);
expect(c.find(x => x.field === 'keywords')!.problems.join()).toContain('spaces around commas');
expect(c.find(x => x.field === 'keywords')!.problems.join()).toContain('duplicates: a');
expect(c.find(x => x.field === 'description')!.problems).toEqual(['identical to the source language']);
expect(checkFields('play', { short: 's'.repeat(81), full: 'ok' }).map(x => x.problems)).toEqual([['81 > 80 characters'], []]);
expect(checkFields('play', { short: 'short' }, {}, 'translate')[0]!.problems).toEqual(['not translated yet (status=translate)']);
});
test('sections: replace in place keeps the rest, markers come off after review', () => {
const md = '# X\n\n## en-US · English\n\n### subtitle\n```\nA\n```\n\n---\n\n## tr · Türkçe\n\n### subtitle\n```\nB\n```\n';
const out = putSection(md, findAppleSection(md, 'en-US'), '## en-US · English\n<!-- storebound-translation from=tr status=draft -->\n\n### subtitle\n```\nC\n```\n');
expect(out).toContain('```\nC\n```\n\n---\n\n## tr');
expect(markerOf(findAppleSection(out, 'en-US')!)).toEqual({ from: 'tr', status: 'draft' });
expect(unmark(findAppleSection(out, 'en-US')!)).toBe('## en-US · English\n\n### subtitle\n```\nC\n```\n\n---\n\n');
});
});
describe('listing commands', () => {
const dir = join(tmp, 'app');
mkdirSync(dir);
sb(dir, 'init', '--profile', 'app');
const cfg = join(dir, 'storebound.config.ts');
writeFileSync(cfg, readFileSync(cfg, 'utf8').replace("{ id: 'tr', play: 'tr-TR', apple: 'tr' },", "{ id: 'tr', play: 'tr-TR', apple: 'tr' },\n { id: 'de', play: 'de-DE', apple: 'de-DE' },\n { id: 'ja', play: 'ja-JP', apple: 'ja' },"));
const apple = join(dir, 'store/appstore.md'), play = join(dir, 'store/listing.md');
test('without a hook: source text copied in as status=translate, check fails until translated', () => {
const r = sb(dir, 'listing', 'translate', '--to', 'de-DE,ja', '--json');
expect(r.exitCode).toBe(0);
const j = JSON.parse(r.stdout.toString());
expect(j.source).toBe('en');
expect(j.results.map((x: { lang: string; store: string; action: string }) => `${x.lang}/${x.store}/${x.action}`)).toEqual(
['de/apple/added (status=translate)', 'de/play/added (status=translate)', 'ja/apple/added (status=translate)', 'ja/play/added (status=translate)']);
const md = readFileSync(apple, 'utf8');
expect(markerOf(findAppleSection(md, 'ja')!)).toEqual({ from: 'en-US', status: 'translate' });
expect(appleFields(findAppleSection(md, 'ja')!).keywords).toBe(appleFields(findAppleSection(md, 'en-US')!).keywords);
expect(Object.keys(parseAppStoreListing(md))).toEqual(['en-US', 'tr', 'de-DE', 'ja']);
expect(parsePlayListing(readFileSync(play, 'utf8'), 'Example App').map(c => c.lang)).toEqual(['en-US', 'tr-TR', 'de-DE', 'ja-JP']);
const c = sb(dir, 'listing', 'check');
expect(c.exitCode).toBe(1);
expect(c.stdout.toString()).toContain('TO TRANSLATE');
expect(sb(dir, 'listing', 'reviewed', '--lang', 'ja').stderr.toString()).toContain('still status=translate');
const check = sb(dir, 'check');
expect(check.stderr.toString()).toContain('not translated yet (status=translate): de-DE, ja');
});
test('with --translate: one call per field with the env, keywords cleaned up, drafts until reviewed; reviewed sections kept', () => {
const hook = join(tmp, 'hook.sh');
writeFileSync(hook, '#!/bin/sh\nif [ "$STOREBOUND_FIELD" = keywords ]; then echo "Liste, liste,notizen,$STOREBOUND_TARGET_LANG"; else printf "[%s %s %s %s] " "$STOREBOUND_STORE" "$STOREBOUND_FIELD" "$STOREBOUND_TARGET_LANG" "$STOREBOUND_LIMIT"; tr a-z A-Z; fi\n');
const r = sb(dir, 'listing', 'translate', '--to', 'de', '--translate', `sh ${hook}`);
expect(r.exitCode).toBe(0);
const sec = findAppleSection(readFileSync(apple, 'utf8'), 'de-DE')!;
expect(markerOf(sec)!.status).toBe('draft');
const f = appleFields(sec);
expect(f.subtitle).toBe('[apple subtitle de-DE 30] LISTS AND NOTES, IN SYNC');
expect(f.keywords).toBe('Liste,notizen,de-DE');
expect(r.stdout.toString()).toContain('dropped "liste" (duplicate)');
const p = playFields(findPlaySection(readFileSync(play, 'utf8'), ['de-DE'])!);
expect(p.short).toStartWith('[play short de-DE 80] ');
expect(p.whatsNew).toBeUndefined();
const c = sb(dir, 'listing', 'check', '--json');
const j = JSON.parse(c.stdout.toString());
expect(j.drafts).toEqual(['apple:de-DE', 'play:de-DE']);
expect(sb(dir, 'listing', 'reviewed', '--lang', 'de').stdout.toString()).toContain('2 section(s) marked reviewed');
expect(markerOf(findAppleSection(readFileSync(apple, 'utf8'), 'de-DE')!)).toBeNull();
// a reviewed section is kept unless --force
const again = JSON.parse(sb(dir, 'listing', 'translate', '--to', 'de', '--translate', `sh ${hook}`, '--json').stdout.toString());
expect(again.results.map((x: { action: string }) => x.action)).toEqual(['kept (reviewed; --force replaces it)', 'kept (reviewed; --force replaces it)']);
expect(sb(dir, 'listing', 'translate', '--to', 'en').stderr.toString()).toContain('source language');
expect(sb(dir, 'listing', 'translate', '--to', 'xx').stderr.toString()).toContain('not a language of the config');
});
});

View file

@ -142,4 +142,21 @@ describe('originality report', () => {
expect(none.exitCode).toBe(1); expect(none.exitCode).toBe(1);
expect(none.stderr.toString()).toContain('nothing to compare with'); expect(none.stderr.toString()).toContain('nothing to compare with');
}); });
test('scan --originality adds the 4.3 / repetitive content findings to the scan report', () => {
const scan = (args: string[]) => Bun.spawnSync([process.execPath, join(ROOT, 'cli/index.ts'), 'scan', ...args], { cwd: me, stdout: 'pipe', stderr: 'pipe' });
const j = JSON.parse(scan(['--originality', '--against', '..', '--json']).stdout.toString());
const f = j.findings.filter((x: { rule: string }) => x.rule === 'originality');
expect(f.length).toBeGreaterThan(0);
expect(f[0].guideline).toBe('4.3');
expect(f[0].title).toContain('Candy Merge Garden');
expect(f[0].skill).toBe('portfolio-originality');
expect(j.originality.flagged).toBe(1);
expect(j.originality.pairs.map((p: { app: string }) => p.app)).toEqual(['Candy Merge Garden', 'Pace Runner']);
const txt = scan(['--originality', '--against', '../pace']).stdout.toString();
expect(txt).toContain('Originality (4.3 / Play repetitive content): 1 app(s) compared, 0 near-duplicate(s)');
const plain = JSON.parse(scan(['--json']).stdout.toString());
expect(plain.originality).toBeUndefined();
expect(plain.findings.some((x: { rule: string }) => x.rule === 'originality')).toBe(false);
});
}); });

View file

@ -4,6 +4,7 @@ import {
type PriceRow, pricesCsv, sameSchedule, type PriceRow, pricesCsv, sameSchedule,
} from '../cli/lib/prices'; } from '../cli/lib/prices';
import { TOOLS, toArgv } from '../cli/mcp-tools'; import { TOOLS, toArgv } from '../cli/mcp-tools';
import { appleSubPriceRows, playSubPriceRows } from '../cli/lib/subscriptions';
const P = 'com.example.game.remove_ads'; const P = 'com.example.game.remove_ads';
const csv = `product,store,region,currency,price,start_date const csv = `product,store,region,currency,price,start_date
@ -65,6 +66,34 @@ describe('store state -> rows', () => {
}); });
}); });
describe('subscription rows (prices export)', () => {
test('apple: price in effect today plus scheduled ones; play: base plan regional prices', () => {
const resp = {
data: [
{ id: 'p1', type: 'subscriptionPrices', attributes: { startDate: null }, relationships: { subscriptionPricePoint: { data: { id: 'pp1' } }, territory: { data: { id: 'USA' } } } },
{ id: 'p2', type: 'subscriptionPrices', attributes: { startDate: '2030-01-01' }, relationships: { subscriptionPricePoint: { data: { id: 'pp2' } }, territory: { data: { id: 'USA' } } } },
{ id: 'p3', type: 'subscriptionPrices', attributes: { startDate: '2024-01-01' }, relationships: { subscriptionPricePoint: { data: { id: 'pp3' } }, territory: { data: { id: 'DEU' } } } },
],
included: [
{ type: 'subscriptionPricePoints', id: 'pp1', attributes: { customerPrice: '4.99' } }, { type: 'subscriptionPricePoints', id: 'pp2', attributes: { customerPrice: '5.99' } },
{ type: 'subscriptionPricePoints', id: 'pp3', attributes: { customerPrice: '4.99' } },
{ type: 'territories', id: 'USA', attributes: { currency: 'USD' } }, { type: 'territories', id: 'DEU', attributes: { currency: 'EUR' } },
],
};
expect(appleSubPriceRows('pro.monthly', resp, '2026-10-12')).toEqual([
{ product: 'pro.monthly', store: 'apple', region: 'US', territory: 'USA', currency: 'USD', price: 4.99 },
{ product: 'pro.monthly', store: 'apple', region: 'DE', territory: 'DEU', currency: 'EUR', price: 4.99 },
{ product: 'pro.monthly', store: 'apple', region: 'US', territory: 'USA', currency: 'USD', price: 5.99, startDate: '2030-01-01' },
]);
const play = { productId: 'pro.monthly', basePlans: [{ basePlanId: 'monthly', regionalConfigs: [{ regionCode: 'US', price: { currencyCode: 'USD', units: '4', nanos: 990000000 } }, { regionCode: 'TR', price: { currencyCode: 'TRY', units: '99' } }] }] };
expect(playSubPriceRows(play, 'monthly')).toEqual([
{ product: 'pro.monthly', store: 'play', region: 'US', currency: 'USD', price: 4.99 }, { product: 'pro.monthly', store: 'play', region: 'TR', currency: 'TRY', price: 99 }]);
// the rows round-trip through the sheet that apple / play subscriptions --csv read
const csv = pricesCsv([...appleSubPriceRows('pro.monthly', resp, '2026-10-12').filter(r => !r.startDate), ...playSubPriceRows(play, 'monthly')]);
expect(parsePriceCsv(csv, { products: ['pro.monthly'] }).length).toBe(4);
});
});
describe('diff', () => { describe('diff', () => {
const current: PriceRow[] = [ const current: PriceRow[] = [
{ product: P, store: 'apple', region: 'US', territory: 'USA', currency: 'USD', price: 2.99 }, { product: P, store: 'apple', region: 'US', territory: 'USA', currency: 'USD', price: 2.99 },

View file

@ -332,6 +332,25 @@ describe('config writing', () => {
}); });
describe('integration', () => { describe('integration', () => {
test('2.2: beta / demo / test wording in the app name or the App Store text (not "demo account")', async () => {
const dir = mkdtempSync(join(tmpdir(), 'storebound-scan-beta-'));
try {
cpSync(join(FX, 'clean'), dir, { recursive: true });
const cfg = join(dir, 'storebound.config.ts');
writeFileSync(cfg, readFileSync(cfg, 'utf8').replace("name: 'Clean Notes'", "name: 'Clean Notes Beta'"));
const md = join(dir, 'store', 'appstore.md');
const text = readFileSync(md, 'utf8');
writeFileSync(md, text.replace(/(### description\n```\n)/, '$1This is a demo of the full app.\nReviewers use the demo account.\n'));
const f = find((await runScan(dir)).report.findings, 'beta-wording', 'apple')!;
expect(f.guideline).toBe('2.2');
expect(f.severity).toBe('high');
expect(f.evidence[0]!.text).toContain('Clean Notes Beta');
expect(f.evidence.some(e => e.file === join('store', 'appstore.md') && /demo of the full app/.test(e.text))).toBe(true);
writeFileSync(cfg, readFileSync(cfg, 'utf8').replace("'Clean Notes Beta'", "'Clean Notes'"));
writeFileSync(md, text.replace(/(### description\n```\n)/, '$1Reviewers use the demo account. Start a free trial of Pro.\n'));
expect(find((await runScan(dir)).report.findings, 'beta-wording')).toBeUndefined();
} finally { rmSync(dir, { recursive: true, force: true }); }
});
test('JSON output, --store filter, exit code', () => { test('JSON output, --store filter, exit code', () => {
const r = Bun.spawnSync(['bun', CLI, 'scan', '--dir', join(FX, 'teaser'), '--json', '--store', 'apple'], { env: { ...process.env, REVIEW_DEMO_USER: '', REVIEW_DEMO_PASSWORD: '' } }); const r = Bun.spawnSync(['bun', CLI, 'scan', '--dir', join(FX, 'teaser'), '--json', '--store', 'apple'], { env: { ...process.env, REVIEW_DEMO_USER: '', REVIEW_DEMO_PASSWORD: '' } });
expect(r.exitCode).toBe(1); expect(r.exitCode).toBe(1);