@joktec/skills 0.1.3 → 0.1.4

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 (84) hide show
  1. package/dist/claude/skills/joktec-adapter-skill/SKILL.md +1 -0
  2. package/dist/claude/skills/joktec-adapter-skill/references/adapters.md +28 -0
  3. package/dist/claude/skills/joktec-broker-skill/SKILL.md +1 -0
  4. package/dist/claude/skills/joktec-broker-skill/references/brokers.md +29 -0
  5. package/dist/claude/skills/joktec-common-skill/SKILL.md +1 -0
  6. package/dist/claude/skills/joktec-common-skill/references/core.md +56 -0
  7. package/dist/claude/skills/joktec-common-skill/references/utils-cron.md +28 -0
  8. package/dist/claude/skills/joktec-database-extended-skill/SKILL.md +1 -0
  9. package/dist/claude/skills/joktec-database-extended-skill/references/extended-databases.md +24 -0
  10. package/dist/claude/skills/joktec-framework-skill/SKILL.md +1 -0
  11. package/dist/claude/skills/joktec-framework-skill/references/framework-map.md +34 -0
  12. package/dist/claude/skills/joktec-integration-skill/SKILL.md +1 -0
  13. package/dist/claude/skills/joktec-integration-skill/references/integrations.md +29 -0
  14. package/dist/claude/skills/joktec-mongo-skill/SKILL.md +1 -0
  15. package/dist/claude/skills/joktec-mongo-skill/references/repository.md +43 -0
  16. package/dist/claude/skills/joktec-mongo-skill/references/schema-and-plugins.md +29 -0
  17. package/dist/claude/skills/joktec-mysql-skill/SKILL.md +3 -1
  18. package/dist/claude/skills/joktec-mysql-skill/references/entities.md +100 -0
  19. package/dist/claude/skills/joktec-mysql-skill/references/repository.md +49 -0
  20. package/dist/claude/skills/joktec-tool-skill/SKILL.md +1 -0
  21. package/dist/claude/skills/joktec-tool-skill/references/tools.md +35 -0
  22. package/dist/codex/skills/joktec-adapter-skill/SKILL.md +1 -0
  23. package/dist/codex/skills/joktec-adapter-skill/references/adapters.md +28 -0
  24. package/dist/codex/skills/joktec-broker-skill/SKILL.md +1 -0
  25. package/dist/codex/skills/joktec-broker-skill/references/brokers.md +29 -0
  26. package/dist/codex/skills/joktec-common-skill/SKILL.md +1 -0
  27. package/dist/codex/skills/joktec-common-skill/references/core.md +56 -0
  28. package/dist/codex/skills/joktec-common-skill/references/utils-cron.md +28 -0
  29. package/dist/codex/skills/joktec-database-extended-skill/SKILL.md +1 -0
  30. package/dist/codex/skills/joktec-database-extended-skill/references/extended-databases.md +24 -0
  31. package/dist/codex/skills/joktec-framework-skill/SKILL.md +1 -0
  32. package/dist/codex/skills/joktec-framework-skill/references/framework-map.md +34 -0
  33. package/dist/codex/skills/joktec-integration-skill/SKILL.md +1 -0
  34. package/dist/codex/skills/joktec-integration-skill/references/integrations.md +29 -0
  35. package/dist/codex/skills/joktec-mongo-skill/SKILL.md +1 -0
  36. package/dist/codex/skills/joktec-mongo-skill/references/repository.md +43 -0
  37. package/dist/codex/skills/joktec-mongo-skill/references/schema-and-plugins.md +29 -0
  38. package/dist/codex/skills/joktec-mysql-skill/SKILL.md +3 -1
  39. package/dist/codex/skills/joktec-mysql-skill/references/entities.md +100 -0
  40. package/dist/codex/skills/joktec-mysql-skill/references/repository.md +49 -0
  41. package/dist/codex/skills/joktec-tool-skill/SKILL.md +1 -0
  42. package/dist/codex/skills/joktec-tool-skill/references/tools.md +35 -0
  43. package/dist/copilot/.github/copilot-instructions.md +495 -1
  44. package/dist/cursor/.cursor/rules/joktec-adapter-skill.mdc +29 -0
  45. package/dist/cursor/.cursor/rules/joktec-broker-skill.mdc +30 -0
  46. package/dist/cursor/.cursor/rules/joktec-common-skill.mdc +85 -0
  47. package/dist/cursor/.cursor/rules/joktec-database-extended-skill.mdc +25 -0
  48. package/dist/cursor/.cursor/rules/joktec-framework-skill.mdc +35 -0
  49. package/dist/cursor/.cursor/rules/joktec-integration-skill.mdc +30 -0
  50. package/dist/cursor/.cursor/rules/joktec-mongo-skill.mdc +73 -0
  51. package/dist/cursor/.cursor/rules/joktec-mysql-skill.mdc +152 -1
  52. package/dist/cursor/.cursor/rules/joktec-tool-skill.mdc +36 -0
  53. package/dist/gemini/GEMINI.md +495 -1
  54. package/dist/windsurf/.windsurf/rules/joktec-adapter-skill.md +29 -0
  55. package/dist/windsurf/.windsurf/rules/joktec-broker-skill.md +30 -0
  56. package/dist/windsurf/.windsurf/rules/joktec-common-skill.md +85 -0
  57. package/dist/windsurf/.windsurf/rules/joktec-database-extended-skill.md +25 -0
  58. package/dist/windsurf/.windsurf/rules/joktec-framework-skill.md +35 -0
  59. package/dist/windsurf/.windsurf/rules/joktec-integration-skill.md +30 -0
  60. package/dist/windsurf/.windsurf/rules/joktec-mongo-skill.md +73 -0
  61. package/dist/windsurf/.windsurf/rules/joktec-mysql-skill.md +152 -1
  62. package/dist/windsurf/.windsurf/rules/joktec-tool-skill.md +36 -0
  63. package/package.json +1 -1
  64. package/skills/joktec-adapter-skill/SKILL.md +1 -0
  65. package/skills/joktec-adapter-skill/references/adapters.md +28 -0
  66. package/skills/joktec-broker-skill/SKILL.md +1 -0
  67. package/skills/joktec-broker-skill/references/brokers.md +29 -0
  68. package/skills/joktec-common-skill/SKILL.md +1 -0
  69. package/skills/joktec-common-skill/references/core.md +56 -0
  70. package/skills/joktec-common-skill/references/utils-cron.md +28 -0
  71. package/skills/joktec-database-extended-skill/SKILL.md +1 -0
  72. package/skills/joktec-database-extended-skill/references/extended-databases.md +24 -0
  73. package/skills/joktec-framework-skill/SKILL.md +1 -0
  74. package/skills/joktec-framework-skill/references/framework-map.md +34 -0
  75. package/skills/joktec-integration-skill/SKILL.md +1 -0
  76. package/skills/joktec-integration-skill/references/integrations.md +29 -0
  77. package/skills/joktec-mongo-skill/SKILL.md +1 -0
  78. package/skills/joktec-mongo-skill/references/repository.md +43 -0
  79. package/skills/joktec-mongo-skill/references/schema-and-plugins.md +29 -0
  80. package/skills/joktec-mysql-skill/SKILL.md +3 -1
  81. package/skills/joktec-mysql-skill/references/entities.md +100 -0
  82. package/skills/joktec-mysql-skill/references/repository.md +49 -0
  83. package/skills/joktec-tool-skill/SKILL.md +1 -0
  84. package/skills/joktec-tool-skill/references/tools.md +35 -0
@@ -21,6 +21,7 @@ Use this skill for pluggable external capability adapters.
21
21
  - Use validated config and `conId` where supported.
22
22
  - Keep secrets and credentials in app config or runtime environment, never in code.
23
23
  - Prefer adapter services over direct SDK usage in app services.
24
+ - If guidance is insufficient, read this skill's references and inspect `../joktec-framework` package source or GitHub fallback before assuming APIs.
24
25
 
25
26
  ## Reference
26
27
 
@@ -32,13 +33,41 @@ Read `references/adapters.md` for setup and package-specific notes.
32
33
 
33
34
  # Adapter Usage
34
35
 
36
+ ## Source Lookup
37
+
38
+ When blocked, inspect:
39
+
40
+ - `packages/adapters/README.md`
41
+ - `packages/adapters/AGENTS.md`
42
+ - `packages/adapters/<package>/README.md`
43
+ - `packages/adapters/<package>/src/index.ts`
44
+ - package module/config/service files under `src/`
45
+
35
46
  ## Runtime Pattern
36
47
 
37
48
  Adapters are global Nest modules. Services own native client creation and expose package-specific operations.
38
49
 
50
+ Most adapters follow `AbstractClientService`: config is validated, native clients are created by the service, `conId` selects the connection, and shutdown/retry/debug behavior should remain package-owned.
51
+
39
52
  ## Package Notes
40
53
 
41
54
  - Cacher: choose local, Redis, or Memcached stores based on runtime config.
42
55
  - Mailer: centralize mail transport configuration in the service that owns outbound email.
43
56
  - Notifier: keep push provider configuration outside app business logic.
44
57
  - Storage: keep storage metadata and object operations behind the adapter service.
58
+
59
+ ## Best Practices
60
+
61
+ - Import adapter modules in the application layer, then inject services into domain services.
62
+ - Keep provider credentials, endpoints, bucket names, SMTP secrets, and push credentials in runtime config.
63
+ - Keep business payload composition in the consuming app. The adapter should send/cache/store, not decide product semantics.
64
+ - Use `conId` for multiple providers or tenants instead of creating ad-hoc service instances.
65
+ - Normalize provider errors at the package/app boundary so controllers do not branch on SDK-specific messages.
66
+ - Mock SDK clients in unit tests; run live provider checks only in explicit integration or consumer harness tests.
67
+
68
+ ## Anti-Patterns
69
+
70
+ - Do not put email template business rules inside `@joktec/mailer`.
71
+ - Do not hardcode S3 buckets, Redis URLs, SMTP credentials, or notification tokens in source.
72
+ - Do not bypass adapter services by importing provider SDK clients directly throughout the app.
73
+ - Do not assume every adapter has identical method names; read each package README/source before calling.
@@ -21,6 +21,7 @@ Use this skill for message broker packages.
21
21
  - Use broker decorators for transport wiring, not for domain policy.
22
22
  - Preserve config-driven client selection and `conId` when available.
23
23
  - Keep topic, queue, and routing names explicit in app configuration or decorators.
24
+ - If guidance is insufficient, read this skill's references and inspect `../joktec-framework` package source or GitHub fallback before assuming APIs.
24
25
 
25
26
  ## Reference
26
27
 
@@ -32,13 +33,42 @@ Read `references/brokers.md` for setup and package-specific notes.
32
33
 
33
34
  # Broker Usage
34
35
 
36
+ ## Source Lookup
37
+
38
+ When blocked, inspect:
39
+
40
+ - `packages/brokers/README.md`
41
+ - `packages/brokers/AGENTS.md`
42
+ - `packages/brokers/<package>/README.md`
43
+ - `packages/brokers/<package>/src/index.ts`
44
+ - package decorators, loaders, config, and service files under `src/`
45
+
35
46
  ## Runtime Pattern
36
47
 
37
48
  Broker services follow `AbstractClientService` lifecycle. Loader classes discover decorator metadata after module initialization. Apps define producers, consumers, and message semantics.
38
49
 
50
+ Use broker packages for transport wiring, not for business workflow ownership. The consuming app owns event names, payload contracts, idempotency, retry policy, dead-letter behavior, and handler semantics.
51
+
39
52
  ## Package Notes
40
53
 
41
54
  - Kafka: check topic existence and broker advertised listeners in local development.
42
55
  - RabbitMQ: use module options and decorators for exchanges, queues, and bindings.
43
56
  - SQS: local ElasticMQ-style environments may require queues to exist before consumers start.
44
57
  - Redcast: use Redis-backed list, stream, or pub/sub behavior when a lightweight broker is enough.
58
+
59
+ ## Best Practices
60
+
61
+ - Start consumers only in processes that should own subscriptions.
62
+ - Keep producer and consumer payload DTOs versionable and explicit.
63
+ - Use config paths or module options for topic/queue names when supported.
64
+ - Make handlers idempotent; brokers may redeliver.
65
+ - Add observable effects for consumer tests rather than asserting log text.
66
+ - Keep broker health/preflight checks separate from business request handling.
67
+ - In local stacks, verify broker-specific infrastructure: Kafka topics, Rabbit exchanges/queues, SQS queues, Redis password/db.
68
+
69
+ ## Anti-Patterns
70
+
71
+ - Do not hide domain workflows inside decorators or broker package services.
72
+ - Do not assume auto-create topic/queue behavior unless the package and local broker support it.
73
+ - Do not run the same consumer group/queue owner in every process by accident.
74
+ - Do not swallow message handling errors without retry/dead-letter visibility.
@@ -22,6 +22,7 @@ Use this skill for shared framework primitives, low-level helpers, cron utilitie
22
22
  - Use page, offset, or cursor pagination contracts from core; let database packages execute storage-specific pagination.
23
23
  - Use `AbstractClientService` patterns for client packages that need config, lifecycle, retry, and `conId`.
24
24
  - Use `@joktec/utils` for shared helpers instead of duplicating conversion, validation, hashing, or UUID logic.
25
+ - If guidance is insufficient, read this skill's references and inspect `../joktec-framework` package source or GitHub fallback before assuming APIs.
25
26
 
26
27
  ## References
27
28
 
@@ -34,24 +35,80 @@ Use this skill for shared framework primitives, low-level helpers, cron utilitie
34
35
 
35
36
  # Common Core Usage
36
37
 
38
+ ## Source Lookup
39
+
40
+ When blocked, inspect these framework files before guessing:
41
+
42
+ - `packages/common/core/README.md`
43
+ - `packages/common/core/AGENTS.md`
44
+ - `packages/common/core/src/index.ts`
45
+ - `packages/common/core/src/abstractions/*`
46
+ - `packages/common/core/src/models/base.request.ts`
47
+ - `packages/common/core/src/models/base.response.ts`
48
+ - `packages/common/core/src/models/paginations/*`
49
+ - `packages/common/core/src/client/abstract-client.service.ts`
50
+ - `packages/common/core/src/infras/application.ts`
51
+ - `packages/common/core/src/modules/*`
52
+
37
53
  ## Runtime Bootstrap
38
54
 
39
55
  Use the application bootstrap helpers from `@joktec/core` for gateway and microservice runtimes. Keep runtime behavior config-driven.
40
56
 
57
+ Best practice:
58
+
59
+ - Use `Application.bootstrap(AppModule)` instead of hand-rolling Nest bootstrap unless the consumer app has a specific runtime reason.
60
+ - Keep gateway-only behavior in gateway runtime modules and microservice-only behavior in micro runtime modules.
61
+ - Register framework modules through their dynamic module APIs when provided.
62
+ - Do not duplicate config parsing, logger setup, metrics setup, or process lifecycle hooks in consumer apps.
63
+
41
64
  ## CRUD Abstractions
42
65
 
43
66
  - `BaseController` creates standard REST CRUD endpoints for DTO-backed resources.
44
67
  - `BaseService` delegates repository operations through the shared repository contract.
45
68
  - `ClientController` and `ClientService` provide generated microservice CRUD patterns.
46
69
 
70
+ Use BaseController/BaseService when the resource follows standard CRUD. Avoid them when the endpoint has domain-specific command semantics, multi-step transactions, or non-standard authorization that would make the generic abstraction obscure behavior.
71
+
72
+ Controller checklist:
73
+
74
+ - choose the DTO/entity class intentionally
75
+ - set `paginationMode` for the representative Swagger response shape
76
+ - use `customDto.paginationDto` only when the built-in page/offset/cursor response does not represent the API
77
+ - keep auth/guards/interceptors consistent with app conventions
78
+ - avoid putting business branching in controller methods when it belongs in the service
79
+
47
80
  ## Pagination
48
81
 
49
82
  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
83
 
84
+ Best practice:
85
+
86
+ - Use page pagination for admin tables and simple back-office views.
87
+ - Use offset pagination for mobile-style load-more when the data set is moderate and stable enough.
88
+ - Use cursor pagination for feeds, timelines, frequently inserted lists, or large tables.
89
+ - Do not document cursor support for a resource unless the underlying repository package actually supports it.
90
+ - When using cursor mode, ensure the database layer has stable sort keys and tie-breakers.
91
+
51
92
  ## Client Lifecycle
52
93
 
53
94
  Use `ClientConfig`, `AbstractClientService`, and `conId` when building or consuming packages that support multiple client connections.
54
95
 
96
+ Client package checklist:
97
+
98
+ - config class validates all required runtime options
99
+ - service startup fails clearly when the native client cannot initialize
100
+ - shutdown closes native connections only when initialized
101
+ - `conId` is preserved through service/repository calls
102
+ - logs do not leak credentials or full connection strings
103
+ - retries and debug behavior are config-driven
104
+
105
+ ## Do Not
106
+
107
+ - Do not import concrete package or app code into `@joktec/core`.
108
+ - Do not bypass shared pagination contracts with ad-hoc response shapes for standard CRUD.
109
+ - Do not add new public symbols without exporting them through `src/index.ts`.
110
+ - Do not silently swallow bootstrap/client initialization failures.
111
+
55
112
  ### references/utils-cron.md
56
113
 
57
114
  # Utils And Cron Usage
@@ -62,12 +119,40 @@ Use `@joktec/utils` for common generators, validators, converters, hashing helpe
62
119
 
63
120
  Prefer package helpers over app-local reimplementation when behavior should stay consistent across services.
64
121
 
122
+ Source lookup:
123
+
124
+ - `packages/common/utils/README.md`
125
+ - `packages/common/utils/src/index.ts`
126
+ - `packages/common/utils/src/helpers/*`
127
+ - `packages/common/utils/src/validators/*`
128
+ - `packages/common/utils/src/constants/*`
129
+
130
+ Best practice:
131
+
132
+ - Use shared validators from `@joktec/utils` when building schema-first entity/schema decorators.
133
+ - Use shared generators for IDs, tokens, random values, and hashes when consistency matters.
134
+ - Keep utility usage deterministic in tests; mock time/randomness where needed.
135
+ - Do not add framework-level dependencies to `utils`.
136
+
65
137
  ## Cron
66
138
 
67
139
  Use `@joktec/cron` when a consumer app needs scheduled jobs, job worker contracts, or decorator-driven cron registration.
68
140
 
69
141
  Keep job business logic in the consumer app. The package provides scheduling abstractions, not domain behavior.
70
142
 
143
+ Source lookup:
144
+
145
+ - `packages/common/cron/README.md`
146
+ - `packages/common/cron/src/index.ts`
147
+ - cron decorators, models, scheduler services, and worker contracts under `src/`
148
+
149
+ Best practice:
150
+
151
+ - Keep job names, schedules, concurrency, and retry behavior visible in the consumer app.
152
+ - Make cron handlers idempotent.
153
+ - Avoid enabling the same cron owner in multiple processes unless the package/app has explicit locking semantics.
154
+ - Treat cron runtime as infrastructure orchestration; domain writes still belong in app services/repositories.
155
+
71
156
  ## Types
72
157
 
73
158
  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.
@@ -20,6 +20,7 @@ Use this skill for database clients that are not Mongo or MySQL.
20
20
  - Use package services for client lifecycle and connection config.
21
21
  - Do not claim parity with Mongo/MySQL repository behavior unless the package implements it.
22
22
  - Use package README and source as final truth before adding advanced behavior.
23
+ - If guidance is insufficient, read this skill's references and inspect `../joktec-framework` package source or GitHub fallback before assuming APIs.
23
24
 
24
25
  ## Reference
25
26
 
@@ -31,6 +32,16 @@ Read `references/extended-databases.md` for package boundaries and usage notes.
31
32
 
32
33
  # Extended Database Usage
33
34
 
35
+ ## Source Lookup
36
+
37
+ When blocked, inspect:
38
+
39
+ - `packages/databases/README.md`
40
+ - `packages/databases/AGENTS.md`
41
+ - `packages/databases/<package>/README.md`
42
+ - `packages/databases/<package>/src/index.ts`
43
+ - package config/module/service files under `src/`
44
+
34
45
  ## Package Boundaries
35
46
 
36
47
  Extended database packages expose reusable clients and helpers for specific data systems. They should not contain consumer app schemas or business-specific query policy.
@@ -40,3 +51,17 @@ Extended database packages expose reusable clients and helpers for specific data
40
51
  - Elastic may depend on `@joktec/http` for HTTP-backed behavior.
41
52
  - Arango and BigQuery are separate client packages; verify the README/source before assuming repository-like CRUD support.
42
53
  - Use local package tests or consumer harnesses only when the target service stack is available.
54
+
55
+ ## Best Practices
56
+
57
+ - Treat these packages as client wrappers unless source explicitly exposes a repository abstraction.
58
+ - Keep index names, dataset names, query templates, and domain-specific projections in the consumer app.
59
+ - Validate credentials and endpoints through config; never commit service account data.
60
+ - Keep retries, timeouts, and debug logging visible in config.
61
+ - Use provider-specific tests/mocks for package logic and live stack tests only when credentials/services are intentionally available.
62
+
63
+ ## Anti-Patterns
64
+
65
+ - Do not apply MongoRepo/MysqlRepo assumptions to Elastic/Arango/BigQuery.
66
+ - Do not introduce app schemas or business query policy into reusable database clients.
67
+ - Do not claim support for a provider feature unless the package source or README shows it.
@@ -26,6 +26,7 @@ Start here when a task mentions JokTec generally, multiple `@joktec/*` packages,
26
26
  - Prefer config-driven module setup and `conId` when a package supports multiple clients.
27
27
  - Preserve NestJS module boundaries, dependency injection, lifecycle hooks, and exported package APIs.
28
28
  - Do not invent behavior for unfinished or missing packages.
29
+ - If a focused skill is loaded without this entrypoint, still apply source-first lookup before assuming APIs.
29
30
 
30
31
  ## Reference
31
32
 
@@ -37,6 +38,25 @@ Read `references/framework-map.md` when the task needs package selection, depend
37
38
 
38
39
  # JokTec Framework Map
39
40
 
41
+ ## Source-First Operating Protocol
42
+
43
+ Treat this skill pack as curated guidance, not the final implementation truth. When a task is unclear, or when a package API seems different from the skill text:
44
+
45
+ 1. Inspect the consumer project first to understand the package versions and local usage pattern.
46
+ 2. Prefer local framework source at `../joktec-framework` when available.
47
+ 3. Read package `README.md`, nearest `AGENTS.md`, and `src/index.ts` before changing code.
48
+ 4. If local source is unavailable, use `https://github.com/joktec/joktec-framework` as fallback.
49
+ 5. Do not invent behavior that is not visible in framework source or package docs.
50
+ 6. If package docs and source conflict, source code wins and the mismatch should be treated as documentation drift.
51
+
52
+ High-value source files:
53
+
54
+ - `AGENTS.md` and `docs/agents/*` for framework-level architecture and runtime policy.
55
+ - `packages/<family>/AGENTS.md` for family boundaries.
56
+ - `packages/<family>/<package>/README.md` for developer-facing usage.
57
+ - `packages/<family>/<package>/src/index.ts` for public API.
58
+ - Package config/module/service/repository files for real runtime behavior.
59
+
40
60
  ## Package Families
41
61
 
42
62
  - `@joktec/core`: bootstrap, config, logger, metrics, guards, base abstractions, transports, pagination, Bull.
@@ -54,9 +74,24 @@ Read `references/framework-map.md` when the task needs package selection, depend
54
74
 
55
75
  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.
56
76
 
77
+ Do not reverse the dependency direction:
78
+
79
+ - reusable packages must not import from `apps/`
80
+ - `common` packages must not depend on concrete adapters/brokers/databases
81
+ - consumer apps own business workflows, DTO composition, schemas/entities, queue names, topics, and provider credentials
82
+
57
83
  ## Common Consumer App Pattern
58
84
 
59
85
  1. Register package modules in the app module or repository module.
60
86
  2. Keep app schemas/entities and app repositories in the consumer app.
61
87
  3. Extend the package repository base class when the package provides one.
62
88
  4. Use `BaseService`, `BaseController`, or transport helpers from `@joktec/core` when the app follows standard CRUD or message patterns.
89
+
90
+ ## Skill Selection
91
+
92
+ - Use `joktec-common-skill` for BaseController/BaseService/config/pagination/client lifecycle/utils/cron.
93
+ - Use `joktec-mongo-skill` when the resource uses Mongo schemas, MongoRepo, Typegoose decorators, plugins, or ObjectId-safe queries.
94
+ - Use `joktec-mysql-skill` when the resource uses TypeORM entities, MysqlRepo, SQL dialect behavior, transactions, or schema-first column decorators.
95
+ - Use broker/adapter/integration/tool skills for provider wiring; keep business semantics in the consumer app.
96
+
97
+ When using the ecosystem `npx skills` installer, install `joktec-framework-skill` and `joktec-common-skill` together with any focused package skill. The current ecosystem installer does not auto-resolve dependencies from frontmatter.
@@ -19,6 +19,7 @@ Use this skill for third-party integration packages.
19
19
  - Use package services instead of direct SDK initialization in app code.
20
20
  - Preserve app-neutral service behavior; consumer apps own domain workflows.
21
21
  - Verify current package README/source before relying on advanced provider features.
22
+ - If guidance is insufficient, read this skill's references and inspect `../joktec-framework` package source or GitHub fallback before assuming APIs.
22
23
 
