Trunk

Use when the repository has been identified as trunk-based — no remote `develop` branch exists. Provides base branches and PR targets for all branch types.

jzills Updated 0 repo stars
claude-marketplace — Skills, workflows, and tools for Claude Code.

File contents

Trunk-Based Branching Conventions

Branch Routing

Branch type Cut from PR targets
All branches (feature/*, fix/*, release/*, hotfix/*, etc.) trunk trunk

All work flows into a single trunk branch. Releases are cut as short-lived branches off trunk and PR back into trunk.

Resolving the Trunk Branch Name

Never hardcode main. Resolve dynamically — the trunk may be main, master, or a custom name:

gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name'

Creating a Branch

trunk=$(gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name')
git checkout "$trunk" && git pull origin "$trunk"
git checkout -b <new-branch>
git push -u origin <new-branch>

Detection Signal

This strategy was identified because git ls-remote --heads origin develop returned no output. If a develop branch is later added, switch to branching-strategy:gitflow.

jzills/claude-marketplace commit a9b96dbd8f

Frequently asked questions

npx get-skill add jzills/trunk