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 commit", "squash commits", "tidy commits", or when reviewing large changesets before committing.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "commit-tidy" with this command: npx skills add drumrobot/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

  1. Unrelated functionality changes

    • Feature A + Bug fix B → 2 commits
    • UI change + API change (if independent) → 2 commits
  2. Wide file spread

    • Changes span 5+ directories with no common purpose
    • Frontend + Backend + Config all modified
  3. Mixed change types

    • Refactoring + New feature → 2 commits
    • Formatting + Logic change → 2 commits
    • Dependency update + Code change → 2 commits
  4. Large diff size

    • 500+ lines changed across unrelated areas
    • Multiple components modified independently
  5. Different reviewers needed

    • Changes require different domain expertise
    • Security-sensitive + general changes

Keep together when

  1. Single logical change

    • Feature requires touching multiple files
    • Refactoring that must be atomic
  2. Dependent changes

    • API change + caller updates
    • Schema change + migration + model update
  3. Related cleanup

    • Feature + directly related tests
    • Bug fix + regression test

Squash Criteria

When analyzing multiple commits, recommend squashing as well as splitting.

Squash when

  1. Same type + same purpose

    • test: A test + test: B test (tests for the same feature) → squash into 1
    • fix: typo A + fix: typo B (same review feedback) → squash into 1
  2. 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
  3. Consecutive WIP commits

    • wip: in progress + feat: complete → squash into one feat

Don't squash

  1. Commits with different types — keep test + chore + feat separate
  2. Commits belonging to different PRs/issues
  3. 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

FilesDirectoriesRecommendation
1-51-2Usually single commit
5-102-3Review for split
10+4+Likely needs split

Change type combinations to split

CombinationSplit?
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:

  1. List of changed files with categories
  2. Whether split is needed and why
  3. Specific commit splitting plan
  4. Suggested commit messages for each
  5. Execution commands (if requested)

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

GigaChat (Sber AI) Proxy

Integrate GigaChat (Sber AI) with OpenClaw via gpt2giga proxy

Registry SourceRecently Updated
3600smvlx
General

TencentCloud Video Face Fusion

通过提取两张人脸核心特征并实现自然融合,支持多种风格适配,提升创意互动性和内容传播力,广泛应用于创意营销、娱乐互动和社交分享场景。

Registry SourceRecently Updated
General

TencentCloud Image Face Fusion

图片人脸融合(专业版)为同步接口,支持自定义美颜、人脸增强、牙齿增强、拉脸等参数,最高支持8K分辨率,有多个模型类型供选择。

Registry SourceRecently Updated
General

YoudaoNote News

有道云笔记资讯推送:基于收藏笔记分析关注话题,推送最新相关资讯。支持对话触发与每日定时推送(如早上9点)。触发词:资讯推送、设置资讯推送、生成资讯推送。

Registry SourceRecently Updated
1.5K1lephix