CLAUDE.md 상주 분량 축소와 paths 규칙 분리 (Fable 5.1 점검) - #1038
Merged
Conversation
- 세션마다, 그리고 Explore·Plan 을 제외한 모든 서브에이전트에 293줄이 실리던 CLAUDE.md 를 243줄로 줄였다. Claude Code 공식 권장은 200줄 이하이고, 길수록 컨텍스트 소모와 규칙 준수율 저하가 함께 온다 - worktree 절 4개(분리·EnterWorktree·스택 금지·정리)는 로비 규칙과 /issue·/session-close 스킬이 절차를 담당하므로 이 repo 의 정책(base origin/dev·스택 금지·이벤트 기반 정리)만 남겼다 - 웹 요청 경계 절은 .claude/rules/web-request-boundary.md 로, 외래 키·마이그레이션 절은 .claude/rules/db-schema.md 로 옮겨 SecurityConfig·필터·admin·템플릿 또는 엔티티·마이그레이션 파일을 다룰 때만 로드된다. 파일을 열지 않는 경로에서도 불변식이 지켜지도록 CLAUDE.md 에 한 줄 스텁을 남겼다 - 트랜잭션 경계 절은 옮기지 않았다. @transactional 이 11개 패키지에 흩어져 있어 paths 글롭으로 정확히 잡을 수 없다 - core 에 없는 클래스를 예시로 든 낡은 문장을 고쳤다: GeminiExtractionResult·"Gemini 60s"·GeminiApiException(502). 현행 예시는 RemoteExtractionContract 의 응답 DTO 와 ImageStorageException 이다 - "절대 규칙"처럼 이유 없이 강도만 올린 표현을 평서문으로 낮췄다. Fable 5.1 은 지시를 그대로 따르므로 압박 어휘는 경직으로 나타난다(Anthropic 프롬프팅 가이드) Claude-Session: https://claude.ai/code/session_01Mg69sPkH9gHFqYZVSbf3ru
|
Discord 스레드 연동용 메타데이터입니다. discord-pr-bot 워크플로가 자동 생성하며, 수정·삭제하면 PR 과 Discord 알림 연동이 끊깁니다. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- db/migration/CLAUDE.md 가 이번에 지운 루트 헤딩 "## 테이블 간 외래 키" 를 가리키고 있었다. 같은 경로에서 함께 자동 로드되는 .claude/rules/db-schema.md 로 참조를 옮겼다 - web-request-boundary 규칙의 paths 가 admin 밖의 SSR 컨트롤러(metrics/dashboard/MetricsController.kt)를 놓쳤다. *Controller.kt 를 더했다. openapi-controller 규칙과 겹치지만 둘이 함께 로드돼도 문제 없다 - db-schema 규칙의 paths 가 @entity 22개 중 domain/ 밖 6개(admin 2·product 3·common 1)를 놓쳤다. *Entity.kt 와 admin 패키지를 더했다 - worktree 절을 압축하면서 두 가지가 어디에도 남지 않았다: 진입하지 않을 때 statusline·경로·PR 표시가 메인 기준이 돼 작업 위치가 안 보인다는 근거와 그때의 대체 절차(알리고 git -C 격리), 그리고 "진입 여부를 함께 확인하고 자동 진입하지 않는다"는 정책. 압축된 첫 불릿에 한 문장씩 되살렸다 - 발견 출처: 머지 전 reviewer 서브에이전트 전수검사(무손실 대조·paths 매칭 실측) Claude-Session: https://claude.ai/code/session_01Mg69sPkH9gHFqYZVSbf3ru
- 도메인 예외 정책 절의 하위 절 4개(예외 이름·생성 패턴·메시지 톤·에러 코드, 약 50줄)는 예외 클래스를 만들거나 message·code 를 만질 때만 필요한 규약이다. .claude/rules/domain-exception.md 로 옮겨 *Exception.kt·*ErrorCode.kt·GlobalExceptionHandler.kt·ErrorCategory.kt·BaseException.kt·HttpMappable.kt 를 다룰 때 자동 로드되게 했다(본코드에 *Exception.kt 20개, *ErrorCode.kt 18개)
- 판단 기준("멀쩡한 클라이언트가 닿을 수 있나")과 표·규칙·검증 배치·한 줄 외울 것은 CLAUDE.md 에 남겼다. 어떤 코드를 쓰든 필요한 판단이라서다. 파일을 열지 않고 새 예외 클래스를 만드는 경로를 위해 불변식 세 가지(private 생성자 + companion 팩토리, ErrorCode enum 참조, 고정 사용자 문구)를 한 문단 스텁으로 남겼다
- openapi-controller 규칙이 "메시지 톤" 절을 CLAUDE.md 경로로 가리키던 참조를 새 규칙 파일로 옮겼다. 옮긴 본문 안의 "## 로깅" 참조는 CLAUDE.md 소속임을 명시했다
- CLAUDE.md 239줄에서 190줄대. 공식 권장(200줄 이하) 안으로 들어간다
Claude-Session: https://claude.ai/code/session_01Mg69sPkH9gHFqYZVSbf3ru
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
핵심 (이 절만 읽어도 된다)
paths규칙 3개로 분리했고, worktree 절 4개를 정책 3불릿으로 압축했으며, core 에 없는 Gemini 클래스를 예로 든 문장 3곳을 현행 클래스로 바꿨다. 코드 변경 없음, 커밋 3개.*Exception.kt·*ErrorCode.kt·핸들러 파일을 다룰 때만 로드되고, 파일을 열지 않는 경로를 위해 CLAUDE.md 의 한 문단 스텁이 불변식을 유지한다.## 별도 작업은 worktree 로 분리절의 압축 문장. 특히 "진입 여부는 분리를 묻는 그 질문에서 함께 확인하고, 묻지 않은 자동 진입은 하지 않는다" 가 뜻한 정책과 같은지.paths를 실제 파일에 매칭(@Entity22개·SSR 컨트롤러 전수), 예시 클래스와 502 매핑 실존, 참조 무결성을 확인했고 발견 5건(끊어진 참조 1, paths 사각 2, 소실 근거 2)을 반영했다. 도메인 예외 분리는 그 뒤 같은 방식(무손실 이동, 참조 갱신, 대상 파일 실존 20+18개)으로 더했다. CI 통과.Situation
GeminiExtractionResult·GeminiApiException)를 예시로 든 문장이 남아 있었다. 모델은 예시를 그대로 따르므로 낡은 예시는 존재하지 않는 코드로 유도한다.Task
paths규칙으로 옮겨 상주 분량을 200줄 아래로 줄이되, 파일을 열지 않는 경로에서도 불변식은 지켜지게 한다.Action
/issue·/session-close스킬이 담당한다. 이 repo 고유 정책(baseorigin/dev, 진입 여부 확인, 스택 금지, 이벤트 기반 정리)만 남긴다.claude/rules/web-request-boundary.md로 이동.claude/rules/db-schema.md로 이동.claude/rules/domain-exception.md로 이동@Transactional이 11개 패키지에 흩어져 있어 paths 글롭으로 정확히 잡을 수 없다paths규칙은 해당 파일을 읽을 때 붙으므로, 새 파일을 곧장 생성하는 경로에서는 스텁이 불변식(FK·연관관계 어노테이션 금지, 웹 경계 결함 목록의 존재, private 생성자 + companion 팩토리 + ErrorCode enum 참조 + 고정 사용자 문구)을 대신 알린다.@Entity22개 중 6개가domain/밖(admin 2·product 3·common 1)이라*Entity.kt와 admin 패키지를 더했고, SSR 컨트롤러 하나(metrics/dashboard/MetricsController.kt)가 admin 밖이라*Controller.kt를 더했다. 도메인 예외 규칙은*Exception.kt20개·*ErrorCode.kt18개와GlobalExceptionHandler·ErrorCategory·BaseException·HttpMappable을 잡는다.GeminiExtractionResult.toProductSnapshot은RemoteExtractionContract.kt의RemoteExtractionResponse로, openapi 규칙의GeminiApiException502 예시는ImageStorageException(RETRYABLE category 가 502 소유, 실제*Api.kt세 곳이 STORAGE 코드로 502 를 문서화)으로 바꿨다.db/migration/CLAUDE.md가 지운 루트 헤딩을 가리키던 참조를 db-schema 규칙으로 옮겼고, worktree 절 압축에서 빠진 두 가지(진입하지 않을 때 statusline·경로·PR 표시가 메인 기준이 된다는 근거와 그때의git -C격리, 진입 여부를 함께 확인하고 자동 진입하지 않는다는 정책)를 되살렸다. openapi 규칙이 "메시지 톤" 절을 CLAUDE.md 경로로 가리키던 참조는 domain-exception 규칙으로 옮겼다.Result
paths없는 상주 규칙은 testing-principles 하나뿐이라 상주 합계는 367줄이다.RemoteExtractionResponse.toProductSnapshot실재,ImageStorageException502 매핑 경로, Gemini 클래스 0건, 스텁의 훅 4가지가 settings.json 과 일치.연관 이슈