Agent skill

Squash Branch

by lbedner in lbedner/aegis-stack

A skill your agent uses when collapsing a feature branch into a single commit before opening or merging a PR.

MITAuto-check passedDevelopment

Install Squash Branch

skills CLI
$ npx skills add lbedner/aegis-stack --skill squash-branch -a claude-code

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

GitHub CLI
$ gh skill install lbedner/aegis-stack squash-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/lbedner/aegis-stack.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/squash-branch .claude/skills/squash-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
squash-branch
GitHub stars
143
Token cost
~660 tokens
SKILL.md length
371 words
Files
1
Skills in repo
9
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when collapsing a feature branch into a single commit before opening or merging a PR.

  • Works in 6 steps: Confirm the base and that the branch is… → Record the current tree to verify the… → Collapse to staged changes without… → …
  • Collapsing a feature branch into a single commit before opening
  • SKILL.md covers When to use, Files that change, Procedure and Gates, plus 1 more section
  • Calls git

What it does

Squash Branch is an agent skill from lbedner/aegis-stack. Use when collapsing a feature branch into a single commit before opening or merging a PR. Covers the non-interactive squash, dropping co-author trailers, and verifying the tree is unchanged.

Its SKILL.md is about 660 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 Project scaffolding. It works with Git and FastAPI. The repository describes itself as: A production-ready FastAPI platform with modular components and a built-in control plane. The licence is MIT.

When your agent uses it

  • Collapsing a feature branch into a single commit before opening
  • Tasks that involve Project scaffolding

Example prompts

  • “/squash-branch”

Workflow steps

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

  1. Confirm the base and that the branch is ahead of it with nothing behind
  2. Record the current tree to verify the squash later
  3. Collapse to staged changes without moving the working tree
  4. Stage any intended uncommitted additions with git add, leaving unrelated
  5. Commit once with a clean message and no co-author or generated-by trailers
  6. Verify nothing changed: git rev-parse HEAD^{tree} must equal the value from

What it can do on your machine

Read from SKILL.md and the folder at commit fb708b7. 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

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

  • Network

    No URLs in SKILL.md. Its commands use git, 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

Squash Branch loads about 660 tokens when it runs. Until then it costs about 51 tokens; SKILL.md has 371 words of instructions outside code blocks.

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

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 lbedner/aegis-stack at commit fb708b7, republished under its MIT licence (© lbedner). 371 words, ~660 tokens.

Download SKILL.mdSave it as .claude/skills/squash-branch/SKILL.md (or your agent's skills folder).
name
squash-branch
description
Use when collapsing a feature branch into a single commit before opening or merging a PR. Covers the non-interactive squash, dropping co-author trailers, and verifying the tree is unchanged.

Squash branch

Collapse all of a branch's commits into one, authored by the committer, with a clean message and no co-author trailers. Interactive rebase (git rebase -i) is not available in this environment, so the squash uses git reset --soft against the base, which produces the identical end state.

When to use

Use when a feature branch has several work-in-progress commits that should land as one commit.

Do NOT use on a shared branch others have based work on (rewriting its history breaks their clones), and do NOT run any git command here without explicit user request, per the repo git policy.

Files that change

None. This operates on git history, not the working tree. The tree at HEAD is byte-for-byte identical before and after; only the commit history collapses.

Procedure

  1. Confirm the base and that the branch is ahead of it with nothing behind: git rev-list --count <base>..HEAD (commits to squash) and git rev-list --count HEAD..<base> (must be 0; rebase onto <base> first if not).
  2. Record the current tree to verify the squash later: git rev-parse HEAD^{tree}.
  3. Collapse to staged changes without moving the working tree: git reset --soft <base>.
  4. Stage any intended uncommitted additions with git add, leaving unrelated working-tree changes out.
  5. Commit once with a clean message and no co-author or generated-by trailers: git commit. The commit is authored by the configured git identity.
  6. Verify nothing changed: git rev-parse HEAD^{tree} must equal the value from step 2, and git log --oneline <base>..HEAD must show exactly one commit.
Show full SKILL.md (115 more words)Show less

Gates

  • The post-squash tree hash must equal the pre-squash tree hash (step 6); a mismatch means content was dropped or added, not just recommitted.
  • git log --oneline <base>..HEAD shows a single commit.

Pitfalls

  • git reset --soft leaves the index and working tree untouched, so uncommitted or untracked files are still present after it; stage deliberately in step 4 so unrelated changes do not get folded into the squash.
  • Squashing rewrites history, so a branch already pushed needs a force push (--force-with-lease), which is an outward-facing action the user must approve.
  • Writing a fresh commit message drops any co-author or generated-by trailers from the original commits, which is the intended cleanup; do not carry them forward.

© lbedner, 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 .claude/skills/squash-branch of lbedner/aegis-stack.

Open the folder on GitHubat commit fb708b7

Compare with similar skills

Squash 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.

Squash Branch compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Squash Branch this skilllbedner/aegis-stack143—~660Automated safety check: PassMIT
Senior Fullstackalirezarezvani/claude-skills28k1 repos~3.7kAutomated safety check: NotesMIT
Senior Fullstackborghei/Claude-Skills881—~1.7kAutomated safety check: PassMIT
degit Project ScaffoldingRich-Harris/degit7.9k—~534Automated safety check: PassMIT
Compare Codegenhw-native-sys/pypto126—~1.4kAutomated safety check: PassCustom licence
Brain Bootstrapmindmuxai/brain.md564—~1.8kAutomated safety check: PassApache-2.0

Similar skills

  • Senior Fullstack

    alirezarezvani/claude-skills

    Fullstack development toolkit with project scaffolding for Next.js, FastAPI, MERN, and Django stacks, code quality analysis with security and complexity scoring, and stack selection guidance.

    28k GitHub starsUsed in 1 repo~3.7k tokens
    DevelopmentAuto-check: notes
  • Senior Fullstack

    borghei/Claude-Skills

    Fullstack development toolkit with project scaffolding for Next.js/FastAPI/MERN/Django stacks and code quality analysis.

    881 GitHub stars~1.7k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • degit Project Scaffolding

    Rich-Harris/degit

    Downloads a repository snapshot or template with degit into an empty folder, from GitHub, GitLab, Bitbucket, Sourcehut or a Gist, optionally at a branch, tag or commit.

    7.9k GitHub stars~534 tokensUpdated 24 days ago
    DevelopmentAuto-check passed
  • Compare Codegen

    hw-native-sys/pypto

    Compare codegen output (.pto files and pass dumps) between origin/main and the current branch for a given test case.

    126 GitHub stars~1.4k tokensUpdated 8 days ago
    DevelopmentAuto-check passed
  • Brain Bootstrap

    mindmuxai/brain.md

    Seed a freshly-scaffolded brain with real project knowledge — on an existing (brownfield) project read the code, docs, and git log to draft the six root pages and capture key historical decisions…

    564 GitHub stars~1.8k tokensUpdated 27 days ago
    DevelopmentAuto-check passed
  • Light Project Structure

    Light0305/Light-skills

    Audits, scaffolds and safely migrates research project folder structures, keeping existing repositories read-only until you approve exact moves from a plan.

    641 GitHub stars~3k tokensUpdated 3 mo ago
    DevelopmentAuto-check: notes

More from lbedner/aegis-stack

All 9 skills in this repo
  • Release

    lbedner/aegis-stack

    A skill your agent uses when cutting a release of the aegis-stack package.

    143 GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Template Dev

    lbedner/aegis-stack

    A skill your agent uses when developing or modifying Copier templates in aegis/templates, or backporting a change from a generated project (e.g.

    143 GitHub stars~2.9k tokensUpdated today
    Auto-check passed
  • Add CLI Command

    lbedner/aegis-stack

    A skill your agent uses when adding a command to the aegis tool CLI (the framework's own aegis ...

    143 GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Create Plugin

    lbedner/aegis-stack

    A skill your agent uses when building an Aegis Stack plugin, a separate package (aegis-stack-<name) that renders files into a project through aegis add <name.

    143 GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Execute Issue

    lbedner/aegis-stack

    A skill your agent uses when handed a GitHub issue (number or URL) to execute end to end.

    143 GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • I18n

    lbedner/aegis-stack

    A skill your agent uses when a code or template change introduces a new translation message key, in either the framework CLI (aegis/i18n/locales/) or a generated project's CLI (the app/i18n/locales/…

    143 GitHub stars~1.8k tokensUpdated today
    Auto-check passed

Works with

Questions about Squash Branch

What does Squash Branch do?

A skill your agent uses when collapsing a feature branch into a single commit before opening or merging a PR. Squash Branch is an agent skill from lbedner/aegis-stack. Use when collapsing a feature branch into a single commit before opening or merging a PR.

When should I use Squash Branch?

Squash Branch fits situations like: collapsing a feature branch into a single commit before opening; tasks that involve Project scaffolding.

How do I install Squash Branch in Claude Code?

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

How do I install Squash Branch in Codex?

Run `npx skills add lbedner/aegis-stack --skill squash-branch -a codex`. Or copy the skill folder (.claude/skills/squash-branch in lbedner/aegis-stack) into .agents/skills/squash-branch in your project. Codex loads it when a task matches its description.

Can I use Squash 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 lbedner/aegis-stack --skill squash-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/squash-branch, .gemini/skills/squash-branch, .github/skills/squash-branch and .opencode/skills/squash-branch in your project.

What does Squash Branch need to run?

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

Does Squash Branch access the network?

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

Is Squash 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 Squash Branch use?

Squash 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 Squash Branch use?

About 660 tokens (SKILL.md is roughly 2.6k 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 Squash Branch?

Skills that share tags, products or a category with Squash Branch: Senior Fullstack (alirezarezvani/claude-skills, 28k stars), Senior Fullstack (borghei/Claude-Skills, 881 stars), degit Project Scaffolding (Rich-Harris/degit, 7.9k stars) and Compare Codegen (hw-native-sys/pypto, 126 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Squash Branch?

lbedner (a GitHub user) maintains it in lbedner/aegis-stack, which has 143 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on October 8, 2026.

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