Community코딩 & 개발github.com

alfathafp/portofolio-web-design

Git 워크플로우와 버전 관리 모범 사례를 제공합니다. 코드 변경 시, 커밋, 브랜칭, 충돌 해결, 작업 정리, PR 검토, 푸시, 또는 여러 병렬 작업 스트림을 구성할 때 사용합니다. 릴리스 절단, 시맨틱 버전 범프, 태깅, 체인지로그 작성 시에도 사용하세요.

portofolio-web-design란 무엇인가요?

이 스킬은 AI 에이전트가 Git을 효과적으로 사용하여 코드 변경 사항을 관리하고, 검토 가능하며, 되돌릴 수 있도록 하는 포괄적인 워크플로우 가이드입니다. 트렁크 기반 개발(Trunk-Based Development)을 권장하며, 메인 브랜치를 항상 배포 가능한 상태로 유지하고 1-3일 이내에 병합되는 단기 피처 브랜치를 사용하는 방법을 설명합니다. 또한, 조기 커밋과 빈번한 커밋, 원자적 커밋(Atomic Commits), 설명적인 커밋 메시지, 변경 사항 분리, 변경 크기 조정(약 100줄 목표) 등 핵심 원칙을 다룹니다. 이 스킬은 브랜치 전략, Git 워크트리(worktree)를 통한 병렬 작업, 저장 지점 패턴, 커밋 전 점검 목록, 생성된 파일 처리, Git을 이용한 디버깅, 시맨틱 버전 관리, 사람이 읽을 수 있는 체인지로그 작성에 대한 구체적인 지침을 제공합니다. Claude Code, Cursor, Codex 등 모든 AI 에이전트 플랫폼에서 사용할 수 있습니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/alfathafp/portofolio-web-design/tree/HEAD/.agents/skills/git-workflow-and-versioning

Installed? Explore more 코딩 & 개발 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

Git 워크플로우 및 버전 관리

개요

Git은 여러분의 안전망입니다. 커밋을 저장 지점으로, 브랜치를 샌드박스로, 히스토리를 문서로 취급하세요. AI 에이전트가 고속으로 코드를 생성하는 시대에, 규율 있는 버전 관리는 변경 사항을 관리 가능하고, 검토 가능하며, 되돌릴 수 있게 만드는 메커니즘입니다.

사용 시기

항상 그렇습니다. 모든 코드 변경은 Git을 통해 이루어집니다.

핵심 원칙

트렁크 기반 개발 (권장)

main 브랜치를 항상 배포 가능한 상태로 유지하세요. 1-3일 이내에 병합되는 단기 피처 브랜치에서 작업하세요. 장기 개발 브랜치는 숨은 비용입니다. 분기되고, 병합 충돌을 만들며, 통합을 지연시킵니다. DORA 연구는 트렁크 기반 개발이 고성능 엔지니어링 팀과 일관되게 상관관계가 있음을 보여줍니다.

main ──●──●──●──●──●──●──●──●──●──  (항상 배포 가능)
        ╲      ╱  ╲    ╱
         ●──●─╱    ●──╱    ← 단기 피처 브랜치 (1-3일)

이것이 권장되는 기본값입니다. Gitflow나 장기 브랜치를 사용하는 팀은 원칙(원자적 커밋, 작은 변경, 설명적인 메시지)을 자신들의 브랜칭 모델에 적용할 수 있습니다. 특정 브랜칭 전략보다는 커밋 규율이 더 중요합니다.

  • 개발 브랜치는 비용입니다. 브랜치가 존재하는 날마다 병합 위험이 누적됩니다.
  • 릴리스 브랜치는 허용됩니다. main이 계속 진행되는 동안 릴리스를 안정화해야 할 때 사용하세요.
  • 피처 플래그 > 장기 브랜치. 완료되지 않은 작업을 브랜치에 오래 보관하는 대신 플래그 뒤에 배포하는 것을 선호하세요.

1. 일찍 커밋하고, 자주 커밋하세요

각 성공적인 증분은 고유한 커밋을 받습니다. 커밋되지 않은 큰 변경 사항을 축적하지 마세요.

작업 패턴:
  구현 → 테스트 → 검증 → 커밋 → 다음 부분

이렇게 하지 마세요:
  모든 것 구현 → 작동하기를 기대 → 거대 커밋

커밋은 저장 지점입니다. 다음 변경이 무언가를 망가뜨리면, 마지막으로 알려진 정상 상태로 즉시 되돌릴 수 있습니다.

2. 원자적 커밋

각 커밋은 하나의 논리적 작업을 수행합니다:

# 좋음: 각 커밋이 독립적임
git log --oneline
a1b2c3d Add task creation endpoint with validation
d4e5f6g Add task creation form component
h7i8j9k Connect form to API and add loading state
m1n2o3p Add task creation tests (unit + integration)

# 나쁨: 모든 것이 뒤섞임
git log --oneline
x1y2z3a Add task feature, fix sidebar, update deps, refactor utils

3. 설명적인 메시지

커밋 메시지는 무엇뿐만 아니라 왜를 설명해야 합니다:

# 좋음: 의도를 설명함
feat: add email validation to registration endpoint

잘못된 이메일 형식이 데이터베이스에 도달하는 것을 방지합니다.
라우트 핸들러 수준에서 Zod 스키마 검증을 사용하며,
auth.ts의 기존 검증 패턴과 일관됩니다.

# 나쁨: diff에서 명백한 것을 설명함
update auth.ts

형식:

<유형>: <짧은 설명>

<선택 사항: 무엇이 아닌 왜를 설명하는 본문>

유형:

  • feat — 새 기능
  • fix — 버그 수정
  • refactor — 버그를 수정하거나 기능을 추가하지 않는 코드 변경
  • test — 테스트 추가 또는 업데이트
  • docs — 문서만 변경
  • chore — 도구, 종속성, 구성

4. 관심사를 분리하세요

서식 변경과 동작 변경을 결합하지 마세요. 리팩터링과 기능을 결합하지 마세요. 각 변경 유형은 별도의 커밋이어야 하며, 이상적으로는 별도의 PR이어야 합니다:

# 좋음: 관심사 분리
git commit -m "refactor: extract validation logic to shared utility"
git commit -m "feat: add phone number validation to registration"

# 나쁨: 관심사 혼합
git commit -m "refactor validation and add phone number field"

리팩터링과 기능 작업을 분리하세요. 리팩터링 변경과 기능 변경은 서로 다른 변경 사항입니다. 별도로 제출하세요. 이렇게 하면 각 변경 사항을 더 쉽게 검토하고, 되돌리고, 히스토리에서 이해할 수 있습니다. 변수 이름 바꾸기와 같은 사소한 정리는 검토자 재량에 따라 기능 커밋에 포함될 수 있습니다.

5. 변경 크기 조정

커밋/PR 당 약 100줄을 목표로 하세요. 약 1000줄이 넘는 변경은 분할해야 합니다. 큰 변경을 분해하는 방법은 code-review-and-quality에서 분할 전략을 참조하세요.

~100줄  → 검토하기 쉽고, 되돌리기 쉬움
~300줄  → 단일 논리적 변경에 허용됨
~1000줄 → 더 작은 변경으로 분할

브랜칭 전략

피처 브랜치

main (항상 배포 가능)
  │
  ├── feature/task-creation    ← 브랜치당 하나의 기능
  ├── feature/user-settings    ← 병렬 작업
  └── fix/duplicate-tasks      ← 버그 수정
  • main(또는 팀의 기본 브랜치)에서 브랜치를 만드세요.
  • 브랜치를 단기로 유지하세요(1-3일 내 병합). 장기 브랜치는 숨은 비용입니다.
  • 병합 후 브랜치를 삭제하세요.
  • 미완료 기능에는 장기 브랜치보다 피처 플래그를 선호하세요.

브랜치 이름 지정

