Agent skill

Next Branch

by portabletext in portabletext/editor

How the next prerelease branch for the upcoming editor major works in the Portable Text Editor monorepo.

MITAuto-check passedDevelopment

Install Next Branch

skills CLI
$ npx skills add portabletext/editor --skill next-branch -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install portabletext/editor next-branch --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/portabletext/editor.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/next-branch .claude/skills/next-branch && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
next-branch
GitHub stars
280
Token cost
~1.8k tokens
SKILL.md length
999 words
Files
1
Skills in repo
10
Repo updated
First seen
Licence
MIT

At a glance

How the next prerelease branch for the upcoming editor major works in the Portable Text Editor monorepo.

  • Works in 5 steps: On next, run pnpm changeset pre exit and… → Merge next into main exactly once, as a… → Let main's Version Packages PR release… → …
  • Targeting a PR at the next major
  • SKILL.md covers Branch layout, Syncing main into next, Timing and When the workflow stops, plus 3 more sections
  • Calls git, gh and pnpm

What it does

Next Branch is an agent skill from portabletext/editor. How the next prerelease branch for the upcoming editor major works in the Portable Text Editor monorepo. Use when targeting a PR at the next major, handling the sync/main-into-next PR or its conflicts, deciding whether to merge "Version Packages (next)", or cutting the stable major. Covers the one-direction sync, its timing, the conflict rule, prerelease cuts, the stable cut, and the repository settings the process relies on.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Monorepo tooling. The repository describes itself as: The Standalone Portable Text Editor. The licence is MIT.

When your agent uses it

  • Targeting a PR at the next major
  • Handling the sync/main-into-next PR
  • Deciding whether to merge Version Packages (next)
  • Cutting the stable major

Example prompts

  • “Version Packages (next)”
  • “/next-branch”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. On next, run pnpm changeset pre exit and land it through a PR into next.
  2. Merge next into main exactly once, as a merge commit. main requires linear history, so this one merge needs an admin bypass of that rule.
  3. Let main's Version Packages PR release the stable major.
  4. Branch the old major's maintenance branch off its last stable tag, for example git push origin…
  5. The branch inherits a release.yml that triggers only on main and next. Through a PR into the maintenance branch, set its push trigger to…

What it can do on your machine

Read from SKILL.md and the folder at commit 60a494b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • gh
    • pnpm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, gh and pnpm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Next Branch loads about 1.8k tokens when it runs. Until then it costs about 111 tokens; SKILL.md has 999 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~111
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from portabletext/editor at commit 60a494b, republished under its MIT licence (© portabletext). 999 words, ~1,804 tokens.

