sonamu 0.8.24 → 0.8.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/api/__tests__/config.test.js +189 -0
  2. package/dist/api/config.d.ts.map +1 -1
  3. package/dist/api/config.js +7 -2
  4. package/dist/api/sonamu.d.ts.map +1 -1
  5. package/dist/api/sonamu.js +14 -10
  6. package/dist/auth/index.d.ts +1 -0
  7. package/dist/auth/index.d.ts.map +1 -1
  8. package/dist/auth/index.js +2 -1
  9. package/dist/auth/knex-adapter.d.ts +23 -0
  10. package/dist/auth/knex-adapter.d.ts.map +1 -0
  11. package/dist/auth/knex-adapter.js +159 -0
  12. package/dist/auth/plugins/wrappers/admin.d.ts +2 -2
  13. package/dist/bin/__tests__/ts-loader-register.test.js +45 -0
  14. package/dist/bin/cli.js +47 -9
  15. package/dist/bin/ts-loader-register.js +3 -29
  16. package/dist/bin/ts-loader-registration.d.ts +2 -0
  17. package/dist/bin/ts-loader-registration.d.ts.map +1 -0
  18. package/dist/bin/ts-loader-registration.js +42 -0
  19. package/package.json +4 -4
  20. package/src/api/__tests__/config.test.ts +225 -0
  21. package/src/api/config.ts +10 -4
  22. package/src/api/sonamu.ts +16 -13
  23. package/src/auth/index.ts +1 -0
  24. package/src/auth/knex-adapter.ts +207 -0
  25. package/src/bin/__tests__/ts-loader-register.test.ts +62 -0
  26. package/src/bin/cli.ts +52 -9
  27. package/src/bin/ts-loader-register.ts +2 -32
  28. package/src/bin/ts-loader-registration.ts +55 -0
  29. package/src/skills/commands/sonamu-skills.md +20 -0
  30. package/src/skills/sonamu/SKILL.md +136 -137
  31. package/src/skills/sonamu/ai-agents.md +69 -69
  32. package/src/skills/sonamu/api.md +147 -147
  33. package/src/skills/sonamu/auth-migration.md +220 -220
  34. package/src/skills/sonamu/auth-plugins.md +83 -83
  35. package/src/skills/sonamu/auth.md +106 -106
  36. package/src/skills/sonamu/cdd.md +65 -200
  37. package/src/skills/sonamu/cone.md +138 -138
  38. package/src/skills/sonamu/config.md +191 -191
  39. package/src/skills/sonamu/create-sonamu.md +66 -66
  40. package/src/skills/sonamu/database.md +158 -158
  41. package/src/skills/sonamu/entity-basic.md +292 -293
  42. package/src/skills/sonamu/entity-relations.md +246 -246
  43. package/src/skills/sonamu/entity-validation-checklist.md +124 -124
  44. package/src/skills/sonamu/fixture-cli.md +231 -231
  45. package/src/skills/sonamu/framework-change.md +37 -37
  46. package/src/skills/sonamu/frontend.md +223 -223
  47. package/src/skills/sonamu/i18n.md +82 -82
  48. package/src/skills/sonamu/migration.md +77 -77
  49. package/src/skills/sonamu/model.md +222 -222
  50. package/src/skills/sonamu/naite.md +86 -86
  51. package/src/skills/sonamu/project-init.md +228 -228
  52. package/src/skills/sonamu/puri.md +122 -122
  53. package/src/skills/sonamu/scaffolding.md +154 -154
  54. package/src/skills/sonamu/skill-contribution.md +124 -124
  55. package/src/skills/sonamu/subset.md +46 -46
  56. package/src/skills/sonamu/tasks.md +82 -82
  57. package/src/skills/sonamu/testing-devrunner.md +147 -147
  58. package/src/skills/sonamu/testing.md +673 -673
  59. package/src/skills/sonamu/upsert.md +79 -79
  60. package/src/skills/sonamu/vector.md +67 -67
  61. package/src/skills/sonamu/workflow.md +0 -317
@@ -1,196 +1,195 @@
1
1
  ---
2
2
  name: sonamu
3
- description: Sonamu TypeScript 풀스택 프레임워크 개발 가이드. Entity, Model, API, 테스트, 프론트엔드 연동. Use when developing with Sonamu framework.
3
+ description: Sonamu TypeScript full-stack framework development guide. Entity, Model, API, testing, and frontend integration. Use when developing with Sonamu framework.
4
4
  ---
5
5
 
6
6
  # Sonamu Framework Skills
7
7
 
8
- Sonamu 프레임워크로 프로젝트를 개발하기 위한 Claude Code skill입니다.
8
+ Claude Code skill for developing projects with the Sonamu framework.
9
9
 
10
- ## CRITICAL: 질문은 하나씩
10
+ ## CRITICAL: Ask one question at a time
11
11
 
12
12
  **MUST ask questions one at a time. NEVER overwhelm users with multiple questions.**
13
13
 
14
14
  ### MUST DO
15
- - 질문 하나사용자 응답 대기다음 질문
16
- - 간결하게 질문
17
- - 선택지가 있으면 명확하게 제시
15
+ - One questionwait for user response next question
16
+ - Keep questions concise
17
+ - Present choices clearly when options are available
18
18
 
19
19
  ### NEVER DO
20
- - 여러 질문을 한꺼번에 나열
21
- - 설명과 함께 질문
22
- - 확인사항 목록을 주루룩 출력
20
+ - List multiple questions at once
21
+ - Ask questions alongside long explanations
22
+ - Output a checklist of confirmation items all at once
23
23
 
24
24
  ---
25
25
 
26
- ## 개발 흐름
26
+ ## Development Flow
27
27
 
28
28
  ```
29
- PHASE 0: 프로젝트 생성 초기 설정 (프로젝트 생성도메인 식별 → auth generate → Users 시퀀스 설정)
30
- PHASE 1: 도메인 Logic 문서화 (도메인별 contract/{domain}/*.contract.md 작성사용자 확인 완료)
31
- PHASE 2: 엔티티 설계 (사용자와 함께 설계 확인)
32
- PHASE 3: 엔티티 생성 마이그레이션 (entity.json + migration + cone + scaffolding)
33
- PHASE 4: 테스트 API 구현 (contract→Claim→AC→implement 반복)
34
- PHASE 5: Fixture 생성 (사용자 승인 LLM으로 생성)
35
- PHASE 6: Frontend 개발 (batch별 진행, 사용자 확인)
29
+ PHASE 0: Project creation and initial setup (create projectidentify domains → auth generate → Users sequence setup)
30
+ PHASE 1: Domain logic documentation (write contract/{domain}/*.contract.md per domain user confirmation)
31
+ PHASE 2: Entity design (design with user confirmation)
32
+ PHASE 3: Entity creation and migration (entity.json + migration + cone + scaffolding)
33
+ PHASE 4: Testing and API implementation (contract Claim AC implement, repeat)
34
+ PHASE 5: Fixture generation (generate with LLM after user approval)
35
+ PHASE 6: Frontend development (proceed in batches with user confirmation)
36
36
  ```
37
37
 
38
- **상세 내용:** `workflow.md` 참조
38
+ **Full details:** see `.claude/workflow/project_init.md`
39
39
 
40
- ### 시작 지점 판단
40
+ ### Starting Point Determination
41
41
 
42
- **사용자의 지시에 따라 적절한 PHASE부터 시작한다.** 무조건 PHASE 0부터 시작하지 않는다.
42
+ **Begin from the PHASE that matches the user's instruction.** Do not always start from PHASE 0.
43
43
 
44
- | 사용자 지시 | 시작 PHASE | 전제 조건 확인 |
45
- |------------|------------|----------------|
46
- | " 프로젝트 만들어줘" | PHASE 0 | — |
47
- | "contract 작성해줘" / "도메인 분석해줘" | PHASE 1 | 도메인 목록 식별 완료 |
48
- | "엔티티 추가해줘" / "엔티티 생성해줘" | PHASE 2 | 프로젝트 존재, dev 서버 실행 중, contract/**/*.contract.md 읽기, PHASE 1 완료 |
49
- | "테스트 작성해줘" / "API 구현해줘" | PHASE 4 | entity.json 존재, migration 완료, scaffolding 완료 |
50
- | "fixture 생성해줘" | PHASE 5 | 테스트 통과, cone.note 존재 확인 |
51
- | "프론트엔드 개발해줘" | PHASE 6 | API 구현 완료, contract/**/*.contract.md 확인 |
44
+ | User instruction | Starting PHASE | Prerequisites to verify |
45
+ |-----------------|----------------|------------------------|
46
+ | "Create a new project" | PHASE 0 | — |
47
+ | "Write contract" / "Analyze domain" | PHASE 1 | Domain list identified |
48
+ | "Add entity" / "Create entity" | PHASE 2 | Project exists, dev server running, read contract/**/*.contract.md, PHASE 1 complete |
49
+ | "Write tests" / "Implement API" | PHASE 4 | entity.json exists, migration complete, scaffolding complete |
50
+ | "Generate fixtures" | PHASE 5 | Tests passing, cone.note exists |
51
+ | "Develop frontend" | PHASE 6 | API implementation complete, contract/**/*.contract.md reviewed |
52
52
 
53
- **중간 진입 시 규칙:**
54
- 1. `contract/**/*.contract.md` `skills/project/architecture.md`가 있으면 반드시 먼저 읽는다
55
- 2. 해당 PHASE의 전제 조건이 충족되었는지 확인한다
56
- 3. 충족되지 않으면 사용자에게 알리고 필요한 단계부터 진행한다
57
- 4. 해당 PHASE 내에서는 `workflow.md`의 넘버링된 Step을 순서대로 진행한다. 어떤 Step도 건너뛰지 않고, 자체 판단으로 병합하지 않는다
53
+ **Mid-entry rules:**
54
+ 1. If `contract/**/*.contract.md` and `skills/project/architecture.md` exist, read them first.
55
+ 2. Verify prerequisites for the target PHASE.
56
+ 3. If prerequisites are not met, inform the user and begin from the required step.
57
+ 4. Within a PHASE, follow the numbered steps in `.claude/workflow/project_init.md` in order. Do not skip any step or merge steps on your own judgment.
58
58
 
59
59
  ---
60
60
 
61
- ## 프로젝트 문서 체계
61
+ ## Project Document System
62
62
 
63
- ### CRITICAL: 작업 시작 필수 확인
63
+ ### CRITICAL: Read these before starting any task
64
64
 
65
- **프로젝트 작업을 시작하기 전에 반드시 다음 문서를 읽으세요.**
65
+ **Before starting any project task, always read the following documents.**
66
66
 
67
67
  ```
68
68
  contract/
69
69
  └── {domain}/
70
- └── {domain}.contract.md # PHASE 1: 도메인 규칙 + 결정 근거 (영구 문서, 코드 변경 시 함께 갱신)
70
+ └── {domain}.contract.md # PHASE 1: domain rules + decision rationale (permanent; update alongside code changes)
71
71
 
72
72
  .claude/skills/project/
73
- └── architecture.md # 엔티티 설계 + 시스템 아키텍처
73
+ └── architecture.md # entity design + system architecture
74
74
 
75
- tmp/claims/ # 진행 Claim YAML (완료 폐기)
75
+ tmp/claims/ # in-progress Claim YAML (discard after completion)
76
76
  ```
77
77
 
78
- **Ground truth 코드다.** `*.contract.md`는 코드 결정의 근거 기록이지 선행 정의서가 아니다. 코드와 `*.contract.md`가 충돌하면 코드를 우선한다.
78
+ **Code is the ground truth.** `*.contract.md` records the rationale behind code decisions it is not a spec that precedes the code. When code and `*.contract.md` conflict, the code takes precedence.
79
79
 
80
- ### 도메인 `*.contract.md`
80
+ ### Domain `*.contract.md`
81
81
 
82
- 도메인 규칙을 응집된 형태로 기술하고, 코드만으로는 파악하기 어려운 결정 근거를 함께 기록한다.
82
+ Documents domain rules in a cohesive form and captures decision rationale that cannot be inferred from code alone.
83
83
 
84
84
  ```markdown
85
- # {도메인} 비즈니스 로직
85
+ # {Domain} Business Logic
86
86
 
87
- ## 규칙
88
- - 환불은 결제 7 이내만 가능 [근거: PG 정책]
89
- - 주문 상태 전환: 대기확인배송완료
87
+ ## Rules
88
+ - Refunds allowed only within 7 days of payment [Rationale: PG provider policy]
89
+ - Order status transitions: pendingconfirmedshippedcompleted
90
90
 
91
- ## 워크플로우
91
+ ## Workflow
92
92
  1. ...
93
93
  ```
94
94
 
95
- **두 가지 개발 경로:**
96
- - **신규**: `*.contract.md` 작성 → Claim → AC(테스트명) → implement (TDD 방식)
97
- - **변경**: 코드 수정 → Claim 등록 → `*.contract.md` 확인/갱신 (변경 근거 기록)
95
+ **Two development paths:**
96
+ - **New**: write `*.contract.md` → Claim → AC (test name) → implement (TDD)
97
+ - **Change**: modify coderegister Claim → verify/update `*.contract.md` (record change rationale)
98
98
 
99
- **갱신 규칙:**
100
- - 코드 변경 영향받는 도메인 규칙을 확인하고 `*.contract.md`도 함께 업데이트
101
- - 변경 이유와 결정 근거를 함께 기록이것이 `*.contract.md`를 살아있게 유지
99
+ **Update rules:**
100
+ - When code changes, check affected domain rules and update `*.contract.md` together
101
+ - Record the reason and decision rationalethis keeps `*.contract.md` alive
102
102
 
103
103
  ### architecture.md
104
104
 
105
- **언제:** 엔티티를 설계하거나 시스템 아키텍처를 논의할
106
- **내용:** Entity 구조 관계 설계, 데이터베이스 스키마, 시스템 컴포넌트 구조
105
+ **When:** designing entities or discussing system architecture
106
+ **Content:** entity structure and relationships, database schema, system component structure
107
107
 
108
- ### Compacting 후에도 안전
108
+ ### Safe after compacting
109
109
 
110
- 문서가 파일로 영속화되어 있어서 대화가 압축(compacting)되어도 프로젝트 맥락이 유지된다.
110
+ Documents are persisted as files, so project context is preserved even when the conversation is compacted.
111
111
 
112
112
  ---
113
113
 
114
- ## Skills 목록
115
-
116
- | Skill | 파일 | 용도 |
117
- |-------|------|------|
118
- | **전체 워크플로우** | `workflow.md` | **엔티티 설계 Frontend 개발 7단계 가이드** |
119
- | **CDD (AC+Claim 기반 개발)** | `cdd.md` | **`*.contract.md`(도메인 규칙), AC(테스트 이름), Claim(작업 지시서) 3종 체계** |
120
- | 프로젝트 생성 | `create-sonamu.md` | create-sonamu CLI 옵션 |
121
- | 프로젝트 초기화 | `project-init.md` | 프로젝트 생성 여부 확인, 대화 흐름 |
122
- | 프로젝트 설정 | `config.md` | .env, sonamu.config.ts 설정 |
123
- | 데이터베이스 | `database.md` | DB 설정, 포트 충돌 해결, 3-Tier 구조 |
124
- | Entity 검증 | `entity-validation-checklist.md` | Entity 생성 단계별 체크리스트 |
125
- | Entity 기본 | `entity-basic.md` | Entity JSON 구조, 필드 타입 |
126
- | Entity 관계 | `entity-relations.md` | BelongsToOne, HasMany, ManyToMany, FK 코드 패턴 |
127
- | Subset | `subset.md` | 조회 필드 범위 정의 |
128
- | Model | `model.md` | BaseModelClass, CRUD 패턴 |
129
- | API | `api.md` | @api 데코레이터 |
130
- | Puri | `puri.md` | SQL 쿼리 빌더 |
131
- | i18n | `i18n.md` | 다국어 지원, SD 함수 |
132
- | Upsert | `upsert.md` | 관계 데이터 저장 |
133
- | Testing | `testing.md` | Vitest 테스트 (test/testAs), Fixture 생성 |
134
- | **DevRunner** | `testing-devrunner.md` | **sonamu test 실행, HMR 연동, 병렬 테스트, sonamu.config.ts 테스트 설정** |
135
- | **Naite** | `naite.md` | **Naite.t()/get() 추적 시스템, 체이닝 필터, trace CLI 출력** |
136
- | **Cone** | `cone.md` | **Cone 메타데이터 생성 관리 (LLM/템플릿)** |
137
- | **Fixture CLI** | `fixture-cli.md` | **fixture gen/fetch/explore 명령어, 3-Tier DB 활용** |
138
- | Migration | `migration.md` | DB 스키마 마이그레이션, PK 타입 변경 |
139
- | Auth | `auth.md` | better-auth 인증 시스템 (엔티티 자동 생성, Guards, Context) |
140
- | Auth Migration | `auth-migration.md` | better-auth 외부 인증 통합 User.id 타입 변경 |
141
- | **Auth Plugins** | `auth-plugins.md` | **better-auth 플러그인 래퍼 (admin, organization, 2fa, passkey 10종), snake_case 매핑** |
142
- | **벡터 검색** | `vector.md` | **pgvector 임베딩 (Voyage AI/OpenAI), 청킹, 하이브리드 검색** |
143
- | Puri 쿼리 빌더 | `puri.md` | SELECT, WHERE, JOIN, FTS, pg_trgm fuzzy search, pgvector |
144
- | **AI Agents** | `ai-agents.md` | **BaseAgentClass, @tools 데코레이터, ToolLoopAgent, AsyncLocalStorage 상태** |
145
- | **Tasks** | `tasks.md` | **백그라운드 워크플로우, cron 스케줄링, durable step, 재시도 정책** |
146
- | **스킬 기여** | `skill-contribution.md` | **트러블슈팅 해결 스킬 반영 워크플로우 (매칭, 판정, 포맷, 승인)** |
147
- | **Framework 변경 판단** | `framework-change.md` | **프레임워크 수정 vs. 프로젝트 우회 판단 기준. @upload 파라미터 패턴** |
114
+ ## Skills List
115
+
116
+ | Skill | File | Purpose |
117
+ |-------|------|---------|
118
+ | **CDD (AC+Claim-based development)** | `cdd.md` | **`*.contract.md` (domain rules), AC (test names), Claim (work instructions) — 3-artifact system** |
119
+ | Project creation | `create-sonamu.md` | create-sonamu CLI options |
120
+ | Project initialization | `project-init.md` | Project creation flow and conversation guide |
121
+ | Project configuration | `config.md` | .env, sonamu.config.ts settings |
122
+ | Database | `database.md` | DB setup, port conflict resolution, 3-Tier structure |
123
+ | Entity validation | `entity-validation-checklist.md` | Step-by-step entity creation checklist |
124
+ | Entity basics | `entity-basic.md` | Entity JSON structure, field types |
125
+ | Entity relations | `entity-relations.md` | BelongsToOne, HasMany, ManyToMany, FK code patterns |
126
+ | Subset | `subset.md` | Response field scope definition |
127
+ | Model | `model.md` | BaseModelClass, CRUD patterns |
128
+ | API | `api.md` | @api decorator |
129
+ | Puri | `puri.md` | SQL query builder |
130
+ | i18n | `i18n.md` | Internationalization, SD functions |
131
+ | Upsert | `upsert.md` | Batch saving of relation data |
132
+ | Testing | `testing.md` | Vitest tests (test/testAs), fixture generation tips |
133
+ | **DevRunner** | `testing-devrunner.md` | **sonamu test execution, HMR integration, parallel tests, sonamu.config.ts test settings** |
134
+ | **Naite** | `naite.md` | **Naite.t()/get() tracing system, chaining filters, trace CLI output** |
135
+ | **Cone** | `cone.md` | **Cone metadata generation and management (LLM/template)** |
136
+ | **Fixture CLI** | `fixture-cli.md` | **fixture gen/fetch/explore commands, 3-Tier DB usage** |
137
+ | Migration | `migration.md` | DB schema migration, PK type changes |
138
+ | Auth | `auth.md` | better-auth system (auto entity generation, Guards, Context) |
139
+ | Auth Migration | `auth-migration.md` | User.id type changes for external auth (e.g., better-auth) |
140
+ | **Auth Plugins** | `auth-plugins.md` | **better-auth plugin wrappers (admin, organization, 2fa, passkey, etc. 10 types), snake_case mapping** |
141
+ | **Vector search** | `vector.md` | **pgvector embeddings (Voyage AI/OpenAI), chunking, hybrid search** |
142
+ | Puri query builder | `puri.md` | SELECT, WHERE, JOIN, FTS, pg_trgm fuzzy search, pgvector |
143
+ | **AI Agents** | `ai-agents.md` | **BaseAgentClass, @tools decorator, ToolLoopAgent, AsyncLocalStorage state** |
144
+ | **Tasks** | `tasks.md` | **Background workflows, cron scheduling, durable steps, retry policies** |
145
+ | **Skill contribution** | `skill-contribution.md` | **Troubleshooting skill contribution workflow (matching, decision, format, approval)** |
146
+ | **Framework change** | `framework-change.md` | **Criteria for framework fix vs. project workaround. @upload parameter pattern** |
148
147
  | Frontend | `frontend.md` | Service, TanStack Query |