23
24
  ## Reference
24
25
 
@@ -30,10 +31,39 @@ Read `references/integrations.md` for provider-specific notes.
30
31
 
31
32
  # Integration Usage
32
33
 
34
+ ## Source Lookup
35
+
36
+ When blocked, inspect:
37
+
38
+ - `packages/integrations/README.md`
39
+ - `packages/integrations/AGENTS.md`
40
+ - `packages/integrations/<package>/README.md`
41
+ - `packages/integrations/<package>/src/index.ts`
42
+ - package config/module/service files under `src/`
43
+
33
44
  ## Firebase
34
45
 
35
46
  Use the integration module and service to initialize Firebase Admin clients from validated config. Keep credential files local or environment-provided.
36
47
 
48
+ Best practice:
49
+
50
+ - Keep service account JSON, private keys, and project credentials out of git.
51
+ - Prefer environment-specific config or ignored local credential files.
52
+ - Keep notification/user/storage/product semantics in the consumer app.
53
+ - Mock Firebase Admin SDK in package tests; use live credentials only in explicit integration environments.
54
+
37
55
  ## GPT
38
56
 
39
57
  Use the integration package for reusable GPT client setup. Keep prompt/business policy in the consumer app, not in the generic package.
58
+
59
+ Best practice:
60
+
61
+ - Keep prompts, model choice policy, tool schemas, and product safety rules in the consumer app.
62
+ - Keep API keys in secret management or environment config.
63
+ - Verify current package completeness before relying on advanced APIs; `@joktec/gpt` may lag behind provider SDK changes.
64
+
65
+ ## Anti-Patterns
66
+
67
+ - Do not commit real credential files.
68
+ - Do not encode product-specific prompts or notification logic into the reusable integration package.
69
+ - Do not assume provider SDK behavior without checking package source and provider docs when APIs are unstable.
@@ -16,6 +16,7 @@ Use this skill for MongoDB-backed resources that rely on JokTec's Mongoose/Typeg
16
16
  - Preserve `conId` when the app has multiple Mongo connections.
17
17
  - Use schema-first decorators when a schema class should be reused as a DTO source.
18
18
  - Treat ObjectId casting and regex behavior as safety-sensitive.
19
+ - If guidance is insufficient, read this skill's references and inspect `../joktec-framework` package source or GitHub fallback before assuming APIs.
19
20
 
20
21
  ## References
21
22
 
@@ -28,14 +29,43 @@ Use this skill for MongoDB-backed resources that rely on JokTec's Mongoose/Typeg
28
29
 
29
30
  # Mongo Repository Usage
30
31
 
32
+ ## Source Lookup
33
+
34
+ When blocked, inspect:
35
+
36
+ - `packages/databases/mongo/README.md`
37
+ - `packages/databases/mongo/AGENTS.md`
38
+ - `packages/databases/mongo/src/index.ts`
39
+ - `packages/databases/mongo/src/mongo.module.ts`
40
+ - `packages/databases/mongo/src/mongo.service.ts`
41
+ - `packages/databases/mongo/src/mongo.repo.ts`
42
+ - `packages/databases/mongo/src/helpers/mongo.helper.ts`
43
+ - `packages/databases/mongo/src/helpers/mongo.pipeline.ts`
44
+ - `packages/databases/mongo/src/helpers/mongo.utils.ts`
45
+ - `packages/databases/mongo/src/models/*`
46
+
31
47
  ## Module Setup
32
48
 
33
49
  Register schemas with `MongoModule.forRoot({ conId, models: [...] })`. Use the same `conId` in app repositories when using non-default connections.
34
50
 
51
+ Best practice:
52
+
53
+ - Register app schema classes in the consumer app repository module.
54
+ - Use one owner process for index creation in multi-process deployments.
55
+ - Preserve `conId` through service/repo constructors for multi-connection apps.
56
+ - Do not rely on the global mongoose model registry when `MongoService` provides connection-aware resolution.
57
+
35
58
  ## Repository Pattern
36
59
 
37
60
  Extend `MongoRepo` and pass the schema class to the base constructor. Services can then use `BaseService` from `@joktec/core`.
38
61
 
