agentleFS
gannonhgannonh/kata-code/.agents/skills/release-testflight/SKILL.md

release-testflight

Skill1 starsChanged 39 days agoMITView on GitHub

Ship a Kata Code iOS build to TestFlight. Dispatches the Mobile TestFlight GitHub workflow, watches it, triages failures, and reports the uploaded version and build number. Falls back to building on this Mac with the signed-in Xcode account. Use when asked to cut, ship, upload, or deploy a TestFlight or iOS beta build of Kata Code.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If export stalls with an idle codesign child of xcodebuild -exportArchive, macOS is waiting on a keychain prompt for the local Apple …

    line 65

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Release TestFlight

The Mobile TestFlight workflow (.github/workflows/mobile-testflight.yml) and a local run both call scripts/mobile-testflight.ts. It prebuilds the production app (com.katacode.app) with OTA off, archives with automatic signing for team ZBZKKWF95G, and uploads to App Store Connect. The build number is the UTC upload minute (YYYYMMDDHHmm). Setup and background are in docs/operations/release.md#mobile-testflight.

Bare gh in this repo targets upstream. Pass -R gannonh/kata-code on every call.

1. Check prerequisites

gh secret list -R gannonh/kata-code | grep -E '^APPLE_API_(KEY|KEY_ID|ISSUER)\b'
gh workflow view mobile-testflight.yml -R gannonh/kata-code >/dev/null

CI needs all three secrets and the workflow on main. If either is missing, CI can't run, so tell the user which piece is missing and go to the local path (step 4). Point to the one-time setup in the release doc for the secrets, since creating the App Store Connect app record and the API key needs a human.

2. Dispatch and watch

Build from main unless the user names another ref. Pass -f upload=false when they want a signed build without an upload.

run_url="$(gh workflow run mobile-testflight.yml -R gannonh/kata-code --ref main 2>&1 | grep -Eo 'https://github.com/[^ ]+/actions/runs/[0-9]+')"
run_id="${run_url##*/}"
gh run watch "$run_id" -R gannonh/kata-code --exit-status --interval 60

gh workflow run prints the URL of the run it created when GitHub returns one. Watch that run, not the latest one in gh run list, which can belong to someone else's dispatch. If no URL comes back, upgrade gh rather than guessing the run.

A run takes roughly 30 to 60 minutes. Run the watch in the background and wait for it to exit instead of polling.

3. Report or triage

On success, read the result line from the log:

gh run view "$run_id" -R gannonh/kata-code --log | grep -E 'Uploaded Kata Code|Exported Kata Code'

Report the version, build number, commit, and run URL. Say that App Store Connect processes the build before TestFlight lists it. Do not claim the build is installable until the user confirms it appears.

On failure, find the first error with gh run view "$run_id" -R gannonh/kata-code --log-failed, then match it:

SymptomCause and action
Missing TestFlight configuration: ...A secret or production environment variable is unset. Report the names.
No profiles for 'com.katacode.app...', or a certificate can't be createdThe API key lacks the Admin role, or the Apple account has a pending agreement. Ask the user to check in App Store Connect.
No suitable application records were foundThe App Store Connect app record for com.katacode.app doesn't exist. Ask the user to create it.
The train version ... is closed or must be higher than the previously approved versionApp Store approval closed the current version. Ask the user which version to bump to. Don't pick one.
The bundle version must be higher than the previously uploaded version, or a duplicate build numberAnother upload started in the same UTC minute. Dispatch again; the new run gets a later build number.
Compile or pod install errorsA real build break. Reproduce it locally with node scripts/mobile-testflight.ts --no-upload and fix it on a branch with its own Linear issue.

4. Local fallback

Use this path when CI can't run, for example when the workflow isn't on main yet or the API key isn't set up. It needs macOS with Xcode, CocoaPods, the repo installed (vp i), and Xcode > Settings > Accounts signed in to team ZBZKKWF95G. If xcodebuild reports Unable to log in with account, the Xcode session expired. Only the user can fix that, by signing in again.

export OP_SERVICE_ACCOUNT_TOKEN=...   # the Expo config loads Clerk and relay settings from 1Password
node scripts/mobile-testflight.ts               # add --no-upload to stop after export

If export stalls with an idle codesign child of xcodebuild -exportArchive, macOS is waiting on a keychain prompt for the local Apple Distribution key. Ask the user to enter their login password and choose Always Allow. CI uses a fresh keychain and never sees this prompt.

Without Clerk and relay config the script refuses to upload and names the missing variables. --no-upload still builds, for checking that the app compiles and signs.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.