149
- | Scaffolding | `scaffolding.md` | UI Scaffolding 오류 해결 |
150
-
151
- ## 작업별 Skill 선택
152
-
153
- **CRITICAL: 새로운 시스템이나 기능을 처음부터 개발할 때는 `workflow.md`부터 시작하세요!**
154
-
155
- | 작업 | 참고 Skill |
156
- |------|-----------|
157
- | **처음부터 전체 시스템 개발** | **workflow.md (7단계 마스터 가이드)** |
158
- | **도메인 Logic 문서화 / AC+Claim 기반 개발** | **cdd.md** |
159
- | 프로젝트 생성 | create-sonamu, project-init |
160
- | 프로젝트 설정 | config |
161
- | Sonamu 로컬 개발 설정 | config |
162
- | DB 설정/포트 충돌 | database, config |
163
- | **3-Tier DB 구조 이해** | **database, fixture-cli** |
164
- | **Cone 메타데이터 생성/관리** | **cone** |
165
- | Entity/속성 정의 | entity-basic |
166
- | 관계 설정 | entity-relations |
167
- | **BelongsToOne FK 코드 사용** | **entity-relations** |
168
- | API 응답 필드 구성 | subset |
169
- | 데이터 조회/저장 로직 | model, puri |
170
- | API 엔드포인트 | api |
171
- | 관계 데이터 배치 저장 | upsert |
172
- | 테스트 작성 | testing |
173
- | **테스트 실행 (sonamu test)** | **testing-devrunner** |
174
- | **Naite 추적/디버깅** | **naite** |
175
- | **Fixture 데이터 생성/관리** | **fixture-cli** |
176
- | **테스트 데이터 생성 팁** | **testing (Fixture 데이터 생성 ), fixture-cli (실전 )** |
177
- | DB 스키마 변경 | migration |
178
- | **인증 설정 (auth generate, Guards, Context)** | **auth** |
179
- | PK 타입 변경 (better-auth ) | auth-migration |
180
- | **인증 플러그인 추가** | **auth-plugins** |
181
- | 프론트엔드 개발 | frontend |
182
- | 다국어/번역 | i18n |
183
- | Scaffolding 오류 | scaffolding |
184
- | **벡터 검색/임베딩** | **vector** |
148
+ | Scaffolding | `scaffolding.md` | Resolving UI scaffolding errors |
149
+
150
+ ## Task-to-Skill Reference
151
+
152
+ **CRITICAL: When building a new system from scratch, start with `.claude/workflow/project_init.md`!**
153
+
154
+ | Task | Reference Skill |
155
+ |------|----------------|
156
+ | **Build an entire system from scratch** | **`.claude/workflow/project_init.md` (7-phase master guide)** |
157
+ | **Domain logic documentation / AC+Claim-based development** | **cdd.md** |
158
+ | Project creation | create-sonamu, project-init |
159
+ | Project configuration | config |
160
+ | Sonamu local dev setup | config |
161
+ | DB setup / port conflict | database, config |
162
+ | **3-Tier DB structure** | **database, fixture-cli** |
163
+ | **Cone metadata generation/management** | **cone** |
164
+ | Entity / field definition | entity-basic |
165
+ | Relationship setup | entity-relations |
166
+ | **BelongsToOne FK code usage** | **entity-relations** |
167
+ | API response field composition | subset |
168
+ | Data query / save logic | model, puri |
169
+ | API endpoints | api |
170
+ | Batch saving of relation data | upsert |
171
+ | Writing tests | testing |
172
+ | **Running tests (sonamu test)** | **testing-devrunner** |
173
+ | **Naite tracing / debugging** | **naite** |
174
+ | **Fixture data generation/management** | **fixture-cli** |
175
+ | **Test data generation tips** | **testing (Fixture data generation tips), fixture-cli (practical tips)** |
176
+ | DB schema changes | migration |
177
+ | **Auth setup (auth generate, Guards, Context)** | **auth** |
178
+ | PK type changes (better-auth, etc.) | auth-migration |
179
+ | **Adding auth plugins** | **auth-plugins** |
180
+ | Frontend development | frontend |
181
+ | Internationalization / translation | i18n |
182
+ | Scaffolding errors | scaffolding |
183
+ | **Vector search / embeddings** | **vector** |
185
184
  | **pg_trgm Fuzzy Search** | **puri, entity-basic** |
186
- | **AI Agent 개발** | **ai-agents** |
187
- | **백그라운드 작업/스케줄링** | **tasks** |
188
- | **트러블슈팅스킬 반영** | **skill-contribution** |
189
- | **프레임워크 버그/제약 발견 대응** | **framework-change** |
185
+ | **AI Agent development** | **ai-agents** |
186
+ | **Background jobs / scheduling** | **tasks** |
187
+ | **Troubleshootingskill contribution** | **skill-contribution** |
188
+ | **Framework bug / constraint response** | **framework-change** |
190
189
 
191
- ## 명령어 실행 경로
190
+ ## Command Execution Path
192
191
 
193
- 모든 `pnpm` 명령어는 **`packages/api`** 디렉토리에서 실행합니다.
192
+ All `pnpm` commands are run from the **`packages/api`** directory.
194
193
 
195
194
  ```bash
196
195
  cd packages/api
@@ -199,9 +198,9 @@ pnpm dev
199
198
  pnpm sonamu migrate run
200
199
  ```
201
200
 
202
- ## 소스코드 참조
201
+ ## Source Code References
203
202
 
204
- - Sonamu 프레임워크: `sonamu/modules/sonamu/`
205
- - 예제 프로젝트: `sonamu/examples/miomock/`
206
- - 공식 문서: `sonamu/modules/docs/`
203
+ - Sonamu framework: `sonamu/modules/sonamu/`
204
+ - Example project: `sonamu/examples/miomock/`
205
+ - Official docs: `sonamu/modules/docs/`
207
206
  - create-sonamu: `sonamu/modules/create-sonamu/`
@@ -1,28 +1,28 @@
1
1
  ---
2
2
  name: sonamu-ai-agents
3
- description: AI Agent 프레임워크. BaseAgentClass 상속, @tools 데코레이터로 도구 정의, ToolLoopAgent 통합, AsyncLocalStorage 기반 상태 관리. Use when building AI agents with tool-use capabilities.
3
+ description: AI Agent framework. Extend BaseAgentClass, define tools with @tools decorator, ToolLoopAgent integration, AsyncLocalStorage-based state management. Use when building AI agents with tool-use capabilities.
4
4
  ---
5
5
 
6
- # AI Agent 가이드
6
+ # AI Agent Guide
7
7
 
8
- Sonamu Vercel AI SDK `ToolLoopAgent`를 래핑하여 클래스 기반 AI Agent를 구성할 수 있는 프레임워크를 제공합니다.
8
+ Sonamu provides a framework that wraps Vercel AI SDK's `ToolLoopAgent` to build class-based AI Agents.
9
9
 
10
- **소스코드:** `modules/sonamu/src/ai/agents/`
10
+ **Source code:** `modules/sonamu/src/ai/agents/`
11
11
 
12
12
  ---
13
13
 
14
- ## 구조
14
+ ## Structure
15
15
 
16
- | 파일 | 역할 |
16
+ | File | Role |
17
17
  |------|------|
18
- | `agent.ts` | `BaseAgentClass`, `tools` 데코레이터 |
19
- | `types.ts` | `AgentConfig`, `ToolDecoratorOptions`, `RegisteredToolDefinition` |
18
+ | `agent.ts` | `BaseAgentClass`, `tools` decorator |
19
+ | `types.ts` | `AgentConfig`, `ToolDecoratorOptions`, `RegisteredToolDefinition`, etc. |
20
20
 
21
21
  ---
22
22
 
23
23
  ## BaseAgentClass
24
24
 
25
- Agent의 베이스 클래스. 상속하여 커스텀 Agent를 만듭니다.
25
+ The base class for Agents. Extend it to create a custom Agent.
26
26
 
27
27
  ```typescript
28
28
  import { BaseAgentClass, tools } from "sonamu/ai/agents";
@@ -30,11 +30,11 @@ import { z } from "zod/v4";
30
30
 
31
31
  class MyAgentClass extends BaseAgentClass<{ count: number }> {
32
32
  constructor() {
33
- super("MyAgent"); // agentName (로거 카테고리로 사용)
33
+ super("MyAgent"); // agentName (used as logger category)
34
34
  }
35
35
 
36
36
  @tools({
37
- description: " 수를 더합니다",
37
+ description: "Adds two numbers",
38
38
  schema: {
39
39
  input: z.object({ a: z.number(), b: z.number() }),
40
40
  output: z.object({ result: z.number() }),
@@ -48,54 +48,54 @@ class MyAgentClass extends BaseAgentClass<{ count: number }> {
48
48
  export const MyAgent = new MyAgentClass();
49
49
  ```
50
50
 
51
- ### 주요 기능
51
+ ### Key Features
52
52
 
53
- | 기능 | 설명 |
53
+ | Feature | Description |
54
54
  |------|------|
55
- | `this.logger` | LogTape 로거 (agent 카테고리) |
56
- | `this.store` | AsyncLocalStorage 기반 상태 접근 |
57
- | `this.tools` | 등록된 도구셋 (ToolSet) |
58
- | `this.use()` | Agent 실행 (ALS 컨텍스트 + ToolLoopAgent) |
55
+ | `this.logger` | LogTape logger (agent category) |
56
+ | `this.store` | AsyncLocalStorage-based state access |
57
+ | `this.tools` | Registered toolset (ToolSet) |
58
+ | `this.use()` | Run the Agent (ALS context + ToolLoopAgent) |
59
59
 
60
60
  ---
61
61
 
62
- ## @tools 데코레이터
62
+ ## @tools Decorator
63
63
 
64
- 메서드를 AI 도구로 등록합니다. Zod v4 스키마로 입출력을 정의합니다.
64
+ Registers a method as an AI tool. Define input/output using Zod v4 schema.
65
65
 
66
66
  ```typescript
67
67
  @tools({
68
- name?: string, // 도구 이름 (기본: "className.methodName" 형태)
69
- description?: string, // LLM에게 보여줄 설명
68
+ name?: string, // Tool name (default: "className.methodName" format)
69
+ description?: string, // Description shown to the LLM
70
70
  schema: {
71
- input: z.ZodType, // 입력 스키마 (필수)
72
- output?: z.ZodType, // 출력 스키마 (선택)
71
+ input: z.ZodType, // Input schema (required)
72
+ output?: z.ZodType, // Output schema (optional)
73
73
  },
74
- needsApproval?: boolean | function, // 사용자 승인 필요 여부
75
- toModelOutput?: function, // 모델에게 반환할 출력 변환
76
- providerOptions?: ProviderOptions, // 프로바이더별 옵션
74
+ needsApproval?: boolean | function, // Whether user approval is required
75
+ toModelOutput?: function, // Transform output returned to the model
76
+ providerOptions?: ProviderOptions, // Provider-specific options
77
77
  })
78
78
  ```
79
79
 
80
- ### 이름 자동 생성 규칙
80
+ ### Automatic Name Generation Rule
81
81
 
82
- `name`을 생략하면 `{ModelName(camelCase)}.{methodName(camelCase)}`로 자동 생성됩니다.
82
+ If `name` is omitted, it is auto-generated as `{ModelName(camelCase)}.{methodName(camelCase)}`.
83
83
 
84
84
  ```typescript
85
85
  class SearchAgentClass extends BaseAgentClass<...> {
86
86
  @tools({ ... })
87
87
  async findDocuments(input: ...) { ... }
88
- // → 도구 이름: "searchAgent.findDocuments"
88
+ // → Tool name: "searchAgent.findDocuments"
89
89
  }
90
90
  ```
91
91
 
92
- 클래스명에서 `Class`, `Model`, `Frame` 접미사는 자동 제거됩니다.
92
+ The suffixes `Class`, `Model`, and `Frame` are automatically stripped from the class name.
93
93
 
94
94
  ---
95
95
 
96
- ## Agent 실행 (use)
96
+ ## Running an Agent (use)
97
97
 
98
- `use()` 메서드로 Agent를 실행합니다. AsyncLocalStorage 컨텍스트 내에서 ToolLoopAgent가 동작합니다.
98
+ Run the Agent with the `use()` method. ToolLoopAgent operates within the AsyncLocalStorage context.
99
99
 
100
100
  ```typescript
101
101
  import { anthropic } from "@ai-sdk/anthropic";
@@ -104,64 +104,64 @@ const result = await MyAgent.use(
104
104
  // AgentConfig
105
105
  {
106
106
  model: anthropic("claude-sonnet-4-5-20250514"),
107
- instructions: "당신은 수학 도우미입니다.",
107
+ instructions: "You are a math assistant.",
108
108
  toolChoice: "auto", // "auto" | "none" | "required"
109
109
  maxOutputTokens: 1000,
110
110
  temperature: 0.7,
111
111
  },
112
- // 초기 상태 (AsyncLocalStorage에 저장)
112
+ // Initial state (stored in AsyncLocalStorage)
113
113
  { count: 0 },
114
- // 콜백 (Agent 인스턴스 받음)
114
+ // Callback (receives Agent instance)
115
115
  async (agent) => {
116
- // agent ToolLoopAgent 인스턴스
117
- // Vercel AI SDK agent API 사용
116
+ // agent is a ToolLoopAgent instance
117
+ // Use Vercel AI SDK's agent API
118
118
  return agent;
119
119
  },
120
120
  );
121
121
  ```
122
122
 
123
- ### AgentConfig 옵션
123
+ ### AgentConfig Options
124
124
 
125
- | 옵션 | 타입 | 설명 |
125
+ | Option | Type | Description |
126
126
  |------|------|------|
