gh-commit

Prepare a clean local commit on the correct feature branch from repository changes.

3|2|Updated Mar 15, 2026
One-click install
npx skills add https://github.com/beeman/skills --skill gh-commit-beeman
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gh-commit
Source: https://github.com/beeman/skills/tree/main/gh-commit
Command: npx skills add https://github.com/beeman/skills --skill gh-commit-beeman

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Package and prepare a clean local commit from repository changes onto the correct feature branch, preventing commits on default branches and ensuring changes are scoped for review.

Core Features & Use Cases

  • Automatically switches to or creates the correct feature branch derived from the tracked changes, ensuring commits are not made on main/master.
  • Inspects git status --short and the current diff to decide which changes to include and whether to amend or create a new commit.
  • Enforces safe history handling by prompting before rewriting history on non-default multi-commit branches and keeping PR-ready workflows separate.
  • Provides a deterministic path to push or open a PR via gh-pr-create only after the local commit is prepared.

Quick Start

Quickly prepare a clean commit on the right branch by running the commit preparation flow for your current repository state.

Frequently Asked Questions about gh-commit

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

FAQPage Schema
How do I ensure my local git commit goes to a new feature branch instead of main?

This workflow automatically switches to or creates a correct feature branch derived from your tracked changes, preventing commits on default branches like main or master. It inspects the current diff to decide which changes to include.

How to decide whether to amend an existing commit or create a new one in a git workflow?

To decide whether to amend an existing commit or create a new one, the workflow inspects the branch history and current branch alignment. It automatically detects the correct action to prepare a clean local commit based on repository changes.

Can I automatically create a pull request right after preparing my local commit?

You cannot automatically create a pull request immediately, because this process stops before pushing or opening a PR. It confines all operations to local commit preparation, providing a deterministic path to push or open a PR via a separate step only after the commit is prepared.

What happens if I try to rewrite git history on a non-default multi-commit branch?

When rewriting git history on a non-default multi-commit branch, the workflow enforces safe handling by prompting you first. This guardrail prevents accidental history rewrites while keeping your PR-ready workflows separate and safe.

Does this commit preparation workflow handle uncommitted changes automatically?

Yes, it handles uncommitted changes automatically by inspecting git status and the current diff. It uses this information to decide which changes to include in the clean local commit and scopes them properly for code review.