Download SKILL.mdSave it as .claude/skills/next-branch/SKILL.md (or your agent's skills folder).
name
next-branch
description
How the `next` prerelease branch for the upcoming editor major works in the Portable Text Editor monorepo. Use when targeting a PR at the next major, handling the `sync/main-into-next` PR or its conflicts, deciding whether to merge "Version Packages (next)", or cutting the stable major. Covers the one-direction sync, its timing, the conflict rule, prerelease cuts, the stable cut, and the repository settings the process relies on.

The next branch

Branch layout

next is the prerelease line for the upcoming editor major. It stays in changesets pre mode (.changeset/pre.json, tag next), so every release from it publishes a -next.N version under the next dist-tag. PRs for the next major target next (--base next). main keeps releasing the current major, and older majors live on maintenance branches (see the backporting skill).

release.yml runs on pushes to both main and next. On next the changesets bot opens "Version Packages (next)" from changeset-release/next.

Syncing main into next

Sync runs one direction only: main into next, never the reverse until the stable cut. It always lands as a two-parent merge through the sync/main-into-next PR, which sync-next.yml opens (or refreshes) after each release of main. Merge that PR with "Create a merge commit". Never squash it, rebase it, or cherry-pick main commits onto next as routine. The merge commit is what records main as an ancestor of next. Without it, the next sync sees the same commits as unmerged, replays them, and hits the same conflicts again.

Timing

Sync only after main's Version Packages PR merges, never before. Until then main still holds pending changesets for a release that has not happened. Syncing then carries those changesets onto next, and the bot proposes prereleases of content that is about to ship stable from main.

sync-next.yml enforces this. It runs on every push to main (and on manual dispatch from main), but it never merges main's tip blindly. It walks back from main's tip along its first-parent history (up to 500 commits) and picks the newest commit with no pending changesets. That commit is the target, and the target is what gets merged. A pending changeset is any .md file anywhere under .changeset/ except README.md files. That includes .changeset/pre/, where changesets v3 keeps prerelease changesets and where pre exit leaves them pending.

For example, after a release commit R, then c1 without a changeset, c2 adding one, and c3, the target is c1. The release and everything up to the first new changeset get synced. The rest waits for the next release.

The workflow skips with a one-line job summary when next does not exist, when no commit within reach is free of pending changesets, or when next already contains the target. So the push that merges Version Packages opens the sync PR, and a feature push re-syncs up to the newest clean commit, which does nothing when next already has it. Every run starts from main's current tip, so a newer run that cancels an older one computes the same or a later target, and nothing is lost.

When the workflow stops

The workflow never overwrites human work on sync/main-into-next. If the branch already contains both next and the target, it leaves the branch alone, so a hand-resolved merge survives later runs. If the branch has commits the workflow did not make and lacks next or the target, it pushes nothing and fails. Otherwise it rebuilds the branch from next and force-pushes with a lease on the SHA it fetched.

It also stops when the merge conflicts, and when its push is rejected. The push error is in the job log. Two likely causes: someone pushed to the branch during the run (the lease caught it), or GitHub refused a workflow file (the app token has no workflows permission, and a clean merge can produce .github/workflows/ contents that exist on neither branch).

In all three cases the report step prints the same commands, with the target filled in, to its own log and to the run summary. For conflicts, the report lists the conflicting files. Keep next's side in the version fields of package.json files and the release headings of CHANGELOG.md files. Everywhere else, both sides changed on purpose, so combine them instead of picking one. Then run the root checks and the affected packages' tests before pushing: tests and lint rules from main can fail against next's code even where Git merged cleanly. Finish in a dedicated worktree, based on origin/sync/main-into-next when the branch exists (so its work is kept) and on origin/next when it does not. Merge the current next first, so a branch that fell behind next catches up, then the target. git worktree add -b refuses to run when a local sync/main-into-next already exists, which protects unpushed work in it: reuse that branch, or delete it once it holds nothing worth keeping.

sh
git fetch origin
git worktree add -b sync/main-into-next \
  ../editor-sync-main-into-next origin/sync/main-into-next
cd ../editor-sync-main-into-next
# if a merge stops on conflicts: resolve them, then
# `git add -A && git commit --no-edit`, then continue
git merge --no-edit origin/next
git merge --no-ff -m "chore: merge main into next" \
  <target>
git push origin sync/main-into-next
# if no sync PR is open:
gh pr create --base next --head sync/main-into-next \
  --title "chore: merge main into next" \
  --body 'Merge with "Create a merge commit".'

<target> is the commit the report names, usually origin/main right after a release.

Show full SKILL.md (252 more words)Show less

Prerelease PRs

Merge "Version Packages (next)" only to deliberately cut a -next.N prerelease. If everything in it already shipped stable from main, do not merge it. Let the sync land, then close the stale PR by hand. With zero changesets left on next the bot takes the publish path, which never updates or closes its old PR. It recreates the PR when the next changeset lands on next.

Cutting the stable major

  1. On next, run pnpm changeset pre exit and land it through a PR into next.
  2. Merge next into main exactly once, as a merge commit. main requires linear history, so this one merge needs an admin bypass of that rule.
  3. Let main's Version Packages PR release the stable major.
  4. Branch the old major's maintenance branch off its last stable tag, for example git push origin '@portabletext/editor@<N>.x.y^{commit}:refs/heads/editor-v<N>.x'.
  5. The branch inherits a release.yml that triggers only on main and next. Through a PR into the maintenance branch, set its push trigger to the branch itself (branches: [editor-v<N>.x], as on editor-v7.x). Backports release from the branch only after that lands.

Repository settings

The process relies on three settings:

  • Merge commits are enabled for the repository, so the sync PR can be merged as one.
  • main keeps required linear history through the existing "Protect default branch" ruleset. The stable cut is the only merge commit it ever receives.
  • A ruleset on next allows only the merge method, so no one can squash or rebase a sync PR by accident.

© portabletext, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/next-branch of portabletext/editor.

Open the folder on GitHubat commit 60a494b

Compare with similar skills

Next Branch next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Next Branch compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Next Branch this skillportabletext/editor280—~1.8kAutomated safety check: PassMIT
Nx Importnrwl/nx29k6 repos~3.5kAutomated safety check: PassMIT
Nx Workspacenomcopter/react-mosaic4.8k8 repos~1.9kAutomated safety check: PassCustom licence
Electron Multi-Process ArchitectureiOfficeAI/AionUi33k1 repos~1.8kAutomated safety check: PassApache-2.0
Nx Run Tasksnomcopter/react-mosaic4.8k8 repos~613Automated safety check: PassCustom licence
Astro Developerwithastro/astro63k1 repos~1.5kAutomated safety check: PassCustom licence

Similar skills

  • Nx Import

    nrwl/nx

    Import, merge, or combine repositories into an Nx workspace using nx import.

    29k GitHub starsUsed in 6 repos~3.5k tokens
    DevelopmentAuto-check passed
  • Nx Workspace

    nomcopter/react-mosaic

    Explore and understand Nx workspaces. An agent skill from nomcopter/react-mosaic.

    4.8k GitHub starsUsed in 8 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Tells the agent where new code belongs in an Electron multi-process project and which APIs each process may use, with rules for new bridges, services, agents and workers.

    33k GitHub starsUsed in 1 repo~1.8k tokens
    DevelopmentAuto-check passed
  • Nx Run Tasks

    nomcopter/react-mosaic

    Helps with running tasks in an Nx workspace. An agent skill from nomcopter/react-mosaic.

    4.8k GitHub starsUsed in 8 repos~613 tokens
    DevelopmentAuto-check passed
  • Astro Developer

    withastro/astro

    Official

    Comprehensive guide for developing in the Astro monorepo. An agent skill from withastro/astro.

    63k GitHub starsUsed in 1 repo~1.5k tokens
    DevelopmentAuto-check passed
  • Moves a package from another TryGhost repository into Ghost as an internal workspace package while keeping its Git history, with checkpoints for the steps that need an administrator.

    55k GitHub stars~3.8k tokensUpdated today
    DevelopmentAuto-check passed

More from portabletext/editor

All 10 skills in this repo
  • Product Copy Assistant

    portabletext/editor

    Write clear, concise, accessible product copy for interfaces, docs, and system messages.

    280 GitHub stars~635 tokensUpdated 2 days ago
    Auto-check passed
  • Changesets

    portabletext/editor

    How to write changesets in the Portable Text Editor monorepo.

    280 GitHub stars~2.1k tokensUpdated 2 days ago
    Auto-check passed
  • Commits

    portabletext/editor

    How to write commit messages in the Portable Text Editor monorepo.

    280 GitHub stars~1.9k tokensUpdated 2 days ago
    Auto-check passed
  • Backporting

    portabletext/editor

    How to backport a fix from main to a maintenance branch (editor-v6.x, editor-v7.x) in the Portable Text Editor monorepo.

    280 GitHub stars~1.1k tokensUpdated 2 days ago
    Auto-check passed
  • Code Comments

    portabletext/editor

    How to write and review code comments in the Portable Text Editor monorepo.

    280 GitHub stars~1.1k tokensUpdated 2 days ago
    Auto-check passed
  • Portable Text

    portabletext/editor

    Work with Portable Text, a JSON-based specification for structured block content.

    280 GitHub stars~656 tokensUpdated 2 days ago
    Auto-check passed

Categories

Questions about Next Branch

What does Next Branch do?

How the next prerelease branch for the upcoming editor major works in the Portable Text Editor monorepo. Next Branch is an agent skill from portabletext/editor. How the next prerelease branch for the upcoming editor major works in the Portable Text Editor monorepo.

When should I use Next Branch?

Next Branch fits situations like: targeting a PR at the next major; handling the sync/main-into-next PR; deciding whether to merge Version Packages (next); cutting the stable major.

How do I install Next Branch in Claude Code?

Run `npx skills add portabletext/editor --skill next-branch -a claude-code`. Or copy the skill folder (.agents/skills/next-branch in portabletext/editor) into .claude/skills/next-branch in your project. Claude Code loads it when a task matches its description.

How do I install Next Branch in Codex?

Run `npx skills add portabletext/editor --skill next-branch -a codex`. Or copy the skill folder (.agents/skills/next-branch in portabletext/editor) into .agents/skills/next-branch in your project. Codex loads it when a task matches its description.

Can I use Next Branch in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add portabletext/editor --skill next-branch -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/next-branch, .gemini/skills/next-branch, .github/skills/next-branch and .opencode/skills/next-branch in your project.

What does Next Branch need to run?

Going by SKILL.md and its folder, Next Branch needs the command-line tools its instructions call (git, gh and pnpm).

Does Next Branch access the network?

SKILL.md contains no URLs. Its commands use git and gh, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Next Branch safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Next Branch use?

Next Branch is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Next Branch use?

About 1.8k tokens (SKILL.md is roughly 7.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Next Branch?

Skills that share tags, products or a category with Next Branch: Nx Import (nrwl/nx, 29k stars), Nx Workspace (nomcopter/react-mosaic, 4.8k stars), Electron Multi-Process Architecture (iOfficeAI/AionUi, 33k stars) and Nx Run Tasks (nomcopter/react-mosaic, 4.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Next Branch?

portabletext (a GitHub organization) maintains it in portabletext/editor, which has 280 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on October 6, 2026.

Source: portabletext/editor on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.