This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
rn-release-automator — a Node.js CLI that automates the React Native release process. It guides release crew members through branch cuts, cherry-picks, publishing, testing, and announcements with interactive prompts. Uses Flow for type checking.
# Build (strips Flow types from src/ into dist/)
npm run build
# Run after building
node dist/index.js # interactive menu
node dist/index.js <command> # specific command
# Build + run in one step
npm run dev
# Global dry-run (skips mutations, runs read-only checks)
node dist/index.js --dry-runThere is no test suite. All commands support --dry-run for safe previewing.
The CLI follows the React Native release lifecycle. Each command links to its corresponding guide at reactwg/react-native-releases/docs/.
| Command | Input | Purpose |
|---|---|---|
init |
— | Validate environment (tools, tokens, repo access, bot merger list) |
status |
--series or none |
Overview of all release series, or details for a specific one |
cut-branch |
--series |
13-step branch cut workflow (CI check, create branch, template, Discord, Hermes) |
create-github-project |
--series |
Clone and configure a GitHub Project for a release |
prepare-release |
--series |
Analyze picks, determine next version (RC/stable/patch), process picks via bot |
publish |
--version |
CI/picks/npm checks, trigger create-release.yml workflow |
test-release |
--version |
Verify repo/branch, clean env, prebuilds, test matrix commands |
verify-release |
--series |
Interactive 8-step post-release verification (npm, template, Maven, changelog, etc.) |
post-promotion |
--series |
Update support policy table, blog post, website version cut |
communicate |
--version |
Generate announcement templates (status, discord, discord-short, github) |
The CLI has two entry modes: interactive (no args → searchable menu with Escape-to-go-back) and direct (node dist/index.js publish --version 0.85.0).
Commands (src/commands/) each export a Commander Command instance. Commands take either --series <X.Y> (series-scoped) or --version <X.Y.Z-rc.N> (version-specific).
Utils (src/utils/):
github.js— Octokit client with auto-token discovery (GITHUB_TOKENorgh auth token). Provides: workflow runs, branch/release CRUD, pick request listing with body parsing, commit status checks, PR details/comments, issue commenting/closing, unpublished commit detection.ui.js— chalk styling, ora spinners, @inquirer prompts (search/input/confirm). HassetDryRun()which adds a redDRY RUNbadge to all prompts. Escape-to-cancel viawithEscapeCancelwrapper.version.js— Parse/format RN versions, series comparison, next RC/patch/minor helpers. Versions >= 0.83 use dual-tag Hermes.preflight.js— Checks Node, npm, git, gh CLI, GitHub token, repo access to 4 repos.npm-utils.js— npm registry queries (versions, dist-tags, publication checks).git.js— Shell-exec git wrappers (branch, cherry-pick, push, etc.).
Config (src/config.js) — repo coordinates, workflow filenames, version patterns, release schedule dates.
Docs (src/docs.js) — URL mapping to reactwg/react-native-releases guides, shown via ui.docRef() at the top of each command.
- Dry-run skips mutations only — read-only checks (CI status, npm queries, pick analysis, branch checks) always run. Only mutations (workflow triggers, comments, branch creation, git push) are gated by
--dry-run. - Global
--dry-run— detected fromprocess.argvbefore routing, setsui._dryRunModewhich all commands check viaoptions.dryRun || ui._dryRunMode. - Pick analysis classifies each pick request into:
bot_merge,not_on_main,pr_against_branch,pr_merged_on_branch,hermes,multiple_targets,complex, ormanual— based on parsing the issue body for PR links, commit SHAs, Hermes URLs, and target branches. - Support tiers derived from npm data: Future (RC-only), Active (top 2 stable), End of Cycle (3rd), Unsupported (rest).
- Only
0.xseries allowed —cut-branchrejectsmajor !== 0. - Commander
--versionconflict resolved by remapping to--cli-version/-V.
- All source files use
// @flowannotations and.jsextension. - The interactive menu uses
@inquirer/promptssearchfor type-to-filter behavior. CancelPromptErrorfrom@inquirer/coreis caught in the menu loop to handle Escape → go back.- Nightly versions are filtered out from all npm version listings.
- Each command shows a
📖doc reference link after its header.