git-trunk-branch-and-pr-automationlisted
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