--- name: setup description: Connect InstallTally MCP and configure aggregate app acquisition measurement from the current app repository. Use when the user asks to set up InstallTally, register an iOS or Android app, or finish its measurement setup. --- # Set up InstallTally Use the selected workspace's MCP connection. The hosted service is https://api.installtally.com/mcp; preserve an explicitly selected self-hosted endpoint. The customer panel is https://app.installtally.com. No mobile attribution SDK is needed. ## Check the loaded plugin version Once per top-level setup, call local MCP `check_plugin_version`. It runs the bundled [version checker](../../scripts/check-plugin-version.mjs) without shell access. If that tool is unavailable, use the bundled Node script from this loaded plugin's absolute path only when local execution is available; otherwise report NOT RUN and continue compatible work. Reuse this result if setup later invokes doctor. It reads only its own manifests and unauthenticated public release metadata, never credentials. `current` or `ahead`: continue without an update question or downgrade. `update_available`: show installed/latest and release URL; ask once whether to update unless the user already explicitly requested that update. Execute only the selected client's fixed commands after approval, preserve unrelated plugins, then require a new session before claiming new skills are loaded. If declined, continue compatible authorized work. `unknown`, offline, rate limiting or missing Node: say the version check is unverified/NOT RUN and continue; never claim current, request GitHub credentials or automatically install a runtime. An old installed release needs a one-time update before it gains this preflight. ## Reuse existing MCP authorization Use the current working OAuth connection and verify `list_products`; preserve unrelated servers and workspace selection. Never open a browser, panel, provider console or login/consent URL (except section 3A of `create-apple-report-request`, on the customer's explicit request). This workflow does not implement browserless first-time account signup or Google/InstallTally consent. If no account-backed owner write authorization exists, report that precise prerequisite and continue independent read-only work. Legacy workspace bearers cannot authorize private owner credential transfer. Never extract tokens from another client's credential store or ask for passwords, bearer tokens, codes or provider keys in chat. Load [private MCP credential transfer](references/private-transfer.md) before connecting store credentials. It explains loading the official local companion and recipient-bound transfer without exposing keys to the model. If a required tool is unavailable on the actual server/client, stop that workflow and report the missing capability; never fall back to a browser. ## Detect the platforms and resume existing work Start discovery immediately; do not ask an opening **iOS / Android / both** question. Preserve the user's explicit platform scope, including a previously selected scope when resuming. Otherwise inspect this repository's real store IDs and compare the matching registered app: configure both when both platforms have verified IDs, or the single verified platform. A platform folder or sample ID alone is not sufficient evidence. Ask only when IDs conflict, multiple apps/workspaces match or no reliable platform evidence is available. Preserve platforms outside an explicit selection; do not duplicate products to add unsupported destinations. Treat setup as a resumable workflow: repository and existing-state discovery → resolved platform scope → matching registered app → missing campaign settings → private report API access → first report evidence → doctor. Read current state on each run. Announce the resolved platforms and immediately load their provider skills; do not wait for redundant confirmation. Do not restart completed steps, ask for saved inputs again or replace apps/links to work around an unsupported edit. When configuring both platforms, collect both identifiers before registering the app. Platform detection does not authorize provider key creation, IAM changes or Apple Admin bootstrap; obtain any required action-specific approval through the provider skill. ## Load the selected provider skills Before any store-report setup action, load and follow the bundled skill for each selected platform: | Selected platform | Required workflow | | --- | --- | | iOS | [setup-app-store-reports](../setup-app-store-reports/SKILL.md) | | Android | [setup-google-play-reports](../setup-google-play-reports/SKILL.md) | | Both | Load both workflows and complete or report the blocker for each separately | Use the client's skill invocation when available, or read the linked bundled `SKILL.md` and its required helper references. Do not replace these workflows with generic store instructions. If a required skill is missing, stop that provider's setup and explain how to install/update the official InstallTally plugin and start a new session. Continue independently ready work within the user's scope. Loading instructions is not proof of executing a helper or connecting a store: report which skills were loaded, which actions actually ran and which checks remain pending or NOT RUN. ## Configure the app 1. Read this repository's manifests/build configuration for real app names, Android package names and numeric App Store IDs. Do not scan unrelated directories or add code to the app. 2. Compare `list_products` and `get_product` results. Reuse the matching app; clarify ambiguous workspace/app matches. Use `create_product` only when absent, in aggregate mode. Existing destination edits are not exposed: report unsupported additions or changes instead of duplicating/replacing an app or archiving its links. Put iOS and Android destinations for the same app in one product; multiple products may share a workspace/account. 3. Use `get_integration`. Register iOS without its provider token if unavailable. When `pt` is missing, explain the steps below before asking for a generated App Store campaign link; its public `pt` tag can be added later with `set_apple_provider_token`. Never infer it from the App Store ID. That operation cannot replace an existing token. 4. Read `list_links` first. Reuse a matching test link for the same intended campaign/tags instead of creating another on every run; clarify ambiguous matches. Create a test-mode campaign link only when absent, for registered, ready destinations and known campaign tags. If required tags are missing, report the remaining input instead of inventing a production campaign. Verify redirects separately from acquisition evidence. Do not replace active ad links. 5. Inspect existing sources first with `list_store_sources`, `list_app_store_sources` and `list_data_sources` as applicable to the selected platforms. Reuse working sources and do not request another key upload. Distinguish absent, paused, pending, permission-error and working connections. Include missing report connections in initial setup, independently of `pt`. Follow the selected provider skills above for private MCP transfer, approved local MCP bootstrap and current server capability limits. MCP authorization does not grant provider access; a saved key, waiting worker or queued import does not prove report access. 6. After MCP saves a private connection, re-read source, worker/job and report evidence. Explain exactly what remains if access is denied or the first report is still being generated; do not mark setup complete merely because the app or link exists. On the next run continue from that outstanding step. Finish with the read-only `doctor` workflow and report configured app/platforms, verification evidence and remaining inputs. Distinguish registration, usable links and measured acquisitions. ## Explain Apple setup when needed Do not just request a provider token or tell the user to find a campaign link. Explain: **App Store Connect → Apps → the app → Analytics → Acquisition → Campaigns → +**. Enter a campaign name, copy the generated link, and take the digits after `pt=`. For illustration, `?pt=123456&ct=example&mt=8` contains `pt` value `123456`; never save this illustrative value for the user's app. The user can share the public generated link instead of extracting the tag manually. `pt` identifies the Apple developer account and is reused across that account's campaigns. `ct` identifies an individual campaign. Neither is the private report API key. Apple's public API does not document a provider-token lookup; do not infer `pt` from the app ID, invent an endpoint or scrape an authenticated session. If Campaigns or `+` is missing, explain that Apple needs app analytics data first; continue registration, Android and report connection setup without `pt`. [Apple's campaign-link steps](https://developer.apple.com/help/app-store-connect-analytics/acquisition/campaign-links). For Apple report access, follow `setup-app-store-reports`; when it needs the initial Admin step, it loads `create-apple-report-request`. Its approved local helper can reuse/create the initial ONGOING request using explicitly selected Admin authority without uploading an Admin key. The permanent reader uses private MCP transfer and a Sales and Reports team key. Choose App Downloads Detailed (formerly App Store Downloads Detailed) / DAILY for Campaign (`ct`) results. `pt` is independent. First generation may take 1–2 days; verify actual report rows and preserve privacy limits. Use the actual server capabilities: with the owner's unattended integration consent, enable `set_provider_setup_background` using the current revision as described in private-transfer. The encrypted server reader and durable task continue while Codex/Claude is closed. Reuse an existing task and `credential_location=source`; do not request another key or repeat an already approved scope. Report any unavailable capability explicitly. [Apple's report workflow](https://developer.apple.com/documentation/appstoreconnectapi/downloading-analytics-reports). Do not change ads/budgets, enable referral mode, export individual conversions, upload customer records or assign overall revenue to campaigns. Unknown metrics remain unknown. Scope any write to the user's requested setup; provider permissions and ad-account actions require their own authorization. References: https://installtally.com/docs/quickstart/ and https://installtally.com/docs/mcp/ . For selected platforms use the bundled provider skills and their shared private MCP transfer. No browser fallback. The only exception is section 3A of [create-apple-report-request](../create-apple-report-request/SKILL.md), and only when the customer explicitly asks the agent to do the App Store Connect work in a browser they watch; it never opens the InstallTally panel. A stored intent does not provision Google access, create Apple keys or prove imported counts. Report unsupported first-time identity/provider authorization explicitly.