diff --git a/.claude/commands/commit.md b/.claude/commands/commit.md index c6aa22c8..d6411c49 100644 --- a/.claude/commands/commit.md +++ b/.claude/commands/commit.md @@ -39,17 +39,7 @@ refactor: DB schema squash 와 테이블명 복수형 통일 ## 허용 타입 -commit-msg 훅이 강제하는 목록과 1:1 이다. 훅의 **소스는 리포에 체크인된 `.claude/hooks/commit-msg`** 이고, SessionStart 훅(`.claude/settings.json`)이 세션 시작마다 이를 `.git/hooks/commit-msg` 로 복사한다. 바꿀 땐 `.git/hooks/` 사본이 아니라 소스를 고치고 이 목록도 함께 갱신한다 — 사본을 직접 수정하면 다음 세션 시작에 조용히 되돌려지고 다른 clone 에 전파되지도 않는다. - -- `feat:` — 새 기능 -- `fix:` — 버그 수정 -- `refactor:` — 동작 변경 없는 리팩토링 -- `perf:` — 성능 개선 -- `chore:` — 빌드, 설정 등 기타 -- `docs:` — 문서 변경 -- `test:` — 테스트 추가/수정 -- `infra:` — 인프라 (Terraform·AWS·배포 워크플로우·서버 설정) -- `style:` — 코드 포맷, 세미콜론 등 로직 변경 없는 스타일 +commit-msg 훅이 기계 강제한다. 훅의 **정본(SSOT)은 PIKI-Infra repo 의 `hooks/commit-msg`** 이고, SessionStart 훅(`.claude/settings.json`)이 세션 시작마다 원격 정본을 받아 `.git/hooks/commit-msg` 로 설치한다. 이 문서는 타입 목록을 열거하지 않는다 — 열거하면 정본과 두 곳이 되어 어긋난다. **현재 허용 타입은 설치된 훅(`.git/hooks/commit-msg`)을 읽어 확인**하고, 바꿀 땐 PIKI-Infra 정본을 고친다 (설치본·이 문서가 아니라). ## 커밋 분리 원칙 diff --git a/.claude/hooks/commit-msg b/.claude/hooks/commit-msg deleted file mode 100755 index 047ca644..00000000 --- a/.claude/hooks/commit-msg +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -msg=$(head -1 "$1") -echo "$msg" | grep -qE '^(feat|fix|refactor|perf|chore|docs|test|infra|style): .+' && exit 0 -echo "커밋 형식 오류: {feat|fix|refactor|perf|chore|docs|test|infra|style}: <제목>" >&2 -exit 1 diff --git a/.claude/settings.json b/.claude/settings.json index e2f35660..ca96cc7f 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -9,7 +9,7 @@ "hooks": [ { "type": "command", - "command": "[ -f .claude/hooks/commit-msg ] && cp .claude/hooks/commit-msg .git/hooks/commit-msg && chmod +x .git/hooks/commit-msg || true" + "command": "bash -c 'tmp=$(mktemp); if gh api -H \"Accept: application/vnd.github.raw\" repos/TeamPiKi/PIKI-Infra/contents/install.sh >\"$tmp\" 2>/dev/null && [ -s \"$tmp\" ] && bash -n \"$tmp\" 2>/dev/null; then bash \"$tmp\"; fi; rm -f \"$tmp\"; exit 0'" } ] }