Skip to content
Agentmart
Submit a tool

cleanup-commits

Rebase and reorganize commits into clean, meaningful commits for easy PR review

Skill by apocohq

IndexedMIT★ 4
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/apocohq-cleanup-commits

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Rebase and reorganize commits into clean, meaningful commits for easy PR review

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/cleanup-commits

Tools it pre-approves 5

From allowed-tools in SKILL.md: the agent may use these without asking you each time.

  • Bash(git
  • *),
  • Read,
  • Grep,
  • Glob

What's inside

Skill name
cleanup-commits
Description
Rebase and reorganize commits into clean, meaningful commits for easy PR review
License
MIT
Allowed tools
Bash(git, *),, Read,, Grep,, Glob
Instructions
138 lines in SKILL.md · view on GitHub

Before installing

  • Pre-approves some shell commands

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Cleanup Commits for PR Review

Reorganize all commits on the current branch into clean, logical commits that are easy to review.

## Arguments

- `$0` - Base branch to rebase onto (default: `main`)

## Process

### 1. Preparation

First, verify clean working state and identify the base:

```bash
git status --porcelain
```

If there are uncommitted changes, warn the user and stop.

Get the base branch (use argument or default to `main`):

- Base branch: `${0:-main}`

### 2. Analyze Changes

Get the full picture of what changed:

```bash
git log --oneline ${0:-main}..HEAD
git diff --stat ${0:-main}..HEAD
git diff ${0:-main}..HEAD
```

Also check the files changed to understand the scope:

```bash
git diff --name-only ${0:-main}..HEAD
```

### 3. Plan Commits

Based on the diff analysis, identify logical groupings. Common patterns:

- **Feature commits**: Group related functionality together
- **Refactor commits**: Structural changes without behavior change
- **Config/setup commits**: Dependencies, configs, tooling
- **Test commits**: Test additions/changes
- **Fix commits**: Bug fixes
- **Docs commits**: Documentation updates

Create a plan listing each commit with:

- Clear subject line (imperative mood, <72 chars)
- Which files go in each commit
- Why this grouping makes sense

**Show the plan to the user and ask for confirmation before proceeding.**

### 4. Execute Rebase

After user confirms the plan:

```bash
git reset --soft ${0:-main}
git reset HEAD
```

This unstages everything while keeping all changes in working directory.

### 5. Create Commits

For each logical group in the plan:

1. Stage the relevant files:

   ```bash
   git add <specific-files>
   ```

2. Create commit with descriptive message:

   ```bash
   git commit -m "type: concise description

   - Detail 1
   - Detail 2"
   ```

Use conventional commit prefixes:

- `feat:` - New features
- `fix:` - Bug fixes
- `refactor:` - Code restructuring
- `test:` - Test changes
- `docs:` - Documentation
- `chore:` - Build, config, dependencies

### 6. Verify Result

Show the new commit history:

```bash
git log --oneline ${0:-main}..HEAD
```

Compare with original to ensure nothing was lost:

```bash
git diff ${0:-main}..HEAD --stat
```

## Important Notes

- This is a **destructive operation** - it rewrites git history
- Only use on branches that haven't been pushed, or be prepared to force push
- Always verify the final diff matches the original diff
- If something goes wrong, use `git reflog` to recover

From apocohq/skills, MIT.

More from apocohq/skills

Signals

Stars
4
Forks
0
Open issues
0
Last commit (this folder)
Mar 18, 2026 (7 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from apocohq

Cite this page

cleanup-commits skill. Agent Mart. https://agentmart.dev/skills/apocohq-cleanup-commits (last updated 2026-10-24)