← ClaudeAtlas

git-trunk-branch-and-pr-automationlisted

Trunk-based Git workflow with enforced branch naming and squash-merge PR titles. Use when setting up or standardising a branch/PR workflow, naming branches (feature/ fix/ hotfix/ and AI-agent prefixes claude/ cursor/ codex/ copilot/ codegen-bot/ dependabot/), configuring squash-only merges where the PR title becomes the commit and the body is the concatenated commits, making the PR title a valid Conventional Commit, adding GitHub Actions that validate branch names or auto-normalise PR titles, fixing a PR-title bot that loops, or deciding trunk vs release branches. Covers the GitHub repo settings, the validation/normalisation workflows, and how it feeds semantic-release.
stealth-engine/skills · ★ 2 · AI & Automation · score 76
Install: claude install-skill stealth-engine/skills
# Trunk-based branches + squash-PR automation A trunk-based workflow where every change is a short-lived branch off `main`, merged via **squash** with a **Conventional Commit PR title**. That title becomes the single commit on `main` that [semantic-release](../semantic-release-automation/SKILL.md) reads — so naming and title hygiene aren't cosmetic, they drive the release. Templates: [`templates/`](./templates) — branch-name validation, the PR-title normaliser workflow, and the shared `normalize-pr-title.js`. ## The model - **Trunk-based:** branch off `main`, keep PRs small, merge frequently; `main` stays releasable. Don't use long-lived `develop`/release branches unless you must stabilise a release while trunk moves on, or support multiple live versions. - **Branch naming:** `feature/<desc>`, `fix/<desc>`, `hotfix/<desc>` — plus **AI-agent prefixes** `claude/ cursor/ codex/ copilot/ codegen-bot/ dependabot/` for agent- and bot-authored branches. Validated by [`branch-name-check.yml`](./templates/branch-name-check.yml). ## Squash merge: the PR title *is* the commit Configure the repo so a merge collapses to one clean, semantic commit: - **GitHub → Settings → General → Pull Requests:** enable **Squash merging only** (turn off merge commits and rebase). Set **"Default commit message" → "Pull request title and commit details"** — GitHub then uses the **PR title as the squash subject** (it appends `(#<PR-number>)`, which doesn't affect Conventional Commit