Install
openclaw skills install commit-tidyAnalyze staged/committed changes and recommend split, squash, or commit-message strategy. Topics — interactive-amend (worktree-based amend+rebase loop), soft-reset-amend (soft-reset top N + selective re-commit), staging-discipline (`git diff --cached --name-only` audit + sensitive-dir gate for rules/agents/docs), security-scan (PUBLIC repo 4-grep secret pattern check before commit), message-discipline (Conventional Commit tags, PUBLIC English enforcement, operation-type continuity, --amend refresh, source-code .md behavior verbs). Use when: "commit split", "squash commits", "tidy commits", "amend earlier", "interactive amend", "soft reset", "rewrite commits", "PUBLIC repo commit", "secret in commit", "commit message", "commit author identity", "commit message English", "staging discipline".
openclaw skills install commit-tidy| Topic | Description | Guide |
|---|---|---|
| interactive-amend | Worktree-based amend+rebase loop for earlier/multiple commits | interactive-amend.md |
| message-discipline | Commit message conventions — Conventional Commit tags, PUBLIC English enforcement, --amend refresh, source-code .md behavior verbs, operation-type continuity | message-discipline.md |
| security-scan | PUBLIC repo commit body 4-grep secret pattern check (PAT/Vault/API key/Base64) before commit | security-scan.md |
| soft-reset-amend | Soft-reset top N commits and selectively re-commit (simpler than worktree rebase) | soft-reset-amend.md |
| staging-discipline | git diff --cached --name-only audit + sensitive-dir gate (rules/agents/docs) before commit | staging-discipline.md |
Analyze staged/unstaged changes and recommend whether to split into multiple commits.
Unrelated functionality changes
Wide file spread
Mixed change types
Large diff size
Different reviewers needed
Single logical change
Dependent changes
Related cleanup
When analyzing multiple commits, recommend squashing as well as splitting.
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 1Commits split per loop by automated agents
test: add unit testsConsecutive WIP commits
wip: in progress + feat: complete → squash into one feattest + chore + feat separate### 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
When ARGUMENTS specify a range (e.g., "since main", "last 3 commits", "PR #N"), analyze all changes in that range — both committed and uncommitted.
# Range specified (e.g., "X changes since main")
git log --oneline <base>..HEAD -- <path> # committed changes
git diff <base>..HEAD --stat -- <path> # committed diff
git diff HEAD --stat -- <path> # uncommitted diff
The analysis must cover committed commits (squash/split candidates) + uncommitted changes (new commit candidates) as a single unified view. Do not analyze only uncommitted changes when a range is specified.
When no range is specified, default to staged + unstaged changes only.
# Check staged changes
git diff --cached --stat
git diff --cached --name-only
# Check unstaged changes
git diff --stat
git status
Group changed files by:
Look for natural split points:
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
# 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"
| Files | Directories | Recommendation |
|---|---|---|
| 1-5 | 1-2 | Usually single commit |
| 5-10 | 2-3 | Review for split |
| 10+ | 4+ | Likely needs split |
| Combination | Split? |
|---|---|
| feat + feat (unrelated) | ✅ Yes |
| feat + related test | ❌ No |
| fix + unrelated refactor | ✅ Yes |
| refactor + style (same files) | ❌ No |
| chore(deps) + feat | ✅ Yes |
Analysis results should include: