Token导航 LogoToken导航

Agent Skill · 待分类

recomposing-commits(重组提交)

recomposing-commits 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

recomposing-commits 是待分类类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为执行命令;许可证信息还不明确,第三方扫描有提醒项,按安装量在待分类类的 11,209 个 Skill 里排第 6,984。

总安装 399周安装 16GitHub Stars 4下载 129核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:recomposing-commits(重组提交)
来源仓库:https://github.com/nur-zaman/git-recompose-skill
仓库路径:skills/recomposing-commits
安装命令:
npx skills add https://github.com/nur-zaman/git-recompose-skill --skill recomposing-commits
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/nur-zaman/git-recompose-skill --skill recomposing-commits

这个 Skill 是做什么的

这个 Skill 的分类还没最终确定,用法以来源仓库的说明为准。

recomposing-commits 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态和协作事项进行整理。通过 npx skills add 命令从指定仓库安装并使用该技能。

安装前需确认权限范围、维护状态,以及是否会触发联网或文件读写。建议结合来源仓库和原始 README 核验具体功能和使用方式。

来源仓库内路径:skills/recomposing-commits

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/nur-zaman/git-recompose-skill --skill recompos…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要执行命令,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

recomposing-commits 怎么安装?

在终端执行 npx skills add https://github.com/nur-zaman/git-recompose-skill --skill recomposing-commit…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

recomposing-commits 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

recomposing-commits 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 npx skills add https://github.com/nur-zaman/git-recompose-skill --skill recomposing-commits 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

recomposing-commits 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

recomposing-commits 用的人多吗?

公开数据是累计安装 399 次,近一周安装 16 次,下载 129 次,GitHub 4 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

recomposing-commits 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理待分类类任务、又不想每次都手写提示词的人。

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

待分类类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
infsh-cli

infsh CLI · Codex、Claude

4,374,576382权限未标注未明确未收录
ai-video-generation

AI 视频生成 · Codex、Claude

4,313,376382调用外部服务未明确有提醒
lark-openapi-explorer

云雀 OpenAPI 浏览器 · Codex、Claude

2,064,1209,011需要联网未明确有提醒
lark-workflow-standup-report

Lark 工作流程站立报告 · Codex、Claude

2,041,6328,978需要联网未明确通过
use-my-browser

使用我的浏览器 · Codex、Claude

1,848,49140操作浏览器未明确未通过
recomposing-commits

重组提交 · 本页

3994执行命令未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

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

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

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

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.

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.

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:

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):

# 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:

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:

# 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:

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)

# 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.


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"

平台分布

Codex

37.26%
按下载量换算48

Claude

28.43%
按下载量换算37

Cursor

18.93%
按下载量换算24

Gemini CLI

8.61%
按下载量换算11

安全审计

Gen Agent Trust Hub

通过

Socket

可疑

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/nur-zaman/git-recompose-skill --skill recomposing-commits 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills