Conversation
AGENTS.md를 프로젝트 루트 source of truth로 배치하고, CLAUDE.md를 포인터로 축소. 상세 컨벤션은 .agent-docs/로 분리하여 Progressive Disclosure 적용. PostToolUse Hook으로 Java 파일 수정 시 checkstyle 즉각 피드백 설정. security-reviewer, test-writer 서브에이전트 추가. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Note
|
| Cohort / File(s) | Summary |
|---|---|
Convention Guides .agent-docs/conventions.md, .agent-docs/test-conventions.md |
도메인 개발, 엔티티, 저장소, 서비스, 유스케이스, 표현 계층, DTO, 성능 최적화, 도메인 이벤트, 코딩 컨벤션과 테스트 구조(Base 테스트 클래스, Fixture, BDD 패턴, 트랜잭션 관리)에 대한 상세 가이드 추가. |
Agent Documentation .claude/agents/security-reviewer.md, .claude/agents/test-writer.md |
Spring Security 검수 체크리스트와 SQL 주입, 인증/인가, 민감 정보 로깅 등을 다루는 Security Reviewer 에이전트와 테스트 작성 규칙 및 워크플로우를 정의하는 Test Writer 에이전트 추가. |
Core Documentation & Configuration .claude/CLAUDE.md, .claude/settings.json, AGENTS.md |
CLAUDE.md를 최소화하고 AGENTS.md 프로젝트 개요 추가, settings.json에서 Gradle checkstyle PostToolUse 훅 설정. |
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~12 minutes
Poem
🐰 문서의 정원을 가꾸며,
규칙의 씨앗을 심고,
컨벤션의 햇빛이 자라나,
일관된 코드의 열매 맺고,
개발자들의 길을 밝히네! ✨
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
| Title check | ✅ Passed | PR 제목은 AI 에이전트 하네스 구축이라는 변경사항의 핵심을 명확하게 요약하고 있으며, chore 태입은 문서 및 설정 추가에 적절합니다. |
| Description check | ✅ Passed | PR 설명이 지정된 템플릿과 다른 형식(마크다운 테이블, 상세한 아키텍처 설명)으로 작성되었지만, 내용은 매우 상세하고 변경사항을 충분히 설명합니다. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
- 📝 Generate docstrings (stacked PR)
- 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
- Commit unit tests in branch
chore/agent-harness-setup
📝 Coding Plan
- Generate coding plan for human review comments
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 @coderabbitai help to get the list of available commands and usage tips.
📝 Jacoco Test Coverage
|
🧪 Test Results412 tests 408 ✅ 24s ⏱️ Results for commit 97b29eb. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.agent-docs/conventions.md (1)
7-31: 코드 블록에 언어 식별자를 추가하세요.정적 분석 도구(markdownlint)에서 경고가 발생했습니다. 디렉토리 구조를 나타내는 코드 블록에 언어 식별자가 없습니다.
text또는plaintext를 추가하면 됩니다.📝 제안된 수정
-``` +```text domain/{도메인명}/ ├── common/ # 도메인 내 공통 유틸리티🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.agent-docs/conventions.md around lines 7 - 31, The markdown code block showing the directory tree (starting with "domain/{도메인명}/") lacks a language identifier causing markdownlint warnings; fix it by adding a language tag (e.g., `text` or `plaintext`) immediately after the opening triple backticks (change ``` to ```text) in the code block in .agent-docs/conventions.md so the block is treated as plain text by linters.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.agent-docs/test-conventions.md:
- Around line 249-265: 설명 문구가 잘못되어 있어 `UseCaseTest`/`ServiceTest` 베이스 클래스에
`@Transactional`이 없어도 "테스트별로 트랜잭션이 롤백된다"라고 되어 있는데, 이 부분을 수정해서 기본 동작을 "베이스 클래스에
`@Transactional`이 없으므로 개별 테스트에 `@Transactional`을 선언해야 롤백이 적용된다"로 바꾸고,
`@Transactional(propagation = Propagation.NEVER)` 예제 설명은 "롤백이 아닌 실제 DB 커밋 상태를
검증하려면 테스트에 명시적으로 `@Transactional`을 사용하지 않거나 `Propagation.NEVER`를 선언"하는 식으로 명확히
바꿔 `UseCaseTest`/`ServiceTest`와 `@Transactional`/`Propagation.NEVER` 기호를 언급해 문서를
업데이트하세요.
---
Nitpick comments:
In @.agent-docs/conventions.md:
- Around line 7-31: The markdown code block showing the directory tree (starting
with "domain/{도메인명}/") lacks a language identifier causing markdownlint
warnings; fix it by adding a language tag (e.g., `text` or `plaintext`)
immediately after the opening triple backticks (change ``` to ```text) in the
code block in .agent-docs/conventions.md so the block is treated as plain text
by linters.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 1f71454d-7816-4628-9320-e3d604cd4bf9
📒 Files selected for processing (7)
.agent-docs/conventions.md.agent-docs/test-conventions.md.claude/CLAUDE.md.claude/agents/security-reviewer.md.claude/agents/test-writer.md.claude/settings.jsonAGENTS.md
| ## 트랜잭션 관리 | ||
|
|
||
| ### 기본 동작 | ||
|
|
||
| `UseCaseTest`/`ServiceTest` 상속 시 테스트별로 트랜잭션이 롤백됩니다. | ||
|
|
||
| ### `Propagation.NEVER` — 실제 DB 상태 검증 | ||
|
|
||
| 트랜잭션 롤백 없이 실제 커밋된 DB 상태를 확인해야 할 때 사용: | ||
|
|
||
| ```java | ||
| @Test | ||
| @Transactional(propagation = Propagation.NEVER) | ||
| void 기존_기록이_존재하는_경우에_완료_상태_변경이_성공한다() { | ||
| // 실제 DB 커밋 후 상태 검증 | ||
| } | ||
| ``` |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Verify `@Transactional` annotation in base test classes
echo "=== Checking UseCaseTest for `@Transactional` ==="
rg -n "@Transactional" src/test/java/im/toduck/UseCaseTest.java || echo "No `@Transactional` found"
echo ""
echo "=== Checking ServiceTest for `@Transactional` ==="
rg -n "@Transactional" src/test/java/im/toduck/ServiceTest.java || echo "No `@Transactional` found"
echo ""
echo "=== Full class annotations in UseCaseTest ==="
head -30 src/test/java/im/toduck/UseCaseTest.java
echo ""
echo "=== Full class annotations in ServiceTest ==="
head -35 src/test/java/im/toduck/ServiceTest.javaRepository: toduck-App/toduck-backend
Length of output: 2761
기본 트랜잭션 롤백 동작 설명을 수정하세요.
UseCaseTest/ServiceTest 베이스 클래스에 @Transactional 어노테이션이 없어서 "테스트별로 트랜잭션이 롤백된다"는 설명이 실제 동작과 맞지 않습니다. 개별 테스트에서 명시적으로 @Transactional을 선언해야 롤백이 적용됩니다.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.agent-docs/test-conventions.md around lines 249 - 265, 설명 문구가 잘못되어 있어
`UseCaseTest`/`ServiceTest` 베이스 클래스에 `@Transactional`이 없어도 "테스트별로 트랜잭션이 롤백된다"라고
되어 있는데, 이 부분을 수정해서 기본 동작을 "베이스 클래스에 `@Transactional`이 없으므로 개별 테스트에
`@Transactional`을 선언해야 롤백이 적용된다"로 바꾸고, `@Transactional(propagation =
Propagation.NEVER)` 예제 설명은 "롤백이 아닌 실제 DB 커밋 상태를 검증하려면 테스트에 명시적으로
`@Transactional`을 사용하지 않거나 `Propagation.NEVER`를 선언"하는 식으로 명확히 바꿔
`UseCaseTest`/`ServiceTest`와 `@Transactional`/`Propagation.NEVER` 기호를 언급해 문서를
업데이트하세요.
✨ 작업 내용
1️⃣ AGENTS.md — 도구 무관 Source of Truth (신규)
AGENTS.md(~50줄) 배치2️⃣ CLAUDE.md 포인터 축소 (변경)
.agent-docs/에서 참조 (Progressive Disclosure)3️⃣ .agent-docs/ — Progressive Disclosure 문서 분리 (신규)
.agent-docs/conventions.md: 기존 CLAUDE.md의 전체 개발 컨벤션 이동final파라미터,@TransactionalEventListener, 이벤트 클래스occurredAt제거 등).agent-docs/test-conventions.md: 실제 테스트 코드에서 패턴 추출하여 신규 작성UseCaseTest/ServiceTest/RepositoryTest차이점)CountDownLatch+ExecutorService)Propagation.NEVER,TransactionTemplate)TestFixtureBuilder,RoutineWithAuditInfo)assertSoftly,assertThatCode, Stream 기반 검증)4️⃣ PostToolUse Hook — 즉각 피드백 (신규)
.claude/settings.json에 PostToolUse Hook 정의checkstyleMain자동 실행 (~5초)5️⃣ 서브에이전트 — 전문화된 역할 분리 (신규)
.claude/agents/security-reviewer.md: Spring 특화 보안 리뷰 체크리스트 (SQL Injection,@PreAuthorize누락, IDOR, Mass Assignment, 민감 정보 로깅, 소프트 삭제 누수).claude/agents/test-writer.md: 프로젝트 테스트 컨벤션 준수 테스트 코드 작성 전용 에이전트기존 하네스 요소와의 관계
이번 추가 요소는 기존에 이미 구축된 하네스들과 상호보완적으로 동작합니다:
pre-commit(기존)git commitcommit-msg(기존)git commit./gradlew build./gradlew build./gradlew test✅ 리뷰 요구사항(선택)
checkstyleMain실행이 개발 흐름에 부담이 되지 않는지 확인 부탁드립니다 (~5초 소요).agent-docs/conventions.md에서 routine 도메인 대비 수정한 3건(Builder final, TransactionalEventListener, occurredAt)이 적절한지 검토 부탁드립니다