@joktec/skills 0.1.4 → 0.1.7
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 +5 -2
- package/dist/claude/skills/joktec-mysql-skill/references/entities.md +59 -51
- 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 +5 -2
- package/dist/codex/skills/joktec-mysql-skill/references/entities.md +59 -51
- 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 +577 -71
- 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 +79 -54
- package/dist/cursor/.cursor/rules/joktec-tool-skill.mdc +1 -0
- package/dist/gemini/GEMINI.md +579 -71
- 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 +79 -54
- 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 +5 -2
- package/skills/joktec-mysql-skill/references/entities.md +59 -51
- package/skills/joktec-mysql-skill/references/repository.md +15 -1
- package/skills/joktec-tool-skill/references/tools.md +1 -0
|
@@ -16,8 +16,11 @@ 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 use `@joktec/mysql` for Mongo/ObjectId columns, even though TypeORM has Mongo-related APIs.
|
|
23
|
+
- 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
24
|
|
|
22
25
|
## References
|
|
23
26
|
|
|
@@ -32,13 +35,29 @@ Use this skill for relational resources backed by JokTec's TypeORM wrapper.
|
|
|
32
35
|
|
|
33
36
|
## Source Lookup
|
|
34
37
|
|
|
35
|
-
When blocked, inspect:
|
|
38
|
+
When blocked in a consumer project, inspect the installed package first:
|
|
39
|
+
|
|
40
|
+
- `node_modules/@joktec/mysql/README.md`
|
|
41
|
+
- `node_modules/@joktec/mysql/AGENTS.md` when published with the package
|
|
42
|
+
- `node_modules/@joktec/mysql/dist/index.d.ts`
|
|
43
|
+
- `node_modules/@joktec/mysql/dist/decorators/column.decorator.d.ts`
|
|
44
|
+
- `node_modules/@joktec/mysql/dist/decorators/columns/column.type.d.ts`
|
|
45
|
+
- `node_modules/@joktec/mysql/dist/decorators/timestamp.decorator.d.ts`
|
|
46
|
+
|
|
47
|
+
If the installed package is missing enough detail, use the GitHub package docs next:
|
|
48
|
+
|
|
49
|
+
- `https://github.com/joktec/joktec-framework/tree/main/packages/databases/mysql`
|
|
50
|
+
|
|
51
|
+
Use GitHub source only after package docs and installed types are not enough:
|
|
36
52
|
|
|
37
53
|
- `packages/databases/mysql/src/decorators/table.decorator.ts`
|
|
38
54
|
- `packages/databases/mysql/src/decorators/column.decorator.ts`
|
|
39
55
|
- `packages/databases/mysql/src/decorators/columns/column.type.ts`
|
|
40
56
|
- `packages/databases/mysql/src/decorators/columns/column.factory.ts`
|
|
41
57
|
- `packages/databases/mysql/src/decorators/columns/primary.column.ts`
|
|
58
|
+
- `packages/databases/mysql/src/decorators/columns/timestamp.column.ts`
|
|
59
|
+
- `packages/databases/mysql/src/decorators/columns/virtual.column.ts`
|
|
60
|
+
- `packages/databases/mysql/src/decorators/columns/object.column.ts`
|
|
42
61
|
- `packages/databases/mysql/src/decorators/columns/string.column.ts`
|
|
43
62
|
- `packages/databases/mysql/src/decorators/columns/number.column.ts`
|
|
44
63
|
- `packages/databases/mysql/src/decorators/columns/transform.column.ts`
|
|
@@ -46,7 +65,7 @@ When blocked, inspect:
|
|
|
46
65
|
|
|
47
66
|
## Schema-First Entity Pattern
|
|
48
67
|
|
|
49
|
-
Use `@Tables`, `@Column`, and `@
|
|
68
|
+
Use `@Tables`, `@Column`, `@PrimaryColumn`, and `@TimestampColumn` from `@joktec/mysql` when an entity should also act as the source class for mapped DTOs.
|
|
50
69
|
|
|
51
70
|
The new decorators are not thin TypeORM aliases. They are schema-first wrappers that compose:
|
|
52
71
|
|
|
@@ -55,11 +74,18 @@ The new decorators are not thin TypeORM aliases. They are schema-first wrappers
|
|
|
55
74
|
- `class-transformer` expose/exclude behavior.
|
|
56
75
|
- Swagger property metadata.
|
|
57
76
|
|
|
58
|
-
|
|
77
|
+
The wrapper can also represent virtual computed getters and nested JSON/jsonb class payloads. Do not use this package for Mongo/ObjectId columns.
|
|
59
78
|
|
|
60
|
-
|
|
79
|
+
Wrapper philosophy:
|
|
61
80
|
|
|
62
|
-
|
|
81
|
+
- prefer one schema declaration that carries persistence, validation, transform, and Swagger metadata
|
|
82
|
+
- use wrapper options before duplicating `@ApiProperty`, `@Expose`, `@Type`, or common validators
|
|
83
|
+
- use raw TypeORM only for advanced cases that the wrapper does not model cleanly
|
|
84
|
+
- keep storage write behavior and API documentation behavior distinct when needed
|
|
85
|
+
|
|
86
|
+
## Current Decorator Capabilities
|
|
87
|
+
|
|
88
|
+
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
89
|
|
|
64
90
|
Common mappings:
|
|
65
91
|
|
|
@@ -68,11 +94,21 @@ Common mappings:
|
|
|
68
94
|
| `@PrimaryGeneratedColumn()` | `@PrimaryColumn('increment')` |
|
|
69
95
|
| `@PrimaryGeneratedColumn('uuid')` | `@PrimaryColumn('uuid')` |
|
|
70
96
|
| app-generated ordered UUID id | `@PrimaryColumn('uuidv7')` |
|
|
97
|
+
| `@CreateDateColumn(...)` | `@TimestampColumn('create', ...)` |
|
|
98
|
+
| `@UpdateDateColumn(...)` | `@TimestampColumn('update', ...)` |
|
|
99
|
+
| `@DeleteDateColumn(...)` | `@TimestampColumn('delete', ...)` |
|
|
100
|
+
| TypeORM `@VersionColumn(...)` | `@Column({ kind: 'version', ... })` |
|
|
101
|
+
| TypeORM `@VirtualColumn(...)` | `@Column({ kind: 'virtual', mode: 'sql', query, ... })` |
|
|
102
|
+
| TypeORM `@ViewColumn(...)` | `@Column({ kind: 'view', ... })` |
|
|
71
103
|
| `@Column(...)` | `@Column(...)` from `@joktec/mysql` |
|
|
104
|
+
| `@RelationId(...)` | `@Column({ kind: 'relation-id', relationId })` |
|
|
72
105
|
| `@IsNotEmpty()` | `@Column({ required: true })` |
|
|
73
106
|
| `@IsOptional()` | `@Column({ required: false })` or nullable TypeORM option when storage allows null |
|
|
74
107
|
| `@IsEmail()` | `@Column({ isEmail: true })` |
|
|
75
108
|
| `@IsMobilePhone()` | `@Column({ isPhone: true })` |
|
|
109
|
+
| `@IsInt()` | `@Column({ isInt: true })` or an integer column type |
|
|
110
|
+
| `@IsUUID()` | `@Column({ isUUID: true })` |
|
|
111
|
+
| `@IsObject()` | `@Column({ isObject: true })` or a JSON column |
|
|
76
112
|
| `@IsHexColor()` | `@Column({ isHexColor: true })` |
|
|
77
113
|
| `@IsUrl()` | `@Column({ isUrl: true })` |
|
|
78
114
|
| `@MinLength(n)` | `@Column({ minLength: n })` |
|
|
@@ -83,53 +119,28 @@ Common mappings:
|
|
|
83
119
|
| `@Expose({ groups })` | `@Column({ groups })` |
|
|
84
120
|
| `@Exclude({ toPlainOnly: true })` plus hidden Swagger | `@Column({ hidden: true })` |
|
|
85
121
|
| `@ApiProperty(...)` | `@Column({ swagger: ... })`, or native options such as `example`, `comment`, `deprecated`, `min`, `max`, `minLength`, `maxLength` |
|
|
122
|
+
| `@ValidateNested()` + `@Type(() => Preference)` | `@Column('jsonb', { nested: Preference })` |
|
|
123
|
+
| `@ValidateNested({ each: true })` + `@Type(() => Preference)` | `@Column('jsonb', { nested: Preference, each: true })` |
|
|
124
|
+
| `@Expose()` + `@ApiProperty(...)` on a getter | `@Column({ kind: 'virtual', ... })` |
|
|
125
|
+
| Swagger `readOnly: true` | `@Column({ immutable: true })` or TypeORM `update: false` when ORM updates must also be blocked |
|
|
126
|
+
|
|
127
|
+
## Read-Only Metadata
|
|
86
128
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
-
|
|
96
|
-
-
|
|
97
|
-
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
// Before
|
|
103
|
-
@Column({ type: 'varchar', length: 255 })
|
|
104
|
-
@IsEmail()
|
|
105
|
-
@IsNotEmpty()
|
|
106
|
-
@Expose()
|
|
107
|
-
@ApiProperty({ example: 'user@example.com' })
|
|
108
|
-
email!: string;
|
|
109
|
-
|
|
110
|
-
// After
|
|
111
|
-
@Column('varchar', {
|
|
112
|
-
length: 255,
|
|
113
|
-
required: true,
|
|
114
|
-
isEmail: true,
|
|
115
|
-
example: 'user@example.com',
|
|
116
|
-
})
|
|
117
|
-
email!: string;
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
For hidden fields:
|
|
121
|
-
|
|
122
|
-
```ts
|
|
123
|
-
// Before
|
|
124
|
-
@Column({ type: 'varchar', length: 255 })
|
|
125
|
-
@Exclude({ toPlainOnly: true })
|
|
126
|
-
@ApiHideProperty()
|
|
127
|
-
password!: string;
|
|
128
|
-
|
|
129
|
-
// After
|
|
130
|
-
@Column('varchar', { length: 255, hidden: true })
|
|
131
|
-
password!: string;
|
|
132
|
-
```
|
|
129
|
+
`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:
|
|
130
|
+
|
|
131
|
+
- `immutable` has priority over `update: false`
|
|
132
|
+
- `update: false` implies Swagger `readOnly` only when `immutable` is not set
|
|
133
|
+
- `swagger.readOnly` remains the final explicit override
|
|
134
|
+
|
|
135
|
+
Some field kinds default to API read-only because they are system-managed or computed:
|
|
136
|
+
|
|
137
|
+
- primary keys
|
|
138
|
+
- timestamp columns
|
|
139
|
+
- version columns
|
|
140
|
+
- view columns
|
|
141
|
+
- virtual getter and SQL virtual columns
|
|
142
|
+
- relation-id columns
|
|
143
|
+
- tree level columns
|
|
133
144
|
|
|
134
145
|
## Primary Keys
|
|
135
146
|
|
|
@@ -150,7 +161,21 @@ The stable dialects are MySQL, MariaDB, and Postgres. Dialect capabilities own d
|
|
|
150
161
|
|
|
151
162
|
## Source Lookup
|
|
152
163
|
|
|
153
|
-
When blocked, inspect:
|
|
164
|
+
When blocked in a consumer project, inspect installed package docs and types first:
|
|
165
|
+
|
|
166
|
+
- `node_modules/@joktec/mysql/README.md`
|
|
167
|
+
- `node_modules/@joktec/mysql/AGENTS.md` when published with the package
|
|
168
|
+
- `node_modules/@joktec/mysql/dist/index.d.ts`
|
|
169
|
+
- `node_modules/@joktec/mysql/dist/mysql.module.d.ts`
|
|
170
|
+
- `node_modules/@joktec/mysql/dist/mysql.service.d.ts`
|
|
171
|
+
- `node_modules/@joktec/mysql/dist/mysql.repo.d.ts`
|
|
172
|
+
- `node_modules/@joktec/mysql/dist/models/mysql.request.d.ts`
|
|
173
|
+
|
|
174
|
+
If the installed package is insufficient, read GitHub package docs next:
|
|
175
|
+
|
|
176
|
+
- `https://github.com/joktec/joktec-framework/tree/main/packages/databases/mysql`
|
|
177
|
+
|
|
178
|
+
Use GitHub source only after installed types and package docs are not enough:
|
|
154
179
|
|
|
155
180
|
- `packages/databases/mysql/README.md`
|
|
156
181
|
- `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
|