A skill your agent uses when commits on a feature branch are messy, out of logical order, mix unrelated changes, or need restructuring before a PR - also triggered by "clean up history", "reorganize…

GPL-3.0Auto-check passedDevelopment

Install Recomposing Commits

skills CLI
$ npx skills add deadlock-mod-manager/deadlock-mod-manager --skill recomposing-commits -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install deadlock-mod-manager/deadlock-mod-manager recomposing-commits --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/deadlock-mod-manager/deadlock-mod-manager.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/recomposing-commits .claude/skills/recomposing-commits && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
recomposing-commits
GitHub stars
574
Token cost
~2.8k tokens
SKILL.md length
995 words
Files
1
Skills in repo
25
Repo updated
First seen
Licence
GPL-3.0

At a glance

A skill your agent uses when commits on a feature branch are messy, out of logical order, mix unrelated changes, or need restructuring before a PR - also triggered by "clean up history", "reorganize…

  • Works in 8 steps: Show current history → Ask for the start SHA → Analyze the commits to recompose → …
  • Commits on a feature branch are messy
  • SKILL.md covers Overview, Safety Check — Do This First, When to Use and Workflow (Steps 1–8), plus 5 more sections
  • Calls git

What it does

Recomposing Commits is an agent skill from deadlock-mod-manager/deadlock-mod-manager. Use when commits on a feature branch are messy, out of logical order, mix unrelated changes, or need restructuring before a PR - also triggered by "clean up history", "reorganize commits", "recompose branch", "make commits logical", or similar

Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development. It works with Git. The repository describes itself as: A mod manager for the Valve game Deadlock. The licence is GPL-3.0.

When your agent uses it

  • Commits on a feature branch are messy
  • Out of logical order
  • Mix unrelated changes
  • Need restructuring before a PR - also triggered by clean up history

Example prompts

  • “clean up history”
  • “reorganize commits”
  • “recompose branch”
  • “/recomposing-commits”

Workflow steps

8 steps, taken from the step headings in SKILL.md.

  1. Show current history
  2. Ask for the start SHA
  3. Analyze the commits to recompose
  4. Create isolated worktree
  5. Collapse commits to unstaged
  6. Stage and commit each logical group
  7. Review gate — MANDATORY, non-negotiable
  8. Handle user response

What it can do on your machine

Read from SKILL.md and the folder at commit 45c273c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Recomposing Commits loads about 2.8k tokens when it runs. Until then it costs about 66 tokens; SKILL.md has 995 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~66
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from deadlock-mod-manager/deadlock-mod-manager at commit 45c273c, republished under its GPL-3.0 licence (© deadlock-mod-manager). 995 words, ~2,775 tokens.

