Skip to content

[chore] Claude Code 개발 플로우 자동화 설정 추가#160

Open
zerochani wants to merge 2 commits into
developfrom
chore/#159-claude-dev-flow-automation
Open

[chore] Claude Code 개발 플로우 자동화 설정 추가#160
zerochani wants to merge 2 commits into
developfrom
chore/#159-claude-dev-flow-automation

Conversation

@zerochani
Copy link
Copy Markdown
Contributor

@zerochani zerochani commented May 9, 2026

💡 작업 개요

팀원 모두가 일관된 개발 플로우를 사용할 수 있도록 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.shgit push 감지 시 ./gradlew test 자동 실행, 실패 시 push 차단
  • .claude/settings.json — pre-push 훅 등록 + 민감 파일 Claude 읽기 차단(permissions.deny)
  • .gitignoreapplication-local.yml, application-prod.yml, *.secret, *.key 등 추가
  • application-local.yml, application-prod.yml git 추적 해제 (로컬 파일은 유지)
  • 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에 포함되어 있었으므로, 해당 파일에 실제 키값이 있다면 교체 권장
  • Closes [CHORE]: Claude Code 개발 플로우 자동화 설정 추가 #159

Summary by CodeRabbit

릴리스 노트

  • 문서

    • 개발 가이드 및 협업 워크플로우 문서 추가 (이슈 생성, PR 작성, 코드 리뷰 절차)
    • API 설계 표준, Java 코딩 규칙, 테스트 작성 가이드 등 기술 규칙 문서화
  • 보안

    • 민감한 환경 설정 파일을 저장소에서 제거
  • Chores

    • Git 푸시 전 자동 테스트 검증 훅 추가
    • 환경 변수 및 보안 파일에 대한 .gitignore 강화
    • 개발 환경 설정 파일 추가

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 9, 2026

📝 Walkthrough

워크스루

Claude Code 커맨드 자동화, 기술 규칙 정의, 개발 온보딩 가이드, 사전 푸시 테스트 훅을 추가합니다. 이슈 기반 워크플로우(/issue-create → /start → /pr-create), 기술 표준(Java/Git/API/테스트), 도메인 권한 관리를 통합하며, 민감한 환경설정은 제거합니다.

변경사항

Claude Code 워크플로우 자동화

레이어 / 파일 요약
설정 파일 및 보안
.claude/settings.json, .gitignore, `src/main/resources/application-*.yml``
사전 푸시 테스트 훅 등록, 민감 파일 패턴 제외(.env.*, *.secret, *.key, 환경설정 YAML), 프로덕션/로컬 환경 설정 파일 제거.
테스트 자동화 훅
.claude/hooks/pre-push-test.sh
Git push 전 자동 테스트 실행. stdin JSON 파싱으로 푸시 감지, ./gradlew test 수행, 실패 시 exit 2로 차단.
커맨드 정의 및 워크플로우
.claude/commands/issue-create.md, start.md, pr-create.md, review.md
이슈 생성(3가지 템플릿), 브랜치 시작(/start), PR 생성(/pr-create), 코드 리뷰(/review) 명령어의 단계별 실행 절차 및 자동화 흐름 문서화.
기술 규칙 및 코딩 표준
.claude/rules/java.md, git.md, api-design.md, testing.md
Java 레이어 분리(Controller/Service/Repository), CQRS 패턴, DTO 변환, 예외 처리; Git/PR 규칙(브랜치명, Conventional Commits, 최소 2 승인); REST API 설계(/api/v1/, 상태 코드, ApiResponse 래핑); 테스트 작성(단위/슬라이스/통합, 80% 커버리지).
온보딩 및 프로젝트 문서
CLAUDE.md, CLAUDE.local.example.md
프로젝트 개요(Java 21, Spring Boot 3.4.1), 기술스택, 개발 명령어, DDD+CQRS 아키텍처; 개인별 담당 도메인 설정, 수정 가능/금지 범위, 권한 관리, 협업 규칙.

예상 코드 리뷰 시간

🎯 3 (보통) | ⏱️ ~25분

제안 라벨

chore

제안 리뷰어

  • sonjunkyu
  • SungMinju

🐰 Claude의 손길이 닿은 곳,

규칙과 자동화로 흐르네,

이슈부터 PR까지 한숨에,

팀의 맥박이 고르게,

개발의 춤을 추도록! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목은 Claude Code 개발 플로우 자동화 설정 추가라는 주요 변경사항을 명확하게 요약하고 있으며, 추가된 모든 파일과 기능과 직접적으로 관련이 있습니다.
Description check ✅ Passed PR 설명은 요구되는 템플릿의 모든 필수 섹션(작업 개요, 작업 내용 체크리스트, 테스트 내용, 기타 참고사항)을 포함하고 있으며, 상세한 작업 내용과 주의사항도 잘 정리되어 있습니다.
Linked Issues check ✅ Passed PR은 #159 이슈에서 요구한 모든 코딩 관련 요구사항을 충족합니다: /start 커맨드 개선(develop 최신화 및 브랜치 자동 생성), /pr-create 커맨드 개선(테스트 실행→push→PR 생성 자동화), pre-push 훅 추가, 민감 파일 제외 설정이 모두 구현되었습니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 #159 이슈의 범위 내에 있습니다. 추가된 문서, 설정 파일, 훅 스크립트, 그리고 민감 파일 제거는 모두 Claude Code 자동화 설정이라는 명시된 목표와 직접 관련이 있습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/#159-claude-dev-flow-automation

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zerochani zerochani requested review from SungMinju, Copilot and twodo0 May 9, 2026 07:55
@zerochani zerochani self-assigned this May 9, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .claude/commands/start.md
아래 명령어를 순서대로 실행합니다:

```bash
git checkout develop
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

