Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

### Added

- `TEST_RULES.md` 생성. 렌더러와 프로필별 테스트 규칙 데이터는 이미 있었지만 출력 목록에
연결되어 있지 않아 실제로는 생성되지 않았습니다. AGENTS.md 라우팅 표에도 추가했습니다.
- 루트 `AGENTS.md` 진입점 생성. 코딩 에이전트가 자동으로 읽는 상위 지시문 경로를 확보하기 위한
변경입니다. `.codex/` 아래 문서는 자동 로드 대상이 아니므로 기존에는 `codex_start_prompt.txt`를
사용자가 직접 붙여넣지 않으면 생성된 규칙이 적용되지 않았습니다. 상세 규칙을 복사하지 않고
Expand All @@ -21,8 +23,16 @@
스모크 실행, 별도 job에서 `python -m build` 및 `twine check`를 수행합니다.
- 이 CHANGELOG.

### Changed

- 프레임워크별 규칙을 `GLOBAL_RULES.md` 한 곳에서만 정의합니다. 기존에는 동일한 문장이
`GLOBAL_RULES.md`, `CODE_STYLE_RULES.md`, `SERVICE_LAYER_RULES.md`에 그대로 세 번
들어갔습니다. 두 문서에는 참조 문구를 남깁니다.

### Removed

- 호출되지 않던 렌더러 메서드 5종 제거(`_render_framework_rules`, `_render_project_overview`,
`_render_feature_spec`, `_render_api_spec`, `_render_db_spec`). 총 208줄.
- 저장소에 커밋되어 있던 `release_0_3_0/` 빌드 산출물(`.whl`, `.tar.gz`). 배포 아티팩트는
버전 관리 대상이 아니며 GitHub Releases 또는 PyPI에서 받을 수 있습니다.

Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ AGENTS.md
│ ├── DOCUMENT_RULE.md
│ ├── DOMAIN_MODEL_RULES.md
│ ├── EXTERNAL_INTEGRATION_RULES.md
│ └── SERVICE_LAYER_RULES.md
│ ├── SERVICE_LAYER_RULES.md
│ └── TEST_RULES.md
├── ref_docs/
└── codex_start_prompt.txt

Expand All @@ -198,6 +199,8 @@ docs/

기존 `AGENTS.md`가 있으면 덮어쓰지 않으므로 직접 수정한 내용은 재생성 후에도 유지됩니다. 생성을 원하지 않으면 `--no-agents-md`를 사용하세요.

프레임워크별 규칙은 `GLOBAL_RULES.md`에만 두고 다른 문서에서는 참조합니다. 같은 문장을 여러 문서에 반복해도 준수율이 오르지는 않고 컨텍스트 예산만 소모하기 때문입니다.

`ai_rule_developer`는 코딩할 때 지켜야 하는 규칙입니다. `ref_docs`는 외부 아키텍처 문서, PRD, 리서치, 벤더 문서처럼 사용자가 임의로 추가하는 참고자료 공간이므로 디렉토리만 생성합니다. 프로젝트 자체 명세는 루트 `docs/` 아래에 생성되며, 기존 `docs/` 파일이 있으면 덮어쓰지 않습니다. `codex_start_prompt.txt`는 Codex가 작업 시작 전에 `.codex` 문서를 먼저 읽고 규칙 우선순위를 적용하도록 지시합니다.

## 지원 프레임워크 프로필
Expand Down
240 changes: 20 additions & 220 deletions codex_builder/template_renderer.py

Large diffs are not rendered by default.

32 changes: 20 additions & 12 deletions tests/snapshots/default_ko.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,8 @@ docs/database
- 서로 다른 계층을 섞은 파일
- 저장소 formatter와 충돌하는 포맷팅

[FastAPI 스타일 메모]
- APIRouter는 라우팅과 의존성 연결만 담당한다.
- Service가 FastAPI Response, Depends, Request에 직접 의존하지 않게 한다.
- Repository는 SQLAlchemy, SQLModel 등 실제 저장소 API를 감싸는 경계로 둔다.
- 예외는 도메인/서비스 예외로 먼저 표현하고 controller에서 HTTP 상태로 변환한다.
- 배경 작업, 외부 호출, 긴 작업은 service 하위의 명시적 adapter/client로 분리한다.
[프레임워크 규칙]
- 프레임워크별 규칙은 `GLOBAL_RULES.md`에 있다. 이 문서와 함께 적용한다.

========================================================================
# file: .codex/ai_rule_developer/DOCUMENT_RULE.md
Expand Down Expand Up @@ -348,12 +344,23 @@ Service/Application 계층은 비즈니스 로직의 중심이다.
- 외부 API 호출을 무관한 비즈니스 로직에 직접 섞기
- 복잡한 분기 로직을 하나의 메서드에 몰아넣기

[FastAPI Service Notes]
- APIRouter는 라우팅과 의존성 연결만 담당한다.
- Service가 FastAPI Response, Depends, Request에 직접 의존하지 않게 한다.
- Repository는 SQLAlchemy, SQLModel 등 실제 저장소 API를 감싸는 경계로 둔다.
- 예외는 도메인/서비스 예외로 먼저 표현하고 controller에서 HTTP 상태로 변환한다.
- 배경 작업, 외부 호출, 긴 작업은 service 하위의 명시적 adapter/client로 분리한다.
[프레임워크 규칙]
- 프레임워크별 규칙은 `GLOBAL_RULES.md`에 있다. 이 문서와 함께 적용한다.

========================================================================
# file: .codex/ai_rule_developer/TEST_RULES.md
========================================================================
# 테스트 규칙 - snapshot-default

## 기본 규칙
- 동작이 바뀌면 테스트를 추가하거나 수정한다.
- 성공 케이스, validation 실패, authorization 실패, 중요한 오류 경로를 검증한다.
- 구현 세부사항보다 공개 계약과 사용자 관찰 가능 동작을 기준으로 테스트한다.

## FastAPI
- Service 테스트는 repository/client를 대체 객체로 격리한다.
- API 테스트는 TestClient 또는 httpx 기반으로 요청/응답 계약을 검증한다.
- Repository 테스트는 DB 스키마와 쿼리 동작을 별도로 검증한다.

========================================================================
# file: .codex/codex_start_prompt.txt
Expand Down Expand Up @@ -431,6 +438,7 @@ Service/Application 계층은 비즈니스 로직의 중심이다.
| Entity, schema, 도메인 상태 | `.codex/ai_rule_developer/DOMAIN_MODEL_RULES.md`, `docs/database/schema.md` |
| 유스케이스와 비즈니스 로직 | `.codex/ai_rule_developer/SERVICE_LAYER_RULES.md` |
| 외부 연동 | `.codex/ai_rule_developer/EXTERNAL_INTEGRATION_RULES.md` |
| 테스트 | `.codex/ai_rule_developer/TEST_RULES.md` |
| 문서 갱신 | `.codex/ai_rule_developer/DOCUMENT_RULE.md` |

## 우선순위
Expand Down
35 changes: 23 additions & 12 deletions tests/snapshots/fastapi_full_en.txt
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,8 @@ Follow the existing formatter and linter first. When the formatter does not deci
- Files that mix unrelated layers.
- Formatting that fights the repository's configured formatter.

[FastAPI Style Notes]
- APIRouter should only handle routing and dependency wiring.
- Services should not directly depend on FastAPI Response, Depends, or Request.
- Repositories wrap storage APIs such as SQLAlchemy or SQLModel.
- Represent errors as domain/service exceptions first, then map them to HTTP statuses in controllers.
- Move background jobs, external calls, and long-running work into explicit adapters/clients below services.
[Framework Rules]
- Framework-specific rules live in `GLOBAL_RULES.md`. Apply them together with this document.

========================================================================
# file: .codex/ai_rule_developer/DOCUMENT_RULE.md
Expand Down Expand Up @@ -386,12 +382,26 @@ The service/application layer is the center of business logic.
- Mixing external API calls directly into unrelated business logic.
- Cramming complex branching into one method.

[FastAPI Service Notes]
- APIRouter should only handle routing and dependency wiring.
- Services should not directly depend on FastAPI Response, Depends, or Request.
- Repositories wrap storage APIs such as SQLAlchemy or SQLModel.
- Represent errors as domain/service exceptions first, then map them to HTTP statuses in controllers.
- Move background jobs, external calls, and long-running work into explicit adapters/clients below services.
[Framework Rules]
- Framework-specific rules live in `GLOBAL_RULES.md`. Apply them together with this document.

========================================================================
# file: .codex/ai_rule_developer/TEST_RULES.md
========================================================================
# Test Rules - snapshot-full-en

## Base Rules
- Add or update tests when behavior changes.
- Cover success cases, validation failures, authorization failures, and important error paths.
- Keep tests aligned with public contracts rather than implementation trivia.

## FastAPI
- Isolate service tests with repository/client doubles.
- Use TestClient or httpx-based API tests to verify request/response contracts.
- Verify repository tests against database schema and query behavior separately.

## Database Tests
- Verify repository behavior and migration/schema assumptions for `postgres`.

========================================================================
# file: .codex/codex_start_prompt.txt
Expand Down Expand Up @@ -468,6 +478,7 @@ Load only what the current task needs:
| Entity, schema, domain state | `.codex/ai_rule_developer/DOMAIN_MODEL_RULES.md`, `docs/database/schema.md` |
| Use-case and business logic | `.codex/ai_rule_developer/SERVICE_LAYER_RULES.md` |
| Third-party or upstream integration | `.codex/ai_rule_developer/EXTERNAL_INTEGRATION_RULES.md` |
| Tests | `.codex/ai_rule_developer/TEST_RULES.md` |
| Documentation updates | `.codex/ai_rule_developer/DOCUMENT_RULE.md` |

## Precedence
Expand Down
50 changes: 27 additions & 23 deletions tests/snapshots/fastapi_react_full_ko.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,18 +178,8 @@ docs/database
- 서로 다른 계층을 섞은 파일
- 저장소 formatter와 충돌하는 포맷팅

[FastAPI 스타일 메모]
- APIRouter는 라우팅과 의존성 연결만 담당한다.
- Service가 FastAPI Response, Depends, Request에 직접 의존하지 않게 한다.
- Repository는 SQLAlchemy, SQLModel 등 실제 저장소 API를 감싸는 경계로 둔다.
- 예외는 도메인/서비스 예외로 먼저 표현하고 controller에서 HTTP 상태로 변환한다.
- 배경 작업, 외부 호출, 긴 작업은 service 하위의 명시적 adapter/client로 분리한다.

[React 스타일 메모]
- 컴포넌트 안에서 fetch/axios 호출을 직접 수행하지 않는다.
- 복잡한 상태 전이는 hook 또는 store action으로 분리한다.
- 공통 UI 컴포넌트와 기능 전용 컴포넌트를 분리한다.
- API 타입과 UI view model의 변환 위치를 명확히 둔다.
[프레임워크 규칙]
- 프레임워크별 규칙은 `GLOBAL_RULES.md`에 있다. 이 문서와 함께 적용한다.

========================================================================
# file: .codex/ai_rule_developer/DOCUMENT_RULE.md
Expand Down Expand Up @@ -427,18 +417,31 @@ Service/Application 계층은 비즈니스 로직의 중심이다.
- 외부 API 호출을 무관한 비즈니스 로직에 직접 섞기
- 복잡한 분기 로직을 하나의 메서드에 몰아넣기

[FastAPI Service Notes]
- APIRouter는 라우팅과 의존성 연결만 담당한다.
- Service가 FastAPI Response, Depends, Request에 직접 의존하지 않게 한다.
- Repository는 SQLAlchemy, SQLModel 등 실제 저장소 API를 감싸는 경계로 둔다.
- 예외는 도메인/서비스 예외로 먼저 표현하고 controller에서 HTTP 상태로 변환한다.
- 배경 작업, 외부 호출, 긴 작업은 service 하위의 명시적 adapter/client로 분리한다.
[프레임워크 규칙]
- 프레임워크별 규칙은 `GLOBAL_RULES.md`에 있다. 이 문서와 함께 적용한다.

