/install commit-tidy
Commit Tidy
Analyze staged/unstaged changes and recommend whether to split into multiple commits.
When to use
- Before committing large changesets
- User asks "should I split this commit?"
- Reviewing changes that touch many files
- Ensuring atomic, reviewable commits
Split Decision Criteria
Split when
-
Unrelated functionality changes
- Feature A + Bug fix B → 2 commits
- UI change + API change (if independent) → 2 commits
-
Wide file spread
- Changes span 5+ directories with no common purpose
- Frontend + Backend + Config all modified
-
Mixed change types
- Refactoring + New feature → 2 commits
- Formatting + Logic change → 2 commits
- Dependency update + Code change → 2 commits
-
Large diff size
- 500+ lines changed across unrelated areas
- Multiple components modified independently
-
Different reviewers needed
- Changes require different domain expertise
- Security-sensitive + general changes
Keep together when
-
Single logical change
- Feature requires touching multiple files
- Refactoring that must be atomic
-
Dependent changes
- API change + caller updates
- Schema change + migration + model update
-
Related cleanup
- Feature + directly related tests
- Bug fix + regression test
Squash Criteria
When analyzing multiple commits, recommend squashing as well as splitting.
Squash when
-
Same type + same purpose
test: A test+test: B test(tests for the same feature) → squash into 1fix: typo A+fix: typo B(same review feedback) → squash into 1
-
Commits split per loop by automated agents
- Autonomous agents like Ralph commit per loop → squash if same purpose
- Example: proxy test in loop 1, OIDC test in loop 2 →
test: add unit tests
-
Consecutive WIP commits
wip: in progress+feat: complete→ squash into one feat
Don't squash
- Commits with different types — keep
test+chore+featseparate - Commits belonging to different PRs/issues
- Independent changes that may need to be reverted
Output format (when recommending squash)
### Recommendation: Squash 2 commits → 1
**Before** (2 commits):
- 441b966a test(dt): OIDC auth, proxy, SSO tests
- e2b6503a test(dt): OIDC route tests (login, callback, me)
**After** (1 commit):
- test(dt): add OIDC auth unit tests
**Reasoning**: Same type (test), same feature (OIDC auth), agent loop split
Instructions
Step 1: Analyze changes
# Check staged changes
git diff --cached --stat
git diff --cached --name-only
# Check unstaged changes
git diff --stat
git status
Step 2: Categorize files
Group changed files by:
- Feature/Component: Which feature does this belong to?
- Change type: feat, fix, refactor, style, test, docs, chore
- Directory: Are changes localized or spread out?
Step 3: Identify boundaries
Look for natural split points:
- Different conventional commit types
- Independent functionality
- Separate test files from implementation (if tests are for different features)
Step 4: Recommend split strategy
Provide specific recommendations:
## Analysis Results
### Changed Files (N files)
- src/api/... (3 files) - API endpoints
- src/components/... (2 files) - UI components
- tests/... (2 files) - Tests
### Recommendation: Split into N commits
**Commit 1**: feat: add user profile API
- src/api/user.ts
- src/api/types.ts
- tests/api/user.test.ts
**Commit 2**: feat: add profile UI component
- src/components/Profile.tsx
- src/components/Profile.css
- tests/components/Profile.test.tsx
### Reasoning
- API and UI can function independently
- Each can be reviewed by different reviewers
Step 5: Execute split (if requested)
# Unstage all
git reset HEAD
# Stage first commit files
git add src/api/ tests/api/
git commit -m "feat: add user profile API"
# Stage second commit files
git add src/components/ tests/components/
git commit -m "feat: add profile UI component"
Quick Reference
File spread heuristic
| Files | Directories | Recommendation |
|---|---|---|
| 1-5 | 1-2 | Usually single commit |
| 5-10 | 2-3 | Review for split |
| 10+ | 4+ | Likely needs split |
Change type combinations to split
| Combination | Split? |
|---|---|
| feat + feat (unrelated) | ✅ Yes |
| feat + related test | ❌ No |
| fix + unrelated refactor | ✅ Yes |
| refactor + style (same files) | ❌ No |
| chore(deps) + feat | ✅ Yes |
Output Format
Analysis results should include:
- List of changed files with categories
- Whether split is needed and why
- Specific commit splitting plan
- Suggested commit messages for each
- Execution commands (if requested)
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install commit-tidy - 安装完成后,直接呼叫该 Skill 的名称或使用
/commit-tidy触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Commit Tidy 是什么?
Analyze staged/committed changes and recommend splitting or squashing strategy. Use when the user says "commit split", "split commits", "should I split this... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 176 次。
如何安装 Commit Tidy?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install commit-tidy」即可一键安装,无需额外配置。
Commit Tidy 是免费的吗?
是的,Commit Tidy 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Commit Tidy 支持哪些平台?
Commit Tidy 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Commit Tidy?
由 es6kr(@drumrobot)开发并维护,当前版本 v0.1.1。