commit-splitter

Split large sets of uncommitted changes into logical, well-organized commits. Use when the user has many uncommitted changes and wants structured commits, or proactively suggest when detecting a large diff that would benefit from splitting.

148 stars

Best use case

commit-splitter is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Split large sets of uncommitted changes into logical, well-organized commits. Use when the user has many uncommitted changes and wants structured commits, or proactively suggest when detecting a large diff that would benefit from splitting.

Teams using commit-splitter should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/commit-splitter/SKILL.md --create-dirs "https://raw.githubusercontent.com/sundial-org/skills/main/skills/commit-splitter/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/commit-splitter/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How commit-splitter Compares

Feature / Agentcommit-splitterStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Split large sets of uncommitted changes into logical, well-organized commits. Use when the user has many uncommitted changes and wants structured commits, or proactively suggest when detecting a large diff that would benefit from splitting.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Structured Git Commits

## Workflow

### 1. Safety stash
```bash
git stash push -m "save before structured commit: <brief description>" --include-untracked
git stash apply
```
Keep changes applied throughout. Do NOT re-stash between commits. Only drop the safety stash at the very end.

### 2. Survey and number hunks

Generate patches for all modified files and list their hunks.
**Quote paths with special characters** (brackets, spaces, etc.):
```bash
git diff "<file>" > /tmp/<file>.patch
.claude/skills/commit-splitter/scripts/extract-hunks.py /tmp/<file>.patch --list
```

This outputs numbered hunks:
```
Hunks (3 total):
  1: @@ -10,6 +10,7 @@ def foo():  (+1/-0) print("perf log")...
  2: @@ -25,4 +26,6 @@ def bar():  (+2/-0) import threading...
  3: @@ -50,3 +53,4 @@ def baz():  (+1/-0) min_containers=1...
```

### 3. Propose commit plan with hunk numbers

Reference hunks by number in the plan:
```
modal_app.py:
  Hunk 1: perf logging
  Hunk 2: async threading
  Hunk 3: min_containers=1

Commit 1: "perf: add logging" - modal_app.py hunks 1
Commit 2: "perf: async + min_containers" - modal_app.py hunks 2,3
```

### 4. Execute commits

**CRITICAL: Follow the approved plan exactly.** Never combine commits because splitting "seems hard."

**NEVER use these shortcuts:**
- `git checkout` to reset files then re-edit them
- Direct file editing (Edit/Update tools) on source files
- Combining commits because changes are "interleaved"
- `Write` tool or heredocs to create patches

**Whole files:** just `git add <file>`

**New files:** just `git add <file>`

**Partial files (specific hunks):**
```bash
.claude/skills/commit-splitter/scripts/extract-hunks.py /tmp/<file>.patch <hunk_numbers> > /tmp/commit.patch
git apply --cached /tmp/commit.patch
```

Example:
```bash
# Commit 1: just perf logging (hunk 1)
.claude/skills/commit-splitter/scripts/extract-hunks.py /tmp/modal_app.patch 1 > /tmp/commit1.patch
git apply --cached /tmp/commit1.patch
git commit -m "perf: add logging"

# Commit 2: async + min_containers (hunks 2,3)
.claude/skills/commit-splitter/scripts/extract-hunks.py /tmp/modal_app.patch 2,3 > /tmp/commit2.patch
git apply --cached /tmp/commit2.patch
git commit -m "perf: async and min_containers"
```

After each commit, verify with `git diff --cached --stat`.

### 5. extract-hunks.py reference

Location: `.claude/skills/commit-splitter/scripts/extract-hunks.py`

```bash
# List hunks with summaries
.claude/skills/commit-splitter/scripts/extract-hunks.py file.patch --list

# Extract specific hunks
.claude/skills/commit-splitter/scripts/extract-hunks.py file.patch 1,3,5      # hunks 1, 3, 5
.claude/skills/commit-splitter/scripts/extract-hunks.py file.patch 2-4        # hunks 2, 3, 4
.claude/skills/commit-splitter/scripts/extract-hunks.py file.patch 1,3-5,7    # mixed
```

