squash-commits
하는 일
이 스킬은 현재 브랜치의 커밋을 소수의 논리적인 커밋으로 다시 정리합니다. 공유하기 전에 깔끔한 기록을 원하는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓브랜치에 작고 어수선한 커밋이 많아서 기록을 더 깔끔하게 만들고 싶을 때.
- ✓풀 리퀘스트를 열기 전에 관련된 변경을 의미 있는 커밋으로 묶고 싶은 경우.
- ✓main에서 가져온 머지 커밋을 브랜치에서 없애야 할 때.
스킬 링크
https://github.com/pipecat-ai/pipecat/blob/main/.claude/skills/squash-commits/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“코드는 바꾸지 않고, 제 브랜치의 커밋을 몇 개의 명확한 커밋으로 정리해 주실 수 있나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 작업이 저장되었는지 확인하고, 브랜치의 백업 복사본을 만든 뒤 모든 변경을 유지하면서 커밋을 다시 설정합니다. 그다음 묶음을 제안하고, 커밋하기 전에 확인을 요청합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Reorganize the commits on the current branch into a small number of logical commits. Do NOT change any file content — only the commit structure changes.
Instructions
1. Safety check
git status --short
If there are uncommitted changes, stop and tell the user to commit or stash them first.
2. Inspect the branch
git log main..HEAD --oneline
git diff main..HEAD --name-only
List every file changed vs main and every commit on the branch (excluding merge commits from main).
3. Create a backup branch
git branch backup/<current-branch-name>
Tell the user the backup exists so they can recover if needed.
4. Soft-reset to main and unstage everything
git reset --soft main
git restore --staged .
All branch changes are now in the working tree, unstaged. No content has changed.
5. Plan the logical groups
Read the changed files and the original commit messages to understand what the work covers. Group related files into logical commits. Typical groups:
- Core feature or fix (new source files + modified core files)
- Secondary features or fixes (each as its own commit if distinct)
- Refactoring or renames
- Tests
- Changelogs / docs
Use the changelog files (if any) as a strong hint — each changelog entry often maps to one commit.
Present the proposed grouping to the user and ask for confirmation before committing.
6. Commit in logical groups
For each group, stage only the relevant files and commit with a clear message following the project's conventions:
git add <file1> <file2> ...
git commit -m "..."
Use conventional commit prefixes if the project uses them (feat:, fix:, refactor:, test:, chore:).
7. Verify
git log main..HEAD --oneline
git diff main..HEAD --name-only
git status --short
Confirm:
- Commit count is small and each message is meaningful
- The set of changed files vs
mainis identical to before - Working tree is clean
8. Remind about force-push
The branch history has been rewritten. Tell the user they will need to git push --force-with-lease when they are ready to update the remote. Do NOT push automatically.
Rules
- Never change file contents. If you find yourself editing a file, stop.
- Never skip the backup branch step.
- Never force-push without explicit user instruction.
- If any step fails or the result looks wrong, tell the user and suggest restoring from the backup:
git reset --hard backup/<branch-name>.
자주 묻는 질문
이 스킬이 제 코드를 바꾸나요?
아니요. 스킬은 커밋이 배열되는 방식만 바꾸고 파일의 내용은 바꾸지 않도록 설계되어 있습니다.
되돌릴 방법이 있나요?
네. 스킬이 먼저 백업 브랜치를 만들므로, 필요하면 원래 커밋으로 돌아갈 수 있습니다.
묶음을 제가 확인해야 하나요?
네. 에이전트는 제안한 커밋 묶음을 보여 주고, 커밋하기 전에 승인을 요청합니다.
상세 정보
작성자의 원본 설명
Reorganize messy branch commits into a small set of logical, meaningful commits without changing any content. Drops merge-from-main commits. Safe: creates a backup branch first.
repo: pipecat-ai/pipecat
인기도
- GitHub 스타
- 17k
- 순위
- #10793
- 라이선스
- BSD-2-Clause
- 업데이트
- 2026. 11. 2.
댓글
- …