sonamu 0.10.4 → 0.10.6
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/bin/cli.js +206 -187
- package/dist/cone/cone-generator.js +3 -9
- package/dist/database/knex.d.ts.map +1 -1
- package/dist/database/knex.js +2 -2
- package/dist/database/puri.d.ts +17 -0
- package/dist/database/puri.d.ts.map +1 -1
- package/dist/database/puri.js +102 -3
- package/dist/migration/code-generation.js +6 -6
- package/dist/migration/migrator.d.ts.map +1 -1
- package/dist/migration/migrator.js +51 -6
- package/dist/ui-web/assets/{index-CDd6xT-F.js → index-D0MHYbxl.js} +2 -2
- package/dist/ui-web/assets/index-Dx_JX4aQ.css +1 -0
- package/dist/ui-web/index.html +2 -2
- package/package.json +2 -2
- package/src/bin/cli.ts +283 -282
- package/src/cone/cone-generator.ts +2 -18
- package/src/database/__tests__/puri.test.ts +183 -0
- package/src/database/knex.ts +4 -1
- package/src/database/puri.ts +229 -2
- package/src/database/puri.types.test-d.ts +56 -0
- package/src/migration/code-generation.ts +5 -5
- package/src/migration/migrator.ts +81 -7
- package/src/skills/AGENTS.md +76 -50
- package/src/skills/sonamu/SKILL.md +46 -227
- package/src/skills/{sonamu/ai-agents.md → sonamu-ai-agents/SKILL.md} +3 -3
- package/src/skills/{sonamu/api.md → sonamu-api/SKILL.md} +3 -2
- package/src/skills/{sonamu/auth.md → sonamu-auth/SKILL.md} +9 -4
- package/src/skills/{sonamu/auth-plugins.md → sonamu-auth/references/plugins.md} +2 -7
- package/src/skills/sonamu-auth/references/user-id-migration-followups.md +192 -0
- package/src/skills/{sonamu/auth-migration.md → sonamu-auth/references/user-id-migration.md} +1 -195
- package/src/skills/sonamu-config/SKILL.md +203 -0
- package/src/skills/{sonamu → sonamu-config/references}/database.md +3 -8
- package/src/skills/sonamu-config/references/environments.md +178 -0
- package/src/skills/sonamu-config/references/server-options.md +400 -0
- package/src/skills/sonamu-entity/SKILL.md +180 -0
- package/src/skills/{sonamu/entity-validation-checklist.md → sonamu-entity/references/creation-workflow.md} +117 -8
- package/src/skills/sonamu-entity/references/design-guides.md +243 -0
- package/src/skills/sonamu-entity/references/field-types.md +170 -0
- package/src/skills/sonamu-entity/references/relations-detail.md +245 -0
- package/src/skills/{sonamu/entity-relations.md → sonamu-entity/references/relations.md} +1 -258
- package/src/skills/{sonamu → sonamu-entity/references}/subset.md +1 -11
- package/src/skills/sonamu-fixture/SKILL.md +180 -0
- package/src/skills/{sonamu/fixture-cli.md → sonamu-fixture/references/cli-usage.md} +5 -176
- package/src/skills/{sonamu → sonamu-fixture/references}/cone.md +4 -14
- package/src/skills/sonamu-frontend/SKILL.md +142 -0
- package/src/skills/sonamu-frontend/references/components.md +323 -0
- package/src/skills/sonamu-frontend/references/examples.md +64 -0
- package/src/skills/sonamu-frontend/references/hooks.md +273 -0
- package/src/skills/sonamu-frontend/references/runtime.md +165 -0
- package/src/skills/{sonamu → sonamu-frontend/references}/scaffolding.md +3 -8
- package/src/skills/{sonamu/i18n.md → sonamu-i18n/SKILL.md} +2 -2
- package/src/skills/{sonamu/migration.md → sonamu-migration/SKILL.md} +1 -1
- package/src/skills/{sonamu/naite.md → sonamu-naite/SKILL.md} +5 -5
- package/src/skills/sonamu-query/SKILL.md +48 -0
- package/src/skills/sonamu-query/references/model-patterns.md +390 -0
- package/src/skills/{sonamu → sonamu-query/references}/model.md +1 -401
- package/src/skills/{sonamu → sonamu-query/references}/puri.md +31 -243
- package/src/skills/sonamu-query/references/search.md +238 -0
- package/src/skills/{sonamu → sonamu-query/references}/upsert.md +1 -6
- package/src/skills/{sonamu/tasks.md → sonamu-tasks/SKILL.md} +1 -1
- package/src/skills/sonamu-testing/SKILL.md +251 -0
- package/src/skills/{sonamu/testing-devrunner.md → sonamu-testing/references/devrunner.md} +4 -9
- package/src/skills/sonamu-testing/references/helpers.md +185 -0
- package/src/skills/sonamu-testing/references/patterns.md +263 -0
- package/src/skills/sonamu-testing/references/pitfalls.md +588 -0
- package/src/skills/sonamu-testing/references/quick-start.md +285 -0
- package/src/skills/sonamu-testing/references/type-safety.md +172 -0
- package/src/skills/sonamu-testing/references/writing-plan.md +375 -0
- package/src/skills/{sonamu/vector.md → sonamu-vector/SKILL.md} +1 -1
- package/dist/ui-web/assets/index-Dx4ap5i4.css +0 -1
- package/src/skills/commands/sonamu-skills.md +0 -20
- package/src/skills/project/README.md +0 -19
- package/src/skills/project/architecture.md +0 -373
- package/src/skills/sonamu/cdd.md +0 -129
- package/src/skills/sonamu/config.md +0 -772
- package/src/skills/sonamu/create-sonamu.md +0 -208
- package/src/skills/sonamu/entity-basic.md +0 -678
- package/src/skills/sonamu/framework-change.md +0 -96
- package/src/skills/sonamu/frontend.md +0 -915
- package/src/skills/sonamu/project-init.md +0 -477
- package/src/skills/sonamu/skill-contribution.md +0 -247
- package/src/skills/sonamu/testing.md +0 -2163
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: sonamu-skill-contribution
|
|
3
|
-
description: Workflow for reflecting troubleshooting resolutions into skills. Covers existing skill matching, duplication check, format standards, and user approval gate. Use when a troubleshooting session concludes and the resolution should be captured as reusable knowledge.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Troubleshooting → Skill Contribution Workflow
|
|
7
|
-
|
|
8
|
-
The process for capturing knowledge from a resolved troubleshooting session into skills.
|
|
9
|
-
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
## Triggers
|
|
13
|
-
|
|
14
|
-
| Trigger | Owner | Example |
|
|
15
|
-
| -------------------- | ----- | ------------------------------------------------------------------------------ |
|
|
16
|
-
| **Explicit request** | User | "Document this in skills", "Record this fix" |
|
|
17
|
-
| **Agent suggestion** | Agent | When a detection pattern below is met, propose: "Should I add this to skills?" |
|
|
18
|
-
|
|
19
|
-
### Agent detection patterns
|
|
20
|
-
|
|
21
|
-
Suggest contribution when the following flow is observed in the conversation:
|
|
22
|
-
|
|
23
|
-
1. **Error/failure → investigation → fix → success** pattern completes
|
|
24
|
-
2. The resolution reveals **internal framework behavior** or **undocumented constraints**
|
|
25
|
-
3. The same problem is **likely to occur in other projects or for other users**
|
|
26
|
-
|
|
27
|
-
Do not suggest when:
|
|
28
|
-
|
|
29
|
-
- Simple typos or missing imports
|
|
30
|
-
- Project-specific business logic bugs
|
|
31
|
-
- One-off environment issues (e.g., port conflict on a specific machine)
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## Steps
|
|
36
|
-
|
|
37
|
-
```
|
|
38
|
-
[1] Extract — summarize problem / cause / solution / source
|
|
39
|
-
[2] Match — compare against existing skills
|
|
40
|
-
[3] Decide — determine where to put it
|
|
41
|
-
[4] Draft — write the content
|
|
42
|
-
[5] Approve — get user confirmation
|
|
43
|
-
[6] Apply — update or create the file
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
## [1] Extract
|
|
49
|
-
|
|
50
|
-
Summarize from the conversation using the following structure:
|
|
51
|
-
|
|
52
|
-
```yaml
|
|
53
|
-
symptom: "one-line description (error message or observed behavior)"
|
|
54
|
-
cause: "explanation of root cause"
|
|
55
|
-
solution: "resolution steps (include specific commands/code)"
|
|
56
|
-
source_paths: # related source file paths
|
|
57
|
-
- "src/testing/dev-vitest-manager.ts"
|
|
58
|
-
tags: # keywords for matching
|
|
59
|
-
- "testing"
|
|
60
|
-
- "devrunner"
|
|
61
|
-
scope: "sonamu" # "sonamu" (framework-level) or "local" (project-specific)
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
### Scope decision criteria
|
|
65
|
-
|
|
66
|
-
| Condition | scope |
|
|
67
|
-
| --------------------------------------------------------------- | ------------ |
|
|
68
|
-
| Relates to Sonamu framework behavior or constraints | `sonamu` |
|
|
69
|
-
| Relates to Sonamu CLI, config, migration, or shared tooling | `sonamu` |
|
|
70
|
-
| Relates to a specific project's business logic or configuration | `local` |
|
|
71
|
-
| Unclear | Ask the user |
|
|
72
|
-
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
## [2] Match — Compare Against Existing Skills
|
|
76
|
-
|
|
77
|
-
**Always read existing skills first and check for duplication.** Creating a new file is a last resort.
|
|
78
|
-
|
|
79
|
-
### Match priority
|
|
80
|
-
|
|
81
|
-
| Priority | Method | Description |
|
|
82
|
-
| -------- | ----------------------- | ------------------------------------------------------------------------------ |
|
|
83
|
-
| 1 | **Source paths** | Check whether `source_paths` overlap with source references in existing skills |
|
|
84
|
-
| 2 | **Tags/keywords** | Compare against each skill's YAML `description` and tags |
|
|
85
|
-
| 3 | **SKILL.md task table** | Cross-reference which task row maps to the problem domain |
|
|
86
|
-
|
|
87
|
-
### Source path → skill mapping (key paths)
|
|
88
|
-
|
|
89
|
-
| Source path pattern | Corresponding skill |
|
|
90
|
-
| ------------------------------ | ---------------------------------------------------------- |
|
|
91
|
-
| `src/testing/*` | testing.md, testing-devrunner.md, naite.md, fixture-cli.md |
|
|
92
|
-
| `src/database/puri*` | puri.md |
|
|
93
|
-
| `src/database/migrator*` | migration.md |
|
|
94
|
-
| `src/auth/*` | auth.md, auth-plugins.md, auth-migration.md |
|
|
95
|
-
| `src/entity/*`, `src/syncer/*` | entity-basic.md, entity-relations.md |
|
|
96
|
-
| `src/vector/*` | vector.md |
|
|
97
|
-
| `src/ai/agents/*` | ai-agents.md |
|
|
98
|
-
| `src/naite/*` | naite.md |
|
|
99
|
-
| `src/cone/*` | cone.md |
|
|
100
|
-
| `src/api/*` | api.md |
|
|
101
|
-
| `src/template/*` | framework-change.md |
|
|
102
|
-
| `src/model/*` | model.md |
|
|
103
|
-
| `src/ssr/*` | (no skill — candidate for new file) |
|
|
104
|
-
| `sonamu.config.ts` related | config.md |
|
|
105
|
-
|
|
106
|
-
If the path is not in this table, fall through to tag/keyword matching.
|
|
107
|
-
|
|
108
|
-
### Matching steps
|
|
109
|
-
|
|
110
|
-
1. Read the Skills list table in `SKILL.md`
|
|
111
|
-
2. Read candidate skill files (1–3 files)
|
|
112
|
-
3. Check whether **identical or similar content already exists** in those skills
|
|
113
|
-
|
|
114
|
-
---
|
|
115
|
-
|
|
116
|
-
## [3] Decide
|
|
117
|
-
|
|
118
|
-
| Match result | Decision | Description |
|
|
119
|
-
| ------------------------------------------------------ | --------------- | -------------------------------------------- |
|
|
120
|
-
| **Same content exists** in an existing skill | **SKIP** | Report: "Already documented in {skill}.md" |
|
|
121
|
-
| Match found + skill has **troubleshooting section** | **APPEND** | Add item to existing section |
|
|
122
|
-
| Match found + skill has **no troubleshooting section** | **ADD_SECTION** | Add a new troubleshooting section at the end |
|
|
123
|
-
| No match + scope=`sonamu` | **NEW_FILE** | Create a new skill file (rare) |
|
|
124
|
-
| No match + scope=`local` | **LOCAL** | Create in `.claude/skills/local/` |
|
|
125
|
-
|
|
126
|
-
**CRITICAL: APPEND and ADD_SECTION should account for the vast majority of cases.** NEW_FILE is only for when the content genuinely does not fit anywhere in the existing skills.
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
|
|
130
|
-
## [4] Draft — Format Standards
|
|
131
|
-
|
|
132
|
-
### Troubleshooting section format
|
|
133
|
-
|
|
134
|
-
Use the pattern from `testing-devrunner.md` as the standard:
|
|
135
|
-
|
|
136
|
-
```markdown
|
|
137
|
-
## Troubleshooting
|
|
138
|
-
|
|
139
|
-
### "Error message or one-line symptom"
|
|
140
|
-
|
|
141
|
-
→ Explanation of root cause
|
|
142
|
-
→ Fix: specific resolution (commands / code / config)
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
List multiple items as separate `###` entries.
|
|
146
|
-
|
|
147
|
-
### Example — APPEND
|
|
148
|
-
|
|
149
|
-
Adding to cone.md:
|
|
150
|
-
|
|
151
|
-
```markdown
|
|
152
|
-
### "pnpm sonamu cone gen --all fails with 'ANTHROPIC_API_KEY is not set'"
|
|
153
|
-
|
|
154
|
-
→ Key is missing from .env or was set only in root .env rather than packages/api/.env
|
|
155
|
-
→ Fix: add `ANTHROPIC_API_KEY=sk-ant-...` to `packages/api/.env`
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
### Example — ADD_SECTION
|
|
159
|
-
|
|
160
|
-
Adding a new section at the end of puri.md:
|
|
161
|
-
|
|
162
|
-
```markdown
|
|
163
|
-
---
|
|
164
|
-
|
|
165
|
-
## Troubleshooting
|
|
166
|
-
|
|
167
|
-
### "nullable field type inferred as non-null after leftJoin"
|
|
168
|
-
|
|
169
|
-
→ Puri type inference does not account for join direction. leftJoin results may be null at runtime but are not reflected as optional in the types.
|
|
170
|
-
→ Fix: explicitly mark the field as optional in the subset, or add a null check at the call site
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
### Example — LOCAL
|
|
174
|
-
|
|
175
|
-
`.claude/skills/local/kopri-deployment.md`:
|
|
176
|
-
|
|
177
|
-
```markdown
|
|
178
|
-
---
|
|
179
|
-
name: kopri-deployment
|
|
180
|
-
description: Deployment notes for the KOPRI project. Use when deploying KOPRI project.
|
|
181
|
-
---
|
|
182
|
-
|
|
183
|
-
# KOPRI Deployment Troubleshooting
|
|
184
|
-
|
|
185
|
-
## Troubleshooting
|
|
186
|
-
|
|
187
|
-
### "sharp package installation fails during Docker build"
|
|
188
|
-
|
|
189
|
-
→ Alpine image is missing native dependencies for sharp
|
|
190
|
-
→ Fix: add `RUN apk add --no-cache vips-dev` to Dockerfile
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
---
|
|
194
|
-
|
|
195
|
-
## [5] Approve — User Confirmation Gate
|
|
196
|
-
|
|
197
|
-
Show the user:
|
|
198
|
-
|
|
199
|
-
1. **Decision**: where to put it + one-line reason
|
|
200
|
-
2. **Content preview**: the markdown to be added or modified
|
|
201
|
-
3. **Approval request**
|
|
202
|
-
|
|
203
|
-
```
|
|
204
|
-
Decision: APPEND — adding troubleshooting entry to cone.md
|
|
205
|
-
Reason: source_paths match src/cone/; troubleshooting section already exists in cone.md
|
|
206
|
-
|
|
207
|
-
Content to add:
|
|
208
|
-
### "cone gen fails with 'No entity found'"
|
|
209
|
-
→ ...
|
|
210
|
-
|
|
211
|
-
Shall I apply this?
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
**Do not apply without approval.**
|
|
215
|
-
|
|
216
|
-
---
|
|
217
|
-
|
|
218
|
-
## [6] Apply
|
|
219
|
-
|
|
220
|
-
| Decision | Action |
|
|
221
|
-
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------- |
|
|
222
|
-
| SKIP | None |
|
|
223
|
-
| APPEND | Add `###` entry to the troubleshooting section in the skill |
|
|
224
|
-
| ADD_SECTION | Add `## Troubleshooting` section + entry at the end of the skill (just before `## References` if it exists, otherwise at the very end) |
|
|
225
|
-
| NEW_FILE | Create new .md file + **register in both tables in SKILL.md** |
|
|
226
|
-
| LOCAL | Create `.claude/skills/local/{name}.md` |
|
|
227
|
-
|
|
228
|
-
### ADD_SECTION insertion position
|
|
229
|
-
|
|
230
|
-
- If a `## References` section exists, insert **immediately before it**
|
|
231
|
-
- Otherwise, insert at the **very end** of the file
|
|
232
|
-
|
|
233
|
-
### NEW_FILE required actions
|
|
234
|
-
|
|
235
|
-
1. Create file in `skills/sonamu/`
|
|
236
|
-
2. Include YAML frontmatter (name, description)
|
|
237
|
-
3. Add a row to the "Skills List" table in `SKILL.md`
|
|
238
|
-
4. Add a row to the "Task-to-Skill" table in `SKILL.md`
|
|
239
|
-
5. If a related PHASE exists in `.claude/workflow/project_init.md`, add the new skill to its reference skills
|
|
240
|
-
|
|
241
|
-
---
|
|
242
|
-
|
|
243
|
-
## References
|
|
244
|
-
|
|
245
|
-
- **Skill list and structure**: `SKILL.md`
|
|
246
|
-
- **Agent rules**: `AGENTS.md`
|
|
247
|
-
- **Project-local skills**: `.claude/skills/local/`
|