squash-commits

Analyze git history to group related commits and generate conventional commit messages.

Updated Feb 22, 2026
One-click install
npx skills add https://github.com/rahulrajaram/rahulskills --skill squash-commits-rahulrajaram
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: squash-commits
Source: https://github.com/rahulrajaram/rahulskills/tree/main/skills/squash-commits
Command: npx skills add https://github.com/rahulrajaram/rahulskills --skill squash-commits-rahulrajaram

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill streamlines your Git workflow by intelligently identifying and merging related commits, creating a cleaner, more understandable project history.

Core Features & Use Cases

  • Thematic Commit Grouping: Automatically detects contiguous commits that belong together (e.g., feature implementation, bug fixes, documentation updates).
  • Conventional Commit Generation: Generates clean, imperative commit messages adhering to conventional commit standards.
  • Interactive & Batch Modes: Offers flexible options for squashing, from single-pass cleanups to iterative batch processing for large histories.
  • Safety Guardrails: Includes robust checks and recovery mechanisms to prevent accidental data loss or history corruption.

Quick Start

Run /squash-commits to analyze and squash the last 20 unpushed commits.

Frequently Asked Questions about squash-commits

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I squash git commits automatically?

Squashing git commits involves merging contiguous thematic groups of commits into clean conventional commit messages. This Skill automates that analysis and provides safety guardrails like original HEAD recording and backup tags to prevent accidental data loss.

What's the best way to clean up git history before pushing?

The best way to clean up git history is by operating on unpushed commits by default, automatically grouping related changes thematically, and generating conventional commit messages. This approach avoids force pushing and keeps your project history clean.

Does squashing commits work with already pushed git history?

Squashing commits works with pushed git history by enabling an option to include it, which requires a force push to update the remote. By default, the process only operates on unpushed commits to avoid rewriting shared history.

How do I generate conventional commit messages when squashing?

Generating conventional commit messages when squashing is handled automatically during the thematic grouping process. The analysis identifies the core purpose of contiguous commits and produces clean, imperative messages adhering to conventional commit standards.

Can I recover my original git history if a squash goes wrong?

Recovering your original git history is possible because the process records the original HEAD and creates backup tags before squashing. It also performs post-squash health checks to catch issues early, ensuring you can revert if needed.

How do I squash a large number of git commits in batches?

Squashing a large number of git commits in batches is supported through an iterative batch processing mode. This allows you to handle large histories in multiple passes, grouping contiguous thematic commits interactively rather than in a single rewrite.