@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.
Files changed (47) hide show
  1. package/README.md +4 -2
  2. package/dist/claude/skills/advanced-typescript-design/SKILL.md +60 -0
  3. package/dist/claude/skills/advanced-typescript-design/agents/openai.yaml +4 -0
  4. package/dist/claude/skills/advanced-typescript-design/references/advanced.md +219 -0
  5. package/dist/claude/skills/advanced-typescript-design/references/simple.md +149 -0
  6. package/dist/claude/skills/joktec-mongo-skill/SKILL.md +9 -2
  7. package/dist/claude/skills/joktec-mongo-skill/references/repository.md +14 -11
  8. package/dist/claude/skills/joktec-mongo-skill/references/schema-and-plugins.md +43 -7
  9. package/dist/claude/skills/joktec-mysql-skill/SKILL.md +6 -2
  10. package/dist/claude/skills/joktec-mysql-skill/references/entities.md +82 -53
  11. package/dist/claude/skills/joktec-mysql-skill/references/repository.md +15 -1
  12. package/dist/claude/skills/joktec-tool-skill/references/tools.md +1 -0
  13. package/dist/codex/skills/advanced-typescript-design/SKILL.md +60 -0
  14. package/dist/codex/skills/advanced-typescript-design/agents/openai.yaml +4 -0
  15. package/dist/codex/skills/advanced-typescript-design/references/advanced.md +219 -0
  16. package/dist/codex/skills/advanced-typescript-design/references/simple.md +149 -0
  17. package/dist/codex/skills/joktec-mongo-skill/SKILL.md +9 -2
  18. package/dist/codex/skills/joktec-mongo-skill/references/repository.md +14 -11
  19. package/dist/codex/skills/joktec-mongo-skill/references/schema-and-plugins.md +43 -7
  20. package/dist/codex/skills/joktec-mysql-skill/SKILL.md +6 -2
  21. package/dist/codex/skills/joktec-mysql-skill/references/entities.md +82 -53
  22. package/dist/codex/skills/joktec-mysql-skill/references/repository.md +15 -1
  23. package/dist/codex/skills/joktec-tool-skill/references/tools.md +1 -0
  24. package/dist/copilot/.github/copilot-instructions.md +601 -73
  25. package/dist/cursor/.cursor/rules/advanced-typescript-design.mdc +437 -0
  26. package/dist/cursor/.cursor/rules/joktec-mongo-skill.mdc +66 -20
  27. package/dist/cursor/.cursor/rules/joktec-mysql-skill.mdc +103 -56
  28. package/dist/cursor/.cursor/rules/joktec-tool-skill.mdc +1 -0
  29. package/dist/gemini/GEMINI.md +603 -73
  30. package/dist/windsurf/.windsurf/rules/advanced-typescript-design.md +433 -0
  31. package/dist/windsurf/.windsurf/rules/joktec-mongo-skill.md +66 -20
  32. package/dist/windsurf/.windsurf/rules/joktec-mysql-skill.md +103 -56
  33. package/dist/windsurf/.windsurf/rules/joktec-tool-skill.md +1 -0
  34. package/package.json +6 -3
  35. package/scripts/sync-pack-version.mjs +38 -0
  36. package/skill-pack.json +35 -1
  37. package/skills/advanced-typescript-design/SKILL.md +60 -0
  38. package/skills/advanced-typescript-design/agents/openai.yaml +4 -0
  39. package/skills/advanced-typescript-design/references/advanced.md +219 -0
  40. package/skills/advanced-typescript-design/references/simple.md +149 -0
  41. package/skills/joktec-mongo-skill/SKILL.md +9 -2
  42. package/skills/joktec-mongo-skill/references/repository.md +14 -11
  43. package/skills/joktec-mongo-skill/references/schema-and-plugins.md +43 -7
  44. package/skills/joktec-mysql-skill/SKILL.md +6 -2
  45. package/skills/joktec-mysql-skill/references/entities.md +82 -53
  46. package/skills/joktec-mysql-skill/references/repository.md +15 -1
  47. package/skills/joktec-tool-skill/references/tools.md +1 -0
@@ -17,9 +17,16 @@ Use this skill for MongoDB-backed resources that rely on JokTec's Mongoose/Typeg
17
17
  - Keep schema classes, app repositories, and app-specific queries in the consumer app.
18
18
  - Extend `MongoRepo<T, ID>` for app repositories.
19
19
  - Preserve `conId` when the app has multiple Mongo connections.
20
- - Use schema-first decorators when a schema class should be reused as a DTO source.
20
+ - Use schema-first decorators when a schema class should be reused as a DTO source; wrappers should reduce repeated Typegoose, validator, transformer, and Swagger stacks.
21
+ - Use `RefId<T>` for stored reference id fields and `PopulatedRef<T>` for populated virtual fields.
22
+ - Use `@Schema({ kind: 'embedded' })` for value objects without `_id` or timestamps.
23
+ - Use `@Schema({ kind: 'subdocument' })` for embedded documents that need their own `_id` and timestamps.
24
+ - Use `@Prop({ kind: 'virtual', mode: 'getter' })` for computed getters that need expose/Swagger metadata without persistence.
25
+ - Use `@Prop({ ref: () => Target, foreignField, localField })` for populate-one virtuals when inferred defaults are enough.
26
+ - Use `@Prop({ type: () => [Target], ref: () => Target, foreignField, localField })` for populate-array virtuals.
27
+ - Use `@Prop({ kind: 'map', type: Object })` for map/snapshot payloads that must keep their raw shape.
21
28
  - Treat ObjectId casting and regex behavior as safety-sensitive.
22
- - If guidance is insufficient, read this skill's references and inspect `../joktec-framework` package source or GitHub fallback before assuming APIs.
29
+ - For real migrations, inspect `node_modules/@joktec/mongo` first, then installed README or GitHub package docs, then GitHub source before assuming APIs.
23
30
 
24
31
  ## References
25
32
 
@@ -4,16 +4,18 @@
4
4
 
5
5
  When blocked, inspect:
6
6
 
7
- - `packages/databases/mongo/README.md`
8
- - `packages/databases/mongo/AGENTS.md`
9
- - `packages/databases/mongo/src/index.ts`
10
- - `packages/databases/mongo/src/mongo.module.ts`
11
- - `packages/databases/mongo/src/mongo.service.ts`
12
- - `packages/databases/mongo/src/mongo.repo.ts`
13
- - `packages/databases/mongo/src/helpers/mongo.helper.ts`
14
- - `packages/databases/mongo/src/helpers/mongo.pipeline.ts`
15
- - `packages/databases/mongo/src/helpers/mongo.utils.ts`
16
- - `packages/databases/mongo/src/models/*`
7
+ - Consumer project first: `node_modules/@joktec/mongo`.
8
+ - Installed docs next: `node_modules/@joktec/mongo/README.md`.
9
+ - GitHub docs next: `https://github.com/joktec/joktec-framework/tree/main/packages/databases/mongo`.
10
+ - GitHub source fallback:
11
+ - `packages/databases/mongo/src/index.ts`
12
+ - `packages/databases/mongo/src/mongo.module.ts`
13
+ - `packages/databases/mongo/src/mongo.service.ts`
14
+ - `packages/databases/mongo/src/mongo.repo.ts`
15
+ - `packages/databases/mongo/src/helpers/mongo.helper.ts`
16
+ - `packages/databases/mongo/src/helpers/mongo.pipeline.ts`
17
+ - `packages/databases/mongo/src/helpers/mongo.utils.ts`
18
+ - `packages/databases/mongo/src/models/*`
17
19
 
18
20
  ## Module Setup
19
21
 
@@ -35,7 +37,8 @@ Repository checklist:
35
37
  - Keep schema-specific query helpers in the app repository, not in controllers.
36
38
  - Use repository methods for standard reads so query parsing, soft delete, populate, and pagination stay consistent.
37
39
  - Pass transaction/session options through read-modify-write flows when the app uses transactions.
38
- - Normalize returned documents through repository/service response paths so ObjectId values do not leak unexpectedly into DTOs.
40
+ - Repository read paths should return schema class instances with normalized ObjectId/string values, including populated and deep-populated values.
41
+ - Code that needs raw Mongoose documents should use `MongoService.getModel(...)` or Typegoose/Mongoose APIs directly.
39
42
 
40
43
  ## Query Safety
41
44
 
@@ -4,13 +4,20 @@
4
4
 
5
5
  When blocked, inspect:
6
6
 
7
- - `packages/databases/mongo/src/decorators/scheme.decorator.ts`
8
- - `packages/databases/mongo/src/decorators/prop.decorator.ts`
9
- - `packages/databases/mongo/src/decorators/props/*`
10
- - `packages/databases/mongo/src/models/mongo.schema.ts`
11
- - `packages/databases/mongo/src/plugins/paranoid.plugin.ts`
12
- - `packages/databases/mongo/src/plugins/strict-reference.plugin.ts`
13
- - `packages/databases/mongo/src/plugins/transform.plugin.ts`
7
+ - Consumer project first: `node_modules/@joktec/mongo`.
8
+ - Package docs next: `node_modules/@joktec/mongo/README.md`.
9
+ - GitHub docs next: `https://github.com/joktec/joktec-framework/tree/main/packages/databases/mongo`.
10
+ - GitHub source fallback:
11
+ - `packages/databases/mongo/src/decorators/schema.decorator.ts`
12
+ - `packages/databases/mongo/src/decorators/schema.options.ts`
13
+ - `packages/databases/mongo/src/decorators/prop.decorator.ts`
14
+ - `packages/databases/mongo/src/decorators/props/*`
15
+ - `packages/databases/mongo/src/models/mongo.ref.ts`
16
+ - `packages/databases/mongo/src/models/object-id.ts`
17
+ - `packages/databases/mongo/src/models/mongo.schema.ts`
18
+ - `packages/databases/mongo/src/plugins/paranoid.plugin.ts`
19
+ - `packages/databases/mongo/src/plugins/strict-reference.plugin.ts`
20
+ - `packages/databases/mongo/src/plugins/transform.plugin.ts`
14
21
 
15
22
  ## Schema Decorators
16
23
 
@@ -25,6 +32,35 @@ Best practice:
25
32
  - Pass custom validators/transforms explicitly rather than adding hidden global behavior.
26
33
  - Keep maps, snapshots, and dynamic objects explicit so helper conversion does not alter their shape.
27
34
  - Keep app-level reference semantics visible; strict reference plugin checks existence, but the app still owns domain rules.
35
+ - Use `RefId<T>` for persisted id fields and `PopulatedRef<T>` for populated virtual instance fields.
36
+ - Use lazy `type` resolvers such as `type: () => User` or `type: () => [User]` when the wrapper cannot infer the runtime class.
37
+ - Use `@Schema({ kind: 'embedded' })` for value objects without `_id` or timestamps.
38
+ - Use `@Schema({ kind: 'subdocument' })` for embedded documents that need `_id` and timestamps but should not create a collection.
39
+ - Use `@Prop({ kind: 'virtual', mode: 'getter', comment, optional, hidden, expose, swagger })` for computed getters that only need class-transformer and Swagger metadata.
40
+ - Use `@Prop({ ref: () => User, foreignField, localField })` for populate-one virtuals when inferred defaults are enough.
41
+ - Use `@Prop({ type: () => [User], ref: () => User, foreignField, localField })` for populate-array virtuals.
42
+ - Use `@Prop({ kind: 'map', type: Object })` for raw maps/snapshots instead of passing `PropType.MAP` at the call site.
43
+
44
+ Common mappings:
45
+
46
+ | Use case | Preferred shape |
47
+ | --- | --- |
48
+ | Stored single reference id | `fieldId?: RefId<User>` with `@Prop({ type: ObjectId, ref: () => User })` |
49
+ | Stored reference id array | `fieldIds?: RefId<User>[]` with `@Prop({ type: [ObjectId], ref: () => User })` |
50
+ | Embedded value object | `@Schema({ kind: 'embedded' })` on the nested class |
51
+ | Embedded document | `@Schema({ kind: 'subdocument' })` on the nested class |
52
+ | Raw map/snapshot | `@Prop({ kind: 'map', type: Object })` |
53
+ | Populated single virtual | `field?: PopulatedRef<User>` with `@Prop({ ref: () => User, foreignField: '_id', localField: 'fieldId' })` |
54
+ | Populated virtual array | `fields?: PopulatedRef<User>[]` with `@Prop({ type: () => [User], ref: () => User, foreignField: '_id', localField: 'fieldIds' })` |
55
+ | Computed getter | `@Prop({ kind: 'virtual', mode: 'getter', comment: '...' }) get value() { ... }` |
56
+
57
+ Populate inference:
58
+
59
+ - `ref` + `localField` + `foreignField` marks the field as virtual populate.
60
+ - Populate-one can fallback to the same class from `ref`.
61
+ - Populate arrays still need `type: () => [Target]` because runtime reflection only sees `Array`.
62
+ - `justOne` defaults to `true` for non-array populate fields.
63
+ - Swagger examples default to `{}` or `[]` for populated fields unless explicitly overridden.
28
64
 
29
65
  ## Plugins
30
66
 
@@ -19,8 +19,12 @@ Use this skill for relational resources backed by JokTec's TypeORM wrapper.
19
19
  - Treat `mysql`, `mariadb`, and `postgres` as the first-class dialects.
20
20
  - Keep `sync` explicit and normally enabled only by an owner process or development bootstrap.
21
21
  - Do not add new behavior to deprecated `MysqlFinder`; use `MysqlRepo.qb()` and `MysqlHelper` paths.
22
- - When migrating an entity to the new schema-first decorators, migrate the whole property decorator stack, not only the TypeORM primary key decorator.
23
- - If guidance is insufficient, read this skill's references and inspect `../joktec-framework` package source or GitHub fallback before assuming APIs.
22
+ - Use schema-first `@Column`, `@PrimaryColumn`, and `@TimestampColumn` wrappers when an entity also acts as DTO metadata.
23
+ - Use `@Column({ kind: 'virtual' })` for computed getters that need expose/Swagger metadata without persistence.
24
+ - 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.
25
+ - 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.
26
+ - Do not use `@joktec/mysql` for Mongo/ObjectId columns, even though TypeORM has Mongo-related APIs.
27
+ - 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.
24
28
 
25
29
  ## References
26
30
 
@@ -2,13 +2,29 @@
2
2
 
3
3
  ## Source Lookup
4
4
 
5
- When blocked, inspect:
5
+ When blocked in a consumer project, inspect the installed package first:
6
+
7
+ - `node_modules/@joktec/mysql/README.md`
8
+ - `node_modules/@joktec/mysql/AGENTS.md` when published with the package
9
+ - `node_modules/@joktec/mysql/dist/index.d.ts`
10
+ - `node_modules/@joktec/mysql/dist/decorators/column.decorator.d.ts`
11
+ - `node_modules/@joktec/mysql/dist/decorators/columns/column.type.d.ts`
12
+ - `node_modules/@joktec/mysql/dist/decorators/timestamp.decorator.d.ts`
13
+
14
+ If the installed package is missing enough detail, use the GitHub package docs next:
15
+
16
+ - `https://github.com/joktec/joktec-framework/tree/main/packages/databases/mysql`
17
+
18
+ Use GitHub source only after package docs and installed types are not enough:
6
19
 
7
20
  - `packages/databases/mysql/src/decorators/table.decorator.ts`
8
21
  - `packages/databases/mysql/src/decorators/column.decorator.ts`
9
22
  - `packages/databases/mysql/src/decorators/columns/column.type.ts`
10
23
  - `packages/databases/mysql/src/decorators/columns/column.factory.ts`
11
24
  - `packages/databases/mysql/src/decorators/columns/primary.column.ts`
25
+ - `packages/databases/mysql/src/decorators/columns/timestamp.column.ts`
26
+ - `packages/databases/mysql/src/decorators/columns/virtual.column.ts`
27
+ - `packages/databases/mysql/src/decorators/columns/object.column.ts`
12
28
  - `packages/databases/mysql/src/decorators/columns/string.column.ts`
13
29
  - `packages/databases/mysql/src/decorators/columns/number.column.ts`
14
30
  - `packages/databases/mysql/src/decorators/columns/transform.column.ts`
@@ -16,7 +32,7 @@ When blocked, inspect:
16
32
 
17
33
  ## Schema-First Entity Pattern
18
34
 
19
- Use `@Tables`, `@Column`, and `@PrimaryColumn` from `@joktec/mysql` when an entity should also act as the source class for mapped DTOs.
35
+ Use `@Tables`, `@Column`, `@PrimaryColumn`, and `@TimestampColumn` from `@joktec/mysql` when an entity should also act as the source class for mapped DTOs.
20
36
 
21
37
  The new decorators are not thin TypeORM aliases. They are schema-first wrappers that compose:
22
38
 
@@ -25,11 +41,19 @@ The new decorators are not thin TypeORM aliases. They are schema-first wrappers
25
41
  - `class-transformer` expose/exclude behavior.
26
42
  - Swagger property metadata.
27
43
 
28
- When migrating old entities, remove duplicate property decorators from `typeorm`, `class-validator`, `class-transformer`, and Swagger when the wrapper option can represent the same behavior.
44
+ The wrapper can also represent virtual computed getters and nested JSON/jsonb class payloads. Do not use this package for Mongo/ObjectId columns.
45
+
46
+ Wrapper philosophy:
29
47
 
30
- ## Legacy Decorator Migration
48
+ - prefer one schema declaration that carries persistence, validation, transform, and Swagger metadata
49
+ - use wrapper options before duplicating `@ApiProperty`, `@Expose`, `@Type`, or common validators
50
+ - do not add `swagger.type` for normal scalar/date fields, arrays, nested JSON classes, or relations when the wrapper can infer the shape
51
+ - use raw TypeORM only for advanced cases that the wrapper does not model cleanly
52
+ - keep storage write behavior and API documentation behavior distinct when needed
31
53
 
32
- Migrate a whole property at a time. Do not only replace `PrimaryGeneratedColumn`.
54
+ ## Current Decorator Capabilities
55
+
56
+ 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.
33
57
 
34
58
  Common mappings:
35
59
 
@@ -38,11 +62,21 @@ Common mappings:
38
62
  | `@PrimaryGeneratedColumn()` | `@PrimaryColumn('increment')` |
39
63
  | `@PrimaryGeneratedColumn('uuid')` | `@PrimaryColumn('uuid')` |
40
64
  | app-generated ordered UUID id | `@PrimaryColumn('uuidv7')` |
65
+ | `@CreateDateColumn(...)` | `@TimestampColumn('create', ...)` |
66
+ | `@UpdateDateColumn(...)` | `@TimestampColumn('update', ...)` |
67
+ | `@DeleteDateColumn(...)` | `@TimestampColumn('delete', ...)` |
68
+ | TypeORM `@VersionColumn(...)` | `@Column({ kind: 'version', ... })` |
69
+ | TypeORM `@VirtualColumn(...)` | `@Column({ kind: 'virtual', mode: 'sql', query, ... })` |
70
+ | TypeORM `@ViewColumn(...)` | `@Column({ kind: 'view', ... })` |
41
71
  | `@Column(...)` | `@Column(...)` from `@joktec/mysql` |
72
+ | `@RelationId(...)` | `@Column({ kind: 'relation-id', relationId })` |
42
73
  | `@IsNotEmpty()` | `@Column({ required: true })` |
43
74
  | `@IsOptional()` | `@Column({ required: false })` or nullable TypeORM option when storage allows null |
44
75
  | `@IsEmail()` | `@Column({ isEmail: true })` |
45
76
  | `@IsMobilePhone()` | `@Column({ isPhone: true })` |
77
+ | `@IsInt()` | `@Column({ isInt: true })` or an integer column type |
78
+ | `@IsUUID()` | `@Column({ isUUID: true })` |
79
+ | `@IsObject()` | `@Column({ isObject: true })` or a JSON column |
46
80
  | `@IsHexColor()` | `@Column({ isHexColor: true })` |
47
81
  | `@IsUrl()` | `@Column({ isUrl: true })` |
48
82
  | `@MinLength(n)` | `@Column({ minLength: n })` |
@@ -52,54 +86,49 @@ Common mappings:
52
86
  | `@Expose()` | default behavior of `@Column(...)` |
53
87
  | `@Expose({ groups })` | `@Column({ groups })` |
54
88
  | `@Exclude({ toPlainOnly: true })` plus hidden Swagger | `@Column({ hidden: true })` |
55
- | `@ApiProperty(...)` | `@Column({ swagger: ... })`, or native options such as `example`, `comment`, `deprecated`, `min`, `max`, `minLength`, `maxLength` |
56
-
57
- Preserve decorators only when the wrapper cannot express them, by passing them through `decorators: [...]`.
58
-
59
- Migration checklist:
60
-
61
- - Replace TypeORM column decorators with wrappers from `@joktec/mysql`.
62
- - Remove duplicate `class-validator` decorators when equivalent wrapper options exist.
63
- - Remove duplicate `class-transformer` decorators when `hidden` or `groups` expresses the same behavior.
64
- - Move Swagger examples/descriptions/limits into wrapper options where possible.
65
- - Preserve custom validators/transforms only through `decorators: [...]`.
66
- - Keep database-specific options such as `type`, `length`, `nullable`, `unique`, `default`, `enum`, and `comment`.
67
- - Rebuild and run entity-related tests after migration because DTO metadata and TypeORM metadata both change.
68
-
69
- Example migration:
70
-
71
- ```ts
72
- // Before
73
- @Column({ type: 'varchar', length: 255 })
74
- @IsEmail()
75
- @IsNotEmpty()
76
- @Expose()
77
- @ApiProperty({ example: 'user@example.com' })
78
- email!: string;
79
-
80
- // After
81
- @Column('varchar', {
82
- length: 255,
83
- required: true,
84
- isEmail: true,
85
- example: 'user@example.com',
86
- })
87
- email!: string;
88
- ```
89
-
90
- For hidden fields:
91
-
92
- ```ts
93
- // Before
94
- @Column({ type: 'varchar', length: 255 })
95
- @Exclude({ toPlainOnly: true })
96
- @ApiHideProperty()
97
- password!: string;
98
-
99
- // After
100
- @Column('varchar', { length: 255, hidden: true })
101
- password!: string;
102
- ```
89
+ | `@ApiProperty(...)` | Prefer native options such as `example`, `comment`, `deprecated`, `min`, `max`, `minLength`, `maxLength`; use `swagger` only as an override |
90
+ | `@ValidateNested()` + `@Type(() => Preference)` | `@Column('jsonb', { nested: Preference })` |
91
+ | `@ValidateNested({ each: true })` + `@Type(() => Preference)` | `@Column('jsonb', { nested: Preference, each: true })` |
92
+ | `@Expose()` + `@ApiProperty(...)` on a getter | `@Column({ kind: 'virtual', ... })` |
93
+ | Swagger `readOnly: true` | `@Column({ immutable: true })` or TypeORM `update: false` when ORM updates must also be blocked |
94
+
95
+ ## Swagger Metadata Rules
96
+
97
+ The `@Column` wrapper already composes Swagger metadata. During migrations, keep entity code small and avoid redundant `swagger` declarations:
98
+
99
+ - Do not add `swagger: { type: String }` for string columns.
100
+ - Do not add `swagger: { type: Number }` for numeric columns.
101
+ - Do not add `swagger: { type: Boolean }` for boolean columns.
102
+ - Do not add `swagger: { type: Date }` for date, datetime, or timestamp columns.
103
+ - 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.
104
+ - Do not add `swagger: { type: NestedClass }` when `nested: NestedClass` is already present.
105
+ - 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.
106
+
107
+ Use `swagger` only for actual overrides, for example:
108
+
109
+ - an OpenAPI primitive differs from the TypeScript property type, such as a SQL decimal represented as `string`
110
+ - a property needs `oneOf`, `anyOf`, `allOf`, custom `items`, or a deliberately shortened example
111
+ - a generated schema needs an explicit read/write/deprecated override that cannot be represented by wrapper options
112
+
113
+ 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.
114
+
115
+ ## Read-Only Metadata
116
+
117
+ `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:
118
+
119
+ - `immutable` has priority over `update: false`
120
+ - `update: false` implies Swagger `readOnly` only when `immutable` is not set
121
+ - `swagger.readOnly` remains the final explicit override
122
+
123
+ Some field kinds default to API read-only because they are system-managed or computed:
124
+
125
+ - primary keys
126
+ - timestamp columns
127
+ - version columns
128
+ - view columns
129
+ - virtual getter and SQL virtual columns
130
+ - relation-id columns
131
+ - tree level columns
103
132
 
104
133
  ## Primary Keys
105
134
 
@@ -2,7 +2,21 @@
2
2
 
3
3
  ## Source Lookup
4
4
 
5
- When blocked, inspect:
5
+ When blocked in a consumer project, inspect installed package docs and types first:
6
+
7
+ - `node_modules/@joktec/mysql/README.md`
8
+ - `node_modules/@joktec/mysql/AGENTS.md` when published with the package
9
+ - `node_modules/@joktec/mysql/dist/index.d.ts`
10
+ - `node_modules/@joktec/mysql/dist/mysql.module.d.ts`
11
+ - `node_modules/@joktec/mysql/dist/mysql.service.d.ts`
12
+ - `node_modules/@joktec/mysql/dist/mysql.repo.d.ts`
13
+ - `node_modules/@joktec/mysql/dist/models/mysql.request.d.ts`
14
+
15
+ If the installed package is insufficient, read GitHub package docs next:
16
+
17
+ - `https://github.com/joktec/joktec-framework/tree/main/packages/databases/mysql`
18
+
19
+ Use GitHub source only after installed types and package docs are not enough:
6
20
 
7
21
  - `packages/databases/mysql/README.md`
8
22
  - `packages/databases/mysql/AGENTS.md`
@@ -19,6 +19,7 @@ Best practice:
19
19
  - Use the package service for outbound HTTP so retry/proxy/metrics behavior stays centralized.
20
20
  - Keep external endpoint URLs and credentials in runtime config.
21
21
  - Be careful with ESM/CommonJS import changes in HTTP/Axios ecosystem packages.
22
+ - `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.
22
23
  - Test request behavior with mocks unless the test is an explicit consumer integration scenario.
23
24
 
24
25
  ## File