git-version-control skill
Git 커밋 표준, 브랜치 전략 및 LLM 지원 개발 워크플로우를 구현하여 원자적 커밋(atomic commits)과 고빈도 통합을 보장합니다.
- GitHub 스타
- 9
- 파일
- 1
- 마지막 커밋
- 2026년 10월 13일
- 라이선스
- EPL-2.0
- 허용된 도구
- —
git-version-control skill은 무엇을 하나요?
git-version-control은(는) agent skill입니다. Git 커밋 표준, 브랜치 전략 및 LLM 지원 개발 워크플로우를 구현하여 원자적 커밋(atomic commits)과 고빈도 통합을 보장합니다.
skill의 SKILL.md에서 생성된 요약입니다.
git-version-control skill 정보
빠른 속도로 개발이 진행되는 환경에서 작업하는 개발자는 이 SKILL을 사용하여 규율 있는 버전 관리 워크플로우를 구현할 수 있습니다. 원자적 커밋을 유지하고 프로젝트 요구 사항에 따라 trunk-based development 또는 GitHub flow 중 하나를 선택할 수 있는 프레임워크를 제공합니다. 이 SKILL은 AI를 사용하여 코드를 생성하는 사용자에게 특히 유용하며, 잘못된 LLM 출력으로부터 코드를 보호하기 위한 체크포인트 패턴을 도입합니다.
에이전트가 코드 변경 관리를 담당할 때, 이 SKILL을 사용하여 테스트 통과, 빌드 성공 또는 linter 준수와 같은 완료 신호를 식별합니다. Conventional Commit 표준을 강제하고 squash-merge를 사용하여 메인라인 히스토리를 깨끗하게 유지함으로써 고품질의 커밋 히스토리를 생성합니다. 이 SKILL은 Git 명령과 함께, 공개 기록을 더럽히지 않고 수정 사항을 처리하기 위해 autosquash와 함께 fixup 커밋을 사용하는 등의 특정 전략을 활용합니다. 또한 불필요한 절차를 피하기 위해 feature branch를 사용할 때와 메인라인에 직접 커밋할 때에 대한 가이드를 제공합니다.
agent가 수행할 수 있는 작업
- 1원자적 커밋 규율 유지에이전트가 테스트 스위트 통과 직후에 코드를 커밋하여 신뢰할 수 있는 저장 지점을 생성하도록 결정할 수 있습니다.
- 2AI 생성 중 작업 보호개발자가 LLM이 파일을 수정하도록 허용하기 전에 가벼운 저장 지점을 생성하여 손쉬운 복구를 보장할 수 있습니다.
- 3커밋 히스토리 정리fixup 워크플로우를 사용하여 수정 사항을 기록하고, 푸시하기 전에 이를 squash하여 실수된 내용이 공유 저장소에 도달하지 않도록 합니다.
- 4전문적인 커밋 메시지 적용모든 커밋 메시지가 명령형 어조를 사용하고 디버깅 과정보다는 결과에 집중하도록 합니다.
skill의 SKILL.md를 기반으로 작성되었습니다. 모든 사용 사례는 해당 문서의 인용구와 대조 확인되었습니다.
git-version-control skill 설치 방법
각 명령은 skill 폴더를 클라이언트의 skills 디렉터리에 복사합니다. 클라이언트를 재시작하거나 새 세션을 시작하여 로드하세요.플러그인에 git-version-control skill 설치
/plugin marketplace add Pyroxin/opinionated-claude-skills /plugin install opinionated-software-engineering@opinionated-claude-skills
Claude Code에 git-version-control skill 설치
~/.claude/skills/git-version-control/SKILL.md
$ npx degit Pyroxin/opinionated-claude-skills/opinionated-software-engineering/skills/git-version-control ~/.claude/skills/git-version-controlClaude Code (project)에 git-version-control skill 설치
.claude/skills/git-version-control/SKILL.md
$ npx degit Pyroxin/opinionated-claude-skills/opinionated-software-engineering/skills/git-version-control .claude/skills/git-version-controlCodex에 git-version-control skill 설치
~/.agents/skills/git-version-control/SKILL.md
$ npx degit Pyroxin/opinionated-claude-skills/opinionated-software-engineering/skills/git-version-control ~/.agents/skills/git-version-controlGemini CLI에 git-version-control skill 설치
~/.gemini/skills/git-version-control/SKILL.md
$ npx degit Pyroxin/opinionated-claude-skills/opinionated-software-engineering/skills/git-version-control ~/.gemini/skills/git-version-controlClaude.ai에 git-version-control skill 설치
npx degit Pyroxin/opinionated-claude-skills/opinionated-software-engineering/skills/git-version-control git-version-control && zip -r git-version-control.zip git-version-control # claude.ai → Customize → Skills → + → Create skill → Upload a skill → git-version-control.zip
SKILL.md
GitHub에서 보기Git Version Control
<skill_scope skill="git-version-control"> Related skills:
software-engineer— Design principles that inform commit granularitytest-driven-development— Test-commit cycles and when to commit during TDD
This skill covers Git commit standards, branch strategy, and LLM-assisted development workflows. It emphasizes atomic commits, meaningful commit messages, and high-frequency integration. </skill_scope>
Core Philosophy
<core_philosophy> "Commit Often, Perfect Later, Publish Once" — Seth Robertson[^robertson]
Integration frequency is the most powerful determinant of branching success. State of DevOps research found that elite teams integrate notably more often than low performers, and continuous-integration practitioners typically integrate many times a day. "If it hurts, do it more often." — Martin Fowler1
Revertability principle: Commits should represent meaningful units of work that could be reverted independently without breaking the system. </core_philosophy>
Commit Practices
<atomic_commits> Atomic commit decision: If you can describe what you did in a short sentence and it makes sense, commit.
When larger commits are acceptable: Initial prototyping (squash before review), closely coupled changes, when over-granularity loses context.
Time guideline: 30-60 min ideal, max 4 hours. See <commit_triggers> for event-based commit points.
</atomic_commits>
Commit Triggers
<commit_triggers> Commits are responses to completion events, not scheduled activities.
Commit discipline isn't about remembering to commit—it's about recognizing completion signals.
<observable_completion_events>
Observable Completion Events
| Event | Action | Rationale |
|---|---|---|
| Tests pass after a change | Commit | Green is a save point |
| Build succeeds after a change | Commit | Working state confirmed |
| Linter/type checker passes | Commit | Code meets standards |
| Todo item marked complete | Commit | Logical unit finished |
| User confirms functionality | Commit | Acceptance achieved |
| Configuration value tweaked | Commit | Discrete, working change |
Key insight: Passing tests/builds are commit signals, not just validation. Green means save your progress. </observable_completion_events>
<transition_points>
Transition Points
| Transition | Action | Rationale |
|---|---|---|
| Before starting different task | Commit current work | Clean separation |
| Before risky/experimental change | Commit as checkpoint | Safe rollback point |
| After reverting failed approach | Commit clean state | Document decision |
| Before context window compaction | Commit all work | Preserve across sessions |
| </transition_points> |
<conversational_cues>
LLM-Assisted Conversational Cues
In LLM-assisted development, user messages signal completion:
| User Says | Likely Meaning | Action |
|---|---|---|
| "That works", "looks good", "perfect" | Acceptance | Commit |
| "Done", "ship it", "let's move on" | Task complete | Commit |
| "Now let's work on..." | Topic change | Commit previous work first |
| "Can you also..." | Scope expansion | Consider committing current state |
Anti-pattern: Batching multiple unrelated changes because "I'll commit later." Each completion event deserves its own commit. </conversational_cues> </commit_triggers>
Branch Discipline
<branch_discipline> Before committing, verify you're on the appropriate branch. Default to committing a finished, self-contained change directly to mainline; reach for a feature branch only when the work will span more than one commit, or when it would overlap other in-progress work.
| Situation | Action |
|---|---|
| Single self-contained commit, no overlap with other in-progress work | Commit directly to mainline |
| Work expected to span more than one commit | Create a feature branch first |
| Change overlaps other uncommitted or parallel work (e.g., shared files, a concurrent effort) | Isolate on a feature branch or worktree |
| Already on a feature branch | Commit freely |
A feature branch earns its cost for two reasons: it groups a multi-commit unit of work so it can be reviewed and merged as one unit, and it isolates a change that would otherwise mix with other in-progress work. A single finished commit that meets neither condition gains nothing from a branch; mainline is the target, and creating a branch for it only adds ceremony.
LLM-assisted pattern: For one finished, self-contained change, commit it to mainline. Create a branch when you expect follow-up commits on the same unit of work, or when the change would entangle with other uncommitted work in the same files. When you genuinely can't tell whether follow-up commits are coming, ask rather than defaulting to a branch.
<merge_strategy> Merge strategy for completed branches: Squash-merge a feature branch to mainline when it's ready for release. A branch is created only for multi-commit or overlapping work (see the table above), so its intermediate commits are implementation exploration, not history worth carrying onto mainline. Squashing lands the whole unit of work as a single mainline commit, so mainline tells the story of what changed, not how you figured it out.
A branch is a single unit of work, and its contents define that unit: subunits inside a feature (e.g., a refactor the feature needed) become part of the one commit the squash creates. Concern separation happens when deciding what belongs on the branch (see the table above), so the squash takes the branch whole.
Give the squashed commit a message that summarizes the unit of work as a whole, rather than inheriting the last branch commit's message. Because the squash puts the change on mainline as one finished commit, merge only once the branch is release-ready. </merge_strategy> </branch_discipline>
<conventional_commits>
Style preference: Use full keywords (feature: not feat:). Imperative mood. Subject ≤50 chars, body wraps at 72, explain WHY.
Imperative mood test: Subject line should complete the sentence "If applied, this commit will _____."2 Examples: "Add caching for API responses" ✓, "Added caching" ✗, "Adds caching" ✗.
Content principles:
- Delta, not journey — Describe what changed, not how you discovered what to change. The debugging process doesn't belong in the permanent record.
- Neutral framing — Avoid judgmental language about prior state ("fix broken", "remove wrong", "correct mistake"). Prefer neutral verbs: "update", "change", "revise".
- Outcome, not process — Don't document how you verified, tested, or arrived at the change. The commit message records what, not how you figured it out.
- Let the diff speak — Implementation details belong in the diff. The message explains intent and scope; the diff shows specifics.
Anti-pattern: "Fix incorrect attribution that cited Apple docs when the quote was actually from a community blog post" — this documents the debugging journey, uses judgmental framing, and includes detail the diff already shows.
Better: "Update source attributions" — neutral, outcome-focused, appropriate abstraction level. </conventional_commits>
<fixup_workflow>
Record a correction as a fixup and squash it before pushing, so that no pushed commit carries the mistake. A pushed commit stays retrievable by its own identifier whatever later commits do, so a follow-up fix publishes a corrected version beside the original rather than replacing it. That is also why a short series costs less to qualify than a long one: each commit is independently fetchable and so needs checking on its own. For the publication consequences, see <per_commit_publication_gate> in opinionated-skill-creation:expert-skill-creator.
git commit --fixup=<sha> # Creates "fixup! Original message"
git rebase --autosquash origin/main # Squashes fixups automatically
git config --global rebase.autosquash true
</fixup_workflow>
Branching Strategies
<branching_decision>
| Context | Strategy | Integration |
|---|---|---|
| Single production version, strong CI/CD | Trunk-Based | Multiple times daily |
| Continuous deployment, web apps | GitHub Flow | Daily+ |
| Multiple production versions | Git Flow | Per release |
Trunk-based: Short-lived branches (<24h), feature flags for incomplete work.
Branch naming: {category}/{ticket-id}-{description} (e.g., feature/PROJ-4521-add-oauth)
</branching_decision>
<merge_vs_rebase> Rebase: Private branches, linear history, working alone. Merge: Public/shared branches, preserve collaboration history, audit trails.
GOLDEN RULE: Never rebase commits others may have based work on.
Force push safety: After rebasing a personal branch, use --force-with-lease instead of --force. It fails if someone else pushed, preventing you from overwriting their work.
git push --force-with-lease # Safe
git push --force # Dangerous
CRITICAL: NEVER force push to main/master branches. Even with --force-with-lease, force pushing to primary branches can destroy team history, break CI/CD pipelines, and cause widespread disruption. If this is ever requested, warn about the consequences first.
</merge_vs_rebase>
<interactive_limitations>
LLM-assisted context limitation: Interactive git commands (git rebase -i, git add -i, git add -p) require terminal interaction and are unavailable in LLM-assisted contexts. Use alternatives:
- Instead of
git rebase -i: Use--autosquashwith fixup commits - Instead of
git add -i: Use explicitgit add <file>commands - Instead of
git add -p: Stage specific files, or use GUI tools </interactive_limitations>
LLM-Assisted Development Patterns
Checkpoint Commits
<llm_checkpoints> Lightweight savepoints before LLM modifications without commit overhead.
Git aliases (adapted from Nathan Orick's checkpoint pattern3):
[alias]
checkpoint = "!f() { git add -A && git commit --no-verify -m \"SAVEPOINT\"; git tag \"checkpoint/$(date +%Y_%m_%d_%H_%M_%S)\"; git reset HEAD~1 --mixed; }; f"
listCheckpoints = tag -l "checkpoint/*"
loadCheckpoint = "!f() { git reset --hard checkpoint/$1 && git reset HEAD~1 --mixed; }; f"
deleteCheckpoint = "!f() { git tag -d checkpoint/$1; }; f"
Workflow:
git checkpoint # Before LLM changes
git listCheckpoints # View savepoints
git loadCheckpoint 2024_11_15_13_25_55 # Restore if bad
</llm_checkpoints>
Commit Frequency by Context
<commit_frequency>
| Context | Frequency | Granularity |
|---|---|---|
| Solo prototyping | Very high | Very fine |
| Team feature dev | Hourly | Atomic units |
| Pre-review cleanup | Once | Squashed |
| LLM-generated code | High → Low | Fine → Squashed |
| </commit_frequency> |
Generate-Test-Commit-or-Revert
<generate_test_commit>
- CHECKPOINT before LLM generates code
- TEST — run tests, build, verify
- DECIDE — pass → commit immediately; fail → restore checkpoint
- REVIEW — PR before merge
Key insight: AI excels at generating plausible-looking but subtly incorrect code. Time saved by being careless will dwarf the mess you'll face later.
If LLM fails 3+ times, break it down further — abstraction level too high. </generate_test_commit>
Context Management
<context_management>
git diff --no-pager --no-color HEAD^ # Full diff for review
git diff -U0 # No context (fewer tokens)
git diff --cached # Staged changes only
</context_management>
Recovery Patterns
<recovery_triggers> Reflog — Recover from rebases, resets, amends. Local only, 90 days default.
git reflog
git reset --hard HEAD@{5}
git reset --hard main@{2.hours.ago}
Rerere — Auto-resolve repeated conflicts. Enable: git config --global rerere.enabled true
Bisect — O(log n) regression hunting.
git bisect start && git bisect bad HEAD && git bisect good v1.0
git bisect run make test # Automated
</recovery_triggers>
Tool Selection
<stash_branch_worktree>
| Tool | Use When |
|---|---|
| Stash | Very temporary, same day |
| Branch | >few hours, need sharing |
| Worktree | Parallel work, multi-agent |
Multi-agent worktrees:
git worktree add ../agent-1-workspace feature-auth
git worktree add ../agent-2-workspace feature-payment
</stash_branch_worktree>
Anti-Patterns
<anti_patterns> Commit Anti-Patterns:
- Broken code on main: Every commit on main should pass tests and build. Use feature branches or feature flags.
- Giant mixed-concern commits: Mixing refactoring with features makes review and revert impossible. Separate concerns.
- Meaningless messages: "fix", "update", "WIP" provide no context. Explain WHY, not just WHAT.
- Committing secrets: API keys, credentials, private keys. Use
.gitignore, git-secrets, or pre-commit hooks.
Branch Anti-Patterns:
- Long-lived branches (>1 week): Merge conflicts compound exponentially. Integrate frequently.
- Rebasing public branches: Rewrites shared history. Use merge for shared branches.
- No feature flags on trunk: Incomplete features on main without flags block releases.
- Force pushing to main/master: Destroys team history. Never do this.
LLM-Assisted Anti-Patterns:
- "Vibe coding" without review: LLM output requires human verification before commit.
- No checkpoints before LLM changes: Always checkpoint before LLM modifications for easy rollback.
- Context drift from large windows: Long conversations lose context. Break into smaller tasks. </anti_patterns>
Common Mistakes by Background
<common_mistakes>
From SVN/Perforce Users
- Treating branches as expensive (they're cheap in Git—use them freely)
- Expecting central locking (Git is distributed—conflicts resolve at merge)
- Not pulling before push (always
git pull --rebasebefore pushing) - Expecting linear history without effort (requires disciplined rebasing)
From Solo Developers
- Not considering rebase vs merge implications (matters when collaborating)
- Treating main as scratch space (use feature branches even when solo)
- Giant commits because "only I use this" (future you will regret it)
- No commit message discipline (you'll forget why in 6 months)
From GUI-Only Users
- Not understanding what commands the GUI executes (learn the underlying operations)
- Panic when something goes wrong (reflog saves almost everything)
- Not leveraging command-line power for scripting and automation </common_mistakes>
Resources
Patterns:
Sources
Footnotes
-
Martin Fowler. 2020. Patterns for Managing Source Code Branches. Retrieved September 6, 2026 from https://martinfowler.com/articles/branching-patterns.html ↩
-
Chris Beams. 2014. How to Write a Git Commit Message. https://cbea.ms/git-commit/ ↩
-
Nathan Orick. Git Checkpoints. https://nathanorick.com/git-checkpoints/ ↩
이 스킬의 파일
1git-version-control skill 질문
Claude Code에 git-version-control skill을 어떻게 설치하나요?
npx degit Pyroxin/opinionated-claude-skills/opinionated-software-engineering/skills/git-version-control ~/.claude/skills/git-version-control를 실행합니다. Claude Code는 ~/.claude/skills(모든 프로젝트) 또는 .claude/skills(한 프로젝트)에서 skills를 로드하며, 설명이 작업과 일치할 때 skill을 사용합니다.
git-version-control skill을 사용할 수 있는 클라이언트는 무엇인가요?
Agent Skills 형식을 읽는 모든 클라이언트(Claude Code, Codex, Gemini CLI, claude.ai(ZIP으로 업로드))가 사용할 수 있습니다. skill 내 스크립트는 클라이언트가 코드 실행을 허용하는 경우에만 실행됩니다.
커밋 메시지는 어떻게 작성해야 하나요?
명령형 어조와 전체 키워드(예: 'feature:')를 사용하십시오. 제목은 50자 이내로 작성하며 'If applied, this commit will _____.'라는 문장을 완성할 수 있어야 합니다.
merge와 rebase 중 무엇을 사용해야 하나요?
혼자 작업하는 개인 브랜치에서는 선형 히스토리를 유지하기 위해 rebase를 사용하고, 공개 또는 공유 브랜치에서는 협업 기록을 보존하기 위해 merge를 사용하십시오.
rebase 후 가장 안전하게 force push를 하는 방법은 무엇인가요?
다른 사람이 푸시한 작업을 덮어쓰는 것을 방지하려면 --force 대신 --force-with-lease를 사용하십시오.