[React Service Notes]
- 컴포넌트 안에서 fetch/axios 호출을 직접 수행하지 않는다.
- 복잡한 상태 전이는 hook 또는 store action으로 분리한다.
- 공통 UI 컴포넌트와 기능 전용 컴포넌트를 분리한다.
- API 타입과 UI view model의 변환 위치를 명확히 둔다.
========================================================================
# file: .codex/ai_rule_developer/TEST_RULES.md
========================================================================
# 테스트 규칙 - snapshot-full

## 기본 규칙
- 동작이 바뀌면 테스트를 추가하거나 수정한다.
- 성공 케이스, validation 실패, authorization 실패, 중요한 오류 경로를 검증한다.
- 구현 세부사항보다 공개 계약과 사용자 관찰 가능 동작을 기준으로 테스트한다.

## FastAPI
- Service 테스트는 repository/client를 대체 객체로 격리한다.
- API 테스트는 TestClient 또는 httpx 기반으로 요청/응답 계약을 검증한다.
- Repository 테스트는 DB 스키마와 쿼리 동작을 별도로 검증한다.

## React
- 컴포넌트 테스트는 사용자 상호작용과 표시 결과를 검증한다.
- hook 테스트는 상태 전이와 비동기 흐름을 검증한다.
- service 테스트는 API client 경계와 오류 변환을 검증한다.

## DB 테스트
- `mysql` repository 동작과 migration/schema 가정을 검증한다.

========================================================================
# file: .codex/codex_start_prompt.txt
Expand Down Expand Up @@ -518,6 +521,7 @@ Service/Application 계층은 비즈니스 로직의 중심이다.
| Entity, schema, 도메인 상태 | `.codex/ai_rule_developer/DOMAIN_MODEL_RULES.md`, `docs/database/schema.md` |
| 유스케이스와 비즈니스 로직 | `.codex/ai_rule_developer/SERVICE_LAYER_RULES.md` |
| 외부 연동 | `.codex/ai_rule_developer/EXTERNAL_INTEGRATION_RULES.md` |
| 테스트 | `.codex/ai_rule_developer/TEST_RULES.md` |
| 문서 갱신 | `.codex/ai_rule_developer/DOCUMENT_RULE.md` |

## 우선순위
Expand Down
30 changes: 20 additions & 10 deletions tests/snapshots/nextjs_light_ko.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,8 @@ docs/database
- 서로 다른 계층을 섞은 파일
- 저장소 formatter와 충돌하는 포맷팅

[Next.js 스타일 메모]
- 'use client'는 필요한 파일에만 선언한다.
- 서버 전용 비밀값과 브라우저 공개 환경 변수를 구분한다.
- 데이터 변경은 server action 또는 route handler로 경계를 명확히 한다.
- 캐시, revalidate, dynamic 설정은 데이터 신선도 요구사항과 함께 문서화한다.
[프레임워크 규칙]
- 프레임워크별 규칙은 `GLOBAL_RULES.md`에 있다. 이 문서와 함께 적용한다.

========================================================================
# file: .codex/ai_rule_developer/DOCUMENT_RULE.md
Expand Down Expand Up @@ -344,11 +341,23 @@ Service/Application 계층은 비즈니스 로직의 중심이다.
- 외부 API 호출을 무관한 비즈니스 로직에 직접 섞기
- 복잡한 분기 로직을 하나의 메서드에 몰아넣기

[Next.js Service Notes]
- 'use client'는 필요한 파일에만 선언한다.
- 서버 전용 비밀값과 브라우저 공개 환경 변수를 구분한다.
- 데이터 변경은 server action 또는 route handler로 경계를 명확히 한다.
- 캐시, revalidate, dynamic 설정은 데이터 신선도 요구사항과 함께 문서화한다.
[프레임워크 규칙]
- 프레임워크별 규칙은 `GLOBAL_RULES.md`에 있다. 이 문서와 함께 적용한다.

========================================================================
# file: .codex/ai_rule_developer/TEST_RULES.md
========================================================================
# 테스트 규칙 - snapshot-next

## 기본 규칙
- 동작이 바뀌면 테스트를 추가하거나 수정한다.
- 성공 케이스, validation 실패, authorization 실패, 중요한 오류 경로를 검증한다.
- 구현 세부사항보다 공개 계약과 사용자 관찰 가능 동작을 기준으로 테스트한다.

