@joktec/skills 0.1.4 → 0.1.8
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/README.md +4 -2
- package/dist/claude/skills/advanced-typescript-design/SKILL.md +60 -0
- package/dist/claude/skills/advanced-typescript-design/agents/openai.yaml +4 -0
- package/dist/claude/skills/advanced-typescript-design/references/advanced.md +219 -0
- package/dist/claude/skills/advanced-typescript-design/references/simple.md +149 -0
- package/dist/claude/skills/joktec-mongo-skill/SKILL.md +9 -2
- package/dist/claude/skills/joktec-mongo-skill/references/repository.md +14 -11
- package/dist/claude/skills/joktec-mongo-skill/references/schema-and-plugins.md +43 -7
- package/dist/claude/skills/joktec-mysql-skill/SKILL.md +6 -2
- package/dist/claude/skills/joktec-mysql-skill/references/entities.md +82 -53
- package/dist/claude/skills/joktec-mysql-skill/references/repository.md +15 -1
- package/dist/claude/skills/joktec-tool-skill/references/tools.md +1 -0
- package/dist/codex/skills/advanced-typescript-design/SKILL.md +60 -0
- package/dist/codex/skills/advanced-typescript-design/agents/openai.yaml +4 -0
- package/dist/codex/skills/advanced-typescript-design/references/advanced.md +219 -0
- package/dist/codex/skills/advanced-typescript-design/references/simple.md +149 -0
- package/dist/codex/skills/joktec-mongo-skill/SKILL.md +9 -2
- package/dist/codex/skills/joktec-mongo-skill/references/repository.md +14 -11
- package/dist/codex/skills/joktec-mongo-skill/references/schema-and-plugins.md +43 -7
- package/dist/codex/skills/joktec-mysql-skill/SKILL.md +6 -2
- package/dist/codex/skills/joktec-mysql-skill/references/entities.md +82 -53
- package/dist/codex/skills/joktec-mysql-skill/references/repository.md +15 -1
- package/dist/codex/skills/joktec-tool-skill/references/tools.md +1 -0
- package/dist/copilot/.github/copilot-instructions.md +601 -73
- package/dist/cursor/.cursor/rules/advanced-typescript-design.mdc +437 -0
- package/dist/cursor/.cursor/rules/joktec-mongo-skill.mdc +66 -20
- package/dist/cursor/.cursor/rules/joktec-mysql-skill.mdc +103 -56
- package/dist/cursor/.cursor/rules/joktec-tool-skill.mdc +1 -0
- package/dist/gemini/GEMINI.md +603 -73
- package/dist/windsurf/.windsurf/rules/advanced-typescript-design.md +433 -0
- package/dist/windsurf/.windsurf/rules/joktec-mongo-skill.md +66 -20
- package/dist/windsurf/.windsurf/rules/joktec-mysql-skill.md +103 -56
- package/dist/windsurf/.windsurf/rules/joktec-tool-skill.md +1 -0
- package/package.json +6 -3
- package/scripts/sync-pack-version.mjs +38 -0
- package/skill-pack.json +35 -1
- package/skills/advanced-typescript-design/SKILL.md +60 -0
- package/skills/advanced-typescript-design/agents/openai.yaml +4 -0
- package/skills/advanced-typescript-design/references/advanced.md +219 -0
- package/skills/advanced-typescript-design/references/simple.md +149 -0
- package/skills/joktec-mongo-skill/SKILL.md +9 -2
- package/skills/joktec-mongo-skill/references/repository.md +14 -11
- package/skills/joktec-mongo-skill/references/schema-and-plugins.md +43 -7
- package/skills/joktec-mysql-skill/SKILL.md +6 -2
- package/skills/joktec-mysql-skill/references/entities.md +82 -53
- package/skills/joktec-mysql-skill/references/repository.md +15 -1
- package/skills/joktec-tool-skill/references/tools.md +1 -0
|
@@ -16,8 +16,12 @@ Use this skill for relational resources backed by JokTec's TypeORM wrapper.
|
|
|
16
16
|
- Treat `mysql`, `mariadb`, and `postgres` as the first-class dialects.
|
|
17
17
|
- Keep `sync` explicit and normally enabled only by an owner process or development bootstrap.
|
|
18
18
|
- Do not add new behavior to deprecated `MysqlFinder`; use `MysqlRepo.qb()` and `MysqlHelper` paths.
|
|
19
|
-
-
|
|
20
|
-
-
|
|
19
|
+
- Use schema-first `@Column`, `@PrimaryColumn`, and `@TimestampColumn` wrappers when an entity also acts as DTO metadata.
|
|
20
|
+
- Use `@Column({ kind: 'virtual' })` for computed getters that need expose/Swagger metadata without persistence.
|
|
21
|
+
- Use `immutable` for API read-only metadata; TypeORM `update: false` remains storage write behavior and is also inferred as Swagger read-only when `immutable` is not set.
|
|
22
|
+
- Do not add `swagger.type` just because a column has a primitive, date, array, nested JSON class, or relation type. The wrapper infers Swagger metadata from TypeScript design type and JokTec options. Use `swagger` only to override an inferred shape.
|
|
23
|
+
- Do not use `@joktec/mysql` for Mongo/ObjectId columns, even though TypeORM has Mongo-related APIs.
|
|
24
|
+
- For real migrations, inspect the installed `@joktec/mysql` source in the consumer project's `node_modules` first. If that is insufficient, read GitHub package docs, then GitHub source. Use the local `../joktec-framework` checkout only when you are working inside the JokTec development workspace.
|
|
21
25
|
|
|
22
26
|
## References
|
|
23
27
|
|
|
@@ -32,13 +36,29 @@ Use this skill for relational resources backed by JokTec's TypeORM wrapper.
|
|
|
32
36
|
|
|
33
37
|
## Source Lookup
|
|
34
38
|
|
|
35
|
-
When blocked, inspect:
|
|
39
|
+
When blocked in a consumer project, inspect the installed package first:
|
|
40
|
+
|
|
41
|
+
- `node_modules/@joktec/mysql/README.md`
|
|
42
|
+
- `node_modules/@joktec/mysql/AGENTS.md` when published with the package
|
|
43
|
+
- `node_modules/@joktec/mysql/dist/index.d.ts`
|
|
44
|
+
- `node_modules/@joktec/mysql/dist/decorators/column.decorator.d.ts`
|
|
45
|
+
- `node_modules/@joktec/mysql/dist/decorators/columns/column.type.d.ts`
|
|
46
|
+
- `node_modules/@joktec/mysql/dist/decorators/timestamp.decorator.d.ts`
|
|
47
|
+
|
|
48
|
+
If the installed package is missing enough detail, use the GitHub package docs next:
|
|
49
|
+
|
|
50
|
+
- `https://github.com/joktec/joktec-framework/tree/main/packages/databases/mysql`
|
|
51
|
+
|
|
52
|
+
Use GitHub source only after package docs and installed types are not enough:
|
|
36
53
|
|
|
37
54
|
- `packages/databases/mysql/src/decorators/table.decorator.ts`
|
|
38
55
|
- `packages/databases/mysql/src/decorators/column.decorator.ts`
|
|
39
56
|
- `packages/databases/mysql/src/decorators/columns/column.type.ts`
|
|
40
57
|
- `packages/databases/mysql/src/decorators/columns/column.factory.ts`
|
|
41
58
|
- `packages/databases/mysql/src/decorators/columns/primary.column.ts`
|
|
59
|
+
- `packages/databases/mysql/src/decorators/columns/timestamp.column.ts`
|
|
60
|
+
- `packages/databases/mysql/src/decorators/columns/virtual.column.ts`
|
|
61
|
+
- `packages/databases/mysql/src/decorators/columns/object.column.ts`
|
|
42
62
|
- `packages/databases/mysql/src/decorators/columns/string.column.ts`
|
|
43
63
|
- `packages/databases/mysql/src/decorators/columns/number.column.ts`
|
|
44
64
|
- `packages/databases/mysql/src/decorators/columns/transform.column.ts`
|
|
@@ -46,7 +66,7 @@ When blocked, inspect:
|
|
|
46
66
|
|
|
47
67
|
## Schema-First Entity Pattern
|
|
48
68
|
|
|
49
|
-
Use `@Tables`, `@Column`, and `@
|
|
69
|
+
Use `@Tables`, `@Column`, `@PrimaryColumn`, and `@TimestampColumn` from `@joktec/mysql` when an entity should also act as the source class for mapped DTOs.
|
|
50
70
|
|
|
51
71
|
The new decorators are not thin TypeORM aliases. They are schema-first wrappers that compose:
|
|
52
72
|
|
|
@@ -55,11 +75,19 @@ The new decorators are not thin TypeORM aliases. They are schema-first wrappers
|
|
|
55
75
|
- `class-transformer` expose/exclude behavior.
|
|
56
76
|
- Swagger property metadata.
|
|
57
77
|
|
|
58
|
-
|
|
78
|
+
The wrapper can also represent virtual computed getters and nested JSON/jsonb class payloads. Do not use this package for Mongo/ObjectId columns.
|
|
79
|
+
|
|
80
|
+
Wrapper philosophy:
|
|
81
|
+
|
|
82
|
+
- prefer one schema declaration that carries persistence, validation, transform, and Swagger metadata
|
|
83
|
+
- use wrapper options before duplicating `@ApiProperty`, `@Expose`, `@Type`, or common validators
|
|
84
|
+
- do not add `swagger.type` for normal scalar/date fields, arrays, nested JSON classes, or relations when the wrapper can infer the shape
|
|
85
|
+
- use raw TypeORM only for advanced cases that the wrapper does not model cleanly
|
|
86
|
+
- keep storage write behavior and API documentation behavior distinct when needed
|
|
59
87
|
|
|
60
|
-
##
|
|
88
|
+
## Current Decorator Capabilities
|
|
61
89
|
|
|
62
|
-
|
|
90
|
+
Use the package README and actual installed source for full migration details. This skill only keeps the common mappings that help an agent recognize old patterns.
|
|
63
91
|
|
|
64
92
|
Common mappings:
|
|
65
93
|
|
|
@@ -68,11 +96,21 @@ Common mappings:
|
|
|
68
96
|
| `@PrimaryGeneratedColumn()` | `@PrimaryColumn('increment')` |
|
|
69
97
|
| `@PrimaryGeneratedColumn('uuid')` | `@PrimaryColumn('uuid')` |
|
|
70
98
|
| app-generated ordered UUID id | `@PrimaryColumn('uuidv7')` |
|
|
99
|
+
| `@CreateDateColumn(...)` | `@TimestampColumn('create', ...)` |
|
|
100
|
+
| `@UpdateDateColumn(...)` | `@TimestampColumn('update', ...)` |
|
|
101
|
+
| `@DeleteDateColumn(...)` | `@TimestampColumn('delete', ...)` |
|
|
102
|
+
| TypeORM `@VersionColumn(...)` | `@Column({ kind: 'version', ... })` |
|
|
103
|
+
| TypeORM `@VirtualColumn(...)` | `@Column({ kind: 'virtual', mode: 'sql', query, ... })` |
|
|
104
|
+
| TypeORM `@ViewColumn(...)` | `@Column({ kind: 'view', ... })` |
|
|
71
105
|
| `@Column(...)` | `@Column(...)` from `@joktec/mysql` |
|
|
106
|
+
| `@RelationId(...)` | `@Column({ kind: 'relation-id', relationId })` |
|
|
72
107
|
| `@IsNotEmpty()` | `@Column({ required: true })` |
|
|
73
108
|
| `@IsOptional()` | `@Column({ required: false })` or nullable TypeORM option when storage allows null |
|
|
74
109
|
| `@IsEmail()` | `@Column({ isEmail: true })` |
|
|
75
110
|
| `@IsMobilePhone()` | `@Column({ isPhone: true })` |
|
|
111
|
+
| `@IsInt()` | `@Column({ isInt: true })` or an integer column type |
|
|
112
|
+
| `@IsUUID()` | `@Column({ isUUID: true })` |
|
|
113
|
+
| `@IsObject()` | `@Column({ isObject: true })` or a JSON column |
|
|
76
114
|
| `@IsHexColor()` | `@Column({ isHexColor: true })` |
|
|
77
115
|
| `@IsUrl()` | `@Column({ isUrl: true })` |
|
|
78
116
|
| `@MinLength(n)` | `@Column({ minLength: n })` |
|
|
@@ -82,54 +120,49 @@ Common mappings:
|
|
|
82
120
|
| `@Expose()` | default behavior of `@Column(...)` |
|
|
83
121
|
| `@Expose({ groups })` | `@Column({ groups })` |
|
|
84
122
|
| `@Exclude({ toPlainOnly: true })` plus hidden Swagger | `@Column({ hidden: true })` |
|
|
85
|
-
| `@ApiProperty(...)` |
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
-
|
|
96
|
-
-
|
|
97
|
-
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
// After
|
|
130
|
-
@Column('varchar', { length: 255, hidden: true })
|
|
131
|
-
password!: string;
|
|
132
|
-
```
|
|
123
|
+
| `@ApiProperty(...)` | Prefer native options such as `example`, `comment`, `deprecated`, `min`, `max`, `minLength`, `maxLength`; use `swagger` only as an override |
|
|
124
|
+
| `@ValidateNested()` + `@Type(() => Preference)` | `@Column('jsonb', { nested: Preference })` |
|
|
125
|
+
| `@ValidateNested({ each: true })` + `@Type(() => Preference)` | `@Column('jsonb', { nested: Preference, each: true })` |
|
|
126
|
+
| `@Expose()` + `@ApiProperty(...)` on a getter | `@Column({ kind: 'virtual', ... })` |
|
|
127
|
+
| Swagger `readOnly: true` | `@Column({ immutable: true })` or TypeORM `update: false` when ORM updates must also be blocked |
|
|
128
|
+
|
|
129
|
+
## Swagger Metadata Rules
|
|
130
|
+
|
|
131
|
+
The `@Column` wrapper already composes Swagger metadata. During migrations, keep entity code small and avoid redundant `swagger` declarations:
|
|
132
|
+
|
|
133
|
+
- Do not add `swagger: { type: String }` for string columns.
|
|
134
|
+
- Do not add `swagger: { type: Number }` for numeric columns.
|
|
135
|
+
- Do not add `swagger: { type: Boolean }` for boolean columns.
|
|
136
|
+
- Do not add `swagger: { type: Date }` for date, datetime, or timestamp columns.
|
|
137
|
+
- Do not add `swagger: { type: String, isArray: true }` for `simple-array` or reflected array fields unless the OpenAPI shape must differ from the entity field.
|
|
138
|
+
- Do not add `swagger: { type: NestedClass }` when `nested: NestedClass` is already present.
|
|
139
|
+
- Do not add `swagger: { type: () => Entity }` on `Column({ kind: 'relation', type: () => Entity })`; the relation wrapper keeps the Swagger type lazy to avoid circular schema evaluation.
|
|
140
|
+
|
|
141
|
+
Use `swagger` only for actual overrides, for example:
|
|
142
|
+
|
|
143
|
+
- an OpenAPI primitive differs from the TypeScript property type, such as a SQL decimal represented as `string`
|
|
144
|
+
- a property needs `oneOf`, `anyOf`, `allOf`, custom `items`, or a deliberately shortened example
|
|
145
|
+
- a generated schema needs an explicit read/write/deprecated override that cannot be represented by wrapper options
|
|
146
|
+
|
|
147
|
+
If a relation wrapper still triggers a circular Swagger error in a consumer project, inspect `node_modules/@joktec/mysql/dist/decorators/column.decorator.d.ts` and the installed implementation first. Do not paper over the issue by adding `swagger.type` to every relation; identify whether the installed package version has lazy relation Swagger support.
|
|
148
|
+
|
|
149
|
+
## Read-Only Metadata
|
|
150
|
+
|
|
151
|
+
`immutable` is the API read-only hint used by the JokTec MySQL wrapper. TypeORM `update: false` is the ORM write behavior. The wrapper maps both to Swagger `readOnly` when appropriate:
|
|
152
|
+
|
|
153
|
+
- `immutable` has priority over `update: false`
|
|
154
|
+
- `update: false` implies Swagger `readOnly` only when `immutable` is not set
|
|
155
|
+
- `swagger.readOnly` remains the final explicit override
|
|
156
|
+
|
|
157
|
+
Some field kinds default to API read-only because they are system-managed or computed:
|
|
158
|
+
|
|
159
|
+
- primary keys
|
|
160
|
+
- timestamp columns
|
|
161
|
+
- version columns
|
|
162
|
+
- view columns
|
|
163
|
+
- virtual getter and SQL virtual columns
|
|
164
|
+
- relation-id columns
|
|
165
|
+
- tree level columns
|
|
133
166
|
|
|
134
167
|
## Primary Keys
|
|
135
168
|
|
|
@@ -150,7 +183,21 @@ The stable dialects are MySQL, MariaDB, and Postgres. Dialect capabilities own d
|
|
|
150
183
|
|
|
151
184
|
## Source Lookup
|
|
152
185
|
|
|
153
|
-
When blocked, inspect:
|
|
186
|
+
When blocked in a consumer project, inspect installed package docs and types first:
|
|
187
|
+
|
|
188
|
+
- `node_modules/@joktec/mysql/README.md`
|
|
189
|
+
- `node_modules/@joktec/mysql/AGENTS.md` when published with the package
|
|
190
|
+
- `node_modules/@joktec/mysql/dist/index.d.ts`
|
|
191
|
+
- `node_modules/@joktec/mysql/dist/mysql.module.d.ts`
|
|
192
|
+
- `node_modules/@joktec/mysql/dist/mysql.service.d.ts`
|
|
193
|
+
- `node_modules/@joktec/mysql/dist/mysql.repo.d.ts`
|
|
194
|
+
- `node_modules/@joktec/mysql/dist/models/mysql.request.d.ts`
|
|
195
|
+
|
|
196
|
+
If the installed package is insufficient, read GitHub package docs next:
|
|
197
|
+
|
|
198
|
+
- `https://github.com/joktec/joktec-framework/tree/main/packages/databases/mysql`
|
|
199
|
+
|
|
200
|
+
Use GitHub source only after installed types and package docs are not enough:
|
|
154
201
|
|
|
155
202
|
- `packages/databases/mysql/README.md`
|
|
156
203
|
- `packages/databases/mysql/AGENTS.md`
|
|
@@ -51,6 +51,7 @@ Best practice:
|
|
|
51
51
|
- Use the package service for outbound HTTP so retry/proxy/metrics behavior stays centralized.
|
|
52
52
|
- Keep external endpoint URLs and credentials in runtime config.
|
|
53
53
|
- Be careful with ESM/CommonJS import changes in HTTP/Axios ecosystem packages.
|
|
54
|
+
- `HttpService.buildAgent(proxy, opts)` expects proxy identity in `HttpProxyConfig` and agent tuning in Node `AgentOptions`; inspect the installed source before adapting to proxy-agent major-version changes.
|
|
54
55
|
- Test request behavior with mocks unless the test is an explicit consumer integration scenario.
|
|
55
56
|
|
|
56
57
|
## File
|