Claude Skill MartBrowse skillsQuick linesLearn by videoTerminal guideWhat is a Skill?
← Back to list

PR Squash Message Generator

Writes a single Conventional Commits squash message from the net base...head diff of a PR, validates it with commitlint, syncs the PR title and copies only the description.

Dev & CodingIntermediate★ 941⑂ 110AI score 9/10Last updated: Oct 9, 2026

What it does

  • Resolves the PR's real base branch with gh (never hardcoding main or develop) and reads only git diff origin/BASE...HEAD — the destination, not the branch's journey.
  • Picks the commit type (feat/fix/test/docs/chore) from the net effect on the repo's users, then composes a one-line header, a short body (max ~12 lines, wrapped at 72 columns), optional extra changelog entries, and a footer (Closes #n, the --------- separator, Co-authored-by lines).
  • Collects and de-duplicates co-authors from commit authors, committers and existing trailers, never inventing identities.
  • Writes the message to a temp file and validates it with npx --no-install commitlint --verbose, plus line-length and body-length shape checks.
  • Updates the PR title to match the header via gh api PATCH, copies only the description to the clipboard (pbcopy/wl-copy/xclip), and always prints title and description in separate code blocks.
  • Treats forks and outside authors as untrusted: it refuses to run branch code (tests, commitlint, installs) without asking first.

Who it's for

  • Teams on GitHub squash merges with Conventional Commits and commitlint enforcement.
  • Projects using release-please or similar automation where commit messages drive the changelog and version bumps.
  • Maintainers who want consistent squash messages across many contributors.

Examples

  1. "Write the squash message for this PR" → detects base develop, reads the diff, and produces feat(api): add pagination to search endpoint with a few tight bullets.
  2. A branch full of self-inflicted fixups gets no fix lines, because those commits are invisible from the base branch.
  3. A PR that ships a feature plus a CI workflow change gets a separate ci(github): ... paragraph so release-please logs two changelog entries.
  4. A stray .env.local in the diff is flagged outside the message so you can drop it before merging.

· · · Install guide · · ·

Try it now, no install

Paste this into Claude to use the skill without installing anything.

Read the instructions in this file and follow them to help me:
https://raw.githubusercontent.com/scenario-labs/skills/HEAD/.agents/skills/pr-squash-message/SKILL.md

What I want: (describe your task here)

If Claude can't open the link, open it yourself and paste the contents instead.

↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.

Install in the Claude app (no terminal)
  1. Download the ZIP with the button below.
  2. In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
  3. Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
↓ Download ZIP
Install in Claude Code

Let Claude do it — paste this into Claude Code

Install the skill I found on Claude Skill Mart.
Copy the .agents/skills/pr-squash-message folder from the GitHub repo scenario-labs/skills into my ~/.claude/skills/pr-squash-message/.
When it's done, tell me in one line what this skill can do.

Install with a command instead

git clone https://github.com/scenario-labs/skills.git /tmp/sl-skills && mkdir -p ~/.claude/skills && cp -r /tmp/sl-skills/.agents/skills/pr-squash-message ~/.claude/skills/

⚠ This is a third-party skill. Check the source repository before installing.

  1. Clone the repository: git clone https://github.com/scenario-labs/skills.git /tmp/sl-skills
  2. Create the skills folder: mkdir -p ~/.claude/skills
  3. Copy just this skill: cp -r /tmp/sl-skills/.agents/skills/pr-squash-message ~/.claude/skills/
  4. Verify prerequisites: git --version, gh --version (GitHub CLI), and gh auth status to confirm you are logged in.
  5. Check whether the target repo has a commitlint config (commitlint.config.*); without it the validation step is skipped.
  6. Make sure a clipboard tool exists: pbcopy on macOS, or install wl-copy / xclip on Linux.
  7. Restart Claude Code, check out the PR branch, and ask: "generate the squash message for this PR".