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,261 +1,261 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sonamu-project-init
|
|
3
|
-
description: Sonamu
|
|
3
|
+
description: Sonamu project creation and initialization. Check whether a project already exists before starting entity design. Use before entity design.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Project Initialization
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## Question Order When Entity Design Is Requested
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
**One question at a time, in order:**
|
|
11
11
|
|
|
12
12
|
```
|
|
13
|
-
0.
|
|
14
|
-
1.
|
|
15
|
-
2. (
|
|
16
|
-
3. (
|
|
17
|
-
4. (
|
|
18
|
-
5.
|
|
19
|
-
6. (
|
|
20
|
-
7.
|
|
21
|
-
8. → entity-basic.md
|
|
13
|
+
0. Confirm working directory ← top priority
|
|
14
|
+
1. Check if project already exists
|
|
15
|
+
2. (If no project) Ask whether to create one
|
|
16
|
+
3. (If yes to create) Ask for project name
|
|
17
|
+
4. (If yes to create) Use defaults vs configure options
|
|
18
|
+
5. Run project creation
|
|
19
|
+
6. (If requirements provided) Document requirements ← important!
|
|
20
|
+
7. Review/customize configuration (see config.md)
|
|
21
|
+
8. → Proceed to entity-basic.md
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
---
|
|
25
25
|
|
|
26
|
-
##
|
|
26
|
+
## Documenting Requirements
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
**If the user provides requirements along with the project creation request, always document them.**
|
|
29
29
|
|
|
30
|
-
###
|
|
30
|
+
### Process
|
|
31
31
|
|
|
32
|
-
1.
|
|
33
|
-
- `pnpm create sonamu`
|
|
34
|
-
- `pnpm install`
|
|
35
|
-
- `.claude/skills/project/`
|
|
32
|
+
1. **Confirm project creation is complete**
|
|
33
|
+
- `pnpm create sonamu` complete
|
|
34
|
+
- `pnpm install` complete
|
|
35
|
+
- Confirm `.claude/skills/project/` directory was auto-created
|
|
36
36
|
|
|
37
|
-
2.
|
|
37
|
+
2. **Write requirements**
|
|
38
38
|
```bash
|
|
39
|
-
# .claude/skills/project/requirements.md
|
|
39
|
+
# Write to .claude/skills/project/requirements.md
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
3.
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
42
|
+
3. **Content to include**
|
|
43
|
+
- Project overview
|
|
44
|
+
- Core feature list
|
|
45
|
+
- User role definitions
|
|
46
|
+
- Key entity list
|
|
47
|
+
- Business rules
|
|
48
|
+
- Tech stack
|
|
49
|
+
- Additional requirements
|
|
50
50
|
|
|
51
|
-
4.
|
|
52
|
-
-
|
|
53
|
-
-
|
|
51
|
+
4. **Ongoing reference**
|
|
52
|
+
- Refer to this document throughout all subsequent development
|
|
53
|
+
- Maintain consistency during entity design, API development, and business logic implementation
|
|
54
54
|
|
|
55
|
-
###
|
|
55
|
+
### Example Scenario
|
|
56
56
|
|
|
57
57
|
```
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
User: "I want to build a research project management system.
|
|
59
|
+
I need announcement, project, and evaluation management,
|
|
60
|
+
with roles for admin, reviewer, and applicant."
|
|
61
61
|
|
|
62
62
|
Claude:
|
|
63
|
-
1.
|
|
64
|
-
2. "pnpm create sonamu research_system --yes"
|
|
65
|
-
3.
|
|
66
|
-
4. .claude/skills/project/requirements.md
|
|
63
|
+
1. Confirm project path
|
|
64
|
+
2. Run "pnpm create sonamu research_system --yes"
|
|
65
|
+
3. Project creation complete
|
|
66
|
+
4. Write the following to .claude/skills/project/requirements.md:
|
|
67
67
|
|
|
68
68
|
---
|
|
69
|
-
#
|
|
70
|
-
|
|
71
|
-
##
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
##
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
|
|
80
|
-
##
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
|
|
85
|
-
##
|
|
86
|
-
- Announcement
|
|
87
|
-
- Project
|
|
88
|
-
- Evaluation
|
|
89
|
-
- User
|
|
69
|
+
# Research Project Management System
|
|
70
|
+
|
|
71
|
+
## Project Overview
|
|
72
|
+
A system for managing research project calls, applications, and evaluations
|
|
73
|
+
|
|
74
|
+
## Core Features
|
|
75
|
+
- Announcement management (create, edit, publish, close)
|
|
76
|
+
- Project application and management
|
|
77
|
+
- Evaluation process (reviewer assignment, evaluation form creation, score calculation)
|
|
78
|
+
- User permission management
|
|
79
|
+
|
|
80
|
+
## User Roles
|
|
81
|
+
- Admin: full system management, announcement creation, reviewer assignment
|
|
82
|
+
- Reviewer: write evaluation forms, assign scores
|
|
83
|
+
- Applicant: apply for projects, check progress
|
|
84
|
+
|
|
85
|
+
## Key Entities
|
|
86
|
+
- Announcement
|
|
87
|
+
- Project
|
|
88
|
+
- Evaluation
|
|
89
|
+
- User
|
|
90
90
|
- ...
|
|
91
91
|
---
|
|
92
92
|
|
|
93
|
-
5.
|
|
93
|
+
5. Reference this document for consistent entity design going forward
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
###
|
|
96
|
+
### Important Notes
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
-
|
|
100
|
-
-
|
|
98
|
+
**Always document when:**
|
|
99
|
+
- The user provides requirements or a feature specification together with project creation
|
|
100
|
+
- There are business rules or special constraints
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
-
|
|
104
|
-
-
|
|
102
|
+
**When to document:**
|
|
103
|
+
- Immediately after project creation
|
|
104
|
+
- Before starting entity design
|
|
105
105
|
|
|
106
|
-
|
|
107
|
-
-
|
|
108
|
-
-
|
|
109
|
-
-
|
|
110
|
-
-
|
|
106
|
+
**How the document is used:**
|
|
107
|
+
- Reference during entity design
|
|
108
|
+
- Reference during API business logic implementation
|
|
109
|
+
- Reference when writing test cases
|
|
110
|
+
- Reference during frontend UI design
|
|
111
111
|
|
|
112
112
|
---
|
|
113
113
|
|
|
114
|
-
## 0.
|
|
114
|
+
## 0. Confirm Working Directory
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
**Must confirm before creating a project:**
|
|
117
117
|
|
|
118
|
-
|
|
119
|
-
-
|
|
120
|
-
-
|
|
121
|
-
-
|
|
118
|
+
Developers often separate working directories by project type:
|
|
119
|
+
- Company/framework projects: `~/Development/`
|
|
120
|
+
- Personal projects: `~/dev/programming/`
|
|
121
|
+
- Client work: `~/Projects/clients/`
|
|
122
122
|
|
|
123
|
-
###
|
|
123
|
+
### Confirmation Process
|
|
124
124
|
|
|
125
|
-
1.
|
|
125
|
+
1. **Determine the current working directory**
|
|
126
126
|
```bash
|
|
127
|
-
pwd #
|
|
127
|
+
pwd # check current directory
|
|
128
128
|
```
|
|
129
129
|
|
|
130
|
-
2.
|
|
130
|
+
2. **Ask the user to confirm**
|
|
131
131
|
```
|
|
132
|
-
"
|
|
133
|
-
|
|
132
|
+
"You are currently in {current_directory}. Should I create the project here?
|
|
133
|
+
If you work in a different location, please tell me the directory to create the project in.
|
|
134
134
|
|
|
135
|
-
1.
|
|
136
|
-
2.
|
|
135
|
+
1. Create in current directory
|
|
136
|
+
2. Specify a different directory"
|
|
137
137
|
```
|
|
138
138
|
|
|
139
|
-
3.
|
|
139
|
+
3. **Handle each choice**
|
|
140
140
|
|
|
141
|
-
**
|
|
142
|
-
-
|
|
143
|
-
-
|
|
141
|
+
**If option 1:**
|
|
142
|
+
- Proceed directly in the current directory
|
|
143
|
+
- Move to the next step (confirm project creation)
|
|
144
144
|
|
|
145
|
-
**
|
|
146
|
-
- "
|
|
147
|
-
-
|
|
148
|
-
-
|
|
149
|
-
-
|
|
150
|
-
-
|
|
145
|
+
**If option 2:**
|
|
146
|
+
- "Please provide the directory path where you want to create the project."
|
|
147
|
+
- After receiving the path: `cd {specified_path}`
|
|
148
|
+
- Check whether the directory exists
|
|
149
|
+
- If it doesn't exist: `mkdir -p {specified_path} && cd {specified_path}`
|
|
150
|
+
- Move to the next step
|
|
151
151
|
|
|
152
|
-
###
|
|
152
|
+
### Example Conversation
|
|
153
153
|
|
|
154
154
|
```
|
|
155
|
-
|
|
155
|
+
User: "I want to build a survey system. Design the entities for me."
|
|
156
156
|
|
|
157
|
-
Claude: "
|
|
158
|
-
|
|
157
|
+
Claude: "You are currently in /Users/noa/Documents. Should I create the project here?
|
|
158
|
+
If you work in a different location, please tell me the directory to create the project in.
|
|
159
159
|
|
|
160
|
-
1.
|
|
161
|
-
2.
|
|
160
|
+
1. Create in current directory
|
|
161
|
+
2. Specify a different directory"
|
|
162
162
|
|
|
163
|
-
|
|
163
|
+
User: "2"
|
|
164
164
|
|
|
165
|
-
Claude: "
|
|
165
|
+
Claude: "Please provide the directory path where you want to create the project."
|
|
166
166
|
|
|
167
|
-
|
|
167
|
+
User: "/Users/noa/Development"
|
|
168
168
|
|
|
169
|
-
Claude: "/Users/noa/Development
|
|
169
|
+
Claude: "Moving to /Users/noa/Development.
|
|
170
170
|
|
|
171
|
-
Sonamu
|
|
171
|
+
Is a Sonamu project already set up there?"
|
|
172
172
|
```
|
|
173
173
|
|
|
174
|
-
###
|
|
174
|
+
### Notes
|
|
175
175
|
|
|
176
|
-
-
|
|
177
|
-
-
|
|
178
|
-
-
|
|
179
|
-
- **Working directory
|
|
176
|
+
- **Relative paths are accepted**: `~/Development`, `../projects`, etc.
|
|
177
|
+
- **Tilde (~) expansion**: home directory is expanded automatically
|
|
178
|
+
- **Path validation**: ask whether to create the directory if it doesn't exist
|
|
179
|
+
- **Working directory change**: all subsequent commands use the new path
|
|
180
180
|
|
|
181
181
|
---
|
|
182
182
|
|
|
183
|
-
##
|
|
183
|
+
## Full Process Details
|
|
184
184
|
|
|
185
|
-
### A. Sonamu
|
|
185
|
+
### A. For Sonamu Developers (Local Link)
|
|
186
186
|
|
|
187
|
-
>
|
|
188
|
-
> -
|
|
189
|
-
> -
|
|
190
|
-
> -
|
|
187
|
+
> **Why use a local link:**
|
|
188
|
+
> - Sync directly from the Skills source
|
|
189
|
+
> - Local Sonamu changes take effect immediately
|
|
190
|
+
> - Required for framework development
|
|
191
191
|
|
|
192
|
-
#### 1.
|
|
192
|
+
#### 1. Create the Project
|
|
193
193
|
```bash
|
|
194
|
-
pnpm create sonamu [
|
|
194
|
+
pnpm create sonamu [project-name] --yes
|
|
195
195
|
```
|
|
196
196
|
|
|
197
|
-
|
|
197
|
+
See `create-sonamu.md` for CLI options.
|
|
198
198
|
|
|
199
|
-
#### 2. Sonamu
|
|
199
|
+
#### 2. Set Up the Sonamu Link
|
|
200
200
|
|
|
201
|
-
`pnpm-workspace.yaml
|
|
201
|
+
Add to the `overrides` section of `pnpm-workspace.yaml`:
|
|
202
202
|
|
|
203
203
|
```yaml
|
|
204
204
|
overrides:
|
|
205
205
|
sonamu: link:../../sonamu/modules/sonamu
|
|
206
206
|
```
|
|
207
207
|
|
|
208
|
-
>
|
|
209
|
-
> - Sonamu
|
|
210
|
-
> -
|
|
208
|
+
> **Path example:**
|
|
209
|
+
> - If Sonamu is at `~/Development/sonamu`
|
|
210
|
+
> - And the project is at `~/Development/my_project`
|
|
211
211
|
> - → `link:../../sonamu/modules/sonamu`
|
|
212
212
|
|
|
213
|
-
#### 3.
|
|
213
|
+
#### 3. Install Dependencies and Build
|
|
214
214
|
|
|
215
|
-
|
|
215
|
+
From the project root:
|
|
216
216
|
```bash
|
|
217
217
|
pnpm install
|
|
218
218
|
pnpm -r build
|
|
219
219
|
```
|
|
220
220
|
|
|
221
|
-
>
|
|
221
|
+
> **If build fails:** may be a resource initialization failure. Start Docker first (step 4), then start the dev server (step 5) and retry.
|
|
222
222
|
|
|
223
|
-
#### 4. DB
|
|
223
|
+
#### 4. Start the DB
|
|
224
224
|
```bash
|
|
225
225
|
cd packages/api
|
|
226
226
|
pnpm docker:up
|
|
227
227
|
```
|
|
228
228
|
|
|
229
|
-
>
|
|
229
|
+
> If a port conflict error occurs → see `database.md`
|
|
230
230
|
|
|
231
|
-
#### 5.
|
|
231
|
+
#### 5. Start the Dev Server
|
|
232
232
|
```bash
|
|
233
233
|
pnpm dev
|
|
234
234
|
```
|
|
235
235
|
|
|
236
|
-
>
|
|
236
|
+
> If step 3 build failed, retry `pnpm -r build` from the project root after the dev server is running
|
|
237
237
|
|
|
238
238
|
> Sonamu UI: http://localhost:34900/sonamu-ui
|
|
239
239
|
|
|
240
|
-
#### 6. Auth
|
|
240
|
+
#### 6. Generate Auth Entities (Separate Terminal)
|
|
241
241
|
|
|
242
|
-
**
|
|
242
|
+
In a separate terminal **while the dev server is running**:
|
|
243
243
|
|
|
244
244
|
```bash
|
|
245
245
|
cd packages/api
|
|
246
246
|
pnpm sonamu auth generate
|
|
247
247
|
```
|
|
248
248
|
|
|
249
|
-
>
|
|
249
|
+
> **Note:** Must run in dev mode for types files to be auto-generated as well
|
|
250
250
|
|
|
251
|
-
#### 7.
|
|
251
|
+
#### 7. Check Subsets
|
|
252
252
|
|
|
253
|
-
Sonamu UI (`http://localhost:34900/sonamu-ui`)
|
|
254
|
-
- User, Account, Session, Verification
|
|
253
|
+
In the Sonamu UI (`http://localhost:34900/sonamu-ui`) Entity menu:
|
|
254
|
+
- Check subsets for User, Account, Session, Verification entities
|
|
255
255
|
|
|
256
256
|
#### 8. DB Migration
|
|
257
257
|
|
|
258
|
-
Sonamu UI
|
|
258
|
+
Run migrations from Sonamu UI
|
|
259
259
|
|
|
260
260
|
#### 9. Scaffolding
|
|
261
261
|
|
|
@@ -266,192 +266,192 @@ pnpm sonamu scaffold model Session
|
|
|
266
266
|
pnpm sonamu scaffold model Verification
|
|
267
267
|
```
|
|
268
268
|
|
|
269
|
-
#### 10. Skills
|
|
269
|
+
#### 10. Sync Skills (Optional)
|
|
270
270
|
|
|
271
|
-
|
|
271
|
+
If you need to sync from the Skills source:
|
|
272
272
|
|
|
273
273
|
```bash
|
|
274
274
|
cd packages/api
|
|
275
275
|
pnpm sonamu skills sync
|
|
276
276
|
```
|
|
277
277
|
|
|
278
|
-
|
|
278
|
+
`.claude/skills/sonamu/` will be created at the project root.
|
|
279
279
|
|
|
280
280
|
---
|
|
281
281
|
|
|
282
|
-
### B. Sonamu
|
|
282
|
+
### B. For Sonamu Users (npm Version)
|
|
283
283
|
|
|
284
|
-
> **
|
|
285
|
-
> - Skills
|
|
286
|
-
> -
|
|
287
|
-
> -
|
|
284
|
+
> **When using the npm version:**
|
|
285
|
+
> - Skills are included in the npm package
|
|
286
|
+
> - No local link needed
|
|
287
|
+
> - For general users
|
|
288
288
|
|
|
289
|
-
#### 1-3.
|
|
289
|
+
#### 1-3. Create and Configure the Project
|
|
290
290
|
```bash
|
|
291
|
-
pnpm create sonamu [
|
|
292
|
-
cd [
|
|
291
|
+
pnpm create sonamu [project-name] --yes
|
|
292
|
+
cd [project-name]
|
|
293
293
|
pnpm install
|
|
294
294
|
pnpm -r build
|
|
295
295
|
```
|
|
296
296
|
|
|
297
|
-
>
|
|
297
|
+
> **If build fails:** Same as A step 3 - start Docker first, then start dev, then rebuild
|
|
298
298
|
|
|
299
|
-
#### 4-9. A
|
|
299
|
+
#### 4-9. Same as A Steps 4-9
|
|
300
300
|
|
|
301
|
-
(
|
|
301
|
+
(Skills sync is not needed)
|
|
302
302
|
|
|
303
303
|
---
|
|
304
304
|
|
|
305
|
-
##
|
|
305
|
+
## Example Conversations
|
|
306
306
|
|
|
307
307
|
### DO - Correct Example
|
|
308
308
|
|
|
309
309
|
```
|
|
310
|
-
|
|
310
|
+
User: "I want to build a survey system. Design the entities for me."
|
|
311
311
|
|
|
312
|
-
Claude: "
|
|
313
|
-
|
|
312
|
+
Claude: "You are currently in /Users/noa/Documents. Should I create the project here?
|
|
313
|
+
If you work in a different location, please tell me the directory to create the project in.
|
|
314
314
|
|
|
315
|
-
1.
|
|
316
|
-
2.
|
|
315
|
+
1. Create in current directory
|
|
316
|
+
2. Specify a different directory"
|
|
317
317
|
|
|
318
|
-
|
|
318
|
+
User: "1"
|
|
319
319
|
|
|
320
|
-
Claude: "Sonamu
|
|
320
|
+
Claude: "Is a Sonamu project already set up here?"
|
|
321
321
|
|
|
322
|
-
|
|
322
|
+
User: "No"
|
|
323
323
|
|
|
324
|
-
Claude: "pnpm create sonamu
|
|
324
|
+
Claude: "Should I create a project with pnpm create sonamu?"
|
|
325
325
|
|
|
326
|
-
|
|
326
|
+
User: "Yes"
|
|
327
327
|
|
|
328
|
-
Claude: "
|
|
328
|
+
Claude: "What should the project name be? (e.g. survey_system)"
|
|
329
329
|
|
|
330
|
-
|
|
330
|
+
User: "survey_system"
|
|
331
331
|
|
|
332
|
-
Claude: "
|
|
333
|
-
1.
|
|
334
|
-
2.
|
|
332
|
+
Claude: "Should I create it quickly with defaults, or would you like to configure DB settings and other options yourself?
|
|
333
|
+
1. Create with defaults (--yes)
|
|
334
|
+
2. Configure options manually"
|
|
335
335
|
|
|
336
|
-
|
|
336
|
+
User: "1"
|
|
337
337
|
|
|
338
|
-
Claude: "
|
|
338
|
+
Claude: "Creating with the following command:
|
|
339
339
|
pnpm create sonamu survey_system --yes
|
|
340
340
|
|
|
341
|
-
|
|
341
|
+
Let me know if you need any additional configuration after creation."
|
|
342
342
|
```
|
|
343
343
|
|
|
344
344
|
### DO NOT - Incorrect Example
|
|
345
345
|
|
|
346
346
|
```
|
|
347
|
-
|
|
347
|
+
User: "I want to build a survey system. Design the entities for me."
|
|
348
348
|
|
|
349
|
-
Claude: "
|
|
349
|
+
Claude: "Before designing the survey system entities, let me confirm a few things.
|
|
350
350
|
|
|
351
|
-
1.
|
|
352
|
-
2. Sonamu
|
|
353
|
-
3.
|
|
354
|
-
4.
|
|
351
|
+
1. Which directory should I create the project in?
|
|
352
|
+
2. Is a Sonamu project already set up?
|
|
353
|
+
3. What should the project name be?
|
|
354
|
+
4. Should I use defaults or configure options manually?"
|
|
355
355
|
```
|
|
356
356
|
|
|
357
|
-
|
|
358
|
-
-
|
|
359
|
-
-
|
|
357
|
+
**Why this is wrong:**
|
|
358
|
+
- Asking multiple questions at once (should ask one at a time)
|
|
359
|
+
- The question order is not clear
|
|
360
360
|
|
|
361
361
|
---
|
|
362
362
|
|
|
363
|
-
##
|
|
363
|
+
## Post-Creation Configuration
|
|
364
364
|
|
|
365
|
-
|
|
365
|
+
Items to confirm with the user after project creation:
|
|
366
366
|
|
|
367
|
-
### 1. .env
|
|
367
|
+
### 1. Check .env
|
|
368
368
|
|
|
369
369
|
```
|
|
370
|
-
Claude: "packages/api/.env
|
|
370
|
+
Claude: "The packages/api/.env file has been created. Would you like to review the default settings?"
|
|
371
371
|
```
|
|
372
372
|
|
|
373
|
-
|
|
373
|
+
Default generated .env:
|
|
374
374
|
```env
|
|
375
375
|
DB_HOST=0.0.0.0
|
|
376
376
|
DB_PORT=5432
|
|
377
377
|
DB_USER=postgres
|
|
378
378
|
DB_PASSWORD=1234
|
|
379
|
-
CONTAINER_NAME={
|
|
380
|
-
DATABASE_NAME={
|
|
381
|
-
PROJECT_NAME={
|
|
382
|
-
SESSION_SECRET={
|
|
383
|
-
SESSION_SALT={
|
|
379
|
+
CONTAINER_NAME={project-name}-container
|
|
380
|
+
DATABASE_NAME={project-name}
|
|
381
|
+
PROJECT_NAME={project-name}
|
|
382
|
+
SESSION_SECRET={auto-generated}
|
|
383
|
+
SESSION_SALT={auto-generated}
|
|
384
384
|
```
|
|
385
385
|
|
|
386
|
-
### 1.5
|
|
386
|
+
### 1.5 Check for Leftover Template Defaults (CRITICAL)
|
|
387
387
|
|
|
388
|
-
`pnpm create sonamu
|
|
388
|
+
Projects created with `pnpm create sonamu` contain placeholder values. **These must be replaced with real values.**
|
|
389
389
|
|
|
390
390
|
```bash
|
|
391
|
-
#
|
|
391
|
+
# Check: search for leftover default values
|
|
392
392
|
grep -r 'SonamuProject' packages/api/src/
|
|
393
393
|
```
|
|
394
394
|
|
|
395
395
|
**`packages/api/src/sonamu.config.ts`:**
|
|
396
396
|
```typescript
|
|
397
|
-
// DO NOT - template
|
|
397
|
+
// DO NOT - template default left as-is
|
|
398
398
|
projectName: process.env.PROJECT_NAME ?? "SonamuProject"
|
|
399
399
|
|
|
400
|
-
// DO -
|
|
400
|
+
// DO - replace with real project name
|
|
401
401
|
projectName: process.env.PROJECT_NAME ?? "NIFOS"
|
|
402
402
|
```
|
|
403
403
|
|
|
404
|
-
|
|
405
|
-
- [ ] `sonamu.config.ts
|
|
406
|
-
- [ ] `package.json` (root)
|
|
407
|
-
- [ ]
|
|
408
|
-
- [ ]
|
|
404
|
+
**Replacement checklist:**
|
|
405
|
+
- [ ] `projectName` default in `sonamu.config.ts`
|
|
406
|
+
- [ ] `name` field in `package.json` (root)
|
|
407
|
+
- [ ] `PROJECT_NAME`, `DATABASE_NAME` in `.env`
|
|
408
|
+
- [ ] `SESSION_SECRET`, `SESSION_SALT` in `.env` (must replace before going to production)
|
|
409
409
|
|
|
410
|
-
### 2.
|
|
410
|
+
### 2. Check Whether Additional Configuration Is Needed
|
|
411
411
|
|
|
412
412
|
```
|
|
413
|
-
Claude: "
|
|
414
|
-
-
|
|
415
|
-
- S3
|
|
416
|
-
-
|
|
417
|
-
-
|
|
413
|
+
Claude: "Is there anything else you need to configure?
|
|
414
|
+
- Session security settings (for production)
|
|
415
|
+
- S3 file upload
|
|
416
|
+
- Change server port
|
|
417
|
+
- Nothing (proceed immediately)"
|
|
418
418
|
```
|
|
419
419
|
|
|
420
|
-
|
|
420
|
+
See `config.md` for configuration details for each item.
|
|
421
421
|
|
|
422
|
-
### 3.
|
|
422
|
+
### 3. Proceed After Configuration
|
|
423
423
|
|
|
424
424
|
```
|
|
425
|
-
Claude: "
|
|
425
|
+
Claude: "Configuration is complete. Ready to proceed to the next step?
|
|
426
426
|
|
|
427
427
|
1. cd survey_system/packages/api
|
|
428
428
|
2. pnpm docker:up
|
|
429
429
|
3. pnpm dev
|
|
430
|
-
4. (
|
|
430
|
+
4. (separate terminal) pnpm sonamu auth generate"
|
|
431
431
|
```
|
|
432
432
|
|
|
433
433
|
---
|
|
434
434
|
|
|
435
|
-
##
|
|
435
|
+
## Checking an Existing Project
|
|
436
436
|
|
|
437
|
-
|
|
437
|
+
If the user says "I already have a project", ask for the path:
|
|
438
438
|
|
|
439
439
|
```
|
|
440
|
-
Claude: "
|
|
440
|
+
Claude: "Please tell me the project path."
|
|
441
441
|
```
|
|
442
442
|
|
|
443
|
-
|
|
443
|
+
After receiving the path, you can confirm by checking whether `packages/api/src/application/` exists.
|
|
444
444
|
|
|
445
445
|
---
|
|
446
446
|
|
|
447
|
-
##
|
|
447
|
+
## Handling Configuration Questions
|
|
448
448
|
|
|
449
|
-
|
|
449
|
+
When the user asks a configuration-related question, refer to `config.md` for the answer:
|
|
450
450
|
|
|
451
|
-
|
|
|
452
|
-
|
|
453
|
-
| ".env
|
|
454
|
-
| "S3
|
|
455
|
-
| "
|
|
456
|
-
| "
|
|
457
|
-
| "
|
|
451
|
+
| Question | Reference |
|
|
452
|
+
|----------|-----------|
|
|
453
|
+
| "How do I configure .env?" | config.md - .env file |
|
|
454
|
+
| "How do I connect S3?" | config.md - server.storage |
|
|
455
|
+
| "How do I change the session settings?" | config.md - server.plugins.session |
|
|
456
|
+
| "How do I change the port?" | config.md - server.listen |
|
|
457
|
+
| "Cache settings?" | config.md - server.cache |
|