@joktec/skills 0.1.0
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/AGENTS.md +89 -0
- package/LICENSE +21 -0
- package/README.md +502 -0
- package/adapters/README.md +12 -0
- package/adapters/copilot/README.md +5 -0
- package/adapters/cursor/README.md +5 -0
- package/adapters/gemini/README.md +5 -0
- package/adapters/windsurf/README.md +5 -0
- package/bin/joktec-skills.mjs +553 -0
- package/dist/claude/skills/joktec-adapter-skill/SKILL.md +26 -0
- package/dist/claude/skills/joktec-adapter-skill/agents/openai.yaml +4 -0
- package/dist/claude/skills/joktec-adapter-skill/references/adapters.md +12 -0
- package/dist/claude/skills/joktec-broker-skill/SKILL.md +26 -0
- package/dist/claude/skills/joktec-broker-skill/agents/openai.yaml +4 -0
- package/dist/claude/skills/joktec-broker-skill/references/brokers.md +12 -0
- package/dist/claude/skills/joktec-common-skill/SKILL.md +28 -0
- package/dist/claude/skills/joktec-common-skill/agents/openai.yaml +4 -0
- package/dist/claude/skills/joktec-common-skill/references/core.md +19 -0
- package/dist/claude/skills/joktec-common-skill/references/utils-cron.md +17 -0
- package/dist/claude/skills/joktec-database-extended-skill/SKILL.md +25 -0
- package/dist/claude/skills/joktec-database-extended-skill/agents/openai.yaml +4 -0
- package/dist/claude/skills/joktec-database-extended-skill/references/extended-databases.md +11 -0
- package/dist/claude/skills/joktec-framework-skill/SKILL.md +31 -0
- package/dist/claude/skills/joktec-framework-skill/agents/openai.yaml +4 -0
- package/dist/claude/skills/joktec-framework-skill/references/framework-map.md +25 -0
- package/dist/claude/skills/joktec-integration-skill/SKILL.md +24 -0
- package/dist/claude/skills/joktec-integration-skill/agents/openai.yaml +4 -0
- package/dist/claude/skills/joktec-integration-skill/references/integrations.md +9 -0
- package/dist/claude/skills/joktec-mongo-skill/SKILL.md +22 -0
- package/dist/claude/skills/joktec-mongo-skill/agents/openai.yaml +4 -0
- package/dist/claude/skills/joktec-mongo-skill/references/repository.md +20 -0
- package/dist/claude/skills/joktec-mongo-skill/references/schema-and-plugins.md +17 -0
- package/dist/claude/skills/joktec-mysql-skill/SKILL.md +22 -0
- package/dist/claude/skills/joktec-mysql-skill/agents/openai.yaml +4 -0
- package/dist/claude/skills/joktec-mysql-skill/references/entities.md +15 -0
- package/dist/claude/skills/joktec-mysql-skill/references/repository.md +23 -0
- package/dist/claude/skills/joktec-tool-skill/SKILL.md +25 -0
- package/dist/claude/skills/joktec-tool-skill/agents/openai.yaml +4 -0
- package/dist/claude/skills/joktec-tool-skill/references/tools.md +13 -0
- package/dist/codex/skills/joktec-adapter-skill/SKILL.md +26 -0
- package/dist/codex/skills/joktec-adapter-skill/agents/openai.yaml +4 -0
- package/dist/codex/skills/joktec-adapter-skill/references/adapters.md +12 -0
- package/dist/codex/skills/joktec-broker-skill/SKILL.md +26 -0
- package/dist/codex/skills/joktec-broker-skill/agents/openai.yaml +4 -0
- package/dist/codex/skills/joktec-broker-skill/references/brokers.md +12 -0
- package/dist/codex/skills/joktec-common-skill/SKILL.md +28 -0
- package/dist/codex/skills/joktec-common-skill/agents/openai.yaml +4 -0
- package/dist/codex/skills/joktec-common-skill/references/core.md +19 -0
- package/dist/codex/skills/joktec-common-skill/references/utils-cron.md +17 -0
- package/dist/codex/skills/joktec-database-extended-skill/SKILL.md +25 -0
- package/dist/codex/skills/joktec-database-extended-skill/agents/openai.yaml +4 -0
- package/dist/codex/skills/joktec-database-extended-skill/references/extended-databases.md +11 -0
- package/dist/codex/skills/joktec-framework-skill/SKILL.md +31 -0
- package/dist/codex/skills/joktec-framework-skill/agents/openai.yaml +4 -0
- package/dist/codex/skills/joktec-framework-skill/references/framework-map.md +25 -0
- package/dist/codex/skills/joktec-integration-skill/SKILL.md +24 -0
- package/dist/codex/skills/joktec-integration-skill/agents/openai.yaml +4 -0
- package/dist/codex/skills/joktec-integration-skill/references/integrations.md +9 -0
- package/dist/codex/skills/joktec-mongo-skill/SKILL.md +22 -0
- package/dist/codex/skills/joktec-mongo-skill/agents/openai.yaml +4 -0
- package/dist/codex/skills/joktec-mongo-skill/references/repository.md +20 -0
- package/dist/codex/skills/joktec-mongo-skill/references/schema-and-plugins.md +17 -0
- package/dist/codex/skills/joktec-mysql-skill/SKILL.md +22 -0
- package/dist/codex/skills/joktec-mysql-skill/agents/openai.yaml +4 -0
- package/dist/codex/skills/joktec-mysql-skill/references/entities.md +15 -0
- package/dist/codex/skills/joktec-mysql-skill/references/repository.md +23 -0
- package/dist/codex/skills/joktec-tool-skill/SKILL.md +25 -0
- package/dist/codex/skills/joktec-tool-skill/agents/openai.yaml +4 -0
- package/dist/codex/skills/joktec-tool-skill/references/tools.md +13 -0
- package/dist/copilot/.github/copilot-instructions.md +459 -0
- package/dist/cursor/.cursor/rules/joktec-adapter-skill.mdc +44 -0
- package/dist/cursor/.cursor/rules/joktec-broker-skill.mdc +44 -0
- package/dist/cursor/.cursor/rules/joktec-common-skill.mdc +73 -0
- package/dist/cursor/.cursor/rules/joktec-database-extended-skill.mdc +42 -0
- package/dist/cursor/.cursor/rules/joktec-framework-skill.mdc +62 -0
- package/dist/cursor/.cursor/rules/joktec-integration-skill.mdc +39 -0
- package/dist/cursor/.cursor/rules/joktec-mongo-skill.mdc +68 -0
- package/dist/cursor/.cursor/rules/joktec-mysql-skill.mdc +69 -0
- package/dist/cursor/.cursor/rules/joktec-tool-skill.mdc +44 -0
- package/dist/gemini/GEMINI.md +477 -0
- package/dist/windsurf/.windsurf/rules/joktec-adapter-skill.md +40 -0
- package/dist/windsurf/.windsurf/rules/joktec-broker-skill.md +40 -0
- package/dist/windsurf/.windsurf/rules/joktec-common-skill.md +69 -0
- package/dist/windsurf/.windsurf/rules/joktec-database-extended-skill.md +38 -0
- package/dist/windsurf/.windsurf/rules/joktec-framework-skill.md +58 -0
- package/dist/windsurf/.windsurf/rules/joktec-integration-skill.md +35 -0
- package/dist/windsurf/.windsurf/rules/joktec-mongo-skill.md +64 -0
- package/dist/windsurf/.windsurf/rules/joktec-mysql-skill.md +65 -0
- package/dist/windsurf/.windsurf/rules/joktec-tool-skill.md +40 -0
- package/package.json +69 -0
- package/scripts/build-copilot-instructions.mjs +22 -0
- package/scripts/build-cursor-rules.mjs +23 -0
- package/scripts/build-gemini-md.mjs +22 -0
- package/scripts/build-skill-folders.mjs +16 -0
- package/scripts/build-windsurf-rules.mjs +18 -0
- package/scripts/lib.mjs +110 -0
- package/scripts/sync-from-joktec-framework.mjs +53 -0
- package/scripts/validate-skills.mjs +78 -0
- package/skill-pack.json +146 -0
- package/skills/joktec-adapter-skill/SKILL.md +26 -0
- package/skills/joktec-adapter-skill/agents/openai.yaml +4 -0
- package/skills/joktec-adapter-skill/references/adapters.md +12 -0
- package/skills/joktec-broker-skill/SKILL.md +26 -0
- package/skills/joktec-broker-skill/agents/openai.yaml +4 -0
- package/skills/joktec-broker-skill/references/brokers.md +12 -0
- package/skills/joktec-common-skill/SKILL.md +28 -0
- package/skills/joktec-common-skill/agents/openai.yaml +4 -0
- package/skills/joktec-common-skill/references/core.md +19 -0
- package/skills/joktec-common-skill/references/utils-cron.md +17 -0
- package/skills/joktec-database-extended-skill/SKILL.md +25 -0
- package/skills/joktec-database-extended-skill/agents/openai.yaml +4 -0
- package/skills/joktec-database-extended-skill/references/extended-databases.md +11 -0
- package/skills/joktec-framework-skill/SKILL.md +31 -0
- package/skills/joktec-framework-skill/agents/openai.yaml +4 -0
- package/skills/joktec-framework-skill/references/framework-map.md +25 -0
- package/skills/joktec-integration-skill/SKILL.md +24 -0
- package/skills/joktec-integration-skill/agents/openai.yaml +4 -0
- package/skills/joktec-integration-skill/references/integrations.md +9 -0
- package/skills/joktec-mongo-skill/SKILL.md +22 -0
- package/skills/joktec-mongo-skill/agents/openai.yaml +4 -0
- package/skills/joktec-mongo-skill/references/repository.md +20 -0
- package/skills/joktec-mongo-skill/references/schema-and-plugins.md +17 -0
- package/skills/joktec-mysql-skill/SKILL.md +22 -0
- package/skills/joktec-mysql-skill/agents/openai.yaml +4 -0
- package/skills/joktec-mysql-skill/references/entities.md +15 -0
- package/skills/joktec-mysql-skill/references/repository.md +23 -0
- package/skills/joktec-tool-skill/SKILL.md +25 -0
- package/skills/joktec-tool-skill/agents/openai.yaml +4 -0
- package/skills/joktec-tool-skill/references/tools.md +13 -0
|
@@ -0,0 +1,459 @@
|
|
|
1
|
+
# JokTec Copilot Instructions
|
|
2
|
+
|
|
3
|
+
Use these instructions when working in repositories that consume `@joktec/*` packages.
|
|
4
|
+
|
|
5
|
+
## JokTec Framework Skill
|
|
6
|
+
|
|
7
|
+
Start here when a task mentions JokTec generally, multiple `@joktec/*` packages, or a consumer app that needs framework wiring.
|
|
8
|
+
|
|
9
|
+
## Select The Focused Skill
|
|
10
|
+
|
|
11
|
+
- For `@joktec/core`, `@joktec/utils`, or `@joktec/cron`, use `joktec-common-skill`.
|
|
12
|
+
- For `@joktec/mongo`, use `joktec-mongo-skill`.
|
|
13
|
+
- For `@joktec/mysql`, use `joktec-mysql-skill`.
|
|
14
|
+
- For Kafka, RabbitMQ, SQS, or Redcast, use `joktec-broker-skill`.
|
|
15
|
+
- For cache, mail, notification, or storage adapters, use `joktec-adapter-skill`.
|
|
16
|
+
- For Elastic, Arango, or BigQuery, use `joktec-database-extended-skill`.
|
|
17
|
+
- For Firebase or GPT integrations, use `joktec-integration-skill`.
|
|
18
|
+
- For HTTP, file, or alert utilities, use `joktec-tool-skill`.
|
|
19
|
+
|
|
20
|
+
## Core Rules
|
|
21
|
+
|
|
22
|
+
- Treat `joktec-framework` code, package README files, and agent docs as source-of-truth.
|
|
23
|
+
- Keep consumer app business logic in the app; do not move it into `@joktec/*` packages.
|
|
24
|
+
- Prefer config-driven module setup and `conId` when a package supports multiple clients.
|
|
25
|
+
- Preserve NestJS module boundaries, dependency injection, lifecycle hooks, and exported package APIs.
|
|
26
|
+
- Do not invent behavior for unfinished or missing packages.
|
|
27
|
+
|
|
28
|
+
## Reference
|
|
29
|
+
|
|
30
|
+
Read `references/framework-map.md` when the task needs package selection, dependency flow, or a quick map from requirement to package.
|
|
31
|
+
|
|
32
|
+
## Bundled References
|
|
33
|
+
|
|
34
|
+
### references/framework-map.md
|
|
35
|
+
|
|
36
|
+
# JokTec Framework Map
|
|
37
|
+
|
|
38
|
+
## Package Families
|
|
39
|
+
|
|
40
|
+
- `@joktec/core`: bootstrap, config, logger, metrics, guards, base abstractions, transports, pagination, Bull.
|
|
41
|
+
- `@joktec/utils`: low-level helpers, validators, conversion utilities.
|
|
42
|
+
- `@joktec/cron`: cron decorators, schedulers, job workers.
|
|
43
|
+
- `@joktec/mongo`: Mongoose/Typegoose database adapter and repository.
|
|
44
|
+
- `@joktec/mysql`: TypeORM relational adapter and repository.
|
|
45
|
+
- `@joktec/kafka`, `@joktec/rabbit`, `@joktec/sqs`, `@joktec/redcast`: broker clients and decorators.
|
|
46
|
+
- `@joktec/cacher`, `@joktec/mailer`, `@joktec/notifier`, `@joktec/storage`: external capability adapters.
|
|
47
|
+
- `@joktec/elastic`, `@joktec/arango`, `@joktec/bigquery`: extended database clients.
|
|
48
|
+
- `@joktec/firebase`, `@joktec/gpt`: third-party integrations.
|
|
49
|
+
- `@joktec/http`, `@joktec/file`, `@joktec/alert`: reusable tools.
|
|
50
|
+
|
|
51
|
+
## Dependency Direction
|
|
52
|
+
|
|
53
|
+
Consumer apps depend on concrete `@joktec/*` packages. Concrete packages usually depend on `@joktec/core` and `@joktec/utils`. Keep app-specific schemas, handlers, and business semantics outside reusable packages.
|
|
54
|
+
|
|
55
|
+
## Common Consumer App Pattern
|
|
56
|
+
|
|
57
|
+
1. Register package modules in the app module or repository module.
|
|
58
|
+
2. Keep app schemas/entities and app repositories in the consumer app.
|
|
59
|
+
3. Extend the package repository base class when the package provides one.
|
|
60
|
+
4. Use `BaseService`, `BaseController`, or transport helpers from `@joktec/core` when the app follows standard CRUD or message patterns.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## JokTec Common Skill
|
|
65
|
+
|
|
66
|
+
Use this skill for shared framework primitives, low-level helpers, cron utilities, and config schema type support.
|
|
67
|
+
|
|
68
|
+
## Packages
|
|
69
|
+
|
|
70
|
+
- `@joktec/core`: NestJS bootstrap, modules, config, logger, metrics, base abstractions, transports, pagination, Bull.
|
|
71
|
+
- `@joktec/utils`: conversion helpers, UUID/OTP/hash generators, validators, common constants.
|
|
72
|
+
- `@joktec/cron`: cron decorators, schedulers, workers, and job contracts.
|
|
73
|
+
- `@joktec/types`: generated config schema/type support for the JokTec package set.
|
|
74
|
+
|
|
75
|
+
## Rules
|
|
76
|
+
|
|
77
|
+
- Keep `@joktec/core` app-neutral; do not import adapters, brokers, databases, integrations, or consumer app code into core concepts.
|
|
78
|
+
- Use `BaseController` and `BaseService` for standard CRUD flows before hand-writing repetitive controllers.
|
|
79
|
+
- Use page, offset, or cursor pagination contracts from core; let database packages execute storage-specific pagination.
|
|
80
|
+
- Use `AbstractClientService` patterns for client packages that need config, lifecycle, retry, and `conId`.
|
|
81
|
+
- Use `@joktec/utils` for shared helpers instead of duplicating conversion, validation, hashing, or UUID logic.
|
|
82
|
+
|
|
83
|
+
## References
|
|
84
|
+
|
|
85
|
+
- Read `references/core.md` for bootstrap, CRUD, pagination, and client lifecycle.
|
|
86
|
+
- Read `references/utils-cron.md` for utility helpers and cron usage.
|
|
87
|
+
|
|
88
|
+
## Bundled References
|
|
89
|
+
|
|
90
|
+
### references/core.md
|
|
91
|
+
|
|
92
|
+
# Common Core Usage
|
|
93
|
+
|
|
94
|
+
## Runtime Bootstrap
|
|
95
|
+
|
|
96
|
+
Use the application bootstrap helpers from `@joktec/core` for gateway and microservice runtimes. Keep runtime behavior config-driven.
|
|
97
|
+
|
|
98
|
+
## CRUD Abstractions
|
|
99
|
+
|
|
100
|
+
- `BaseController` creates standard REST CRUD endpoints for DTO-backed resources.
|
|
101
|
+
- `BaseService` delegates repository operations through the shared repository contract.
|
|
102
|
+
- `ClientController` and `ClientService` provide generated microservice CRUD patterns.
|
|
103
|
+
|
|
104
|
+
## Pagination
|
|
105
|
+
|
|
106
|
+
Request priority is cursor, then offset, then page. `BaseController.paginationMode` affects Swagger response shape; runtime selection remains request-driven unless the app service narrows it.
|
|
107
|
+
|
|
108
|
+
## Client Lifecycle
|
|
109
|
+
|
|
110
|
+
Use `ClientConfig`, `AbstractClientService`, and `conId` when building or consuming packages that support multiple client connections.
|
|
111
|
+
|
|
112
|
+
### references/utils-cron.md
|
|
113
|
+
|
|
114
|
+
# Utils And Cron Usage
|
|
115
|
+
|
|
116
|
+
## Utils
|
|
117
|
+
|
|
118
|
+
Use `@joktec/utils` for common generators, validators, converters, hashing helpers, constants, and class-validator/class-transformer exports.
|
|
119
|
+
|
|
120
|
+
Prefer package helpers over app-local reimplementation when behavior should stay consistent across services.
|
|
121
|
+
|
|
122
|
+
## Cron
|
|
123
|
+
|
|
124
|
+
Use `@joktec/cron` when a consumer app needs scheduled jobs, job worker contracts, or decorator-driven cron registration.
|
|
125
|
+
|
|
126
|
+
Keep job business logic in the consumer app. The package provides scheduling abstractions, not domain behavior.
|
|
127
|
+
|
|
128
|
+
## Types
|
|
129
|
+
|
|
130
|
+
Use `@joktec/types` when a consumer workflow needs generated JokTec package config schema/type artifacts. Treat the framework repository as source-of-truth for the generated schema shape.
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## JokTec Mongo Skill
|
|
135
|
+
|
|
136
|
+
Use this skill for MongoDB-backed resources that rely on JokTec's Mongoose/Typegoose wrapper.
|
|
137
|
+
|
|
138
|
+
## Rules
|
|
139
|
+
|
|
140
|
+
- Register app schema classes through `MongoModule.forRoot(...)`.
|
|
141
|
+
- Keep schema classes, app repositories, and app-specific queries in the consumer app.
|
|
142
|
+
- Extend `MongoRepo<T, ID>` for app repositories.
|
|
143
|
+
- Preserve `conId` when the app has multiple Mongo connections.
|
|
144
|
+
- Use schema-first decorators when a schema class should be reused as a DTO source.
|
|
145
|
+
- Treat ObjectId casting and regex behavior as safety-sensitive.
|
|
146
|
+
|
|
147
|
+
## References
|
|
148
|
+
|
|
149
|
+
- Read `references/repository.md` for `MongoService`, `MongoRepo`, query parsing, and cursor pagination.
|
|
150
|
+
- Read `references/schema-and-plugins.md` for decorators, paranoid soft delete, strict references, transform behavior, and debug output.
|
|
151
|
+
|
|
152
|
+
## Bundled References
|
|
153
|
+
|
|
154
|
+
### references/repository.md
|
|
155
|
+
|
|
156
|
+
# Mongo Repository Usage
|
|
157
|
+
|
|
158
|
+
## Module Setup
|
|
159
|
+
|
|
160
|
+
Register schemas with `MongoModule.forRoot({ conId, models: [...] })`. Use the same `conId` in app repositories when using non-default connections.
|
|
161
|
+
|
|
162
|
+
## Repository Pattern
|
|
163
|
+
|
|
164
|
+
Extend `MongoRepo` and pass the schema class to the base constructor. Services can then use `BaseService` from `@joktec/core`.
|
|
165
|
+
|
|
166
|
+
## Query Safety
|
|
167
|
+
|
|
168
|
+
- Root `id` can act as an API alias for `_id` in query conditions.
|
|
169
|
+
- ObjectId casting should be schema-aware and limited to `_id`, ObjectId paths, or explicitly configured paths.
|
|
170
|
+
- `$like`, `$begin`, and `$end` escape regex input by default.
|
|
171
|
+
- Do not rely on broad conversion when storing raw snapshots, maps, or nested subdocuments.
|
|
172
|
+
|
|
173
|
+
## Pagination
|
|
174
|
+
|
|
175
|
+
`MongoRepo.paginate` supports page, offset, and cursor responses. Cursor mode defaults to `_id`; custom `cursorKey` appends `_id` as a tie-breaker.
|
|
176
|
+
|
|
177
|
+
### references/schema-and-plugins.md
|
|
178
|
+
|
|
179
|
+
# Mongo Schema And Plugins
|
|
180
|
+
|
|
181
|
+
## Schema Decorators
|
|
182
|
+
|
|
183
|
+
Use `@Schema` and `@Prop` wrappers from `@joktec/mongo` for Typegoose schema metadata plus validation, transform, and Swagger metadata.
|
|
184
|
+
|
|
185
|
+
Avoid mutating shared option objects across multiple properties.
|
|
186
|
+
|
|
187
|
+
## Plugins
|
|
188
|
+
|
|
189
|
+
- Paranoid plugin handles soft delete filtering and must respect aggregate first-stage constraints such as `$geoNear`.
|
|
190
|
+
- Strict reference plugin validates referenced documents and must resolve models through the active connection.
|
|
191
|
+
- Transform plugin centralizes common document transformation and should not break Mongo update operators.
|
|
192
|
+
|
|
193
|
+
## Debug Output
|
|
194
|
+
|
|
195
|
+
Use `mongoDebug(collection, method, ...args)` when a Mongoose debug callback should be rendered as a Mongo shell-friendly command.
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## JokTec MySQL Skill
|
|
200
|
+
|
|
201
|
+
Use this skill for relational resources backed by JokTec's TypeORM wrapper.
|
|
202
|
+
|
|
203
|
+
## Rules
|
|
204
|
+
|
|
205
|
+
- Register app entities through `MysqlModule.forRoot(...)`.
|
|
206
|
+
- Keep entities, app repositories, and app-specific SQL in the consumer app.
|
|
207
|
+
- Extend `MysqlRepo<T, ID>` for app repositories.
|
|
208
|
+
- Treat `mysql`, `mariadb`, and `postgres` as the first-class dialects.
|
|
209
|
+
- Keep `sync` explicit and normally enabled only by an owner process or development bootstrap.
|
|
210
|
+
- Do not add new behavior to deprecated `MysqlFinder`; use `MysqlRepo.qb()` and `MysqlHelper` paths.
|
|
211
|
+
|
|
212
|
+
## References
|
|
213
|
+
|
|
214
|
+
- Read `references/repository.md` for connection lifecycle, repository usage, query safety, transaction, and cursor behavior.
|
|
215
|
+
- Read `references/entities.md` for `@Tables`, `@Column`, `@PrimaryColumn`, uuidv7, and dialect guidance.
|
|
216
|
+
|
|
217
|
+
## Bundled References
|
|
218
|
+
|
|
219
|
+
### references/entities.md
|
|
220
|
+
|
|
221
|
+
# MySQL Entity Decorators
|
|
222
|
+
|
|
223
|
+
## Schema-First Entity Pattern
|
|
224
|
+
|
|
225
|
+
Use `@Tables`, `@Column`, and `@PrimaryColumn` from `@joktec/mysql` when an entity should also act as the source class for mapped DTOs.
|
|
226
|
+
|
|
227
|
+
## Primary Keys
|
|
228
|
+
|
|
229
|
+
- Prefer numeric auto-increment keys for write-heavy MySQL tables.
|
|
230
|
+
- Use UUIDs when the app needs globally unique or public identifiers.
|
|
231
|
+
- Prefer `uuidv7` over random UUIDs when the id participates in ordered indexes or cursor-like access.
|
|
232
|
+
|
|
233
|
+
## Dialects
|
|
234
|
+
|
|
235
|
+
The stable dialects are MySQL, MariaDB, and Postgres. Dialect capabilities own differences such as `LIKE` vs `ILIKE`, array support, fulltext support, and generated map reliability.
|
|
236
|
+
|
|
237
|
+
### references/repository.md
|
|
238
|
+
|
|
239
|
+
# MySQL Repository Usage
|
|
240
|
+
|
|
241
|
+
## Module Setup
|
|
242
|
+
|
|
243
|
+
Register entities with `MysqlModule.forRoot({ conId, models: [...] })`. Use `conId` for multiple DataSources.
|
|
244
|
+
|
|
245
|
+
## Repository Pattern
|
|
246
|
+
|
|
247
|
+
Extend `MysqlRepo` and pass the entity class to the base constructor. Services can use `BaseService` when CRUD behavior follows the shared contract.
|
|
248
|
+
|
|
249
|
+
## Query Safety
|
|
250
|
+
|
|
251
|
+
- Validate field paths against TypeORM metadata before interpolating SQL identifiers.
|
|
252
|
+
- Use parameter binding for values.
|
|
253
|
+
- Keep logical operators such as `$and` and `$or` grouped through QueryBuilder behavior.
|
|
254
|
+
|
|
255
|
+
## Pagination
|
|
256
|
+
|
|
257
|
+
`MysqlRepo.paginate` supports page, offset, and cursor responses. Cursor mode defaults to `createdAt` plus primary key columns. Custom cursor keys must be mapped columns.
|
|
258
|
+
|
|
259
|
+
## Transactions
|
|
260
|
+
|
|
261
|
+
When using transaction-scoped operations, pass the manager or query runner through repository options so pre-read and write operations use the same context.
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## JokTec Broker Skill
|
|
266
|
+
|
|
267
|
+
Use this skill for message broker packages.
|
|
268
|
+
|
|
269
|
+
## Packages
|
|
270
|
+
|
|
271
|
+
- `@joktec/kafka`: Kafka client, decorators, loaders, metrics.
|
|
272
|
+
- `@joktec/rabbit`: RabbitMQ client, decorators, auto-binding, metrics.
|
|
273
|
+
- `@joktec/sqs`: AWS SQS/SNS queue and topic wrapper.
|
|
274
|
+
- `@joktec/redcast`: Redis-backed broker behavior.
|
|
275
|
+
|
|
276
|
+
## Rules
|
|
277
|
+
|
|
278
|
+
- Keep message business semantics in the consumer app.
|
|
279
|
+
- Use broker decorators for transport wiring, not for domain policy.
|
|
280
|
+
- Preserve config-driven client selection and `conId` when available.
|
|
281
|
+
- Keep topic, queue, and routing names explicit in app configuration or decorators.
|
|
282
|
+
|
|
283
|
+
## Reference
|
|
284
|
+
|
|
285
|
+
Read `references/brokers.md` for setup and package-specific notes.
|
|
286
|
+
|
|
287
|
+
## Bundled References
|
|
288
|
+
|
|
289
|
+
### references/brokers.md
|
|
290
|
+
|
|
291
|
+
# Broker Usage
|
|
292
|
+
|
|
293
|
+
## Runtime Pattern
|
|
294
|
+
|
|
295
|
+
Broker services follow `AbstractClientService` lifecycle. Loader classes discover decorator metadata after module initialization. Apps define producers, consumers, and message semantics.
|
|
296
|
+
|
|
297
|
+
## Package Notes
|
|
298
|
+
|
|
299
|
+
- Kafka: check topic existence and broker advertised listeners in local development.
|
|
300
|
+
- RabbitMQ: use module options and decorators for exchanges, queues, and bindings.
|
|
301
|
+
- SQS: local ElasticMQ-style environments may require queues to exist before consumers start.
|
|
302
|
+
- Redcast: use Redis-backed list, stream, or pub/sub behavior when a lightweight broker is enough.
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## JokTec Adapter Skill
|
|
307
|
+
|
|
308
|
+
Use this skill for pluggable external capability adapters.
|
|
309
|
+
|
|
310
|
+
## Packages
|
|
311
|
+
|
|
312
|
+
- `@joktec/cacher`: cache stores.
|
|
313
|
+
- `@joktec/mailer`: mail delivery.
|
|
314
|
+
- `@joktec/notifier`: push notifications.
|
|
315
|
+
- `@joktec/storage`: object storage and file metadata helpers.
|
|
316
|
+
|
|
317
|
+
## Rules
|
|
318
|
+
|
|
319
|
+
- Keep adapter services app-neutral.
|
|
320
|
+
- Use validated config and `conId` where supported.
|
|
321
|
+
- Keep secrets and credentials in app config or runtime environment, never in code.
|
|
322
|
+
- Prefer adapter services over direct SDK usage in app services.
|
|
323
|
+
|
|
324
|
+
## Reference
|
|
325
|
+
|
|
326
|
+
Read `references/adapters.md` for setup and package-specific notes.
|
|
327
|
+
|
|
328
|
+
## Bundled References
|
|
329
|
+
|
|
330
|
+
### references/adapters.md
|
|
331
|
+
|
|
332
|
+
# Adapter Usage
|
|
333
|
+
|
|
334
|
+
## Runtime Pattern
|
|
335
|
+
|
|
336
|
+
Adapters are global Nest modules. Services own native client creation and expose package-specific operations.
|
|
337
|
+
|
|
338
|
+
## Package Notes
|
|
339
|
+
|
|
340
|
+
- Cacher: choose local, Redis, or Memcached stores based on runtime config.
|
|
341
|
+
- Mailer: centralize mail transport configuration in the service that owns outbound email.
|
|
342
|
+
- Notifier: keep push provider configuration outside app business logic.
|
|
343
|
+
- Storage: keep storage metadata and object operations behind the adapter service.
|
|
344
|
+
|
|
345
|
+
---
|
|
346
|
+
|
|
347
|
+
## JokTec Extended Database Skill
|
|
348
|
+
|
|
349
|
+
Use this skill for database clients that are not Mongo or MySQL.
|
|
350
|
+
|
|
351
|
+
## Packages
|
|
352
|
+
|
|
353
|
+
- `@joktec/elastic`
|
|
354
|
+
- `@joktec/arango`
|
|
355
|
+
- `@joktec/bigquery`
|
|
356
|
+
|
|
357
|
+
## Rules
|
|
358
|
+
|
|
359
|
+
- Keep app-specific query semantics in the consumer app.
|
|
360
|
+
- Use package services for client lifecycle and connection config.
|
|
361
|
+
- Do not claim parity with Mongo/MySQL repository behavior unless the package implements it.
|
|
362
|
+
- Use package README and source as final truth before adding advanced behavior.
|
|
363
|
+
|
|
364
|
+
## Reference
|
|
365
|
+
|
|
366
|
+
Read `references/extended-databases.md` for package boundaries and usage notes.
|
|
367
|
+
|
|
368
|
+
## Bundled References
|
|
369
|
+
|
|
370
|
+
### references/extended-databases.md
|
|
371
|
+
|
|
372
|
+
# Extended Database Usage
|
|
373
|
+
|
|
374
|
+
## Package Boundaries
|
|
375
|
+
|
|
376
|
+
Extended database packages expose reusable clients and helpers for specific data systems. They should not contain consumer app schemas or business-specific query policy.
|
|
377
|
+
|
|
378
|
+
## Notes
|
|
379
|
+
|
|
380
|
+
- Elastic may depend on `@joktec/http` for HTTP-backed behavior.
|
|
381
|
+
- Arango and BigQuery are separate client packages; verify the README/source before assuming repository-like CRUD support.
|
|
382
|
+
- Use local package tests or consumer harnesses only when the target service stack is available.
|
|
383
|
+
|
|
384
|
+
---
|
|
385
|
+
|
|
386
|
+
## JokTec Integration Skill
|
|
387
|
+
|
|
388
|
+
Use this skill for third-party integration packages.
|
|
389
|
+
|
|
390
|
+
## Packages
|
|
391
|
+
|
|
392
|
+
- `@joktec/firebase`: Firebase Admin SDK integration.
|
|
393
|
+
- `@joktec/gpt`: GPT/OpenAI-style client integration.
|
|
394
|
+
|
|
395
|
+
## Rules
|
|
396
|
+
|
|
397
|
+
- Keep credentials config-driven and never commit real credentials.
|
|
398
|
+
- Use package services instead of direct SDK initialization in app code.
|
|
399
|
+
- Preserve app-neutral service behavior; consumer apps own domain workflows.
|
|
400
|
+
- Verify current package README/source before relying on advanced provider features.
|
|
401
|
+
|
|
402
|
+
## Reference
|
|
403
|
+
|
|
404
|
+
Read `references/integrations.md` for provider-specific notes.
|
|
405
|
+
|
|
406
|
+
## Bundled References
|
|
407
|
+
|
|
408
|
+
### references/integrations.md
|
|
409
|
+
|
|
410
|
+
# Integration Usage
|
|
411
|
+
|
|
412
|
+
## Firebase
|
|
413
|
+
|
|
414
|
+
Use the integration module and service to initialize Firebase Admin clients from validated config. Keep credential files local or environment-provided.
|
|
415
|
+
|
|
416
|
+
## GPT
|
|
417
|
+
|
|
418
|
+
Use the integration package for reusable GPT client setup. Keep prompt/business policy in the consumer app, not in the generic package.
|
|
419
|
+
|
|
420
|
+
---
|
|
421
|
+
|
|
422
|
+
## JokTec Tool Skill
|
|
423
|
+
|
|
424
|
+
Use this skill for reusable utility services.
|
|
425
|
+
|
|
426
|
+
## Packages
|
|
427
|
+
|
|
428
|
+
- `@joktec/http`: Axios-backed HTTP client wrapper.
|
|
429
|
+
- `@joktec/file`: file classification and local file helpers.
|
|
430
|
+
- `@joktec/alert`: alert delivery through Slack-compatible webhooks.
|
|
431
|
+
|
|
432
|
+
## Rules
|
|
433
|
+
|
|
434
|
+
- Keep tools app-neutral and reusable.
|
|
435
|
+
- Use config-driven clients instead of direct ad hoc setup in app code.
|
|
436
|
+
- Preserve retry, metrics, proxy, and upload behavior where the package exposes it.
|
|
437
|
+
- Keep alert tokens and webhook URLs in runtime config only.
|
|
438
|
+
|
|
439
|
+
## Reference
|
|
440
|
+
|
|
441
|
+
Read `references/tools.md` for package-specific usage notes.
|
|
442
|
+
|
|
443
|
+
## Bundled References
|
|
444
|
+
|
|
445
|
+
### references/tools.md
|
|
446
|
+
|
|
447
|
+
# Tool Usage
|
|
448
|
+
|
|
449
|
+
## HTTP
|
|
450
|
+
|
|
451
|
+
Use `@joktec/http` for Axios-backed requests, uploads, proxy agent support, retry config, and metrics where exposed.
|
|
452
|
+
|
|
453
|
+
## File
|
|
454
|
+
|
|
455
|
+
Use `@joktec/file` for shared file helpers and classification behavior instead of duplicating local utility code.
|
|
456
|
+
|
|
457
|
+
## Alert
|
|
458
|
+
|
|
459
|
+
Use `@joktec/alert` for Slack-compatible webhook alerts. Keep webhook URLs and credentials out of source control.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Use when wiring or using JokTec adapter packages @joktec/cacher, @joktec/mailer, @joktec/notifier, or @joktec/storage for cache, mail delivery, push notifications, object storage, config-driven clients, and app-neutral adapter services.
|
|
3
|
+
globs: packages/adapters/**
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# JokTec Adapter Skill
|
|
8
|
+
|
|
9
|
+
Use this skill for pluggable external capability adapters.
|
|
10
|
+
|
|
11
|
+
## Packages
|
|
12
|
+
|
|
13
|
+
- `@joktec/cacher`: cache stores.
|
|
14
|
+
- `@joktec/mailer`: mail delivery.
|
|
15
|
+
- `@joktec/notifier`: push notifications.
|
|
16
|
+
- `@joktec/storage`: object storage and file metadata helpers.
|
|
17
|
+
|
|
18
|
+
## Rules
|
|
19
|
+
|
|
20
|
+
- Keep adapter services app-neutral.
|
|
21
|
+
- Use validated config and `conId` where supported.
|
|
22
|
+
- Keep secrets and credentials in app config or runtime environment, never in code.
|
|
23
|
+
- Prefer adapter services over direct SDK usage in app services.
|
|
24
|
+
|
|
25
|
+
## Reference
|
|
26
|
+
|
|
27
|
+
Read `references/adapters.md` for setup and package-specific notes.
|
|
28
|
+
|
|
29
|
+
## Bundled References
|
|
30
|
+
|
|
31
|
+
### references/adapters.md
|
|
32
|
+
|
|
33
|
+
# Adapter Usage
|
|
34
|
+
|
|
35
|
+
## Runtime Pattern
|
|
36
|
+
|
|
37
|
+
Adapters are global Nest modules. Services own native client creation and expose package-specific operations.
|
|
38
|
+
|
|
39
|
+
## Package Notes
|
|
40
|
+
|
|
41
|
+
- Cacher: choose local, Redis, or Memcached stores based on runtime config.
|
|
42
|
+
- Mailer: centralize mail transport configuration in the service that owns outbound email.
|
|
43
|
+
- Notifier: keep push provider configuration outside app business logic.
|
|
44
|
+
- Storage: keep storage metadata and object operations behind the adapter service.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Use when wiring or using JokTec broker packages @joktec/kafka, @joktec/rabbit, @joktec/sqs, or @joktec/redcast, including client config, producer decorators, consumer loaders, message handlers, auto-binding, and app-level broker flows.
|
|
3
|
+
globs: packages/brokers/**
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# JokTec Broker Skill
|
|
8
|
+
|
|
9
|
+
Use this skill for message broker packages.
|
|
10
|
+
|
|
11
|
+
## Packages
|
|
12
|
+
|
|
13
|
+
- `@joktec/kafka`: Kafka client, decorators, loaders, metrics.
|
|
14
|
+
- `@joktec/rabbit`: RabbitMQ client, decorators, auto-binding, metrics.
|
|
15
|
+
- `@joktec/sqs`: AWS SQS/SNS queue and topic wrapper.
|
|
16
|
+
- `@joktec/redcast`: Redis-backed broker behavior.
|
|
17
|
+
|
|
18
|
+
## Rules
|
|
19
|
+
|
|
20
|
+
- Keep message business semantics in the consumer app.
|
|
21
|
+
- Use broker decorators for transport wiring, not for domain policy.
|
|
22
|
+
- Preserve config-driven client selection and `conId` when available.
|
|
23
|
+
- Keep topic, queue, and routing names explicit in app configuration or decorators.
|
|
24
|
+
|
|
25
|
+
## Reference
|
|
26
|
+
|
|
27
|
+
Read `references/brokers.md` for setup and package-specific notes.
|
|
28
|
+
|
|
29
|
+
## Bundled References
|
|
30
|
+
|
|
31
|
+
### references/brokers.md
|
|
32
|
+
|
|
33
|
+
# Broker Usage
|
|
34
|
+
|
|
35
|
+
## Runtime Pattern
|
|
36
|
+
|
|
37
|
+
Broker services follow `AbstractClientService` lifecycle. Loader classes discover decorator metadata after module initialization. Apps define producers, consumers, and message semantics.
|
|
38
|
+
|
|
39
|
+
## Package Notes
|
|
40
|
+
|
|
41
|
+
- Kafka: check topic existence and broker advertised listeners in local development.
|
|
42
|
+
- RabbitMQ: use module options and decorators for exchanges, queues, and bindings.
|
|
43
|
+
- SQS: local ElasticMQ-style environments may require queues to exist before consumers start.
|
|
44
|
+
- Redcast: use Redis-backed list, stream, or pub/sub behavior when a lightweight broker is enough.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Use when implementing or wiring @joktec/core, @joktec/utils, or @joktec/cron in a consumer app, especially BaseController, BaseService, pagination, config, client lifecycle, bootstrap, cron decorators, or utility helpers.
|
|
3
|
+
globs: packages/common/**
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# JokTec Common Skill
|
|
8
|
+
|
|
9
|
+
Use this skill for shared framework primitives, low-level helpers, cron utilities, and config schema type support.
|
|
10
|
+
|
|
11
|
+
## Packages
|
|
12
|
+
|
|
13
|
+
- `@joktec/core`: NestJS bootstrap, modules, config, logger, metrics, base abstractions, transports, pagination, Bull.
|
|
14
|
+
- `@joktec/utils`: conversion helpers, UUID/OTP/hash generators, validators, common constants.
|
|
15
|
+
- `@joktec/cron`: cron decorators, schedulers, workers, and job contracts.
|
|
16
|
+
- `@joktec/types`: generated config schema/type support for the JokTec package set.
|
|
17
|
+
|
|
18
|
+
## Rules
|
|
19
|
+
|
|
20
|
+
- Keep `@joktec/core` app-neutral; do not import adapters, brokers, databases, integrations, or consumer app code into core concepts.
|
|
21
|
+
- Use `BaseController` and `BaseService` for standard CRUD flows before hand-writing repetitive controllers.
|
|
22
|
+
- Use page, offset, or cursor pagination contracts from core; let database packages execute storage-specific pagination.
|
|
23
|
+
- Use `AbstractClientService` patterns for client packages that need config, lifecycle, retry, and `conId`.
|
|
24
|
+
- Use `@joktec/utils` for shared helpers instead of duplicating conversion, validation, hashing, or UUID logic.
|
|
25
|
+
|
|
26
|
+
## References
|
|
27
|
+
|
|
28
|
+
- Read `references/core.md` for bootstrap, CRUD, pagination, and client lifecycle.
|
|
29
|
+
- Read `references/utils-cron.md` for utility helpers and cron usage.
|
|
30
|
+
|
|
31
|
+
## Bundled References
|
|
32
|
+
|
|
33
|
+
### references/core.md
|
|
34
|
+
|
|
35
|
+
# Common Core Usage
|
|
36
|
+
|
|
37
|
+
## Runtime Bootstrap
|
|
38
|
+
|
|
39
|
+
Use the application bootstrap helpers from `@joktec/core` for gateway and microservice runtimes. Keep runtime behavior config-driven.
|
|
40
|
+
|
|
41
|
+
## CRUD Abstractions
|
|
42
|
+
|
|
43
|
+
- `BaseController` creates standard REST CRUD endpoints for DTO-backed resources.
|
|
44
|
+
- `BaseService` delegates repository operations through the shared repository contract.
|
|
45
|
+
- `ClientController` and `ClientService` provide generated microservice CRUD patterns.
|
|
46
|
+
|
|
47
|
+
## Pagination
|
|
48
|
+
|
|
49
|
+
Request priority is cursor, then offset, then page. `BaseController.paginationMode` affects Swagger response shape; runtime selection remains request-driven unless the app service narrows it.
|
|
50
|
+
|
|
51
|
+
## Client Lifecycle
|
|
52
|
+
|
|
53
|
+
Use `ClientConfig`, `AbstractClientService`, and `conId` when building or consuming packages that support multiple client connections.
|
|
54
|
+
|
|
55
|
+
### references/utils-cron.md
|
|
56
|
+
|
|
57
|
+
# Utils And Cron Usage
|
|
58
|
+
|
|
59
|
+
## Utils
|
|
60
|
+
|
|
61
|
+
Use `@joktec/utils` for common generators, validators, converters, hashing helpers, constants, and class-validator/class-transformer exports.
|
|
62
|
+
|
|
63
|
+
Prefer package helpers over app-local reimplementation when behavior should stay consistent across services.
|
|
64
|
+
|
|
65
|
+
## Cron
|
|
66
|
+
|
|
67
|
+
Use `@joktec/cron` when a consumer app needs scheduled jobs, job worker contracts, or decorator-driven cron registration.
|
|
68
|
+
|
|
69
|
+
Keep job business logic in the consumer app. The package provides scheduling abstractions, not domain behavior.
|
|
70
|
+
|
|
71
|
+
## Types
|
|
72
|
+
|
|
73
|
+
Use `@joktec/types` when a consumer workflow needs generated JokTec package config schema/type artifacts. Treat the framework repository as source-of-truth for the generated schema shape.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Use when working with extended JokTec database packages @joktec/elastic, @joktec/arango, or @joktec/bigquery in a consumer app, including app-neutral client setup, config-driven lifecycle, and package-specific query/service usage.
|
|
3
|
+
globs: packages/databases/elastic/**,packages/databases/arango/**,packages/databases/bigquery/**
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# JokTec Extended Database Skill
|
|
8
|
+
|
|
9
|
+
Use this skill for database clients that are not Mongo or MySQL.
|
|
10
|
+
|
|
11
|
+
## Packages
|
|
12
|
+
|
|
13
|
+
- `@joktec/elastic`
|
|
14
|
+
- `@joktec/arango`
|
|
15
|
+
- `@joktec/bigquery`
|
|
16
|
+
|
|
17
|
+
## Rules
|
|
18
|
+
|
|
19
|
+
- Keep app-specific query semantics in the consumer app.
|
|
20
|
+
- Use package services for client lifecycle and connection config.
|
|
21
|
+
- Do not claim parity with Mongo/MySQL repository behavior unless the package implements it.
|
|
22
|
+
- Use package README and source as final truth before adding advanced behavior.
|
|
23
|
+
|
|
24
|
+
## Reference
|
|
25
|
+
|
|
26
|
+
Read `references/extended-databases.md` for package boundaries and usage notes.
|
|
27
|
+
|
|
28
|
+
## Bundled References
|
|
29
|
+
|
|
30
|
+
### references/extended-databases.md
|
|
31
|
+
|
|
32
|
+
# Extended Database Usage
|
|
33
|
+
|
|
34
|
+
## Package Boundaries
|
|
35
|
+
|
|
36
|
+
Extended database packages expose reusable clients and helpers for specific data systems. They should not contain consumer app schemas or business-specific query policy.
|
|
37
|
+
|
|
38
|
+
## Notes
|
|
39
|
+
|
|
40
|
+
- Elastic may depend on `@joktec/http` for HTTP-backed behavior.
|
|
41
|
+
- Arango and BigQuery are separate client packages; verify the README/source before assuming repository-like CRUD support.
|
|
42
|
+
- Use local package tests or consumer harnesses only when the target service stack is available.
|