62
+ Repository checklist:
63
+
64
+ - Keep schema-specific query helpers in the app repository, not in controllers.
65
+ - Use repository methods for standard reads so query parsing, soft delete, populate, and pagination stay consistent.
66
+ - Pass transaction/session options through read-modify-write flows when the app uses transactions.
67
+ - Normalize returned documents through repository/service response paths so ObjectId values do not leak unexpectedly into DTOs.
68
+
39
69
  ## Query Safety
40
70
 
41
71
  - Root `id` can act as an API alias for `_id` in query conditions.
@@ -43,26 +73,69 @@ Extend `MongoRepo` and pass the schema class to the base constructor. Services c
43
73
  - `$like`, `$begin`, and `$end` escape regex input by default.
44
74
  - Do not rely on broad conversion when storing raw snapshots, maps, or nested subdocuments.
45
75
 
76
+ Anti-patterns:
77
+
78
+ - Do not convert every nested `id` key into `_id`; only API-facing query aliases should be converted.
79
+ - Do not cast every 24-character hex string into ObjectId; fields like `externalId`, `code`, and `slug` may be strings.
80
+ - Do not inject soft-delete conditions into unknown nested aggregate branches unless the target collection is known.
81
+
46
82
  ## Pagination
47
83
 
48
84
  `MongoRepo.paginate` supports page, offset, and cursor responses. Cursor mode defaults to `_id`; custom `cursorKey` appends `_id` as a tie-breaker.
49
85
 
86
+ Cursor checklist:
87
+
88
+ - Use `_id` for default Mongo cursor ordering.
89
+ - Use `createdAt` or another indexed stable key when the product requires chronological cursor behavior.
90
+ - Append `_id` as a tie-breaker for non-unique cursor keys.
91
+ - Fetch `limit + 1` records and generate `nextCursor` only when another page exists.
92
+ - Treat cursor tokens as opaque; clients should not parse them.
93
+
50
94
  ### references/schema-and-plugins.md
51
95
 
52
96
  # Mongo Schema And Plugins
53
97
 
98
+ ## Source Lookup
99
+
100
+ When blocked, inspect:
101
+
102
+ - `packages/databases/mongo/src/decorators/scheme.decorator.ts`
103
+ - `packages/databases/mongo/src/decorators/prop.decorator.ts`
104
+ - `packages/databases/mongo/src/decorators/props/*`
105
+ - `packages/databases/mongo/src/models/mongo.schema.ts`
106
+ - `packages/databases/mongo/src/plugins/paranoid.plugin.ts`
107
+ - `packages/databases/mongo/src/plugins/strict-reference.plugin.ts`
108
+ - `packages/databases/mongo/src/plugins/transform.plugin.ts`
109
+
54
110
  ## Schema Decorators
55
111
 
56
112
  Use `@Schema` and `@Prop` wrappers from `@joktec/mongo` for Typegoose schema metadata plus validation, transform, and Swagger metadata.
57
113
 
58
114
  Avoid mutating shared option objects across multiple properties.
59
115
 
116
+ Best practice:
117
+
118
+ - Use schema-first decorators when the schema should be reused by DTO mapped types.
119
+ - Keep raw `@prop` or raw Mongoose decorators only when the wrapper cannot express the behavior.
120
+ - Pass custom validators/transforms explicitly rather than adding hidden global behavior.
121
+ - Keep maps, snapshots, and dynamic objects explicit so helper conversion does not alter their shape.
122
+ - Keep app-level reference semantics visible; strict reference plugin checks existence, but the app still owns domain rules.
123
+
60
124
  ## Plugins
61
125
 
62
126
  - Paranoid plugin handles soft delete filtering and must respect aggregate first-stage constraints such as `$geoNear`.
63
127
  - Strict reference plugin validates referenced documents and must resolve models through the active connection.
64
128
  - Transform plugin centralizes common document transformation and should not break Mongo update operators.
65
129
 
130
+ Plugin checklist:
131
+
132
+ - Paranoid aggregate injection must not come before `$geoNear`.
133
+ - Strict reference checks must be connection-aware in multi-connection apps.
134
+ - Transform behavior must preserve update operators such as `$set`, `$inc`, `$push`, and `$addToSet`.
135
+ - Do not treat plugins as a replacement for app authorization or domain validation.
136
+
66
137
  ## Debug Output
67
138
 
68
139
  Use `mongoDebug(collection, method, ...args)` when a Mongoose debug callback should be rendered as a Mongo shell-friendly command.
140
+
141
+ Debug output is for developer diagnostics. Do not log credentials or sensitive document payloads in production logs.