[chore] Claude Code 개발 플로우 자동화 설정 추가#160
Conversation
📝 Walkthrough워크스루Claude Code 커맨드 자동화, 기술 규칙 정의, 개발 온보딩 가이드, 사전 푸시 테스트 훅을 추가합니다. 이슈 기반 워크플로우(/issue-create → /start → /pr-create), 기술 표준(Java/Git/API/테스트), 도메인 권한 관리를 통합하며, 민감한 환경설정은 제거합니다. 변경사항Claude Code 워크플로우 자동화
예상 코드 리뷰 시간🎯 3 (보통) | ⏱️ ~25분 제안 라벨
제안 리뷰어
시
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request establishes a comprehensive development workflow and governance framework for the Eatsfine backend by introducing Claude Code configuration files, coding standards, and automation scripts. Key additions include detailed rules for Java development, API design, and testing, alongside custom commands for task initialization and pull request creation. The PR also enhances project security by updating the .gitignore and Claude settings to protect sensitive configuration files. Review feedback focused on improving the robustness of the automation scripts, specifically by suggesting safer branch naming conventions, handling uncommitted changes during branch switching, and refining command detection logic in the pre-push hook.
| 아래 명령어를 순서대로 실행합니다: | ||
|
|
||
| ```bash | ||
| git checkout develop |
|
|
||
| ### Step 2: 작업 브랜치 생성 | ||
|
|
||
| 브랜치명 규칙: `{타입}/#${이슈번호}-{설명}` |
| 수집한 정보로 브랜치를 생성합니다: | ||
|
|
||
| ```bash | ||
| git checkout -b {타입}/#${이슈번호}-{설명} |
| git status --short | ||
| ``` | ||
|
|
||
| 브랜치명 `{타입}/#${이슈번호}-{설명}` 에서 타입과 이슈번호를 추출합니다. |
| " <<< "$INPUT") | ||
|
|
||
| # git push 명령이 아니면 즉시 통과 | ||
| if ! echo "$BASH_CMD" | grep -qE '(^|&&|\|\|)\s*git push'; then |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.claude/rules/testing.md (1)
331-366: 🧹 Nitpick | 🔵 Trivial | 💤 Low value[선택] Markdown 포맷 개선 제안
Static analysis에서 heading 주변 빈 줄 누락을 지적하고 있습니다. 가독성 향상을 위해 다음 heading 앞뒤로 빈 줄을 추가하는 것을 권장합니다:
- Line 331 (### 필수 테스트)
- Line 337 (### 테스트 작성 가이드)
- Line 344 (### 테스트 커버리지 기준)
- Line 355 (### 테스트 실행 명령어)
- Line 356 코드 블록 전후
머지 블로킹은 아니지만 문서 일관성을 위해 고려해보세요.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.claude/rules/testing.md around lines 331 - 366, 문서 내 특정 headings 주변에 빈 줄이 누락되어 있어 가독성 검사에 걸리므로 "### 필수 테스트", "### 테스트 작성 가이드", "### 테스트 커버리지 기준", "### 테스트 실행 명령어" 헤딩 각각 앞뒤에 한 줄의 빈 줄을 추가하고, 코드 블록(./gradlew test 예시) 전후에도 빈 줄을 넣어 Markdown 렌더링과 정적 분석 규칙을 만족시키도록 수정하세요; 해당 헤딩 텍스트를 찾아 바로 위와 아래에 공백 라인을 삽입하면 됩니다.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.claude/hooks/pre-push-test.sh:
- Line 27: Add explicit error handling for the directory change: after the cd
"$PROJECT_ROOT" command, check its exit status and abort the script with a clear
error message if it fails so you never run ./gradlew test from the wrong
location; update the pre-push-test.sh flow around the cd "$PROJECT_ROOT" and the
subsequent ./gradlew test invocation to fail fast (exit non‑zero) on cd errors.
- Around line 8-15: The hook (.claude/hooks/pre-push-test.sh) currently assumes
python3 exists when setting BASH_CMD, which lets the hook be bypassed if python3
is missing; update the script so before calling python3 it checks for an
available interpreter (check for `python3` then `python` using command -v or
which), and if none exist log a clear error and exit non-zero; ensure the
assignment to BASH_CMD (the JSON parse step) uses the found interpreter and that
any JSON parse failure also causes the hook to fail rather than leaving BASH_CMD
empty.
---
Outside diff comments:
In @.claude/rules/testing.md:
- Around line 331-366: 문서 내 특정 headings 주변에 빈 줄이 누락되어 있어 가독성 검사에 걸리므로 "### 필수
테스트", "### 테스트 작성 가이드", "### 테스트 커버리지 기준", "### 테스트 실행 명령어" 헤딩 각각 앞뒤에 한 줄의 빈 줄을
추가하고, 코드 블록(./gradlew test 예시) 전후에도 빈 줄을 넣어 Markdown 렌더링과 정적 분석 규칙을 만족시키도록
수정하세요; 해당 헤딩 텍스트를 찾아 바로 위와 아래에 공백 라인을 삽입하면 됩니다.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 716c7938-5b5c-45ee-bba4-e676889e06b5
📒 Files selected for processing (15)
.claude/commands/issue-create.md.claude/commands/pr-create.md.claude/commands/review.md.claude/commands/start.md.claude/hooks/pre-push-test.sh.claude/rules/api-design.md.claude/rules/git.md.claude/rules/java.md.claude/rules/testing.md.claude/settings.json.gitignoreCLAUDE.local.example.mdCLAUDE.mdsrc/main/resources/application-local.ymlsrc/main/resources/application-prod.yml
💤 Files with no reviewable changes (2)
- src/main/resources/application-prod.yml
- src/main/resources/application-local.yml
| BASH_CMD=$(python3 -c " | ||
| import sys, json | ||
| try: | ||
| data = json.loads(sys.stdin.read()) | ||
| print(data.get('command', '')) | ||
| except Exception: | ||
| print('') | ||
| " <<< "$INPUT") |
There was a problem hiding this comment.
Python3 가용성 검증이 누락되었습니다.
python3가 시스템에 설치되지 않은 경우 JSON 파싱이 실패하고 BASH_CMD가 빈 문자열이 되어, git push 명령이 감지되지 않고 훅이 우회될 수 있습니다.
🛡️ 제안하는 수정
+# Python3 가용성 확인
+if ! command -v python3 &> /dev/null; then
+ echo "❌ python3를 찾을 수 없습니다. pre-push 훅을 실행하려면 python3가 필요합니다."
+ exit 2
+fi
+
# Bash 도구 입력에서 실행 명령어 추출
BASH_CMD=$(python3 -c "🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.claude/hooks/pre-push-test.sh around lines 8 - 15, The hook
(.claude/hooks/pre-push-test.sh) currently assumes python3 exists when setting
BASH_CMD, which lets the hook be bypassed if python3 is missing; update the
script so before calling python3 it checks for an available interpreter (check
for `python3` then `python` using command -v or which), and if none exist log a
clear error and exit non-zero; ensure the assignment to BASH_CMD (the JSON parse
step) uses the found interpreter and that any JSON parse failure also causes the
hook to fail rather than leaving BASH_CMD empty.
| echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" | ||
|
|
||
| PROJECT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd) | ||
| cd "$PROJECT_ROOT" |
There was a problem hiding this comment.
cd 실패 시 에러 핸들링이 누락되었습니다.
cd "$PROJECT_ROOT" 실패 시(예: 디렉터리 권한 문제, 삭제된 경로 등) 스크립트가 잘못된 디렉터리에서 ./gradlew test를 실행하거나 예상치 못한 동작을 할 수 있습니다. Shellcheck SC2164 경고가 타당합니다.
🛡️ 제안하는 수정
PROJECT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
-cd "$PROJECT_ROOT"
+cd "$PROJECT_ROOT" || {
+ echo "❌ 프로젝트 루트로 이동 실패: $PROJECT_ROOT"
+ exit 2
+}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| cd "$PROJECT_ROOT" | |
| cd "$PROJECT_ROOT" || { | |
| echo "❌ 프로젝트 루트로 이동 실패: $PROJECT_ROOT" | |
| exit 2 | |
| } |
🧰 Tools
🪛 Shellcheck (0.11.0)
[warning] 27-27: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
(SC2164)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.claude/hooks/pre-push-test.sh at line 27, Add explicit error handling for
the directory change: after the cd "$PROJECT_ROOT" command, check its exit
status and abort the script with a clear error message if it fails so you never
run ./gradlew test from the wrong location; update the pre-push-test.sh flow
around the cd "$PROJECT_ROOT" and the subsequent ./gradlew test invocation to
fail fast (exit non‑zero) on cd errors.
|
@SungMinju @twodo0 저희 개발 워크 플로우 자동화시키려고 하는데 어떻게 생각하시나요? |
There was a problem hiding this comment.
Pull request overview
팀원 공통의 Claude Code 기반 개발 플로우를 정착시키기 위해, Claude 커맨드/훅 설정과 팀 규칙 문서를 추가하고 민감 설정 파일 추적을 해제하는 PR입니다.
Changes:
- Claude Code 전용 설정(
.claude/settings.json)과git push감지 시 테스트를 실행하는 훅 스크립트 추가 /start,/pr-create,/review,/issue-create커맨드 문서(자동화 플로우) 추가- 민감한
application-*.yml제거 및.gitignore보강, 팀/개인 Claude 설정 문서 추가
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/resources/application-prod.yml | 프로덕션 민감 설정 파일 제거(저장소 추적 해제) |
| src/main/resources/application-local.yml | 로컬 민감 설정 파일 제거(저장소 추적 해제) |
| CLAUDE.md | 팀 공통 Claude/프로젝트 규칙 및 워크플로우 문서 추가 |
| CLAUDE.local.example.md | 개인별 담당 도메인/수정 범위 예시 문서 추가 |
| .gitignore | 민감 설정/키 파일 및 Claude 개인 설정 ignore 추가 |
| .claude/settings.json | Claude 권한 deny 및 PreToolUse(Bash) 훅 등록 추가 |
| .claude/hooks/pre-push-test.sh | git push 감지 시 ./gradlew test 실행 훅 스크립트 추가 |
| .claude/commands/start.md | develop 최신화 + 브랜치 생성 플로우 문서 추가 |
| .claude/commands/pr-create.md | 테스트→커밋→push→PR 생성 자동화 플로우 문서 추가 |
| .claude/commands/review.md | 팀 기준 코드리뷰 체크리스트 문서 추가 |
| .claude/commands/issue-create.md | 이슈 생성 가이드 문서 추가 |
| .claude/rules/java.md | Java 코딩 규칙 문서 추가 |
| .claude/rules/git.md | Git/PR 규칙 문서 추가 |
| .claude/rules/api-design.md | REST/API 설계 규칙 문서 추가 |
| .claude/rules/testing.md | 테스트 작성 규칙 및 예시 문서 추가 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| - **서버 포트**: `8080` | ||
| - **API 문서**: `http://localhost:8080/swagger-ui/index.html` | ||
| - **환경변수**: `src/main/resources/application-local.yml` 참고 (Git 제외) |
| │ ├── application.yml | ||
| │ ├── application-local.yml # 로컬 전용 (Git 제외) | ||
| │ ├── application-prod.yml # 프로덕션 (민감정보) | ||
| │ └── application-test.yml # 테스트 | ||
| │ | ||
| └── test/ | ||
| └── java/com/eatsfine/ | ||
| ├── EatsfineApplicationTests.java | ||
| ├── controller/ | ||
| │ └── HealthControllerTest.java | ||
| └── domain/inquiry/controller/ | ||
| └── InquiryControllerTest.java |
| BASH_CMD=$(python3 -c " | ||
| import sys, json | ||
| try: | ||
| data = json.loads(sys.stdin.read()) | ||
| print(data.get('command', '')) |
| # Bash 도구 입력에서 실행 명령어 추출 | ||
| BASH_CMD=$(python3 -c " | ||
| import sys, json | ||
| try: | ||
| data = json.loads(sys.stdin.read()) | ||
| print(data.get('command', '')) | ||
| except Exception: | ||
| print('') | ||
| " <<< "$INPUT") | ||
|
|
||
| # git push 명령이 아니면 즉시 통과 | ||
| if ! echo "$BASH_CMD" | grep -qE '(^|&&|\|\|)\s*git push'; then |
| $ARGUMENTS: $ARGUMENTS | ||
|
|
💡 작업 개요
팀원 모두가 일관된 개발 플로우를 사용할 수 있도록 Claude Code 자동화 설정을 추가합니다.
/start,/pr-create커맨드가 실제로 git 명령어를 실행하도록 개선하고,git push전 테스트를 자동으로 검증하는 훅을 추가했습니다.또한 민감한 설정 파일(
application-local.yml,application-prod.yml)이 git에 올라가지 않도록 추적을 해제했습니다.✅ 작업 내용
📋 상세 작업 내용
/start {이슈번호} {타입} {설명}— develop 최신화 후 브랜치 자동 생성/pr-create— 테스트 실행 → 미커밋 처리 → push → PR 생성 전체 자동화.claude/hooks/pre-push-test.sh—git push감지 시./gradlew test자동 실행, 실패 시 push 차단.claude/settings.json— pre-push 훅 등록 + 민감 파일 Claude 읽기 차단(permissions.deny).gitignore—application-local.yml,application-prod.yml,*.secret,*.key등 추가application-local.yml,application-prod.ymlgit 추적 해제 (로컬 파일은 유지)CLAUDE.md,CLAUDE.local.example.md추가 — 팀 공통 Claude 설정 및 개인 설정 예시🧪 테스트 내용
./gradlew test전체 통과 (6 tests)📝 기타 참고 사항
settings.local.json은.gitignore에 추가되어 개인 권한 설정은 각자 관리cp CLAUDE.local.example.md CLAUDE.local.md후 담당 도메인 설정 필요application-prod.yml이 기존에 git history에 포함되어 있었으므로, 해당 파일에 실제 키값이 있다면 교체 권장Summary by CodeRabbit
릴리스 노트
문서
보안
Chores