The script outputs a valid patch to stdout. Redirect to a file, then `git apply --cached`.

### Recovery

If something goes wrong:
- `git reset HEAD` to unstage
- `git stash list` to find safety stash
- `git checkout -- <file>` then `git stash apply` to restore a file

After all commits succeed:
- `git stash drop` to remove safety stash

Related Skills

cs448b-visualization

148
from sundial-org/skills

Data visualization design based on Stanford CS448B. Use for: (1) choosing chart types, (2) selecting visual encodings, (3) critiquing visualizations, (4) building D3.js visualizations, (5) designing interactions/animations, (6) choosing colors, (7) visualizing networks, (8) visualizing text. Covers Bertin, Mackinlay, Cleveland & McGill.

training-data-curation

148
from sundial-org/skills

Guidelines for creating high-quality datasets for LLM post-training (SFT/DPO/RLHF). Use when preparing data for fine-tuning, evaluating data quality, or designing data collection strategies.

tinker

148
from sundial-org/skills

Fine-tune LLMs using the Tinker API. Covers supervised fine-tuning, reinforcement learning, LoRA training, vision-language models, and both high-level Cookbook patterns and low-level API usage.

tinker-training-cost

148
from sundial-org/skills

Calculate training costs for Tinker fine-tuning jobs. Use when estimating costs for Tinker LLM training, counting tokens in datasets, or comparing Tinker model training prices. Tokenizes datasets using the correct model tokenizer and provides accurate cost estimates.

skill

148
from sundial-org/skills

Find, install, create, improve, and publish AI agent skills through the Sundial ecosystem. Use when the user wants to find or search for skills, install a skill, create a new skill, improve or evaluate an existing skill, or publish a skill to Sundial Hub. Trigger phrases include "find a skill", "install skill", "create a skill", "make a skill", "improve this skill", "evaluate skill", "publish skill", "push skill", "search for skills".

skill-to-card

148
from sundial-org/skills

End-to-end workflow that creates a skill from a description and attached files, publishes it to Sundial as a private skill, generates a trading card (front + back with QR code), and sends it to a printer. Use when the user wants to create a skill and get a printed trading card, or says "skill to card", "create and print a skill card", "make me a skill with a card".

project-referee

148
from sundial-org/skills

Critiques ML conference papers with reviewer-style feedback. Use when users want to anticipate reviewer concerns, identify weaknesses, check claim-evidence gaps, or find missing citations.

neuro-symbolic-reasoning

148
from sundial-org/skills

Neuro-symbolic AI combining LLMs with symbolic solvers. Use when exploring neuro-symbolic approaches (ideation, no code) or implementing solver integrations (code).

icml-reviewer

148
from sundial-org/skills

Paper reviewer that evaluates machine learning research projects following official ICML reviewer guidelines. Provides comprehensive reviews with actionable feedback across all key dimensions: claims/evidence, relation to prior work, originality, significance, clarity, and reproducibility. Also provides formative feedback on incomplete drafts, proposals, and research code repositories. MANDATORY TRIGGERS: review paper, ICML review, paper review, evaluate paper, research paper feedback, ML paper review, conference review, academic review, paper critique, NeurIPS review, ICLR review, project proposal, research proposal, paper draft, early feedback, incomplete paper, work in progress, WIP review, review repo, review codebase, research project review

cs-research-methodology

148
from sundial-org/skills

Conduct a literature review and develop a CS research proposal. Use when asked to review a research area, find gaps in existing work, and propose a novel research contribution. The output is a research proposal identifying an assumption to challenge (the "bit flip") and how to validate it.

codex

148
from sundial-org/skills

Run OpenAI's Codex CLI agent in non-interactive mode using `codex exec`. Use when delegating coding tasks to Codex, running Codex in scripts/automation, or when needing a second agent to work on a task in parallel.

ai-co-scientist

148
from sundial-org/skills

Transform Claude Code into an AI Scientist that orchestrates research workflows using tree-based hypothesis exploration. Triggers on "research project", "scientific experiment", "run experiments", "AI scientist", "tree search experimentation", "systematic study".