Files
fe-common-rules/examples/sample-nuxt-project/README.md

108 lines
4.0 KiB
Markdown

# sample-nuxt-project
`fe-common-rules` 공통 지침과 skill 을 실제 프로젝트에서 어떻게 사용하는지 보여주는 **샘플**입니다.
> 💡 이 샘플은 실제로 실행 가능한 Nuxt 앱이 아니라, **디렉토리 구조와 CLAUDE.md / skill 연동 방식**을 보여주기 위한 최소 구성입니다.
## 구조
```
sample-nuxt-project/
├── CLAUDE.md # 공통 + 프로젝트 지침 @import 엔트리
├── .claude/
│ ├── common/ # fe-common-rules submodule
│ │ ├── CLAUDE.md
│ │ ├── rules/*.md # 코딩/프레임워크/커밋/워크플로 지침
│ │ ├── templates/project/*.md # 프로젝트 지침 양식
│ │ ├── skills/ # 팀 공용 Claude skill
│ │ │ ├── vue-component-review/SKILL.md
│ │ │ └── conventional-commit/SKILL.md
│ │ └── scripts/
│ │ ├── install.sh
│ │ ├── init-project.sh
│ │ ├── link-skills.sh
│ │ └── update.sh
│ ├── project/ # 프로젝트 고유 지침 (양식에서 복사 후 편집)
│ │ ├── overview.md
│ │ ├── conventions.md
│ │ └── architecture.md
│ └── skills/ # 공통 skill 링크 + 프로젝트 고유 skill
│ ├── vue-component-review → ../common/skills/vue-component-review
│ └── conventional-commit → ../common/skills/conventional-commit
├── package.json # Nuxt 4 + Vue 3 + TS + Tailwind 의존성
├── nuxt.config.ts
├── tsconfig.json
├── tailwind.config.ts
├── app.vue
└── .gitignore
```
## 실제 프로젝트에서는 어떻게 만드나요?
### 방법 A: install.sh 한 번으로 세팅
```bash
cd my-project
git init && git add . && git commit -m "chore: init"
curl -fsSL https://<raw>/scripts/install.sh | bash -s -- git@github.com:<org>/fe-common-rules.git
```
스크립트가 아래를 한 번에 처리합니다.
1. `.claude/common/` 에 fe-common-rules 를 submodule 로 추가
2. `.claude/common/templates/project/*.md``.claude/project/` 로 복사
3. `.claude/common/templates/CLAUDE.md.tpl` → 루트 `CLAUDE.md` 로 복사
4. `.claude/common/skills/*``.claude/skills/*` 로 심볼릭 링크
### 방법 B: 수동 설정
```bash
git submodule add git@github.com:<org>/fe-common-rules.git .claude/common
git submodule update --init --recursive
# 프로젝트 지침 양식 복사
mkdir -p .claude/project
cp .claude/common/templates/project/*.md .claude/project/
# 루트 CLAUDE.md 템플릿 복사
cp .claude/common/templates/CLAUDE.md.tpl CLAUDE.md
# 공통 skill 링크
bash .claude/common/scripts/link-skills.sh
```
## 공통 지침 / skill 업데이트
```bash
# submodule 을 최신으로 당기기
git submodule update --remote --merge .claude/common
# 새로 추가된 skill 이 있다면 자동 링크
bash .claude/common/scripts/link-skills.sh
git add .gitmodules .claude
git commit -m "chore: sync fe-common-rules"
```
심볼릭 링크 방식이므로 **이미 링크된 기존 skill 의 내용**은 submodule 업데이트만으로
자동 최신화됩니다. `link-skills.sh` 는 "새로 추가된 skill 이 있을 때" 한 번씩 실행하면 됩니다.
## 프로젝트 지침 양식 업데이트
```bash
# 양식 차이 확인
bash .claude/common/scripts/init-project.sh --diff
# 없는 양식만 새로 복사 (기존 파일 보존)
bash .claude/common/scripts/init-project.sh
# 강제 덮어쓰기
bash .claude/common/scripts/init-project.sh --force
```
## Claude 가 읽는 순서
1. 루트 `CLAUDE.md``@.claude/common/CLAUDE.md``@rules/*.md``@.claude/project/*.md`
2. Claude 가 특정 작업을 할 때 `.claude/skills/<skill>/SKILL.md` 의 description 과 매칭되면 해당 skill 을 자동 트리거
3. 충돌이 있을 경우 **프로젝트 지침이 우선**합니다.