## Next.js
- 서버 로직은 service 단위 테스트로 우선 검증한다.
- 클라이언트 컴포넌트는 사용자 상호작용 중심으로 검증한다.
- 라우팅과 인증 흐름은 통합 테스트 또는 E2E 테스트로 검증한다.

========================================================================
# file: .codex/codex_start_prompt.txt
Expand Down Expand Up @@ -426,6 +435,7 @@ Service/Application 계층은 비즈니스 로직의 중심이다.
| Entity, schema, 도메인 상태 | `.codex/ai_rule_developer/DOMAIN_MODEL_RULES.md`, `docs/database/schema.md` |
| 유스케이스와 비즈니스 로직 | `.codex/ai_rule_developer/SERVICE_LAYER_RULES.md` |
| 외부 연동 | `.codex/ai_rule_developer/EXTERNAL_INTEGRATION_RULES.md` |
| 테스트 | `.codex/ai_rule_developer/TEST_RULES.md` |
| 문서 갱신 | `.codex/ai_rule_developer/DOCUMENT_RULE.md` |

## 우선순위
Expand Down
32 changes: 20 additions & 12 deletions tests/snapshots/python_standard_en.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,8 @@ Follow the existing formatter and linter first. When the formatter does not deci
- Files that mix unrelated layers.
- Formatting that fights the repository's configured formatter.

[Python Style Notes]
- Avoid import-time side effects such as file creation, network calls, or process execution.
- Runnable modules should expose a `main()` entrypoint and keep direct execution under `if __name__ == "__main__"`.
- Do not add dependencies when the standard library is enough for the problem.
- Keep meaningful type hints on public functions and classes, and represent input/output models with explicit data structures.
- Separate pure computation from I/O so logic stays testable and reusable.
[Framework Rules]
- Framework-specific rules live in `GLOBAL_RULES.md`. Apply them together with this document.

========================================================================
# file: .codex/ai_rule_developer/DOCUMENT_RULE.md
Expand Down Expand Up @@ -347,12 +343,23 @@ The service/application layer is the center of business logic.
- Mixing external API calls directly into unrelated business logic.
- Cramming complex branching into one method.

[Python Service Notes]
- Avoid import-time side effects such as file creation, network calls, or process execution.
- Runnable modules should expose a `main()` entrypoint and keep direct execution under `if __name__ == "__main__"`.
- Do not add dependencies when the standard library is enough for the problem.
- Keep meaningful type hints on public functions and classes, and represent input/output models with explicit data structures.
- Separate pure computation from I/O so logic stays testable and reusable.
[Framework Rules]
- Framework-specific rules live in `GLOBAL_RULES.md`. Apply them together with this document.

========================================================================
# file: .codex/ai_rule_developer/TEST_RULES.md
========================================================================
# Test Rules - snapshot-python

## Base Rules
- Add or update tests when behavior changes.
- Cover success cases, validation failures, authorization failures, and important error paths.
- Keep tests aligned with public contracts rather than implementation trivia.

## Python
- Separate tests for pure logic from tests that cover filesystem, network, or environment I/O.
- Use `tmp_path`, monkeypatching, and test doubles to isolate filesystem and external dependencies.
- Lock down CLI arguments, configuration parsing, and error paths with regression tests.

========================================================================
# file: .codex/codex_start_prompt.txt
Expand Down Expand Up @@ -427,6 +434,7 @@ Load only what the current task needs:
| Entity, schema, domain state | `.codex/ai_rule_developer/DOMAIN_MODEL_RULES.md`, `docs/database/schema.md` |
| Use-case and business logic | `.codex/ai_rule_developer/SERVICE_LAYER_RULES.md` |
| Third-party or upstream integration | `.codex/ai_rule_developer/EXTERNAL_INTEGRATION_RULES.md` |
| Tests | `.codex/ai_rule_developer/TEST_RULES.md` |
| Documentation updates | `.codex/ai_rule_developer/DOCUMENT_RULE.md` |

## Precedence
Expand Down
Loading
Loading