chore: Claude Code 하네스 및 커밋 훅 구성 - #3
Conversation
|
📦 EAS Update 프리뷰가 Expo 대시보드에서 확인하세요: https://expo.dev/accounts/h4zx7/projects/MUDDA-CrossPlatform/updates |
There was a problem hiding this comment.
Code Review
This pull request establishes the project's development environment and standards by adding Claude agent rules, custom skills, GitHub templates, and pre-commit hooks using Husky, commitlint, and lint-staged. The review feedback suggests several practical refinements to the newly added rules and configurations: simplifying component prop type definitions in the React Native rules, using a generic code snippet instead of a specific file reference for Zustand store resets in the testing rules, allowing documented exceptions for type assertions in the TypeScript rules, and replacing 'npx --no' with 'npx --no-install' in the Husky commit-msg hook for broader npm compatibility.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
|
||
| - Components are function declarations: `export function LoginForm() {}`. Default exports only where expo-router requires them (route files in `src/app/`). | ||
| - Component files are kebab-case (`login-form.tsx`); one component per file as a rule. | ||
| - Props: define a `Props` type per component (`type LoginFormProps = {...}`); destructure in the signature. |
There was a problem hiding this comment.
파일당 하나의 컴포넌트만 두는 규칙(line 9)을 따르고 있으므로, 컴포넌트 내부에서만 사용하는 Props 타입은 굳이 LoginFormProps처럼 컴포넌트 이름을 붙이지 않고 단순히 type Props = { ... }로 정의하는 것이 더 간결하고 일관성 있습니다. 외부로 내보내야 하거나 여러 컴포넌트가 한 파일에 존재할 때만 이름을 명시하도록 가이드를 보완하면 좋겠습니다.
| - Props: define a `Props` type per component (`type LoginFormProps = {...}`); destructure in the signature. | |
| - Props: define a local `Props` type per component (`type Props = {...}`); destructure in the signature. Use named props (e.g., `LoginFormProps`) only if exporting them. |
| - Structure: `describe` per component/function, `it` names state the expected behavior in plain English. | ||
| - Run with `npm run test` (single run) or `npx jest --watch`; CI runs `npm run test:ci` (with coverage). | ||
| - New features and bug fixes ship with tests; a bug fix starts with a failing test that reproduces it. | ||
| - Zustand stores are module-level singletons — reset store state in `beforeEach` (see `useCounterStore.test.ts`) so tests stay independent. |
There was a problem hiding this comment.
Zustand 스토어 상태를 beforeEach에서 초기화하라는 규칙은 훌륭합니다. 다만 예시로 언급된 useCounterStore.test.ts 파일이 현재 프로젝트에 실제로 존재하지 않는다면, 새로운 개발자가 참고하려 할 때 혼란을 줄 수 있습니다. 실제 존재하는 테스트 파일로 예시를 변경하거나, Zustand 스토어 초기화 패턴의 간단한 코드 스니펫을 규칙 문서 내에 직접 포함하는 것을 제안합니다.
| - Zustand stores are module-level singletons — reset store state in `beforeEach` (see `useCounterStore.test.ts`) so tests stay independent. | |
| - Zustand stores are module-level singletons — reset store state in `beforeEach` (e.g., `useStore.getState().reset()`) so tests stay independent. |
|
|
||
| - `strict` mode is on — never weaken it. No `any`; use `unknown` + narrowing when the type is genuinely unknown. | ||
| - No non-null assertions (`!`) — handle the null case or restructure so it can't be null. | ||
| - No `as` type assertions except `as const`. If a cast seems necessary, fix the types instead. |
There was a problem hiding this comment.
No as type assertions except as const 규칙은 다소 엄격할 수 있습니다. React Native 환경에서는 외부 라이브러리 연동, Native Event 객체 처리, 또는 useRef 등에서 불가피하게 타입 단언(as)을 사용해야 하는 경우가 발생합니다. 따라서 '원칙적으로 금지하되, 불가피한 경우(예: 외부 라이브러리 타입 한계, Native API 연동 등)에는 주석으로 이유를 명시하고 허용한다'와 같이 실용적인 예외 조항을 추가하는 것을 제안합니다.
| - No `as` type assertions except `as const`. If a cast seems necessary, fix the types instead. | |
| - No `as` type assertions except `as const` or where strictly unavoidable (e.g., third-party library types, native refs). If a cast is necessary, document the reason with a comment. |
| @@ -0,0 +1 @@ | |||
| npx --no -- commitlint --edit "$1" | |||
💡 배경 및 개요
ARENA-Android의 하네스 세팅(ARENA-Android#6)을 참고해 MUDDA에도 Claude Code 하네스와 로컬 커밋 훅을 구성했어요. develop에 이미 갖춰진 CI/CD·테스트 세팅과 겹치지 않는 부분만 추가했습니다.
📃 작업내용
AGENTS.md/CLAUDE.md— 프로젝트 스택·구조·커밋/브랜치/PR 컨벤션 가이드 문서 (develop의 실제 CI 구성 기준으로 작성).claude/rules/— 파일 패턴별 자동 로드 규칙 4종 (typescript / react-native / styling / testing).claude/skills/—commit/issue/pr스킬 3종typecheck스크립트 추가 (tsc --noEmit)CODEOWNERS추가.editorconfig추가 (인코딩·들여쓰기 에디터 통일)🙋♂️ 리뷰노트
subject-case규칙은 껐습니다.npm ci가 깨지지 않게 했어요.✅ PR 체크리스트
.env,노션,README)"API 개발 완료됐어요","환경값 추가되었어요")🤖 Generated with Claude Code