feature-merge

Squash merge feature branch commits into main with a Conventional Commit message.

2|Updated Apr 24, 2024
One-click install
npx skills add https://github.com/haleyrc/stele --skill feature-merge
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: feature-merge
Source: https://github.com/haleyrc/stele/tree/main/.claude/skills/feature-merge
Command: npx skills add https://github.com/haleyrc/stele --skill feature-merge

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Managing messy Git histories from feature branches can be time-consuming and make your main branch difficult to audit. This Skill automates the process of consolidating multiple feature commits into a single, clean, and descriptive squash commit, simplifying your project's history.

Core Features & Use Cases

  • Automated Squash Merge: Consolidates all commits from a feature branch into a single, well-structured commit on main.
  • Conventional Commit Generation: Analyzes branch changes to craft a summary commit message adhering to Conventional Commits standards.
  • Branch Cleanup: Automatically deletes the local and remote feature branches after a successful merge.
  • Use Case: When a feature is complete and ready for integration, use this Skill to ensure your main branch maintains a clean, linear history with clear, high-level commit messages, simplifying future rollbacks and audits.

Quick Start

Assuming you are on your feature branch, e.g., 'my-new-feature'

git checkout main git pull origin main git merge --squash my-new-feature

Then, craft your comprehensive commit message and commit

git commit -m "feat: Add my new feature with a clear summary"

Frequently Asked Questions about feature-merge

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

FAQPage Schema
How do I squash commits from a feature branch into main?

Squash merging consolidates all commits from a feature branch into a single commit on main. Check out main, pull the latest changes, run `git merge --squash` on your feature branch, then commit with a descriptive message. This creates a clean, linear history without intermediate commits.

What's the best way to write commit messages when merging features?

Use Conventional Commits format: start with a type (feat, fix, etc.) followed by a colon and summary. Analyze all changes from your feature branch to craft a clear, high-level description. This standardized approach makes your commit history readable and supports automated tooling.

When should I use squash merge instead of a regular merge?

Squash merge is ideal when integrating a completed feature, shipping work, or maintaining a clean main branch history. Use it when you want a single, descriptive commit representing the entire feature rather than preserving intermediate development commits.

Can I automatically clean up my feature branch after merging?

Yes. After a successful squash merge, delete the feature branch locally with `git branch -d` and remotely with `git push origin --delete`. This prevents accumulation of stale branches and keeps your repository organized.

What checks should I perform before squashing and merging?

Verify you're on the correct branch, main exists and is up to date, your working directory is clean, and your feature branch has diverged from main. These preconditions prevent accidental data loss and ensure a smooth merge operation.