feature/<짧은-설명>   → feature/task-creation
fix/<짧은-설명>       → fix/duplicate-tasks
chore/<짧은-설명>     → chore/update-deps
refactor/<짧은-설명>  → refactor/auth-module

워크트리 사용하기

병렬 AI 에이전트 작업의 경우, git 워크트리를 사용하여 여러 브랜치를 동시에 실행하세요:

# 피처 브랜치를 위한 워크트리 생성
git worktree add ../project-feature-a feature/task-creation
git worktree add ../project-feature-b feature/user-settings

# 각 워크트리는 고유한 브랜치를 가진 별도의 디렉토리입니다.
# 에이전트는 서로 간섭하지 않고 병렬로 작업할 수 있습니다.
ls ../
  project/              ← main 브랜치
  project-feature-a/    ← task-creation 브랜치
  project-feature-b/    ← user-settings 브랜치

# 완료되면 병합하고 정리
git worktree remove ../project-feature-a

이점:

  • 여러 에이전트가 동시에 다른 기능을 작업할 수 있습니다.
  • 브랜치 전환이 필요 없습니다(각 디렉토리에 고유한 브랜치가 있습니다).
  • 하나의 실험이 실패하면 워크트리를 삭제하세요. 아무것도 손실되지 않습니다.
  • 명시적으로 병합될 때까지 변경 사항이 격리됩니다.

저장 지점 패턴

에이전트가 작업 시작
    │
    ├── 변경 수행
    │   ├── 테스트 통과? → 커밋 → 계속
    │   └── 테스트 실패? → 마지막 커밋으로 되돌리기 → 조사
    │
    ├── 다른 변경 수행
    │   ├── 테스트 통과? → 커밋 → 계속
    │   └── 테스트 실패? → 마지막 커밋으로 되돌리기 → 조사
    │
    └── 기능 완료 → 모든 커밋이 깔끔한 히스토리를 형성

이 패턴은 한 번의 작업 증분 이상을 잃지 않음을 의미합니다. 에이전트가 잘못된 방향으로 가면 git reset --hard HEAD를 사용하여 마지막 성공 상태로 돌아갈 수 있습니다.

변경 요약

수정 후에는 구조화된 요약을 제공하세요. 이렇게 하면 검토가 쉬워지고, 범위 규율을 문서화하며, 의도하지 않은 변경을 표면화합니다:

변경 사항:
- src/routes/tasks.ts: POST 엔드포인트에 검증 미들웨어 추가
- src/lib/validation.ts: Zod를 사용하여 TaskCreateSchema 추가

건드리지 않은 항목 (의도적으로):
- src/routes/auth.ts: 유사한 검증 격차가 있지만 범위 밖
- src/middleware/error.ts: 오류 형식이 개선될 수 있음 (별도 작업)

잠재적 우려 사항:
- Zod 스키마가 엄격함 — 추가 필드를 거부함. 이것이 의도된 것인지 확인.
- zod를 종속성으로 추가함(72KB gzipped) — 이미 package.json에 있음

이 패턴은 잘못된 가정을 조기에 잡아내고 검토자에게 변경 사항에 대한 명확한 지도를 제공합니다. "건드리지 않은 항목" 섹션은 특히 중요합니다. 범위 규율을 적용했으며 요청되지 않은 수정을 하지 않았음을 보여줍니다.

커밋 전 점검

모든 커밋 전에:

# 1. 커밋할 내용 확인
git diff --staged

# 2. 비밀 정보가 없는지 확인
git diff --staged | grep -i "password\|secret\|api_key\|token"

# 3. 테스트 실행
npm test

# 4. 린트 실행
npm run lint

# 5. 타입 검사 실행
npx tsc --noEmit

Git 훅으로 자동화:

// package.json (lint-staged + husky 사용)
{
  "lint-staged": {
    "*.{ts,tsx}": ["eslint --fix", "prettier --write"],
    "*.{json,md}": ["prettier --write"]
  }
}

