docs(session): add restart-safe recovery workflow
Context: - codex cli 중단 후에도 작업 품질과 맥락을 안정적으로 복구하기 위해 Changes: - docs/00~07, 90 문서 세트 추가/정리 - commit convention 문서 및 .gitmessage-session.txt 템플릿 추가 - scripts/session/recover-context.sh 추가 - package.json에 session:recover 스크립트 추가 Validation: - npm run session:recover Session-State: session recovery docs, template, and script are in place Session-Next: apply this commit format to feature and refactor commits Session-Risks: legacy commits before this change do not include session trailers
This commit is contained in:
51
docs/02_arch_fsd_rules.md
Normal file
51
docs/02_arch_fsd_rules.md
Normal file
@@ -0,0 +1,51 @@
|
||||
# 02. Architecture & FSD Rules
|
||||
|
||||
## 레이어 구조
|
||||
|
||||
```text
|
||||
src/
|
||||
app/ # 라우트 진입점, 조합 전용
|
||||
widgets/ # 화면 섹션 단위 조합
|
||||
features/ # 사용자 액션/유즈케이스 단위
|
||||
entities/ # 도메인 타입/더미 데이터
|
||||
shared/ # 공용 UI/유틸
|
||||
store/ # 전역 상태(필요 최소)
|
||||
```
|
||||
|
||||
## 핵심 규칙
|
||||
|
||||
1. `page.tsx`는 조합만 수행한다.
|
||||
2. 비즈니스 로직은 `features` 또는 `entities`로 이동한다.
|
||||
3. UI 상태(토글/선택)만 컴포넌트 내부에서 최소 허용한다.
|
||||
4. 파일 길이 500줄 이상이면 즉시 분리한다.
|
||||
5. 하위 레이어가 상위 레이어를 import하지 않는다.
|
||||
|
||||
## Import 방향 규칙
|
||||
|
||||
- `app` -> `widgets`, `features`, `entities`, `shared`
|
||||
- `widgets` -> `features`, `entities`, `shared`
|
||||
- `features` -> `entities`, `shared`
|
||||
- `entities` -> `shared`
|
||||
- `shared` -> 외부 의존성 또는 `shared` 내부
|
||||
|
||||
금지:
|
||||
|
||||
- `features` -> 다른 `features` 직접 참조 (강한 결합 유발)
|
||||
- `shared` -> `entities/features/widgets/app` 참조
|
||||
- `page.tsx`에 도메인 로직/세부 UI 구현 누적
|
||||
|
||||
## 구현 정책 (이 프로젝트 전용)
|
||||
|
||||
- 실제 타이머/오디오/서버/DB 기능은 구현하지 않는다.
|
||||
- 기능 트리거는 토스트 또는 더미 상태 전환으로 표현한다.
|
||||
- 도메인 표시는 `entities` 데이터에서 읽고 뷰 하드코딩을 지양한다.
|
||||
|
||||
## 파일 분리 기준
|
||||
|
||||
- 조건:
|
||||
- 파일 500줄 이상
|
||||
- 하나의 파일에 2개 이상의 독립 관심사가 혼재
|
||||
- 분리 대상 예시:
|
||||
- UI 파트 -> `ui/*`
|
||||
- 상태/핸들러 -> `model/*`
|
||||
- 타입 -> `model/types.ts`
|
||||
Reference in New Issue
Block a user