현재 작업 트리에 미커밋된 변경사항이 있는 상태에서 develop 브랜치로 체크아웃을 시도하면 명령어가 실패할 수 있습니다. 작업을 시작하기 전에 git status를 확인하여 작업 트리가 깨끗한지 확인하거나, 변경사항이 있다면 git stash를 수행하도록 안내하는 단계를 추가하는 것이 좋습니다.

Comment thread .claude/commands/start.md

### Step 2: 작업 브랜치 생성

브랜치명 규칙: `{타입}/#${이슈번호}-{설명}`
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

브랜치명에 # 문자를 포함하는 것은 Git에서 허용되지만, 일부 쉘(Shell) 환경이나 자동화 도구에서 특수 문자로 오인될 수 있습니다. 또한 ${이슈번호} 형식은 다른 플레이스홀더({타입}, {설명})와 형식이 달라 일관성이 떨어집니다. 더 안전하고 일관된 {타입}/{이슈번호}-{설명} 형식을 권장합니다.

Suggested change
브랜치명 규칙: `{타입}/#${이슈번호}-{설명}`
브랜치명 규칙: {타입}/{이슈번호}-{설명}

Comment thread .claude/commands/start.md
수집한 정보로 브랜치를 생성합니다:

```bash
git checkout -b {타입}/#${이슈번호}-{설명}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

위에서 언급한 브랜치명 규칙 변경에 맞춰 실제 생성 명령어의 플레이스홀더도 수정이 필요합니다.

Suggested change
git checkout -b {타입}/#${이슈번호}-{설명}
git checkout -b {타입}/{이슈번호}-{설명}

git status --short
```

브랜치명 `{타입}/#${이슈번호}-{설명}` 에서 타입과 이슈번호를 추출합니다.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

/start 커맨드에서 제안한 브랜치명 규칙 변경에 맞춰, 여기서도 추출 로직에 대한 설명을 일관성 있게 수정하는 것이 좋습니다.

Suggested change
브랜치명 `{타입}/#${이슈번호}-{설명}` 에서 타입과 이슈번호를 추출합니다.
브랜치명 `{타입}/{이슈번호}-{설명}` 에서 타입과 이슈번호를 추출합니다.

" <<< "$INPUT")

# git push 명령이 아니면 즉시 통과
if ! echo "$BASH_CMD" | grep -qE '(^|&&|\|\|)\s*git push'; then
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

현재 정규표현식은 세미콜론(;)을 명령 구분자로 사용하는 경우를 감지하지 못합니다 (예: cd src; git push). 세미콜론도 구분자 그룹에 추가하여 감지 로직을 보완하는 것이 좋습니다.

Suggested change
if ! echo "$BASH_CMD" | grep -qE '(^|&&|\|\|)\s*git push'; then
if ! echo "$BASH_CMD" | grep -qE '(^|&&|\|\||;)\s*git push'; then

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between ba3ece4 and dd336c7.

📒 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
  • .gitignore
  • CLAUDE.local.example.md
  • CLAUDE.md
  • src/main/resources/application-local.yml
  • src/main/resources/application-prod.yml
💤 Files with no reviewable changes (2)
  • src/main/resources/application-prod.yml
  • src/main/resources/application-local.yml

Comment on lines +8 to +15
BASH_CMD=$(python3 -c "
import sys, json
try:
data = json.loads(sys.stdin.read())
print(data.get('command', ''))
except Exception:
print('')
" <<< "$INPUT")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

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"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

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.

Suggested change
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.

@zerochani
Copy link
Copy Markdown
Contributor Author

zerochani commented May 9, 2026

@SungMinju @twodo0 저희 개발 워크 플로우 자동화시키려고 하는데 어떻게 생각하시나요?
.md 파일은 일단 기본으로 채워둔거고, 수정 계속해가야 할 것 같습니다.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread CLAUDE.md

- **서버 포트**: `8080`
- **API 문서**: `http://localhost:8080/swagger-ui/index.html`
- **환경변수**: `src/main/resources/application-local.yml` 참고 (Git 제외)
Comment thread CLAUDE.md
Comment on lines +226 to +237
│ ├── 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
Comment on lines +8 to +12
BASH_CMD=$(python3 -c "
import sys, json
try:
data = json.loads(sys.stdin.read())
print(data.get('command', ''))
Comment on lines +7 to +18
# 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
Comment thread .claude/commands/start.md
Comment on lines +6 to +7
$ARGUMENTS: $ARGUMENTS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CHORE]: Claude Code 개발 플로우 자동화 설정 추가

2 participants