docs(agents)!: leaf 지역 규칙 문서를 같은 폴더 AGENTS.md로 옮긴다

leaf·family 지역 규칙은 지금 src/**/CLAUDE.md에만 있어서 Claude Code
밖의 에이전트는 이 규칙을 정본 이름으로 찾지 못한다. 소유자가
2026-11-07에 루트와 하위 폴더 모두 AGENTS.md를 정본으로 정했다
(design-docs harness/01-harness-design.md 13절 Q1·Q2).

- 28개 파일을 git mv로 같은 폴더 AGENTS.md로 옮기고, 그 자리
  CLAUDE.md에는 `@AGENTS.md` 한 줄만 둔다. 이 세션에서
  src/domain-core 파일을 열자 CLAUDE.md의 가져오기가 펼쳐져
  AGENTS.md 본문이 함께 읽히는 것을 확인했다. 그래서 Claude Code는
  지금처럼 그 폴더를 만질 때 규칙을 읽는다.
- 버린 대안: 심볼릭 링크(Edit 도구가 링크를 통해 쓰지 않는다),
  CLAUDE.md 그대로 두기(다른 에이전트가 못 찾는다).
- 살아 있는 문서와 테스트 코드의 leaf 규칙 경로를 새 이름으로 바꿨다.
  기록 문서(evidence, upgrade, design, history, reviews, adr)는 쓴
  때의 경로를 그대로 둔다.
- link-check workflow(lychee)는 src/**/CLAUDE.md만 본다. 내용이
  AGENTS.md로 가면 상대 링크가 검사 밖으로 나가므로, PR마다 도는
  check-docs.py에 살아 있는 문서 전체의 상대 링크 검사를 더했다.
  workflow는 CI 재편 몫이라 고치지 않았다.
- check-work-docs.py의 이력 ID 검사도 src/**/AGENTS.md를 본다.

위험: git은 이 커밋을 "CLAUDE.md 수정 + AGENTS.md 추가"로 본다(같은
이름의 새 파일이 생겨 이름 바꾸기로 잡히지 않는다). 옛 이력은
`git log -- <폴더>/CLAUDE.md`로 본다. 코드 주석의 "CLAUDE.md"는
가져오기를 거쳐 같은 문서에 닿으므로 운영 코드는 고치지 않았다.

검증: python3 scripts/check-docs.py, python3 scripts/check-work-docs.py,
python3 -m unittest discover -s scripts/tests 모두 rc=0. 링크 검사
시험은 검사 조건을 끈 사본에서 7건 중 3건이 실패했다.

BREAKING CHANGE: 파생 서비스의 leaf 규칙 문서 이름이 AGENTS.md로
바뀐다. 동기화 뒤 각 leaf의 CLAUDE.md는 `@AGENTS.md` 한 줄이다.
This commit is contained in:
DongHyeonka
2026-11-07 21:58:12 +09:00
parent b3f63be655
commit 08f932123a
102 changed files with 3107 additions and 2986 deletions
+4 -3
View File
@@ -9,7 +9,7 @@ to finish the job from those alone. Two things break that, and both are mechanic
who does not know that review. History belongs in `docs/work/evidence.md`, and the two reference
files that are indexes of history (`reference/decisions.md`, `reference/defect-patterns.md`).
The same rule covers the other files a new session reads first: the rule book `AGENTS.md` and
every `src/**/CLAUDE.md` (owner decision 2026-11-07). Module READMEs, design documents and
every `src/**/AGENTS.md` (owner decision 2026-11-07). Module READMEs, design documents and
`docs/reviews/**` keep their IDs, because a reader can follow them from inside the repository.
2. Length. Each entry file has a line limit, and the entry path (map + README + one playbook) has a
total limit, so a session reads the whole path instead of skimming it.
@@ -196,11 +196,12 @@ def check_skeleton(errors: list[str]) -> None:
def module_guides() -> list[Path]:
"""Every src/**/CLAUDE.md, the local rule book of a leaf or a family, outside build output."""
"""Every src/**/AGENTS.md, the local rule book of a leaf or a family, outside build output.
The src/**/CLAUDE.md beside it is one line, `@AGENTS.md`, so Claude Code reads the same book."""
skipped = {"build", ".gradle", "node_modules"}
return sorted(
path
for path in (REPO_ROOT / "src").rglob("CLAUDE.md")
for path in (REPO_ROOT / "src").rglob("AGENTS.md")
if not skipped.intersection(path.relative_to(REPO_ROOT).parts)
)