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