생성된 파일 처리

  • 생성된 파일 커밋하기 — 프로젝트가 예상하는 경우에만 (예: package-lock.json, Prisma 마이그레이션)
  • 커밋하지 마세요 — 빌드 출력물(dist/, .next/), 환경 파일(.env), IDE 설정(.vscode/settings.json — 공유되지 않는 한)
  • .gitignore 파일이 있는지 확인하여 다음을 포함: node_modules/, dist/, .env, .env.local, *.pem

디버깅을 위한 Git 사용

# 버그를 도입한 커밋 찾기
git bisect start
git bisect bad HEAD
git bisect good <알려진-양호-커밋>
# Git이 중간 지점을 체크아웃하고, 각 지점에서 테스트를 실행하여 범위를 좁힙니다.

# 최근 변경 사항 보기
git log --oneline -20
git diff HEAD~5..HEAD -- src/

# 특정 줄을 마지막으로 변경한 사람 찾기
git blame src/services/task.ts

# 키워드로 커밋 메시지 검색
git log --grep="validation" --oneline

릴리스 및 버전 관리

커밋은 여러분이 변경 사항을 추적하는 방법입니다. 버전은 소비자가 변경 사항을 추적하는 방법입니다. 다른 팀, 배포된 패키지, 배포된 클라이언트 등 다른 것이 여러분의 코드에 의존하게 되는 순간, "main의 최신"은 "내가 무엇을 실행 중이며, 업그레이드해도 안전한가?"라는 질문에 대한 충분한 답변이 될 수 없습니다. 버전 번호와 체인지로그는 이 질문에 답하는 계약입니다.

시맨틱 버전 관리

소비자가 있는 모든 것에 대해, MAJOR.MINOR.PATCH로 버전을 매기고 숫자가 의미를 전달하도록 하세요:

  MAJOR  호환되지 않는 변경 — 소비자가 업그레이드하려면 코드를 변경해야 함
  MINOR  새로운 기능, 하위 호환 — 업그레이드해도 안전함
  PATCH  버그 수정, 하위 호환 — 업그레이드해도 안전함

숫자는 약속이므로 코드가 일치해야 합니다. 소비자가 의존하는 동작을 변경하는 "패치"는 변장한 주요 변경입니다(Hyrum의 법칙 — api-and-interface-design 스킬 참조). 변경 사항이 호환되지 않는지 확실하지 않은 경우, 그렇다고 가정하세요. 예상치 못한 주요 변경은 소비자에게 손상을 주는 것보다 훨씬 저렴합니다.

태그를 릴리스하고, 태그를 진실의 원천으로 삼으세요.

릴리스는 움직이는 브랜치가 아닌, 히스토리의 불변 지점입니다. 항상 재현할 수 있도록 태그를 추가하세요:

git tag -a v1.4.0 -m "Release 1.4.0"
git push origin v1.4.0

버전을 여러 파일에 수동으로 편집하는 대신 태그에서 파생시키세요. 그러면 아티팩트, 태그, 체인지로그가 절대 불일치하지 않습니다.

사람을 위해 작성된 체인지로그 유지

체인지로그는 git log가 아닙니다. "무엇이 변경되었고 내가 신경 써야 합니까?"라는 질문에 대한 소비자 대면 답변을 큐레이션한 것입니다. Added / Changed / Fixed / Deprecated / Removed / Security로 그룹화하고, 최신 항목이 위에 오며, 각 항목은 내부 메커니즘이 아닌 사용자 영향을 중심으로 작성됩니다.

## [1.4.0] - 2025-06-12
### Added
- CSV를 통한 대량 작업 가져오기
### Fixed
- 반복 작업 마감일의 시간대 드리프트
### Deprecated
- `GET /v1/tasks/all` — 페이지네이션된 `GET /v1/tasks`를 사용하세요 (2.0에서 제거)

변경 사항을 적용하는 동시에 항목을 작성하세요. 영향이 생생할 때 작성하고, 릴리스 시점에 커밋 고고학에서 재구성하지 마세요. 호환되지 않는 변경 사항은 마이그레이션 노트와 지원 중단 기간을 포함하세요(deprecation-and-migration 스킬 참조). 실제 릴리스를 제공하는 것은 shipping-and-launch 스킬의 작업입니다. 이 섹션은 이를 공급하는 버전 관리 계약입니다.

일반적인 합리화

합리화현실
"기능이 완료되면 커밋하겠습니다"하나의 거대한 커밋은 검토, 디버그, 또는 되돌리기가 불가능합니다. 각 부분을 커밋하세요.
"메시지는 중요하지 않습니다"메시지는 문서입니다. 미래의 여러분(그리고 미래의 에이전트)은 무엇이 변경되었고 왜 변경되었는지 이해해야 합니다.
"나중에 모두 스쿼시하겠습니다"스쿼시는 개발 내러티브를 파괴합니다. 처음부터 깔끔한 점진적 커밋을 선호하세요.
"브랜치는 오버헤드를 추가합니다"단기 브랜치는 무료이며 충돌하는 작업이 충돌하는 것을 방지합니다. 장기 브랜치가 문제입니다. 1-3일 내에 병합하세요.
"나중에 이 변경을 분할하겠습니다"큰 변경은 검토하기 어렵고, 배포하기 위험하며, 되돌리기 어렵습니다. 제출하기 전에 분할하세요.
".gitignore가 필요 없습니다".env에 프로덕션 비밀이 커밋될 때까지입니다. 즉시 설정하세요.
"그냥 작은 수정이니까 패치를 올리세요"소비자가 관찰할 수 있는 것을 확인하세요. 그들이 의존하는 동작 변경은 diff 크기와 상관없이 주요 변경입니다.
"체인지로그는 그냥 커밋 로그입니다"커밋은 여러분을 위한 것입니다. 체인지로그는 소비자를 위한 것이며, 영향을 기준으로 큐레이션됩니다. 원시 커밋에서 생성하는 것은 중요한 것을 묻어버립니다.
"릴리스 시점에 체인지로그를 작성하겠습니다"그때쯤이면 영향은 기억에서 재구성되며 절반은 누락됩니다. 변경 사항과 함께 항목을 작성하세요.

위험 신호

  • 커밋되지 않은 큰 변경 사항이 축적됨
  • "fix", "update", "misc"와 같은 커밋 메시지
  • 서식 변경과 동작 변경이 혼합됨
  • 프로젝트에 .gitignore 없음
  • node_modules/, .env, 빌드 아티팩트 커밋
  • main에서 크게 분기된 장기 브랜치
  • 공유 브랜치에 강제 푸시
  • 마이너 또는 패치 버전 범프로 제공된 호환되지 않는 변경
  • 태그가 없거나, 태그와 동기화되지 않은 수동 편집 버전 번호
  • 체인지로그 항목이 없거나, 커밋 메시지를 덤프한 체인지로그

확인

모든 커밋에 대해:

  • 커밋이 하나의 논리적 작업을 수행함
  • 메시지가 왜를 설명하고, 유형 규칙을 따름
  • 커밋 전에 테스트 통과
  • diff에 비밀 정보 없음
  • 서식만 변경된 항목이 동작 변경과 혼합되지 않음
  • .gitignore가 표준 제외 항목을 포함

모든 릴리스(소비자가 있는 모든 것)에 대해:

  • 버전 범프가 변경 사항과 일치: 호환되지 않음 → major, 추가 → minor, 수정 → patch
  • 릴리스에 태그가 지정되었으며, 버전이 태그에서 파생되고 수동 편집과 동기화되지 않음
  • 체인지로그에 이 버전에 대한 영향을 기준으로 그룹화된 큐레이션되고 사람이 읽을 수 있는 항목이 있음

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

alfathafp/portofolio-web-design

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).

alfathafp/portofolio-web-design

