smart-commit

Group code changes into atomic commits by feature with conventional commit messages.

2|Updated Mar 22, 2024
One-click install
npx skills add https://github.com/wh131462/x-cli --skill smart-commit-wh131462
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: smart-commit
Source: https://github.com/wh131462/x-cli/tree/main/.claude/skills/smart-commit
Command: npx skills add https://github.com/wh131462/x-cli --skill smart-commit-wh131462

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers create clean, organized commit history by automatically grouping changes by feature or module and ensuring each commit represents a single functional unit.

Core Features & Use Cases

  • Feature-based grouping: Analyze staged and unstaged changes across the project and propose commits that map to logical features or modules.
  • Conventional commits enforcement: Aligns with @commitlint/config-conventional to produce standardized messages and scopes.
  • Safety and accuracy: Respects existing git configuration for author identity, avoids co-authored-by annotations, and preserves work when pre-commit checks fail.

Quick Start

Summarize all unstaged changes and generate an atomic, feature-based commit plan.

Frequently Asked Questions about smart-commit

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

FAQPage Schema
How do I group git commits by feature for atomic changes?

To group git commits by feature for atomic changes, you can automate the intelligent grouping of staged and unstaged multi-file diffs into logical modules. This generates a feature-based commit plan where each commit represents a single functional unit.

What is an atomic commit and how does it work with unstaged changes?

An atomic commit represents a single functional unit of work. The grouping mechanism works by analyzing both staged and unstaged changes across your project, then proposing a structured plan that maps these multi-file diffs into separate, logical feature-based commits.

Does this atomic commit workflow work with Husky and commitlint?

Yes, this atomic commit workflow works with Husky and commitlint. It respects pre-commit constraints and aligns with @commitlint/config-conventional to produce standardized messages, while preserving your work if pre-commit checks fail.

How do I enforce conventional commits without adding co-authors?

You can enforce conventional commits without co-authors by applying grouping rules that respect your existing git config author identity and avoid co-authored-by annotations. This ensures standardized commit messages and scopes without altering authorship metadata.

What is the best way to handle multi-file diffs in large repositories?

The best way to handle multi-file diffs in large repositories is to automate intelligent grouping into atomic, feature-based commits. This approach analyzes all active changes and surfaces grouping suggestions via user prompts to maintain a clean commit history.

Why does pre-commit grouping fail and how can I preserve my work?

Pre-commit grouping can fail when pre-commit checks in Husky reject the commit. This skill preserves your work when pre-commit checks fail by respecting existing constraints and allowing you to adjust the proposed atomic commit plan before retrying.