commit-by-logic

Group git changes into logical commits with Conventional Commits messages.

10|Updated Jun 3, 2020
One-click install
npx skills add https://github.com/magic3007/dotfiles --skill commit-by-logic
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: commit-by-logic
Source: https://github.com/magic3007/dotfiles/tree/main/cursor_config/skills/commit-by-logic
Command: npx skills add https://github.com/magic3007/dotfiles --skill commit-by-logic

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

自动分析当前工作区的改动,将它们按逻辑分组并生成符合 Conventional Commits 规范的提交消息,帮助你分多次提交而不丢失上下文。

Core Features & Use Cases

  • 自动分析 git status 和 git diff,识别需要分组的改动。
  • 按文件类型、功能模块或改动类型对改动进行分组,确保每个提交语义清晰。
  • 交互式确认:逐组展示改动及提交消息,允许你调整分组或消息后再提交。
  • 支持逐组提交:对每个逻辑分组执行 git add 和 git commit,确保提交完整性。
  • 遵循 Conventional Commits: <type>(<scope>): <description> 的格式。

Quick Start

在有未提交改动时触发该工具,让它按逻辑将改动分组并逐次提交。

Frequently Asked Questions about commit-by-logic

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

FAQPage Schema
How do I split git changes into logical commits?

To split git changes into logical commits, this tool analyzes your git status and diff, automatically grouping changes by file type, module, or change type, and then committing each group separately to ensure semantic clarity and traceability.

How do I generate conventional commits automatically from my staged changes?

Generating conventional commits automatically involves grouping your unstaged changes logically and applying the <type>(<scope>): <description> format. This tool creates these messages and interactively lets you confirm or adjust them before committing.

Can I review and adjust git commit groups before they are committed?

Yes, you can review and adjust git commit groups before they are committed. The tool provides interactive confirmation, displaying each logical group and its generated message so you can modify the grouping or text before the actual git add and commit execution.

What is the best way to separate feature and refactor changes in git?

The best way to separate feature and refactor changes in git is by analyzing diffs to group changes by their logical type. This tool identifies whether changes are features, fixes, or refactors, grouping them accordingly for distinct, conventional commit messages.

Does this tool require any specific git hooks or dependencies to organize commits?

No specific git hooks or dependencies are required to organize commits. The tool operates independently by running standard git status and diff analysis directly in your working directory to identify and group changes.