.agents/skills/release-lanes/SKILL.md
Use this when the user asks to maintain Plate latest and beta, promote beta
to stable, sync main into next, recover release lane drift, verify npm
dist-tags, or run the release lane after a stable release.
CI owns publishing. This skill owns lane maintenance.
Do not create a routine main -> next sync PR. That path creates review churn
for deterministic release metadata conflicts. Sync directly with a merge commit,
repair known release metadata automatically, push next, then let release.yml
publish beta.
One invocation is permission to run the lane until completion. Ask again only for hard stops.
This is a derived autogoal skill.
Default flow mode: one-shot execution.
Use:
node .agents/skills/autogoal/scripts/create-goal-scratchpad.mjs \
--template release-lanes \
--title "release lane maintenance"
Create or continue a goal before mutating remote release branches. The goal is complete only when the requested lane state is true and the template gates pass.
main publishes stable packages with npm tag latest.next publishes prerelease packages with npm tag beta..changeset/pre.json belongs on next only.main must never publish while .changeset/pre.json exists.next for beta before stable promotion.main, not next.main; use next patch changes only for active
beta-lane fixes or direct-sync beta metadata.Read state only:
git fetch origin main next
gh pr list --base main --head next --state open --json number,title,url,state
gh run list --workflow release.yml --branch main --limit 5 \
--json databaseId,status,conclusion,createdAt,url
gh run list --workflow release.yml --branch next --limit 5 \
--json databaseId,status,conclusion,createdAt,url
npm view platejs dist-tags --json
Record:
origin/main SHAorigin/next SHAorigin/next:.changeset/pre.json exists and has tag betaplatejs dist-tags for latest and betasync/main-to-next PRs, if anyRun after a stable release, after merging a promote PR, or whenever main has
commits missing from next.
Dry run first:
node tooling/scripts/release-branch-prs.mjs sync-main-to-next --dry-run
Then run the direct sync:
node tooling/scripts/release-branch-prs.mjs sync-main-to-next --push
The script must:
main and nextnextnext beta package versions over main stable versions.changeset/pre.json from next, or create beta pre mode in the same
sync commit when next is out of pre mode after promotionmainmain
commits so the beta lane can publish those fixespnpm ci:version before committing when beta changesets are generated,
so next receives versioned beta package metadata instead of a pending
Version Packages PR[skip release] sync commit only when no beta changesets were generatedverify-main-to-next-syncorigin/nextIf the script stops on files outside known release metadata, do not guess. Resolve only when source ownership is obvious; otherwise stop with exact files.
After a beta-to-stable promotion, next may be out of prerelease mode. The
direct main -> next sync restores beta pre mode in the same unskipped merge
commit, so the next release workflow can publish the generated beta changesets.
Use a standalone beta re-entry commit only when no direct sync is needed and no beta changesets need publication:
git switch next
git pull --ff-only origin next
pnpm changeset pre enter beta
git add .changeset/pre.json
git commit -m "chore: enter beta pre-release mode [skip release]"
git push origin next
If .changeset/pre.json already exists with { "mode": "pre", "tag": "beta" },
record N/A and do not create a duplicate commit.
Run dry first unless the user explicitly asks for the real promotion:
gh workflow run promote.yml --ref next -f dry_run=true
gh run watch <run-id> --exit-status
For a real promotion:
gh workflow run promote.yml --ref next -f dry_run=false
gh run watch <run-id> --exit-status
Then review the generated next -> main PR:
mainnext.changeset/pre.json-beta.*Merging the promote PR is allowed when the user asked for full automation or merge. Use a merge commit, not squash or rebase.
Watch release workflows:
gh run list --workflow release.yml --branch main --limit 5 \
--json databaseId,status,conclusion,createdAt,url
gh run list --workflow release.yml --branch next --limit 5 \
--json databaseId,status,conclusion,createdAt,url
Verify npm:
npm view platejs dist-tags --json
npm view platejs@latest version
npm view platejs@beta version
Verify GitHub releases:
gh release list --limit 10
Close stale sync/main-to-next PRs after direct sync succeeds:
gh pr list --base next --head sync/main-to-next --state open --json number,url
gh pr close <number> --comment "Closing because release-lanes synced main directly into next."
Do this only after direct sync and verification pass.
Stop only for:
.changeset/pre.jsonlatest or beta points at an unexpected version after publicationDo not stop to ask whether to run the next obvious lane step. The goal plan is the authorization boundary.
Report:
main SHA and next SHAlatest and beta versionsnone