xiaohongshu
xiaohongshu
claude-guide
Guides Claude Code setup and configuration. Use when setting up CLAUDE.md, rules, hooks, or skills structure for projects.
Full skill instructions
Claude Code 설정 구조를 안내하고, 프로젝트별 CLAUDE.md를 리뷰합니다.
Claude Code는 다양한 설정 방식을 제공합니다. 컨텍스트 소비 최소화를 위해 적절한 유형을 선택하세요.
| 유형 | 로드 시점 | 용도 |
|---|---|---|
| CLAUDE.md | 항상 | 핵심 규칙, 필수 설정 |
| rules/ | 자동 로드 (paths 지정 시 해당 경로만) | 상세 규칙 분리 (20줄+ 시) |
| hooks/ | 이벤트 시 | 도구 호출 전후 자동 실행 |
| commands/ | 호출 시만 | 반복 작업 템플릿 (/auto-dev) |
| skills/ | 필요 시만 | 전문 지식 패키지 (drawio) |
| agents/ | 위임 시만 | 독립 컨텍스트 작업 (code-review) |
CLAUDE.md: 커밋 규칙, 테스트 정책, 금지 사항 (항상 적용되어야 할 것) rules/: 상세 규칙 (20줄+), 영역별 분리 (frontend/, backend/) hooks/: 도구 호출 전후 자동화 (pre-Bash, post-Edit 등) commands/: 반복 워크플로우 (/review, /deploy, /docs) skills/: 특정 주제 전문 지식 (항상 필요하지 않은 것) agents/: 독립 컨텍스트 필요한 작업 (코드 리뷰, 탐색)
Claude Code는 여러 위치에서 메모리를 로드합니다. 위에서 아래로 우선순위가 높습니다.
| 우선순위 | 유형 | 위치 | 공유 범위 |
|---|---|---|---|
| 1 | Enterprise policy | macOS: /Library/Application Support/ClaudeCode/CLAUDE.md<br>Linux: /etc/claude-code/CLAUDE.md<br>Windows: C:\Program Files\ClaudeCode\CLAUDE.md | 조직 전체 |
| 2 | User memory | ~/.claude/CLAUDE.md | 개인 (모든 프로젝트) |
| 3 | Project memory | ./CLAUDE.md 또는 ./.claude/CLAUDE.md | 팀 (소스 컨트롤) |
| 4 | Project rules | ./.claude/rules/*.md | 팀 (소스 컨트롤) |
| 5 | Project local | ./CLAUDE.local.md | 개인 (현재 프로젝트만) |
동작 방식: cwd에서 루트까지 재귀적으로 탐색하며 모든 CLAUDE.md, CLAUDE.local.md 로드
CLAUDE.local.md는 자동으로.gitignore에 추가됨
다른 파일을 import할 수 있습니다:
See @README for project overview and @package.json for available npm commands.
# Additional Instructions
- git workflow @docs/git-instructions.md
- 개인 설정 @~/.claude/my-project-instructions.md
.claude/rules/ 내 파일에 YAML frontmatter로 특정 경로에만 적용:
---
paths: src/api/**/*.ts
---
# API Development Rules
- All API endpoints must include input validation
- Use the standard error response format
Glob 패턴 예시:
**/*.ts: 모든 TypeScript 파일src/**/*: src/ 하위 모든 파일src/components/*.tsx: 특정 디렉토리만{src,lib}/**/*.ts: 여러 디렉토리/init # CLAUDE.md 생성
/memory # 로드된 memory 파일 확인
프로젝트별 CLAUDE.md를 리뷰하고 정리합니다.
핵심 목표:
# 현재 디렉토리 확인
pwd
# claude.md 찾기
ls claude.md 2>/dev/null || ls CLAUDE.md 2>/dev/null
있으면: 리뷰 시작 없으면: 생성 제안 (templates/ 참조)
Read claude.md (또는 CLAUDE.md)
분석 항목:
컨텍스트 효율성 체크
Skills로 분리할 내용 감지
키워드 패턴으로 감지:
판단 기준:
필수 항목 체크
사용자에게 분석 결과 요약:
## 📊 claude.md 리뷰 결과
### 전체 현황
- 총 라인: XXX줄
- 상태: ✅ 간결하고 적절 / ⚠️ 약간 김 / ❌ 분리 필요
### Skills로 분리 권장 (총 YYY줄)
1. TypeScript 컨벤션 (50줄) → patterns-typescript
2. React 패턴 (80줄) → patterns-react
3. 테스트 가이드 (40줄) → test-guidelines
### 필수 항목 누락
- [ ] 퀵 커맨드
- [ ] 서비스 엔드포인트
### 적절한 내용
- [x] 프로젝트별 quirks
- [x] 특정 서비스 설정
개선 방향 선택지 제시:
[1] Skills 분리 + 정리
[2] 정리만 (분리 없이)
[3] 새로 작성
[1] Skills 분리 선택 시:
각 분리 대상마다 확인:
"TypeScript 컨벤션(50줄)을 patterns-typescript skill로 분리하시겠습니까?"
→ Yes: 새 skill 생성
→ No: claude.md에 유지
새 skill 생성:
mkdir -p skills/patterns-{name}/
Write skills/patterns-{name}/SKILL.md
claude.md에서 해당 섹션 제거
claude.md에 skill 참조 추가:
## 코딩 가이드
- TypeScript: `patterns-typescript` skill 참조
- React: `patterns-react` skill 참조
[2] 정리만 선택 시:
[3] 새로 작성 선택 시:
프로젝트 유형 확인:
적절한 템플릿 선택 (templates/{유형}.md)
사용자와 대화하며 커스터마이징:
claude.md 생성
정리 후 재확인:
프로젝트 고유 정보:
예시:
# MyApp
웹 기반 사용자 관리 시스템
## 퀵 커맨드
- Build: `npm run build`
- Dev: `npm run dev` (http://localhost:3000)
- Test: `npm test`
- Deploy: `./scripts/deploy.sh`
## 서비스
- API: http://localhost:3000/api
- Admin: http://localhost:3001
- Redis: localhost:6379
## 환경변수 필수
- DATABASE_URL
- REDIS_URL
- JWT_SECRET
## 주의사항
- DB 마이그레이션은 항상 백업 후 실행
- Redis는 개발 시 docker compose로 자동 실행
범용 패턴 및 가이드:
분리 대상 skill 매핑:
patterns-typescriptpatterns-reactpatterns-backendpatterns-apitest-guidelinespatterns-error-handlingreview-security대규모 엔터프라이즈 프로젝트는 일반 권장 범위를 초과할 수 있습니다.
1. Project Overview # 프로젝트 개요
2. Quick Commands # 개발 명령어
3. Services # 서비스 엔드포인트
4. Environment Variables # 환경변수
5. Architecture # 아키텍처 가이드라인 (패키지 구조, 계층 의존성)
6. REST API Standards # API 응답 패턴, 로깅 표준
7. Internationalization # i18n 메시지 사용법
8. Swagger Documentation # API 문서화 규칙
9. Checklists # 체크리스트 (새 컨트롤러, 새 서비스, PR)
10. Testing Strategy # 테스트 전략, 디렉토리 구조
11. Troubleshooting # 자주 발생하는 문제 해결
12. References # 상세 문서 링크
올바른 방법과 잘못된 방법을 대비하여 명확하게 가이드:
// ✅ 올바른 패턴: ApiResult 래퍼 사용
@PostMapping
public ResponseEntity<ApiResult<UserResponse>> createUser(...) {
return ResponseEntity.status(HttpStatus.CREATED)
.body(ApiResult.success(response, message));
}
// ❌ 잘못된 패턴: ApiResult 없이 직접 반환
@GetMapping
public ResponseEntity<List<UserResponse>> getUsers() {
return ResponseEntity.ok(service.getAll()); // 이렇게 하지 마세요
}
효과: AI가 명확한 패턴을 학습하여 일관된 코드 생성
새 기능 구현 시 빠뜨리기 쉬운 사항을 명시적으로 나열:
### New Controller Checklist
- [ ] **ApiResult 패턴 적용**: 모든 엔드포인트가 `ResponseEntity<ApiResult<T>>` 반환
- [ ] **MessageSourceService 주입**: 다국어 메시지 처리를 위해 필수
- [ ] **Swagger 문서화**: `@Tag`, `@Operation`, `@ApiResponses` 어노테이션 추가
- [ ] **로깅 표준 준수**: GET은 `debug`, POST/PUT/DELETE는 `info` 레벨
- [ ] **메시지 파일 업데이트**: messages_ko.properties에 메시지 키 추가
효과: AI가 코드 생성 후 자체 검증 가능
대규모 프로젝트용 템플릿: templates/enterprise.md
User: "claude.md 리뷰해줘" Assistant:
User: "claude.md 만들어줘" Assistant:
템플릿은 templates/ 디렉토리 참조:
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience