squash-branch
БесплатноБез исполняемых скриптовНе проверенSquash all commits on a feature branch into a single commit. Use when the user wants to clean up commit history, squash commits, or consolidate branch changes…
от diegosouzapw★ 68 звёзд на GitHubОб этом скилле
Squash Branch Skill
Squash all commits on a feature branch into a single commit by generating a patch, recreating the branch from the base, and applying the patch.
Parameters
The user should provide:
- feature_branch: The branch to squash (e.g.,
jose/vectors,feature/my-feature) - base_branch: The branch to squash against (e.g.,
mainline,main,master) - commit_message (optional): If not provided, prompt the user for a commit message
Instructions
Verify current state: Ensure the working directory is clean and you're on the feature branch
git status git branch --show-currentGenerate the patch: Create a diff between the base branch and feature branch
git diff <base_branch>...<feature_branch> > /tmp/squash-branch.patchSwitch to base branch and delete feature branch:
git checkout <base_branch> git branch -D <feature_branch>Recreate feature branch from base and apply patch:
git checkout -b <feature_branch> git apply /tmp/squash-branch.patchPrompt for commit message: If no commit message was provided, use AskUserQuestion to ask the user what commit message they want
Stage and commit:
git add -A git commit -m "<commit_message> Co-Authored-By: Claude <[email protected]>"Show final result: Display the new clean commit history
git log --oneline <base_branch>..<feature_branch> git diff --stat <base_branch>...<feature_branch>
Example Usage
User: "Squash my feature/auth branch against main with message 'Add user authentication'"
User: "Clean up the commit history of jose/vectors against mainline"
User: "/squash-branch feature_branch=dev/new-feature base_branch=main"
Important Notes
- This operation is destructive to the local branch history - make sure changes are not pushed and nothing other than the feature branch is modified
- Always verify the patch was created successfully before deleting the branch
- If the patch application fails, the original branch is already deleted - warn the user about this risk
- The patch file is stored in /tmp and will be cleaned up by the system
Установить squash-branch в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл squash-branch?
Squash all commits on a feature branch into a single commit. Use when the user wants to clean up commit history, squash commits, or consolidate branch changes into one commit.
Как установить скилл squash-branch?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл squash-branch запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic