From 3af7b0a68ccec033c833ca1d1e672a2274811fd1 Mon Sep 17 00:00:00 2001 From: HYOJIN Date: Tue, 7 Apr 2026 14:26:17 +0900 Subject: [PATCH 1/2] =?UTF-8?q?chore:=20=ED=8C=80=20=EC=9B=8C=ED=81=AC?= =?UTF-8?q?=ED=94=8C=EB=A1=9C=EC=9A=B0=20=EC=B4=88=EA=B8=B0=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - .claude/settings.json: 프로젝트 권한, env, hooks 설정 - .claude/workflow-version.json: 팀 워크플로우 v1.6.1 - .githooks/: pre-commit, commit-msg, post-checkout - .gitignore: 팀 워크플로우 경로 제외 추가 - docs/RELEASE-NOTES.md: 릴리즈 노트 초기화 --- .claude/settings.json | 87 +++++++++++++++++++++++++++++++++++ .claude/workflow-version.json | 6 +++ .githooks/commit-msg | 60 ++++++++++++++++++++++++ .githooks/post-checkout | 25 ++++++++++ .githooks/pre-commit | 33 +++++++++++++ .gitignore | 14 +++++- docs/RELEASE-NOTES.md | 5 ++ 7 files changed, 229 insertions(+), 1 deletion(-) create mode 100644 .claude/settings.json create mode 100644 .claude/workflow-version.json create mode 100755 .githooks/commit-msg create mode 100755 .githooks/post-checkout create mode 100755 .githooks/pre-commit create mode 100644 docs/RELEASE-NOTES.md diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 0000000..ec18b8e --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,87 @@ +{ + "$schema": "https://json.schemastore.org/claude-code-settings.json", + "env": { + "CLAUDE_BOT_TOKEN": "ac15488ad66463bd5c4e3be1fa6dd5b2743813c5" + }, + "permissions": { + "allow": [ + "Bash(./mvnw *)", + "Bash(curl -s *)", + "Bash(git add *)", + "Bash(git branch *)", + "Bash(git checkout *)", + "Bash(git commit *)", + "Bash(git config *)", + "Bash(git diff *)", + "Bash(git fetch *)", + "Bash(git log *)", + "Bash(git merge *)", + "Bash(git pull *)", + "Bash(git remote *)", + "Bash(git rev-parse *)", + "Bash(git show *)", + "Bash(git stash *)", + "Bash(git status)", + "Bash(git tag *)", + "Bash(java -jar *)", + "Bash(java -version)", + "Bash(mvn *)", + "Bash(sdk *)" + ], + "deny": [ + "Bash(git push --force*)", + "Bash(git push -f *)", + "Bash(git push origin --force*)", + "Bash(git reset --hard*)", + "Bash(git clean -fd*)", + "Bash(git checkout -- .)", + "Bash(git restore .)", + "Bash(rm -rf /)", + "Bash(rm -rf ~)", + "Bash(rm -rf .git*)", + "Bash(rm -rf /*)", + "Read(./**/.env)", + "Read(./**/.env.*)", + "Read(./**/secrets/**)", + "Read(./**/application-local.yml)", + "Read(./**/application-local.properties)" + ] + }, + "hooks": { + "SessionStart": [ + { + "matcher": "compact", + "hooks": [ + { + "type": "command", + "command": "bash .claude/scripts/on-post-compact.sh", + "timeout": 10 + } + ] + } + ], + "PreCompact": [ + { + "hooks": [ + { + "type": "command", + "command": "bash .claude/scripts/on-pre-compact.sh", + "timeout": 30 + } + ] + } + ], + "PostToolUse": [ + { + "matcher": "Bash", + "hooks": [ + { + "type": "command", + "command": "bash .claude/scripts/on-commit.sh", + "timeout": 15 + } + ] + } + ] + } +} diff --git a/.claude/workflow-version.json b/.claude/workflow-version.json new file mode 100644 index 0000000..4220a0b --- /dev/null +++ b/.claude/workflow-version.json @@ -0,0 +1,6 @@ +{ + "applied_global_version": "1.6.1", + "applied_date": "2026-04-07", + "project_type": "java-maven", + "gitea_url": "https://gitea.gc-si.dev" +} diff --git a/.githooks/commit-msg b/.githooks/commit-msg new file mode 100755 index 0000000..93bb350 --- /dev/null +++ b/.githooks/commit-msg @@ -0,0 +1,60 @@ +#!/bin/bash +#============================================================================== +# commit-msg hook +# Conventional Commits 형식 검증 (한/영 혼용 지원) +#============================================================================== + +COMMIT_MSG_FILE="$1" +COMMIT_MSG=$(cat "$COMMIT_MSG_FILE") + +# Merge 커밋은 검증 건너뜀 +if echo "$COMMIT_MSG" | head -1 | grep -qE "^Merge "; then + exit 0 +fi + +# Revert 커밋은 검증 건너뜀 +if echo "$COMMIT_MSG" | head -1 | grep -qE "^Revert "; then + exit 0 +fi + +# Conventional Commits 정규식 +# type(scope): subject +# - type: feat|fix|docs|style|refactor|test|chore|ci|perf (필수) +# - scope: 영문, 숫자, 한글, 점, 밑줄, 하이픈 허용 (선택) +# - subject: 1~72자, 한/영 혼용 허용 (필수) +PATTERN='^(feat|fix|docs|style|refactor|test|chore|ci|perf)(\([a-zA-Z0-9가-힣._-]+\))?: .{1,72}$' + +FIRST_LINE=$(head -1 "$COMMIT_MSG_FILE") + +if ! echo "$FIRST_LINE" | grep -qE "$PATTERN"; then + echo "" + echo "╔══════════════════════════════════════════════════════════════╗" + echo "║ 커밋 메시지가 Conventional Commits 형식에 맞지 않습니다 ║" + echo "╚══════════════════════════════════════════════════════════════╝" + echo "" + echo " 올바른 형식: type(scope): subject" + echo "" + echo " type (필수):" + echo " feat — 새로운 기능" + echo " fix — 버그 수정" + echo " docs — 문서 변경" + echo " style — 코드 포맷팅" + echo " refactor — 리팩토링" + echo " test — 테스트" + echo " chore — 빌드/설정 변경" + echo " ci — CI/CD 변경" + echo " perf — 성능 개선" + echo "" + echo " scope (선택): 한/영 모두 가능" + echo " subject (필수): 1~72자, 한/영 모두 가능" + echo "" + echo " 예시:" + echo " feat(auth): JWT 기반 로그인 구현" + echo " fix(배치): 야간 배치 타임아웃 수정" + echo " docs: README 업데이트" + echo " chore: Gradle 의존성 업데이트" + echo "" + echo " 현재 메시지: $FIRST_LINE" + echo "" + exit 1 +fi diff --git a/.githooks/post-checkout b/.githooks/post-checkout new file mode 100755 index 0000000..bae360f --- /dev/null +++ b/.githooks/post-checkout @@ -0,0 +1,25 @@ +#!/bin/bash +#============================================================================== +# post-checkout hook +# 브랜치 체크아웃 시 core.hooksPath 자동 설정 +# clone/checkout 후 .githooks 디렉토리가 있으면 자동으로 hooksPath 설정 +#============================================================================== + +# post-checkout 파라미터: prev_HEAD, new_HEAD, branch_flag +# branch_flag=1: 브랜치 체크아웃, 0: 파일 체크아웃 +BRANCH_FLAG="$3" + +# 파일 체크아웃은 건너뜀 +if [ "$BRANCH_FLAG" = "0" ]; then + exit 0 +fi + +# .githooks 디렉토리 존재 확인 +REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null) +if [ -d "${REPO_ROOT}/.githooks" ]; then + CURRENT_HOOKS_PATH=$(git config core.hooksPath 2>/dev/null || echo "") + if [ "$CURRENT_HOOKS_PATH" != ".githooks" ]; then + git config core.hooksPath .githooks + chmod +x "${REPO_ROOT}/.githooks/"* 2>/dev/null + fi +fi diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100755 index 0000000..7a1a3ec --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,33 @@ +#!/bin/bash +#============================================================================== +# pre-commit hook (Java Maven) +# Maven 컴파일 검증 — 컴파일 실패 시 커밋 차단 +#============================================================================== + +echo "pre-commit: Maven 컴파일 검증 중..." + +# Maven Wrapper 사용 (없으면 mvn 사용) +if [ -f "./mvnw" ]; then + MVN="./mvnw" +elif command -v mvn &>/dev/null; then + MVN="mvn" +else + echo "경고: Maven이 설치되지 않았습니다. 컴파일 검증을 건너뜁니다." + exit 0 +fi + +# 컴파일 검증 (테스트 제외, 오프라인 가능) +$MVN compile -q -DskipTests 2>&1 +RESULT=$? + +if [ $RESULT -ne 0 ]; then + echo "" + echo "╔══════════════════════════════════════════════════════════╗" + echo "║ 컴파일 실패! 커밋이 차단되었습니다. ║" + echo "║ 컴파일 오류를 수정한 후 다시 커밋해주세요. ║" + echo "╚══════════════════════════════════════════════════════════╝" + echo "" + exit 1 +fi + +echo "pre-commit: 컴파일 성공" diff --git a/.gitignore b/.gitignore index feba811..96ea6b0 100644 --- a/.gitignore +++ b/.gitignore @@ -103,6 +103,18 @@ frontend/node_modules/ frontend/node/ src/main/resources/static/ -# Claude Code (개인 파일만 무시, 팀 파일은 추적) +# Claude Code .claude/settings.local.json +.claude/CLAUDE.local.md +*.local + +# Team workflow (managed by /sync-team-workflow) +.claude/rules/ +.claude/agents/ +.claude/skills/push/ +.claude/skills/mr/ +.claude/skills/create-mr/ +.claude/skills/release/ +.claude/skills/version/ +.claude/skills/fix-issue/ .claude/scripts/ diff --git a/docs/RELEASE-NOTES.md b/docs/RELEASE-NOTES.md new file mode 100644 index 0000000..60dd5df --- /dev/null +++ b/docs/RELEASE-NOTES.md @@ -0,0 +1,5 @@ +# Release Notes + +이 문서는 [Keep a Changelog](https://keepachangelog.com/ko/1.0.0/) 형식을 따릅니다. + +## [Unreleased] From e96cef3fcba9d7d0647a844c89e9bcd69b0929d4 Mon Sep 17 00:00:00 2001 From: HYOJIN Date: Tue, 7 Apr 2026 14:26:54 +0900 Subject: [PATCH 2/2] =?UTF-8?q?docs:=20=EB=A6=B4=EB=A6=AC=EC=A6=88=20?= =?UTF-8?q?=EB=85=B8=ED=8A=B8=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/RELEASE-NOTES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/RELEASE-NOTES.md b/docs/RELEASE-NOTES.md index 60dd5df..9bc0f97 100644 --- a/docs/RELEASE-NOTES.md +++ b/docs/RELEASE-NOTES.md @@ -3,3 +3,6 @@ 이 문서는 [Keep a Changelog](https://keepachangelog.com/ko/1.0.0/) 형식을 따릅니다. ## [Unreleased] + +### 기타 +- 팀 워크플로우 초기화 (.claude, .githooks, .gitignore)