Token导航 LogoToken导航

Agent Skill · 研究检索

git-squash-commits(git 挤压提交)

git-squash-commits 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

git-squash-commits 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证为 MIT,第三方扫描有未通过项,按安装量在研究检索类的 73,675 个 Skill 里排第 69,087。

总安装 220周安装 9GitHub Stars 6下载 71核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/acking-you/myclaude-skills --skill git-squash-commits

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于查找、检索和筛选相关信息。适合根据关键词、任务场景或来源线索快速定位候选结果。可结合来源仓库和原始 README 核验具体用法和功能细节。安装通过 npx skills add 命令从指定 GitHub 仓库获取,适用于 Codex、Claude、Cursor、Gemini CLI。

建议确认权限范围、维护状态及是否触发联网、命令执行或文件读写。

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

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

git-squash-commits 怎么安装?

在终端执行 npx skills add https://github.com/acking-you/myclaude-skills --skill git-squash-commits。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

git-squash-commits 支持哪些 AI 工具?

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

git-squash-commits 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

git-squash-commits 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

git-squash-commits 用的人多吗?

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

git-squash-commits 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

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

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
git-squash-commits

git 挤压提交 · 本页

2206只读MIT未通过

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

SKILL.md 原文

Git Squash Commits Skill

Overview

This skill helps you squash a range of git commits into a single commit with an automatically generated commit message that summarizes all the changes. It analyzes the commit history and file changes to create a comprehensive, well-structured commit message.

When to Use

  • Cleaning up messy commit history before merging
  • Consolidating multiple work-in-progress commits
  • Preparing commits for code review or pull request
  • Simplifying feature branch history
  • Removing unnecessary intermediate commits

Prerequisites

IMPORTANT: Before invoking this skill, you MUST manually reset your branch to the parent of the earliest commit you want to squash. The skill will verify this and prompt you if needed.

Example:

# If you want to squash commits from abc123 to xyz789
# First find the parent of abc123
git log --oneline abc123~5..abc123

# Then reset to the parent (e.g., parent_commit)
git reset --hard parent_commit

Usage

When invoking this skill, provide:

  1. Start commit ID: The earliest commit in the range (will NOT be included in current branch after squash)
  2. End commit ID: The latest commit in the range (will NOT be included in current branch after squash)

The skill will:

  1. Verify the current HEAD is at the parent of the start commit
  2. Analyze all commits between start and end (inclusive)
  3. Examine the file changes and commit messages
  4. Generate a comprehensive commit message with:

- High-level summary - Major changes grouped by category - Detailed improvements and fixes - Statistics (files changed, lines added/removed)

  1. Prompt user to run build/compilation to verify changes

- Wait for user confirmation - If build fails, help resolve errors - If build succeeds, proceed to next step

  1. Create the squash commit
  2. Verify the old commits are no longer in the branch history
  3. Save a summary record to ai_docs/git-squash-commits/ directory containing:

- Squash operation metadata (timestamp, branch, commit hashes) - The generated commit message - Statistics and list of original commits

Commit Message Structure

The generated commit message follows this structure:

<Type>: <Brief summary of the main changes>

Major changes:
- <Category 1>: <Description>
- <Category 2>: <Description>
- ...

<Specific area> improvements:
- <Detailed change 1>
- <Detailed change 2>
- ...

Other changes:
- <Miscellaneous improvements>
- ...

This squash consolidates N commits focusing on <focus areas>.

Statistics: X files changed, Y insertions(+), Z deletions(-)

Example Invocation

User request:

Help me squash commits from f2da9a6 to d2755e90

Skill execution flow:

  1. Check current HEAD position
  2. If not at correct position, prompt user: Please first reset to the parent of f2da9a6: git reset --hard <parent_commit_id> Then invoke this skill again.
  3. If at correct position, proceed with:

- List all commits to be squashed - Show statistics of changes - Analyze commit messages and file changes - Generate comprehensive commit message - Prompt user to run build/compile and wait for confirmation - If build fails, help resolve errors - If build succeeds, continue to next step - Execute git merge --squash d2755e90 - Commit with generated message - Verify old commits are removed from branch

Implementation Guidelines

Step 1: Verify Prerequisites

# Get current HEAD
git rev-parse HEAD

# Get parent of start commit
git rev-parse <start_commit>^

# Compare - they should match

Step 2: Analyze Commits

# List commits to squash (from start to end, inclusive)
git log --oneline <start_commit>..<end_commit>

# Include the end commit itself
git log --oneline <end_commit> -1

# Get commit messages for analysis
git log --format="%s" <start_commit>~1..<end_commit>

Step 3: Analyze Changes

# Get file statistics
git diff --stat <start_commit>~1..<end_commit>

# Get detailed changes for major files
git diff <start_commit>~1..<end_commit> -- <important_files>

Step 4: Generate Commit Message

Analyze the commits and changes to create a message that:

  • Identifies the main purpose (Refactor, Feature, Fix, etc.)
  • Groups changes by functional area
  • Highlights important improvements
  • Includes quantitative metrics

Step 5: Build Verification

After generating the commit message but before executing the squash, prompt the user to verify the changes build correctly:

Please run your project's build/compilation command to verify the changes:
- For Node.js: npm run build or yarn build
- For Python: python -m pytest or your test suite
- For Go: go build ./...
- For Rust: cargo build
- For Java/Maven: mvn compile
- For other projects: use your project-specific build command

Please run the build and let me know:
1. If the build succeeds, I will proceed with creating the squash commit
2. If the build fails, share the error output and I will help resolve it

Wait for user response:

  • If build succeeds: proceed to Step 6
  • If build fails: analyze the error, help fix issues, ask user to rebuild, repeat until success

Step 6: Execute Squash

# Squash merge all commits
git merge --squash <end_commit>

# Commit with generated message
git commit -m "$(cat <<'EOF'
<generated_message_here>
EOF
)"

Step 7: Verify Result

# Check new commit is created
git log --oneline -3

# Verify old commits are NOT in current branch
git log --oneline HEAD~20..HEAD | grep -E "(<start_commit_short>|<end_commit_short>)"
# Should return empty

Step 8: Save Summary to ai_docs

# Create ai_docs directory structure if not exists
mkdir -p ai_docs/git-squash-commits

# Generate summary filename with timestamp and commit hash
SUMMARY_FILE="ai_docs/git-squash-commits/$(date +%Y%m%d_%H%M%S)_$(git rev-parse --short HEAD).md"

# Write summary containing:
# - Squash operation metadata (date, commit range, new commit hash)
# - Generated commit message
# - Statistics (files changed, insertions, deletions)
# - List of original commits that were squashed
cat > "$SUMMARY_FILE" <<EOF
# Git Squash Summary

**Date**: $(date +"%Y-%m-%d %H:%M:%S")
**Branch**: $(git branch --show-current)
**New Commit**: $(git rev-parse HEAD)

## Commit Range Squashed
- Start: <start_commit>
- End: <end_commit>

## Generated Commit Message
\`\`\`
<paste the generated commit message here>
\`\`\`

## Statistics
<paste git diff --stat output>

## Original Commits
<paste git log --oneline output of squashed commits>
EOF

echo "Summary saved to: $SUMMARY_FILE"

Notes

  • The skill assumes a linear commit history between start and end commits
  • Merge commits in the range will be included in the squash
  • The generated commit message aims to be comprehensive yet concise
  • All original commits will be removed from the current branch history
  • The squash commit will have the current branch HEAD parent as its parent
  • Statistics include all accumulated changes from start to end
  • Summary records: Each squash operation creates a markdown file in ai_docs/git-squash-commits/ directory

- Filename format: YYYYMMDD_HHMMSS_<short_hash>.md (timestamp + new commit hash) - Content includes: operation metadata, generated commit message, statistics, and list of squashed commits - Records are useful for auditing and understanding the history of squash operations - The ai_docs/ directory should be added to .gitignore if you prefer not to commit these records

Error Handling

If the user hasn't reset to the correct parent commit:

  1. Calculate the correct parent: git rev-parse <start_commit>^
  2. Show current HEAD: git rev-parse HEAD
  3. Instruct user to run: git reset --hard <correct_parent>
  4. Exit and ask user to re-invoke after reset

Best Practices

  • Always verify the commit range before squashing
  • Keep the generated message focused on "what" and "why"
  • Group related changes together
  • Highlight breaking changes or important modifications
  • Include statistics for transparency
  • Always run build/compilation before creating the squash commit to catch errors early
  • Resolve all build errors before proceeding with the squash
  • Test the changes after squashing to ensure nothing broke

平台分布

windsurf

26.62%
按下载量换算19

Codex

22.95%
按下载量换算16

github-copilot

20.02%
按下载量换算14

Claude Code

12.7%
按下载量换算9

Antigravity

8.16%
按下载量换算6

Gemini CLI

3.5%
按下载量换算2

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

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

继续浏览同类 Skills