127
- | `model` | `LanguageModel` | AI SDK 모델 (필수) |
128
- | `instructions` | `string` | 시스템 프롬프트 |
129
- | `toolChoice` | `"auto" \| "none" \| "required"` | 도구 선택 방식 |
130
- | `stopWhen` | `StopCondition` | 중단 조건 |
131
- | `activeTools` | `string[]` | 활성화할 도구 이름 목록 |
132
- | `maxOutputTokens` | `number` | 최대 출력 토큰 |
133
- | `temperature` | `number` | 온도 |
134
- | `topP` / `topK` | `number` | 샘플링 파라미터 |
135
- | `presencePenalty` / `frequencyPenalty` | `number` | 페널티 |
136
- | `seed` | `number` | 재현성용 시드 |
137
- | `stopSequences` | `string[]` | 생성 중단 시퀀스 |
138
- | `providerOptions` | `ProviderOptions` | 프로바이더별 추가 옵션 |
139
- | `headers` | `Record<string, string>` | 커스텀 HTTP 헤더 |
127
+ | `model` | `LanguageModel` | AI SDK model (required) |
128
+ | `instructions` | `string` | System prompt |
129
+ | `toolChoice` | `"auto" \| "none" \| "required"` | Tool selection strategy |
130
+ | `stopWhen` | `StopCondition` | Stop condition |
131
+ | `activeTools` | `string[]` | List of tool names to activate |
132
+ | `maxOutputTokens` | `number` | Maximum output tokens |
133
+ | `temperature` | `number` | Temperature |
134
+ | `topP` / `topK` | `number` | Sampling parameters |
135
+ | `presencePenalty` / `frequencyPenalty` | `number` | Penalties |
136
+ | `seed` | `number` | Seed for reproducibility |
137
+ | `stopSequences` | `string[]` | Generation stop sequences |
138
+ | `providerOptions` | `ProviderOptions` | Additional provider-specific options |
139
+ | `headers` | `Record<string, string>` | Custom HTTP headers |
140
140
 
141
141
  ---
142
142
 
143
- ## 상태 관리 (AsyncLocalStorage)
143
+ ## State Management (AsyncLocalStorage)
144
144
 
145
- `BaseAgentClass`는 제네릭 `TStore`로 상태 타입을 정의합니다. `use()` 호출 초기 상태를 전달하면, 도구 실행 중 `this.store`로 접근할 있습니다.
145
+ `BaseAgentClass` defines the state type with the generic `TStore`. When you pass the initial state to `use()`, it can be accessed via `this.store` during tool execution.
146
146
 
147
147
  ```typescript
148
148
  class StatefulAgentClass extends BaseAgentClass<{ processedItems: string[] }> {
149
149
  @tools({ ... })
150
150
  async processItem(input: { item: string }) {
151
- // 상태 접근
151
+ // Access state
152
152
  this.store?.processedItems.push(input.item);
153
153
  return { ok: true };
154
154
  }
155
155
  }
156
156
  ```
157
157
 
158
- **주의:** `this.store`는 `use()` 컨텍스트 밖에서는 `undefined`입니다.
158
+ **Note:** `this.store` is `undefined` outside of a `use()` context.
159
159
 
160
160
  ---
161
161
 
162
- ## 도구 격리
162
+ ## Tool Isolation
163
163
 
164
- Agent 클래스의 도구는 클래스별로 격리됩니다. `toolSet` getter `def.from === this.constructor.name`으로 필터링합니다.
164
+ Tools for each Agent class are isolated per class. The `toolSet` getter filters by `def.from === this.constructor.name`.
165
165
 
166
166
  ```typescript
167
167
  class AgentA extends BaseAgentClass<void> {
@@ -171,34 +171,34 @@ class AgentB extends BaseAgentClass<void> {
171
171
  @tools({ ... }) async toolY() { ... }
172
172
  }
173
173
 
174
- // AgentA.tools → { toolX 포함 }
175
- // AgentB.tools → { toolY 포함 }
174
+ // AgentA.tools → { contains only toolX }
175
+ // AgentB.tools → { contains only toolY }
176
176
  ```
177
177
 
178
178
  ---
179
179
 
180
- ## 로깅
180
+ ## Logging
181
181
 
182
- `this.logger`는 LogTape 사용합니다. 카테고리는 `convertDomainToCategory(agentName, "agent")`로 생성됩니다.
182
+ `this.logger` uses LogTape. The category is generated with `convertDomainToCategory(agentName, "agent")`.
183
183
 
184
- 도구 실행 자동으로 debug 로그가 기록됩니다:
184
+ Debug logs are automatically recorded on tool execution:
185
185
  ```
186
186
  tools: {model}.{method} with args: {args}
187
187
  ```
188
188
 
189
189
  ---
190
190
 
191
- ## 관련 패키지
191
+ ## Related Packages
192
192
 
193
193
  - `ai`: Vercel AI SDK (`ToolLoopAgent`, `Agent`, `ToolSet`)
194
194
  - `@ai-sdk/provider-utils`: `tool()`, `Tool`, `ToolExecutionOptions`
195
- - `zod/v4`: 스키마 정의
196
- - `@logtape/logtape`: 로깅
195
+ - `zod/v4`: Schema definitions
196
+ - `@logtape/logtape`: Logging
197
197
 
198
198
  ---
199
199
 
200
- ## 참고
200
+ ## References
201
201
 
202
- - **소스코드**: `modules/sonamu/src/ai/agents/`
202
+ - **Source code**: `modules/sonamu/src/ai/agents/`
203
203
  - **Vercel AI SDK**: https://sdk.vercel.ai/docs
204
- - **벡터 검색**: `vector.md`
204
+ - **Vector search**: `vector.md`