Baton: Command for Claude Code

.claude/commands/testflight.md

testflight is a command for Claude Code from zhu-xiaowei/Baton. It costs 20 tokens per session (1,130 once invoked), scanned A, original, MIT.

An iOS release command that builds an IPA, the installable package for an iPhone or iPad app, and uploads a new build to TestFlight. TestFlight is Apple's service for distributing beta app builds to testers.

In plain words
What is it for?
Use it to run an iOS release, create and validate the IPA, upload it to TestFlight, and report the new build number and package path.
Why use it?
It automates the release steps, including increasing the app's build number, validating the package, and sending it through the App Store Connect API.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

This is zhu-xiaowei/Baton's own configuration. It tells Claude Code how to work on Baton itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything Baton configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is Bash(npm run release:ios), Bash(./scripts/release-ios.sh), Bash(npm run release:ios:cloud), Bash(node scripts/release-ios-cloud.mjs --dry-run).

Reuse

Borrowing it

Nothing to install: this file belongs to zhu-xiaowei/Baton. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/zhu-xiaowei/Baton/main/.claude/commands/testflight.md
Clone the repo
git clone --depth 1 https://github.com/zhu-xiaowei/Baton

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for testflight

README.md
[![agentmods](https://agentmods.dev/badge/commands/zhu-xiaowei/baton/testflight/github.svg)](https://agentmods.dev/commands/zhu-xiaowei/baton/testflight)
Your own site
<a href="https://agentmods.dev/commands/zhu-xiaowei/baton/testflight"><img src="https://agentmods.dev/badge/commands/zhu-xiaowei/baton/testflight/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for testflight

Your own site · 80×15
<a href="https://agentmods.dev/commands/zhu-xiaowei/baton/testflight"><img src="https://agentmods.dev/badge/commands/zhu-xiaowei/baton/testflight.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,130 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00020 $0.01130
Opus 5.5 $0.00008 $0.00452
Sonnet 5.5 $0.00004 $0.00226
Haiku 4.5 $0.00002 $0.00113

Measured today against content hash 9366acacee4b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

testflight scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/testflight.md · 96 lines

How it starts

The opening of the file, as written. The whole thing — 96 lines — stays where its author put it; the contents beside it link to each section on GitHub.

For TestFlight update notes (whatsNew), default to exactly Bug fixes and improvements. when there are no major new user-facing features. Use feature-specific notes for major additions, or the user's supplied wording.

A request to publish authorizes the release's source commits, branch creation, pushes, build-number bump, cloud run, TestFlight group assignment, the PR and merge after a successful release, and deletion of the release branch after the merge is confirmed. Continue without additional approval prompts. Before publishing, inspect git status --short, including untracked files. Automatically commit changes within the requested release scope and preserve unrelated work, using an isolated checkout when needed. Continue with the release in the same invocation.

When Xcode Cloud cannot create a build: If POST /v1/ciBuildRuns returns an unexplained HTTP 500 or UNEXPECTED_ERROR, first remind the user to check their Apple Developer account and App Store Connect for an updated Apple Developer Program License Agreement awaiting acceptance. An unaccepted agreement can surface as this generic server error, even when other API calls work and Apple's status page is normal. The user/account holder must review and accept the agreement themselves.

Capture the response and its request correlation ID when available. After the user confirms that pending agreements are accepted, check whether a cloud run was already created. Monitor an existing run instead of starting another; otherwise, rerun the dry-run and resume the existing release. Reuse an unused prepared build number; avoid duplicate runs or unnecessary bumps. This resolved the build 55 start failure on 2026-10-29.

On macOS:

Ship a new TestFlight build. Run the release script — it auto-bumps CFBundleVersion in src-tauri/gen/apple/project.yml, builds the release IPA, validates it, and uploads to TestFlight via the App Store Connect API:

npm run release:ios

Run it in the background (build + upload takes several minutes) and monitor the output. When it finishes, report the result: the bumped CFBundleVersion, the IPA path, and whether validation + upload succeeded. If it fails, show the error.

After a successful release, commit the build-number changes for the PR below.

On Linux: Always use the fixed branch name release/testflight; never create per-build branches such as release/testflight-<N>. Before each release, fetch origin and merge the latest origin/main into release/testflight, preserving its release commits. If the branch does not exist, create it from the prepared release commit or latest origin/main. Commit release changes there, push it, run node scripts/release-ios-cloud.mjs --dry-run as a preflight, then start the real release in the background on that branch:

npm run release:ios:cloud

Never force-push. The cloud script commits and pushes its own build-number bump before starting Xcode Cloud, so running it on protected main fails before packaging or upload. Do not bypass branch protection.

The script waits for a valid upload and adds it to the internal Test group. Wait until the upload is VALID and the group is IN_BETA_TESTING before opening the PR. The dry-run and the Prepared <version> (<build>) message are not completion of /testflight.

After successful publication: Automatically create or reuse a PR from the existing release/testflight branch to main with the build-number bump and release changes, without asking for separate approval. Do not create a temporary PR branch. Wait for all required CI checks and repository review requirements, resolve relevant failures within the release scope, and merge using the repository's supported method without bypassing branch protection. This repository supports squash merge and has GitHub auto-merge disabled, so merge directly when ready. Confirm the actual merge. After branch cleanup, report the build number, upload status, internal Test group state, cloud run ID (or local IPA path), PR URL, and merge result. Continue monitoring through upload, required CI, merge, and branch cleanup; do not stop after starting the upload, creating the PR, or enabling auto-merge. Do not merge a PR whose release failed.

Read the full file on GitHub · 96 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed · +15 lines 9366acacee4b
  2. 14d ago Changed · +17 lines 9f40f0d1bb19
  3. 15d ago Changed · -17 lines 666726391025
  4. 16d ago Changed · +6 lines 69610315e6cb
  5. 18d ago Changed · +15 lines da039875d07d
  6. 19d ago Changed · +18 lines dea00ed57250
  7. 21d ago Changed · +4 lines 949590b6016a
  8. 28d ago Changed · +8 lines 8de669cd1b75
  9. 29d ago Changed · +11 lines f70704b47167
  10. 1mo ago First seen · 19 lines · 20 tokens per session scan A 807f21f45fe3

Subscribe to this mod's changes

testflight is a command published in the GitHub repository zhu-xiaowei/Baton (14 stars, last pushed today), licensed MIT. It adds 20 tokens to every session and 1,130 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.