From c58d698df6c7a431125a58ec60c636f541f7d447 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chyeonggkim=E2=80=9D?= <“hyeonggkim@smilegate.com”> Date: Mon, 13 Apr 2026 14:01:12 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20docs:=20.gitignore=20=EC=9E=90?= =?UTF-8?q?=EB=8F=99=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20=EC=84=A4=EC=B9=98?= =?UTF-8?q?=20=EC=8A=A4=ED=81=AC=EB=A6=BD=ED=8A=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 +++++++- scripts/install.sh | 23 +++++++++++++++++++---- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9dae96c..a0807d5 100644 --- a/README.md +++ b/README.md @@ -56,13 +56,18 @@ git submodule update --init --recursive bash .claude/common/scripts/install.sh https://git.sginfra.net/sgp-web-d/gameservice-fe-agent.git ``` +> `install.sh`는 `.gitignore`에 `.claude/common/`를 자동으로 추가합니다. +> `.gitignore`가 없으면 새로 생성합니다. + 설치 후 프로젝트 구조는 다음과 같이 됩니다. ``` your-project/ ├── .claude/ │ ├── common/ ← submodule (gameservice-fe-agent) -│ └── project/ ← 프로젝트 고유 지침 +│ ├── project/ ← 프로젝트 고유 지침 +│ └── skills/ ← 공통 skill 심볼릭 링크 +├── .gitignore ← .claude/common/ 자동 추가됨 ├── CLAUDE.md ← 공통 + 프로젝트 지침을 @import └── ... ``` @@ -109,6 +114,7 @@ bash .claude/common/scripts/update.sh ```bash bash .claude/common/scripts/install.sh https://git.sginfra.net/sgp-web-d/gameservice-fe-agent.git # → .claude/common 에 submodule 설치 +# → .gitignore 에 .claude/common/ 추가 # → templates/project/*.md 를 .claude/project/ 로 복사 # → templates/CLAUDE.md.tpl 을 루트 CLAUDE.md 로 복사 ``` diff --git a/scripts/install.sh b/scripts/install.sh index b37d66f..4c6b12b 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -43,7 +43,22 @@ else echo "✅ submodule 추가 완료: $TARGET_PATH" fi -# 2) 프로젝트 지침 양식 복사 (templates/project/ → .claude/project/) +# 2) .gitignore 에 .claude/common 추가 +GITIGNORE=".gitignore" +IGNORE_ENTRY=".claude/common/" +if [[ -f "$GITIGNORE" ]]; then + if grep -qF "$IGNORE_ENTRY" "$GITIGNORE" || grep -qF ".claude/common" "$GITIGNORE"; then + echo "ℹ️ .gitignore 에 '$IGNORE_ENTRY' 가 이미 있습니다. 건너뜁니다." + else + printf "\n# gameservice-fe-agent submodule\n%s\n" "$IGNORE_ENTRY" >> "$GITIGNORE" + echo "✅ .gitignore 에 '$IGNORE_ENTRY' 를 추가했습니다." + fi +else + printf "# gameservice-fe-agent submodule\n%s\n" "$IGNORE_ENTRY" > "$GITIGNORE" + echo "✅ .gitignore 를 생성하고 '$IGNORE_ENTRY' 를 추가했습니다." +fi + +# 4) 프로젝트 지침 양식 복사 (templates/project/ → .claude/project/) mkdir -p "$PROJECT_PATH" TEMPLATE_DIR="$TARGET_PATH/templates/project" @@ -64,7 +79,7 @@ else echo "⚠️ $TEMPLATE_DIR 를 찾지 못했습니다. 공통 저장소의 templates 가 오래됐을 수 있습니다." fi -# 3) 루트 CLAUDE.md 템플릿 복사 +# 5) 루트 CLAUDE.md 템플릿 복사 if [[ ! -f "CLAUDE.md" ]]; then TPL_FILE="$TARGET_PATH/templates/CLAUDE.md.tpl" if [[ -f "$TPL_FILE" ]]; then @@ -97,7 +112,7 @@ else echo "" fi -# 4) 공통 skill 심볼릭 링크 (.claude/common/skills/* → .claude/skills/*) +# 6) 공통 skill 심볼릭 링크 (.claude/common/skills/* → .claude/skills/*) SKILLS_SRC="$TARGET_PATH/skills" SKILLS_DEST=".claude/skills" @@ -131,5 +146,5 @@ echo "" echo "다음 작업을 진행해 주세요:" echo " 1) $PROJECT_PATH/*.md 내용을 프로젝트에 맞게 채우기" echo " 2) 변경 사항을 커밋하기" -echo " git add .gitmodules .claude CLAUDE.md" +echo " git add .gitmodules .gitignore .claude CLAUDE.md" echo " git commit -m 'chore: add gameservice-fe-agent submodule'"