Download SKILL.mdSave it as .claude/skills/recomposing-commits/SKILL.md (or your agent's skills folder).
name
recomposing-commits
description
Use when commits on a feature branch are messy, out of logical order, mix unrelated changes, or need restructuring before a PR - also triggered by "clean up history", "reorganize commits", "recompose branch", "make commits logical", or similar

Recomposing Commits

Overview

Analyze messy commits → isolate in a worktree → let user review → apply back.

Core principle: The original branch is NEVER modified until the user explicitly approves the new history. Worktree isolation and the review gate are non-negotiable — even if the user says "just do it" or "I trust you, skip review."

Announce at start: "I'm using the recomposing-commits skill to reorganize your branch history."


Safety Check — Do This First

bash
git rev-parse --abbrev-ref HEAD

Refuse immediately if the current branch is any of: main, master, dev, develop, development, staging, production, release, or matches release/* or hotfix/*.

⛔ Recomposing commits on '<branch>' is not allowed.
This skill only works on feature branches.
Please switch to your feature branch first.

Do NOT create a workaround branch. Do NOT proceed. Refuse and stop.


When to Use

  • Commits are WIP/messy and a PR is coming
  • Multiple unrelated changes were mixed into the same commits
  • Commit messages are unclear ("fix", "WIP", "stuff")
  • Commits need to be split, merged, or reordered

Do NOT use when:

  • History is already clean
  • You are on a protected/shared branch (refuse instead)
  • There is only one commit to restructure

Workflow (Steps 1–8)

Step 1: Show current history
bash
git log --oneline

Display the output to the user.

Step 2: Ask for the start SHA
Which commit should be the start of the recompose?
Provide the SHA of the first commit you want to reorganize.
(All commits from that SHA through HEAD will be recomposed.)

Enter SHA:

Compute the base: BASE=$(git rev-parse <user-sha>^)

Step 3: Analyze the commits to recompose
bash
git log --oneline $BASE..HEAD
git diff $BASE HEAD

Read all diffs. Identify logical groups. Flag any files that appear in multiple logical groups (overlapping files — see Step 6).

Step 4: Create isolated worktree

Always use an absolute path. Relative paths like .git/recompose/feat/HISBA-mastra-ai silently break when branch names contain slashes AND when shell state doesn't persist between tool calls.

bash
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
REPO_ROOT=$(git rev-parse --show-toplevel)
WORKTREE_PATH="$REPO_ROOT/.git/recompose/$BRANCH_NAME"
WORKTREE_BRANCH="recompose/$BRANCH_NAME"

git worktree add "$WORKTREE_PATH" -b "$WORKTREE_BRANCH"

All subsequent git operations happen inside $WORKTREE_PATH. The original branch is untouched.

Step 5: Collapse commits to unstaged

Use git -C with the absolute path — do NOT rely on cd. Each Bash tool invocation starts with a fresh shell; cd from a previous call does not carry over.

bash
git -C "$WORKTREE_PATH" reset --mixed $BASE

All changes are now unstaged in the worktree, ready to be re-staged logically.

Step 6: Stage and commit each logical group

Use git -C "$WORKTREE_PATH" for every command. Never assume the shell is cd'd into the worktree.

For files that belong cleanly to ONE logical commit:

bash
git -C "$WORKTREE_PATH" add <file> <file2>
git -C "$WORKTREE_PATH" commit --no-verify -m "type: description"

For overlapping files (same file spans multiple logical commits):

bash
# git add -p requires a TTY — run it inside a single shell block
cd "$WORKTREE_PATH" && git add -p <file>   # stage hunk by hunk: y/n/s/e
git -C "$WORKTREE_PATH" commit --no-verify -m "type: first concern"
cd "$WORKTREE_PATH" && git add -p <file>
git -C "$WORKTREE_PATH" commit --no-verify -m "type: second concern"

NEVER use git add -i or git rebase -i — these require interactive TTY input and will hang or fail in this context.

Step 7: Review gate — MANDATORY, non-negotiable

After all commits are created in the worktree, always present this to the user:

Recomposition complete in isolated worktree.

To review:
  cd .git/recompose/<branch-name>
  git log --oneline

Original branch is UNCHANGED. Nothing will be applied until you approve.

Does the new history look good?
  [yes]       → Apply to original branch
  [no/edit]   → Describe what to change, I'll update the worktree
  [cancel]    → Discard worktree, original branch stays as-is

Wait for explicit user response. Do not proceed to Step 8 without it.

If the user previously said "no review, just do it": You must still present this review gate. Explain: "The review step is part of this skill's safety guarantee. I've isolated the changes — reviewing takes 30 seconds and means the original branch is safe. Here's what the new history looks like:"

Step 8: Handle user response

[yes] — Apply back:

Check for remote upstream first:

bash
git -C "$REPO_ROOT" remote -v
git -C "$REPO_ROOT" branch -vv

If branch tracks a remote:

⚠️  This branch has a remote upstream. Applying recomposed commits will
   require a force-push. Do you want to proceed?

Wait for confirmation, then:

bash
# DO NOT run `git checkout $BRANCH_NAME` — you are already on it in the main worktree.
# git checkout will fail with "already used by worktree". Skip it entirely.
# Use git -C with the absolute REPO_ROOT to ensure you're resetting the right branch.
git -C "$REPO_ROOT" reset --hard "recompose/$BRANCH_NAME"

# Verify it worked
git -C "$REPO_ROOT" log --oneline -5

# Clean up — worktree FIRST, then branch
git -C "$REPO_ROOT" worktree remove "$WORKTREE_PATH"
git -C "$REPO_ROOT" branch -D "recompose/$BRANCH_NAME"

[no/edit] — Iterate: Return to the worktree, adjust commits as described, re-present the review gate.

[cancel] — Discard:

bash
git worktree remove "$WORKTREE_PATH"
git branch -D "recompose/$BRANCH_NAME"

Original branch is untouched.


Overlapping Files Strategy

SituationCommand
File changes belong to different sectionsgit add -p <file> → y/n per hunk
Hunk mixes two concernss to split, then y/n
Concerns are truly interleaved linese to edit the hunk diff manually
File belongs entirely to one commitgit add <file> (no -p needed)

Verification (Before Declaring Done)

bash
# 1. Confirm new clean history
git -C "$WORKTREE_PATH" log --oneline $BASE..HEAD

# 2. Full content diff — stats alone are NOT enough
# Stats can match while content differs. Always do a byte-for-byte comparison.
diff \
  <(git -C "$REPO_ROOT" diff $BASE HEAD) \
  <(git -C "$WORKTREE_PATH" diff $BASE HEAD) \
&& echo "IDENTICAL — diffs match exactly" || echo "DIFFERENCES FOUND — investigate before proceeding"

Stats are not sufficient. 66 files changed, 8393 insertions matching does not prove content matches — only a full diff comparison does. Always use the diff <(...) <(...) form and confirm "IDENTICAL" before presenting the review gate.


Show full SKILL.md (409 more words)Show less

Quick Reference

StepAction
1git rev-parse --abbrev-ref HEAD — safety check
2git log --oneline → ask for start SHA
3git diff $BASE HEAD — analyze
4git worktree add — isolate
5git reset --mixed $BASE — collapse
6Stage + commit per logical group
7Present review gate — mandatory
8Apply back + cleanup

Common Mistakes / Rationalization Table

ExcuseReality
"git rebase -i is the standard tool for this"git rebase -i requires interactive TTY — it HANGS in this context. Use git reset --mixed + selective staging.
"User said no review, I'll respect their preference"The review gate is non-negotiable. It costs 30 seconds and protects the original branch. Present it anyway.
"I'll just modify the original branch directly, it's faster"Non-negotiable: all commits happen in the worktree only. Original branch is untouched until approval.
"The cleanup branch workaround achieves the same result"No workarounds for the protected branch check. If on main/master/dev, refuse and stop.
"git add -i is similar to git add -p"git add -i requires interactive TTY. Use git add -p only.
"The worktree cleanup can happen after the user reviews"Clean up as part of Step 8 — leaving worktrees around pollutes the repo.
"I can use a relative WORKTREE_PATH, the path is obvious"Relative paths break when branch names contain slashes. Always use REPO_ROOT=$(git rev-parse --show-toplevel) and an absolute path.
"I'll cd into the worktree and run git commands there"Shell state does NOT persist between Bash tool invocations. Use git -C "$WORKTREE_PATH" for every command.
"I need to git checkout $BRANCH_NAME before the reset"That checkout FAILS — the branch is already in use by the main worktree. Skip it. Just run git -C "$REPO_ROOT" reset --hard directly.
"The diff stats match, so the content is identical"Stats (66 files, 8393 insertions) can match while content differs. Always verify with diff <(git diff ...) <(git -C worktree diff ...).

Red Flags — STOP

If you find yourself thinking any of these, stop and follow the skill:

  • "I'll use git rebase -i"
  • "User said skip review, so I'll skip it"
  • "I'll work directly on the original branch since it's faster"
  • "I'll create a backup branch instead of a worktree"
  • "The protected branch thing doesn't matter here"
  • "I can do git add <file> for the overlapping file since it's cleaner"
  • "I'll cd into the worktree, it's simpler than git -C"
  • "The stats match so the diff is fine, I'll skip the content check"
  • "I need to checkout the branch before resetting to it"

© deadlock-mod-manager, GPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/recomposing-commits of deadlock-mod-manager/deadlock-mod-manager.

Open the folder on GitHubat commit 45c273c

Compare with similar skills

Recomposing Commits next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Recomposing Commits compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Recomposing Commits this skilldeadlock-mod-manager/deadlock-mod-manager574—~2.8kAutomated safety check: PassGPL-3.0
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT
Codebase Knowledge Graph Q&AEgonex-AI/Understand-Anything86k1 repos~1.2kAutomated safety check: PassMIT
Code Design Rationale Investigatorcursor/plugins10k9 repos~2.6kAutomated safety check: PassNone
Understand Diff AnalysisEgonex-AI/Understand-Anything86k1 repos~1.4kAutomated safety check: PassMIT

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Codebase Knowledge Graph Q&A

    Egonex-AI/Understand-Anything

    Answers questions about a codebase by searching a prebuilt knowledge graph of its files, functions, classes and dependencies, not by rereading every source file.

    86k GitHub starsUsed in 1 repo~1.2k tokens
    DevelopmentAuto-check passed
  • Official

    Digs into why code is shaped the way it is by checking git history, pull requests and connected tools in parallel, then reporting a cited read on the tradeoffs.

    10k GitHub starsUsed in 9 repos~2.6k tokens
    DevelopmentAuto-check passed
  • Understand Diff Analysis

    Egonex-AI/Understand-Anything

    Reads your git changes or a pull request against a prebuilt knowledge graph of the project to explain what changed, which components are affected and what is risky.

    86k GitHub starsUsed in 1 repo~1.4k tokens
    DevelopmentAuto-check passed
  • Understand Explain

    Egonex-AI/Understand-Anything

    Gives an in-depth explanation of one file, function or module by reading the project's knowledge graph and checking that the graph is still fresh.

    86k GitHub starsUsed in 1 repo~1.3k tokens
    DevelopmentAuto-check passed

More from deadlock-mod-manager/deadlock-mod-manager

All 25 skills in this repo
  • Skill Creator

    deadlock-mod-manager/deadlock-mod-manager

    Create new agent skills following the Agent Skills specification.

    574 GitHub starsUsed in 1 repo~2.9k tokens
    Auto-check passed
  • Create Auth Skill

    deadlock-mod-manager/deadlock-mod-manager

    Scaffold and implement authentication in TypeScript/JavaScript apps using Better Auth.

    574 GitHub starsUsed in 4 repos~3.4k tokens
    Auto-check passed
  • Opensrc

    deadlock-mod-manager/deadlock-mod-manager

    Fetch source code for npm, PyPI, or crates.io packages and GitHub/GitLab repos to provide AI agents with implementation context beyond types and docs.

    574 GitHub stars~910 tokensUpdated today
    Auto-check passed
  • Security Review

    deadlock-mod-manager/deadlock-mod-manager

    Security code review for Tauri/Rust/TypeScript desktop apps and Hono/oRPC APIs.

    574 GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Babysit

    deadlock-mod-manager/deadlock-mod-manager

    Stay on one pull request until it is merge-ready, fixing the highest-priority blocker and telling the user when it is green.

    574 GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Changeset

    deadlock-mod-manager/deadlock-mod-manager

    Generate a changeset file describing the current PR's changes.

    574 GitHub stars~1.2k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Recomposing Commits

What does Recomposing Commits do?

A skill your agent uses when commits on a feature branch are messy, out of logical order, mix unrelated changes, or need restructuring before a PR - also triggered by "clean up history", "reorganize…. Recomposing Commits is an agent skill from deadlock-mod-manager/deadlock-mod-manager.

When should I use Recomposing Commits?

Recomposing Commits fits situations like: commits on a feature branch are messy; out of logical order; mix unrelated changes; need restructuring before a PR - also triggered by clean up history.

How do I install Recomposing Commits in Claude Code?

Run `npx skills add deadlock-mod-manager/deadlock-mod-manager --skill recomposing-commits -a claude-code`. Or copy the skill folder (.agents/skills/recomposing-commits in deadlock-mod-manager/deadlock-mod-manager) into .claude/skills/recomposing-commits in your project. Claude Code loads it when a task matches its description.

How do I install Recomposing Commits in Codex?

Run `npx skills add deadlock-mod-manager/deadlock-mod-manager --skill recomposing-commits -a codex`. Or copy the skill folder (.agents/skills/recomposing-commits in deadlock-mod-manager/deadlock-mod-manager) into .agents/skills/recomposing-commits in your project. Codex loads it when a task matches its description.

Can I use Recomposing Commits in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add deadlock-mod-manager/deadlock-mod-manager --skill recomposing-commits -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/recomposing-commits, .gemini/skills/recomposing-commits, .github/skills/recomposing-commits and .opencode/skills/recomposing-commits in your project.

What does Recomposing Commits need to run?

Going by SKILL.md and its folder, Recomposing Commits needs the command-line tools its instructions call (git).

Does Recomposing Commits access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Recomposing Commits safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Recomposing Commits use?

Recomposing Commits is published under the GPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Recomposing Commits use?

About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Recomposing Commits?

Skills that share tags, products or a category with Recomposing Commits: Finishing a Development Branch (obra/superpowers, 296k stars), Code Review Checklist (shareAI-lab/learn-claude-code, 78k stars), Codebase Knowledge Graph Q&A (Egonex-AI/Understand-Anything, 86k stars) and Code Design Rationale Investigator (cursor/plugins, 10k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Recomposing Commits?

deadlock-mod-manager (a GitHub organization) maintains it in deadlock-mod-manager/deadlock-mod-manager, which has 574 GitHub stars. The repository holds 25 skills in this directory. The repository was last updated on October 8, 2026.

Source: deadlock-mod-manager/deadlock-mod-manager on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.