sonamu 0.8.24 → 0.8.26
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.
- package/dist/api/__tests__/config.test.js +189 -0
- package/dist/api/config.d.ts.map +1 -1
- package/dist/api/config.js +7 -2
- package/dist/api/sonamu.d.ts.map +1 -1
- package/dist/api/sonamu.js +14 -10
- package/dist/auth/index.d.ts +1 -0
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +2 -1
- package/dist/auth/knex-adapter.d.ts +23 -0
- package/dist/auth/knex-adapter.d.ts.map +1 -0
- package/dist/auth/knex-adapter.js +163 -0
- package/dist/auth/plugins/wrappers/admin.d.ts +2 -2
- package/dist/bin/__tests__/ts-loader-register.test.js +45 -0
- package/dist/bin/cli.js +47 -9
- package/dist/bin/ts-loader-register.js +3 -29
- package/dist/bin/ts-loader-registration.d.ts +2 -0
- package/dist/bin/ts-loader-registration.d.ts.map +1 -0
- package/dist/bin/ts-loader-registration.js +42 -0
- package/dist/cone/cone-generator.js +3 -3
- package/dist/database/puri-subset.test-d.js +9 -1
- package/dist/database/puri-subset.types.d.ts +1 -1
- package/dist/database/puri-subset.types.d.ts.map +1 -1
- package/dist/database/puri-subset.types.js +1 -1
- package/dist/testing/fixture-generator.js +5 -5
- package/dist/ui/ai-client.js +2 -2
- package/dist/ui/api.d.ts.map +1 -1
- package/dist/ui/api.js +14 -14
- package/dist/ui/cdd-service.d.ts +15 -18
- package/dist/ui/cdd-service.d.ts.map +1 -1
- package/dist/ui/cdd-service.js +246 -222
- package/dist/ui/cdd-types.d.ts +41 -68
- package/dist/ui/cdd-types.d.ts.map +1 -1
- package/dist/ui/cdd-types.js +2 -2
- package/dist/ui-web/assets/index-CKo0Z2Iu.css +1 -0
- package/dist/ui-web/assets/{index-CxiydzeC.js → index-DK-2aacv.js} +83 -83
- package/dist/ui-web/index.html +2 -2
- package/package.json +6 -2
- package/src/api/__tests__/config.test.ts +225 -0
- package/src/api/config.ts +10 -4
- package/src/api/sonamu.ts +16 -13
- package/src/auth/index.ts +1 -0
- package/src/auth/knex-adapter.ts +208 -0
- package/src/bin/__tests__/ts-loader-register.test.ts +62 -0
- package/src/bin/cli.ts +52 -9
- package/src/bin/ts-loader-register.ts +2 -32
- package/src/bin/ts-loader-registration.ts +55 -0
- package/src/cone/cone-generator.ts +2 -2
- package/src/database/puri-subset.test-d.ts +102 -0
- package/src/database/puri-subset.types.ts +1 -1
- package/src/skills/commands/sonamu-skills.md +20 -0
- package/src/skills/sonamu/SKILL.md +179 -137
- package/src/skills/sonamu/ai-agents.md +69 -69
- package/src/skills/sonamu/api.md +147 -147
- package/src/skills/sonamu/auth-migration.md +220 -220
- package/src/skills/sonamu/auth-plugins.md +83 -83
- package/src/skills/sonamu/auth.md +106 -106
- package/src/skills/sonamu/cdd.md +65 -200
- package/src/skills/sonamu/cone.md +138 -138
- package/src/skills/sonamu/config.md +191 -191
- package/src/skills/sonamu/create-sonamu.md +66 -66
- package/src/skills/sonamu/database.md +158 -158
- package/src/skills/sonamu/entity-basic.md +292 -293
- package/src/skills/sonamu/entity-relations.md +246 -246
- package/src/skills/sonamu/entity-validation-checklist.md +124 -124
- package/src/skills/sonamu/fixture-cli.md +231 -231
- package/src/skills/sonamu/framework-change.md +37 -37
- package/src/skills/sonamu/frontend.md +223 -223
- package/src/skills/sonamu/i18n.md +82 -82
- package/src/skills/sonamu/migration.md +77 -77
- package/src/skills/sonamu/model.md +222 -222
- package/src/skills/sonamu/naite.md +86 -86
- package/src/skills/sonamu/project-init.md +228 -228
- package/src/skills/sonamu/puri.md +122 -122
- package/src/skills/sonamu/scaffolding.md +154 -154
- package/src/skills/sonamu/skill-contribution.md +124 -124
- package/src/skills/sonamu/subset.md +46 -46
- package/src/skills/sonamu/tasks.md +82 -82
- package/src/skills/sonamu/testing-devrunner.md +147 -147
- package/src/skills/sonamu/testing.md +673 -673
- package/src/skills/sonamu/upsert.md +79 -79
- package/src/skills/sonamu/vector.md +67 -67
- package/src/testing/fixture-generator.ts +4 -4
- package/src/ui/ai-client.ts +1 -1
- package/src/ui/api.ts +18 -17
- package/src/ui/cdd-service.ts +264 -254
- package/src/ui/cdd-types.ts +40 -75
- package/dist/ui-web/assets/index-BrQKU3j9.css +0 -1
- package/src/skills/sonamu/workflow.md +0 -317
|
@@ -1,159 +1,159 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sonamu-cone
|
|
3
|
-
description:
|
|
3
|
+
description: Guide for creating and managing cone metadata. Used for fixture generation, documentation, and search across Entity fields. Supports LLM-based or template-based generation. Use when creating or managing cone metadata for entities.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Cone
|
|
6
|
+
# Cone Metadata Guide
|
|
7
7
|
|
|
8
|
-
Cone
|
|
9
|
-
|
|
8
|
+
Cone is metadata for each prop, subset, and enum of an Entity.
|
|
9
|
+
During fixture generation, the LLM references `cone.note` to produce realistic, context-appropriate data.
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
## Cone
|
|
13
|
+
## Role of Cone
|
|
14
14
|
|
|
15
|
-
|
|
|
16
|
-
|
|
17
|
-
| **Fixture
|
|
18
|
-
| **Scaffolding** | cone
|
|
19
|
-
|
|
|
15
|
+
| Purpose | Description |
|
|
16
|
+
|---------|-------------|
|
|
17
|
+
| **Fixture generation** | LLM generates contextually appropriate test data based on `cone.note` |
|
|
18
|
+
| **Scaffolding** | Uses cone information to generate model and view templates |
|
|
19
|
+
| **Documentation** | Metadata describing Entity structure and the meaning of each field |
|
|
20
20
|
|
|
21
21
|
---
|
|
22
22
|
|
|
23
|
-
## Cone
|
|
23
|
+
## Cone Field Types
|
|
24
24
|
|
|
25
25
|
### Entity cone
|
|
26
26
|
|
|
27
|
-
|
|
|
28
|
-
|
|
29
|
-
| `note` | string | Entity
|
|
30
|
-
| `tags` | string[] |
|
|
27
|
+
| Field | Type | Description |
|
|
28
|
+
|-------|------|-------------|
|
|
29
|
+
| `note` | string | Entity purpose, business context, and fixture generation guide |
|
|
30
|
+
| `tags` | string[] | Classification tags |
|
|
31
31
|
|
|
32
32
|
### Prop cone
|
|
33
33
|
|
|
34
|
-
|
|
|
35
|
-
|
|
36
|
-
| `note` | string |
|
|
37
|
-
| `fixtureGenerator` | string | **Fallback.** faker.js
|
|
38
|
-
| `fixtureDefault` | any |
|
|
39
|
-
| `fixtureStrategy` | string | `"sequence"` —
|
|
40
|
-
| `dataSource` | object |
|
|
34
|
+
| Field | Type | Description |
|
|
35
|
+
|-------|------|-------------|
|
|
36
|
+
| `note` | string | **Highest priority.** Business meaning of the field, concrete examples, value ranges, format constraints. Input the LLM reads to generate data |
|
|
37
|
+
| `fixtureGenerator` | string | **Fallback.** faker.js expression. Fallback when no API key is available |
|
|
38
|
+
| `fixtureDefault` | any | Fixed default value |
|
|
39
|
+
| `fixtureStrategy` | string | `"sequence"` — used when id is auto-assigned by a DB sequence |
|
|
40
|
+
| `dataSource` | object | Strategy for fetching reference data for relation props |
|
|
41
41
|
|
|
42
42
|
### Subset cone
|
|
43
43
|
|
|
44
|
-
|
|
|
45
|
-
|
|
46
|
-
| `note` | string |
|
|
44
|
+
| Field | Type | Description |
|
|
45
|
+
|-------|------|-------------|
|
|
46
|
+
| `note` | string | Subset purpose, included fields, and when it is used |
|
|
47
47
|
|
|
48
48
|
### Enum cone
|
|
49
49
|
|
|
50
|
-
|
|
|
51
|
-
|
|
52
|
-
| `note` | string |
|
|
53
|
-
| `values` | object |
|
|
50
|
+
| Field | Type | Description |
|
|
51
|
+
|-------|------|-------------|
|
|
52
|
+
| `note` | string | Meaning and usage context of the enum |
|
|
53
|
+
| `values` | object | `{ note: string }` for each enum value |
|
|
54
54
|
|
|
55
55
|
---
|
|
56
56
|
|
|
57
|
-
##
|
|
57
|
+
## Priority During Fixture Generation
|
|
58
58
|
|
|
59
|
-
`--use-llm`
|
|
59
|
+
When the `--use-llm` flag is used:
|
|
60
60
|
|
|
61
61
|
```
|
|
62
|
-
1. override
|
|
63
|
-
2. cone.note + LLM ← API key
|
|
64
|
-
3. fixtureGenerator (faker.js
|
|
65
|
-
4. fixtureDefault (
|
|
66
|
-
5.
|
|
62
|
+
1. override value (passed at generate() call time)
|
|
63
|
+
2. cone.note + LLM ← highest priority when API key is present
|
|
64
|
+
3. fixtureGenerator (faker.js expression) ← fallback when LLM fails
|
|
65
|
+
4. fixtureDefault (fixed default value)
|
|
66
|
+
5. type-based default (auto-generated)
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
**CRITICAL: `cone.note
|
|
69
|
+
**CRITICAL: If `cone.note` is empty, the LLM generates data without context, resulting in poor quality. Always verify that cone.note exists before running fixture generation.**
|
|
70
70
|
|
|
71
71
|
---
|
|
72
72
|
|
|
73
|
-
## CLI
|
|
73
|
+
## CLI Commands
|
|
74
74
|
|
|
75
|
-
### 1. cone gen —
|
|
75
|
+
### 1. cone gen — Generate cone with LLM (recommended)
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
Passes the project requirements (`.claude/skills/project/*.md`) and Entity structure to the LLM to generate contextually appropriate cone.
|
|
78
78
|
|
|
79
|
-
**ANTHROPIC_API_KEY
|
|
79
|
+
**Requires ANTHROPIC_API_KEY** (`.env` or `sonamu.config.ts`'s `secret.anthropic_api_key`)
|
|
80
80
|
|
|
81
81
|
```bash
|
|
82
|
-
#
|
|
82
|
+
# Single Entity
|
|
83
83
|
pnpm sonamu cone gen Post
|
|
84
84
|
|
|
85
|
-
#
|
|
85
|
+
# All Entities
|
|
86
86
|
pnpm sonamu cone gen --all
|
|
87
87
|
|
|
88
|
-
#
|
|
88
|
+
# Regenerate all existing cones (overwrite)
|
|
89
89
|
pnpm sonamu cone gen Post --regenerate
|
|
90
90
|
|
|
91
|
-
#
|
|
91
|
+
# Regenerate all Entities
|
|
92
92
|
pnpm sonamu cone gen --all --regenerate
|
|
93
93
|
|
|
94
|
-
#
|
|
94
|
+
# Specify locale
|
|
95
95
|
pnpm sonamu cone gen Post --locale en
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
-
####
|
|
98
|
+
#### Options
|
|
99
99
|
|
|
100
|
-
|
|
|
101
|
-
|
|
102
|
-
| `--all` |
|
|
103
|
-
| `--regenerate` |
|
|
104
|
-
| `--locale <ko\|en\|ja>` |
|
|
100
|
+
| Option | Description |
|
|
101
|
+
|--------|-------------|
|
|
102
|
+
| `--all` | Generate cone for all Entities |
|
|
103
|
+
| `--regenerate` | Overwrite existing cone (default: only generate for fields with no note) |
|
|
104
|
+
| `--locale <ko\|en\|ja>` | Generation language (default: `i18n.defaultLocale` from `sonamu.config.ts`, or `ko`) |
|
|
105
105
|
|
|
106
|
-
####
|
|
106
|
+
#### How it works
|
|
107
107
|
|
|
108
|
-
-
|
|
109
|
-
- **`--regenerate`
|
|
108
|
+
- **Default mode**: `onlyEmpty` — only generates for props where cone.note is empty; existing notes are preserved
|
|
109
|
+
- **`--regenerate` mode**: full regeneration, overwrites existing cone
|
|
110
110
|
|
|
111
|
-
####
|
|
111
|
+
#### Information referenced by the LLM
|
|
112
112
|
|
|
113
|
-
1. Entity JSON
|
|
114
|
-
2.
|
|
115
|
-
3.
|
|
113
|
+
1. Entity JSON structure (props, subsets, enums, relations)
|
|
114
|
+
2. Domain rule files (`contract/**/*.contract.md`)
|
|
115
|
+
3. Existing cone metadata (in preserve mode)
|
|
116
116
|
|
|
117
|
-
### 2. stub entity —
|
|
117
|
+
### 2. stub entity — Auto-generate cone when creating an Entity
|
|
118
118
|
|
|
119
119
|
```bash
|
|
120
|
-
#
|
|
120
|
+
# Default: auto-generate template cone (no API key required)
|
|
121
121
|
pnpm sonamu stub entity Post
|
|
122
122
|
|
|
123
|
-
#
|
|
123
|
+
# Generate cone with LLM
|
|
124
124
|
pnpm sonamu stub entity Post --ai
|
|
125
125
|
|
|
126
|
-
# cone
|
|
126
|
+
# Skip cone generation
|
|
127
127
|
pnpm sonamu stub entity Post --no-cones
|
|
128
128
|
```
|
|
129
129
|
|
|
130
|
-
####
|
|
130
|
+
#### Template cone vs LLM cone
|
|
131
131
|
|
|
132
|
-
|
|
|
133
|
-
|
|
134
|
-
| API key |
|
|
135
|
-
|
|
|
136
|
-
|
|
|
137
|
-
|
|
|
132
|
+
| Item | Template cone | LLM cone |
|
|
133
|
+
|------|--------------|----------|
|
|
134
|
+
| API key | Not required | Required |
|
|
135
|
+
| Quality | Defaults based on faker-mappings | Reflects project context |
|
|
136
|
+
| Speed | Immediate | Takes a few seconds |
|
|
137
|
+
| Upgrade | Can be upgraded with `cone gen` | — |
|
|
138
138
|
|
|
139
139
|
---
|
|
140
140
|
|
|
141
|
-
##
|
|
141
|
+
## Key Cone Patterns
|
|
142
142
|
|
|
143
|
-
###
|
|
143
|
+
### General field
|
|
144
144
|
|
|
145
145
|
```json
|
|
146
146
|
{
|
|
147
147
|
"name": "title",
|
|
148
148
|
"type": "string",
|
|
149
149
|
"cone": {
|
|
150
|
-
"note": "
|
|
150
|
+
"note": "Post title. A Korean title roughly 20–50 characters long",
|
|
151
151
|
"fixtureGenerator": "faker.lorem.sentence()"
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
```
|
|
155
155
|
|
|
156
|
-
###
|
|
156
|
+
### Relation field (BelongsToOne)
|
|
157
157
|
|
|
158
158
|
```json
|
|
159
159
|
{
|
|
@@ -162,7 +162,7 @@ pnpm sonamu stub entity Post --no-cones
|
|
|
162
162
|
"with": "User",
|
|
163
163
|
"relationType": "BelongsToOne",
|
|
164
164
|
"cone": {
|
|
165
|
-
"note": "
|
|
165
|
+
"note": "Post author. References existing User data",
|
|
166
166
|
"dataSource": {
|
|
167
167
|
"strategy": "recent",
|
|
168
168
|
"config": { "limit": 5 }
|
|
@@ -171,22 +171,22 @@ pnpm sonamu stub entity Post --no-cones
|
|
|
171
171
|
}
|
|
172
172
|
```
|
|
173
173
|
|
|
174
|
-
###
|
|
174
|
+
### Correlated fields (name + name_en, etc.)
|
|
175
175
|
|
|
176
|
-
|
|
176
|
+
Do not set `fixtureGenerator` on correlated fields. The LLM generates them together per row to ensure consistency.
|
|
177
177
|
|
|
178
178
|
```json
|
|
179
179
|
{
|
|
180
180
|
"name": "name",
|
|
181
|
-
"cone": { "note": "
|
|
181
|
+
"cone": { "note": "Korean name (e.g. 김민수)" }
|
|
182
182
|
},
|
|
183
183
|
{
|
|
184
184
|
"name": "name_en",
|
|
185
|
-
"cone": { "note": "
|
|
185
|
+
"cone": { "note": "Romanized form of name (e.g. Kim Minsu). Must refer to the same person as name" }
|
|
186
186
|
}
|
|
187
187
|
```
|
|
188
188
|
|
|
189
|
-
### DB
|
|
189
|
+
### DB sequence PK
|
|
190
190
|
|
|
191
191
|
```json
|
|
192
192
|
{
|
|
@@ -194,53 +194,53 @@ pnpm sonamu stub entity Post --no-cones
|
|
|
194
194
|
"type": "string",
|
|
195
195
|
"cone": {
|
|
196
196
|
"fixtureStrategy": "sequence",
|
|
197
|
-
"note": "
|
|
197
|
+
"note": "Sequential number automatically assigned by the DB sequence (stored as string)"
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
200
|
```
|
|
201
201
|
|
|
202
|
-
### better-auth
|
|
202
|
+
### better-auth entity PK (Account / Session / Verification)
|
|
203
203
|
|
|
204
|
-
better-auth
|
|
205
|
-
`fixtureStrategy: "sequence"
|
|
204
|
+
The id of entities managed by better-auth is a UUID generated via `crypto.randomUUID()`.
|
|
205
|
+
Using `fixtureStrategy: "sequence"` causes a `MAX(id::bigint)` error during fixture sync, so always use `fixtureGenerator: "faker.string.uuid()"`.
|
|
206
206
|
|
|
207
207
|
```json
|
|
208
208
|
{
|
|
209
209
|
"name": "id",
|
|
210
210
|
"type": "string",
|
|
211
211
|
"cone": {
|
|
212
|
-
"note": "better-auth
|
|
212
|
+
"note": "UUID-format identifier generated by better-auth via crypto.randomUUID()",
|
|
213
213
|
"fixtureGenerator": "faker.string.uuid()"
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
```
|
|
217
217
|
|
|
218
|
-
###
|
|
218
|
+
### Enum field
|
|
219
219
|
|
|
220
220
|
```json
|
|
221
221
|
{
|
|
222
222
|
"name": "status",
|
|
223
223
|
"type": "enum",
|
|
224
224
|
"cone": {
|
|
225
|
-
"note": "
|
|
225
|
+
"note": "Post status. One of draft/published/archived"
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
```
|
|
229
229
|
|
|
230
230
|
---
|
|
231
231
|
|
|
232
|
-
## dataSource
|
|
232
|
+
## dataSource Strategies
|
|
233
233
|
|
|
234
|
-
|
|
234
|
+
Specifies how reference data is fetched for relation props.
|
|
235
235
|
|
|
236
|
-
|
|
|
237
|
-
|
|
238
|
-
| `recent` |
|
|
239
|
-
| `sample` |
|
|
240
|
-
| `random` |
|
|
241
|
-
| `ids` |
|
|
242
|
-
| `query` |
|
|
243
|
-
| `file` |
|
|
236
|
+
| Strategy | Description |
|
|
237
|
+
|----------|-------------|
|
|
238
|
+
| `recent` | Most recent data (by created_at) |
|
|
239
|
+
| `sample` | Uniform sampling |
|
|
240
|
+
| `random` | Random sampling |
|
|
241
|
+
| `ids` | Specific IDs |
|
|
242
|
+
| `query` | Custom query |
|
|
243
|
+
| `file` | Load from file |
|
|
244
244
|
|
|
245
245
|
```json
|
|
246
246
|
"dataSource": {
|
|
@@ -249,22 +249,22 @@ relation prop에서 참조 데이터 조회 방식을 지정합니다.
|
|
|
249
249
|
}
|
|
250
250
|
```
|
|
251
251
|
|
|
252
|
-
### DataExplorer
|
|
252
|
+
### DataExplorer Options Detail
|
|
253
253
|
|
|
254
|
-
|
|
254
|
+
**Source:** `modules/sonamu/src/testing/data-explorer.ts`
|
|
255
255
|
|
|
256
|
-
|
|
|
257
|
-
|
|
258
|
-
| `strategy` | string | — |
|
|
259
|
-
| `limit` | number | — |
|
|
260
|
-
| `where` | object \| function | — | WHERE
|
|
261
|
-
| `orderBy` | string | — |
|
|
262
|
-
| `ids` | number[] | — |
|
|
263
|
-
| `filePath` | string | — | `file`
|
|
264
|
-
| `useCache` | boolean | `false` |
|
|
265
|
-
| `cacheTtl` | number | `300` |
|
|
256
|
+
| Option | Type | Default | Description |
|
|
257
|
+
|--------|------|---------|-------------|
|
|
258
|
+
| `strategy` | string | — | Fetch strategy (see table above) |
|
|
259
|
+
| `limit` | number | — | Maximum number of records to fetch |
|
|
260
|
+
| `where` | object \| function | — | WHERE condition (object or Knex QueryBuilder function) |
|
|
261
|
+
| `orderBy` | string | — | Sort criteria |
|
|
262
|
+
| `ids` | number[] | — | Specific ID list for `ids` strategy |
|
|
263
|
+
| `filePath` | string | — | File path for `file` strategy |
|
|
264
|
+
| `useCache` | boolean | `false` | Whether to use caching |
|
|
265
|
+
| `cacheTtl` | number | `300` | Cache TTL (in seconds) |
|
|
266
266
|
|
|
267
|
-
**
|
|
267
|
+
**Example using a where condition:**
|
|
268
268
|
|
|
269
269
|
```json
|
|
270
270
|
"dataSource": {
|
|
@@ -276,47 +276,47 @@ relation prop에서 참조 데이터 조회 방식을 지정합니다.
|
|
|
276
276
|
}
|
|
277
277
|
```
|
|
278
278
|
|
|
279
|
-
###
|
|
279
|
+
### Relation Traversal Options (ExploreWithRelationsOptions)
|
|
280
280
|
|
|
281
|
-
`fixture gen
|
|
281
|
+
Used in `fixture gen` to fetch related data alongside the target data.
|
|
282
282
|
|
|
283
|
-
|
|
|
284
|
-
|
|
285
|
-
| `includeRelations` | boolean | `true` |
|
|
286
|
-
| `maxDepth` | number | `2` |
|
|
283
|
+
| Option | Type | Default | Description |
|
|
284
|
+
|--------|------|---------|-------------|
|
|
285
|
+
| `includeRelations` | boolean | `true` | Whether to include related data |
|
|
286
|
+
| `maxDepth` | number | `2` | Maximum depth for recursive traversal |
|
|
287
287
|
|
|
288
288
|
---
|
|
289
289
|
|
|
290
|
-
##
|
|
290
|
+
## Practical Tips
|
|
291
291
|
|
|
292
|
-
### cone.note
|
|
292
|
+
### Writing effective cone.note
|
|
293
293
|
|
|
294
|
-
**note
|
|
294
|
+
**note is the primary input for fixture data generation.** The LLM reads note to produce contextually appropriate data, so it must contain specific, domain-specialized content.
|
|
295
295
|
|
|
296
|
-
-
|
|
297
|
-
-
|
|
298
|
-
-
|
|
299
|
-
-
|
|
300
|
-
-
|
|
301
|
-
-
|
|
296
|
+
- **Be specific**: "Korean phone number in 010-XXXX-XXXX format" rather than "string"
|
|
297
|
+
- **Include business context**: "Employee salary. Range: 30,000,000–150,000,000 KRW"
|
|
298
|
+
- **Include concrete examples**: "e.g. AI-based drug discovery platform development, eco-friendly energy storage system development"
|
|
299
|
+
- **State value ranges explicitly**: "Between 50,000,000 (50,000) and 5,000,000,000 (5,000,000)"
|
|
300
|
+
- **Describe correlated fields**: "name_en must be the romanized form of name"
|
|
301
|
+
- **Specify length/format constraints**: "Korean self-introduction, 20–100 characters"
|
|
302
302
|
|
|
303
|
-
### LLM cone
|
|
303
|
+
### Improving LLM cone generation quality
|
|
304
304
|
|
|
305
|
-
1. `contract/{domain}/{domain}.contract.md
|
|
306
|
-
2. `cone gen`
|
|
305
|
+
1. Record domain rules and decision rationale in detail in `contract/{domain}/{domain}.contract.md`
|
|
306
|
+
2. Run `cone gen` — the LLM uses `contract/**/*.contract.md` as context
|
|
307
307
|
|
|
308
|
-
###
|
|
308
|
+
### When to regenerate cone
|
|
309
309
|
|
|
310
|
-
-
|
|
311
|
-
-
|
|
312
|
-
- fixture
|
|
313
|
-
- `--regenerate`
|
|
310
|
+
- After adding a new prop to an Entity
|
|
311
|
+
- After a business requirement change
|
|
312
|
+
- When fixture data quality is poor
|
|
313
|
+
- Running without `--regenerate` preserves existing notes and only fills in empty ones
|
|
314
314
|
|
|
315
315
|
---
|
|
316
316
|
|
|
317
|
-
##
|
|
317
|
+
## References
|
|
318
318
|
|
|
319
|
-
- **Fixture CLI**: `fixture-cli.md` — fixture gen/fetch/explore
|
|
320
|
-
- **Testing**: `testing.md` —
|
|
321
|
-
-
|
|
322
|
-
-
|
|
319
|
+
- **Fixture CLI**: `fixture-cli.md` — fixture gen/fetch/explore commands
|
|
320
|
+
- **Testing**: `testing.md` — writing tests and using fixtures
|
|
321
|
+
- **Source code**: `modules/sonamu/src/cone/cone-generator.ts`
|
|
322
|
+
- **Template cone**: `modules/sonamu/src/entity/entity-template-cone.ts`
|