Tests in real browsers via Chrome DevTools MCP. Use when building or debugging anything that runs in a browser. Use when you need to inspect the DOM, capture console errors, analyze network requests, profile performance, or verify visual output with real runtime data. Requires the chrome-devtools MCP server to be configured.

alfathafp/portofolio-web-design

Automates CI/CD pipeline setup. Use when setting up or modifying build and deployment pipelines. Use when you need to automate quality gates, configure test runners in CI, or establish deployment strategies.

alfathafp/portofolio-web-design

Conducts multi-axis code review. Use before merging any change. Use when reviewing code written by yourself, another agent, or a human. Use when you need to assess code quality across multiple dimensions before it enters the main branch. Use when asked to review a diff or a pull request, even when the diff is pasted inline.

alfathafp/portofolio-web-design

Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder to read, maintain, or extend than it should be. Use when reviewing code that has accumulated unnecessary complexity.

alfathafp/portofolio-web-design

Establishes a project's quality bar as a written contract and stops agents quietly lowering it. Interviews the user on which dimensions matter, supplies sane default thresholds when they have no number in mind, records everything in CONSTRAINTS.md, and watches the diff for a weakened bar — new @ts-ignore or eslint-disable suppressions, skipped or deleted tests, assertions stripped out, unimplemented stubs, thresholds edited down. Use when no quality bar is written down, when the user says "set up constraints" or "define our standards", when the user wants dimensions they care about — accessibility, web performance, coverage — set up as enforced constraints, when an agent keeps silencing checks or skipping tests to get to green, when you need a coverage or performance threshold and don't know what number to pick, or when an agent writes more code than anyone will read.

alfathafp/portofolio-web-design

Optimizes agent context setup. Use when starting a new session, when agent output quality degrades, when switching between tasks, or when you need to configure rules files and context for a project.

alfathafp/portofolio-web-design

Guides systematic root-cause debugging. Use when tests fail, builds break, something that worked yesterday broke, behavior doesn't match expectations, or you encounter any unexpected error. Use when you need to figure out what broke and why — a systematic approach to finding and fixing the root cause rather than guessing.

alfathafp/portofolio-web-design

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

alfathafp/portofolio-web-design

Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code.

alfathafp/portofolio-web-design

Use when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.

alfathafp/portofolio-web-design

Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies

alfathafp/portofolio-web-design

Records decisions and documentation. Use when you need to document an architecture decision (ADR) or the reasoning behind a design choice, when changing public APIs, shipping features, or when you need to record context that future engineers and agents will need to understand the codebase.

alfathafp/portofolio-web-design

Subjects every non-trivial decision to a fresh-context adversarial review before it stands. Use when you want every assumption cross-examined before proceeding, when stress-testing a plan for hidden failure modes, when correctness matters more than speed, when working in unfamiliar code, when stakes are high (production auth, security-sensitive logic, a high-stakes migration, irreversible operations), or any time a confident output would be cheaper to verify now than to debug later.

alfathafp/portofolio-web-design

Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available

alfathafp/portofolio-web-design

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work

alfathafp/portofolio-web-design

Builds production-quality, accessible, responsive user-facing UIs. Use when building or modifying interfaces and pages, creating components, implementing layouts, meeting WCAG accessibility requirements, managing state, or when the output needs to look and feel production-quality rather than AI-generated.

alfathafp/portofolio-web-design

Refines raw ideas into sharp, actionable concepts through structured divergent and convergent thinking. Use when an idea is still vague, when you need to stress-test assumptions before committing to a plan, or when you want to expand options before converging on one. Triggers on "ideate", "refine this idea", or "stress-test my plan".

alfathafp/portofolio-web-design

Delivers changes incrementally in thin, verifiable slices. Use when implementing any feature or change that touches more than one file, or when picking up the next task from a plan. Use when rolling a change out behind a feature flag, when you're about to write a large amount of code at once, or when a task feels too big to land in one step.

alfathafp/portofolio-web-design

Guides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defining type contracts between modules, or establishing boundaries between frontend and backend.

관련 스킬