@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.
Files changed (129) hide show
  1. package/AGENTS.md +89 -0
  2. package/LICENSE +21 -0
  3. package/README.md +502 -0
  4. package/adapters/README.md +12 -0
  5. package/adapters/copilot/README.md +5 -0
  6. package/adapters/cursor/README.md +5 -0
  7. package/adapters/gemini/README.md +5 -0
  8. package/adapters/windsurf/README.md +5 -0
  9. package/bin/joktec-skills.mjs +553 -0
  10. package/dist/claude/skills/joktec-adapter-skill/SKILL.md +26 -0
  11. package/dist/claude/skills/joktec-adapter-skill/agents/openai.yaml +4 -0
  12. package/dist/claude/skills/joktec-adapter-skill/references/adapters.md +12 -0
  13. package/dist/claude/skills/joktec-broker-skill/SKILL.md +26 -0
  14. package/dist/claude/skills/joktec-broker-skill/agents/openai.yaml +4 -0
  15. package/dist/claude/skills/joktec-broker-skill/references/brokers.md +12 -0
  16. package/dist/claude/skills/joktec-common-skill/SKILL.md +28 -0
  17. package/dist/claude/skills/joktec-common-skill/agents/openai.yaml +4 -0
  18. package/dist/claude/skills/joktec-common-skill/references/core.md +19 -0
  19. package/dist/claude/skills/joktec-common-skill/references/utils-cron.md +17 -0
  20. package/dist/claude/skills/joktec-database-extended-skill/SKILL.md +25 -0
  21. package/dist/claude/skills/joktec-database-extended-skill/agents/openai.yaml +4 -0
  22. package/dist/claude/skills/joktec-database-extended-skill/references/extended-databases.md +11 -0
  23. package/dist/claude/skills/joktec-framework-skill/SKILL.md +31 -0
  24. package/dist/claude/skills/joktec-framework-skill/agents/openai.yaml +4 -0
  25. package/dist/claude/skills/joktec-framework-skill/references/framework-map.md +25 -0
  26. package/dist/claude/skills/joktec-integration-skill/SKILL.md +24 -0
  27. package/dist/claude/skills/joktec-integration-skill/agents/openai.yaml +4 -0
  28. package/dist/claude/skills/joktec-integration-skill/references/integrations.md +9 -0
  29. package/dist/claude/skills/joktec-mongo-skill/SKILL.md +22 -0
  30. package/dist/claude/skills/joktec-mongo-skill/agents/openai.yaml +4 -0
  31. package/dist/claude/skills/joktec-mongo-skill/references/repository.md +20 -0
  32. package/dist/claude/skills/joktec-mongo-skill/references/schema-and-plugins.md +17 -0
  33. package/dist/claude/skills/joktec-mysql-skill/SKILL.md +22 -0
  34. package/dist/claude/skills/joktec-mysql-skill/agents/openai.yaml +4 -0
  35. package/dist/claude/skills/joktec-mysql-skill/references/entities.md +15 -0
  36. package/dist/claude/skills/joktec-mysql-skill/references/repository.md +23 -0
  37. package/dist/claude/skills/joktec-tool-skill/SKILL.md +25 -0
  38. package/dist/claude/skills/joktec-tool-skill/agents/openai.yaml +4 -0
  39. package/dist/claude/skills/joktec-tool-skill/references/tools.md +13 -0
  40. package/dist/codex/skills/joktec-adapter-skill/SKILL.md +26 -0
  41. package/dist/codex/skills/joktec-adapter-skill/agents/openai.yaml +4 -0
  42. package/dist/codex/skills/joktec-adapter-skill/references/adapters.md +12 -0
  43. package/dist/codex/skills/joktec-broker-skill/SKILL.md +26 -0
  44. package/dist/codex/skills/joktec-broker-skill/agents/openai.yaml +4 -0
  45. package/dist/codex/skills/joktec-broker-skill/references/brokers.md +12 -0
  46. package/dist/codex/skills/joktec-common-skill/SKILL.md +28 -0
  47. package/dist/codex/skills/joktec-common-skill/agents/openai.yaml +4 -0
  48. package/dist/codex/skills/joktec-common-skill/references/core.md +19 -0
  49. package/dist/codex/skills/joktec-common-skill/references/utils-cron.md +17 -0
  50. package/dist/codex/skills/joktec-database-extended-skill/SKILL.md +25 -0
  51. package/dist/codex/skills/joktec-database-extended-skill/agents/openai.yaml +4 -0
  52. package/dist/codex/skills/joktec-database-extended-skill/references/extended-databases.md +11 -0
  53. package/dist/codex/skills/joktec-framework-skill/SKILL.md +31 -0
  54. package/dist/codex/skills/joktec-framework-skill/agents/openai.yaml +4 -0
  55. package/dist/codex/skills/joktec-framework-skill/references/framework-map.md +25 -0
  56. package/dist/codex/skills/joktec-integration-skill/SKILL.md +24 -0
  57. package/dist/codex/skills/joktec-integration-skill/agents/openai.yaml +4 -0
  58. package/dist/codex/skills/joktec-integration-skill/references/integrations.md +9 -0
  59. package/dist/codex/skills/joktec-mongo-skill/SKILL.md +22 -0
  60. package/dist/codex/skills/joktec-mongo-skill/agents/openai.yaml +4 -0
  61. package/dist/codex/skills/joktec-mongo-skill/references/repository.md +20 -0
  62. package/dist/codex/skills/joktec-mongo-skill/references/schema-and-plugins.md +17 -0
  63. package/dist/codex/skills/joktec-mysql-skill/SKILL.md +22 -0
  64. package/dist/codex/skills/joktec-mysql-skill/agents/openai.yaml +4 -0
  65. package/dist/codex/skills/joktec-mysql-skill/references/entities.md +15 -0
  66. package/dist/codex/skills/joktec-mysql-skill/references/repository.md +23 -0
  67. package/dist/codex/skills/joktec-tool-skill/SKILL.md +25 -0
  68. package/dist/codex/skills/joktec-tool-skill/agents/openai.yaml +4 -0
  69. package/dist/codex/skills/joktec-tool-skill/references/tools.md +13 -0
  70. package/dist/copilot/.github/copilot-instructions.md +459 -0
  71. package/dist/cursor/.cursor/rules/joktec-adapter-skill.mdc +44 -0
  72. package/dist/cursor/.cursor/rules/joktec-broker-skill.mdc +44 -0
  73. package/dist/cursor/.cursor/rules/joktec-common-skill.mdc +73 -0
  74. package/dist/cursor/.cursor/rules/joktec-database-extended-skill.mdc +42 -0
  75. package/dist/cursor/.cursor/rules/joktec-framework-skill.mdc +62 -0
  76. package/dist/cursor/.cursor/rules/joktec-integration-skill.mdc +39 -0
  77. package/dist/cursor/.cursor/rules/joktec-mongo-skill.mdc +68 -0
  78. package/dist/cursor/.cursor/rules/joktec-mysql-skill.mdc +69 -0
  79. package/dist/cursor/.cursor/rules/joktec-tool-skill.mdc +44 -0
  80. package/dist/gemini/GEMINI.md +477 -0
  81. package/dist/windsurf/.windsurf/rules/joktec-adapter-skill.md +40 -0
  82. package/dist/windsurf/.windsurf/rules/joktec-broker-skill.md +40 -0
  83. package/dist/windsurf/.windsurf/rules/joktec-common-skill.md +69 -0
  84. package/dist/windsurf/.windsurf/rules/joktec-database-extended-skill.md +38 -0
  85. package/dist/windsurf/.windsurf/rules/joktec-framework-skill.md +58 -0
  86. package/dist/windsurf/.windsurf/rules/joktec-integration-skill.md +35 -0
  87. package/dist/windsurf/.windsurf/rules/joktec-mongo-skill.md +64 -0
  88. package/dist/windsurf/.windsurf/rules/joktec-mysql-skill.md +65 -0
  89. package/dist/windsurf/.windsurf/rules/joktec-tool-skill.md +40 -0
  90. package/package.json +69 -0
  91. package/scripts/build-copilot-instructions.mjs +22 -0
  92. package/scripts/build-cursor-rules.mjs +23 -0
  93. package/scripts/build-gemini-md.mjs +22 -0
  94. package/scripts/build-skill-folders.mjs +16 -0
  95. package/scripts/build-windsurf-rules.mjs +18 -0
  96. package/scripts/lib.mjs +110 -0
  97. package/scripts/sync-from-joktec-framework.mjs +53 -0
  98. package/scripts/validate-skills.mjs +78 -0
  99. package/skill-pack.json +146 -0
  100. package/skills/joktec-adapter-skill/SKILL.md +26 -0
  101. package/skills/joktec-adapter-skill/agents/openai.yaml +4 -0
  102. package/skills/joktec-adapter-skill/references/adapters.md +12 -0
  103. package/skills/joktec-broker-skill/SKILL.md +26 -0
  104. package/skills/joktec-broker-skill/agents/openai.yaml +4 -0
  105. package/skills/joktec-broker-skill/references/brokers.md +12 -0
  106. package/skills/joktec-common-skill/SKILL.md +28 -0
  107. package/skills/joktec-common-skill/agents/openai.yaml +4 -0
  108. package/skills/joktec-common-skill/references/core.md +19 -0
  109. package/skills/joktec-common-skill/references/utils-cron.md +17 -0
  110. package/skills/joktec-database-extended-skill/SKILL.md +25 -0
  111. package/skills/joktec-database-extended-skill/agents/openai.yaml +4 -0
  112. package/skills/joktec-database-extended-skill/references/extended-databases.md +11 -0
  113. package/skills/joktec-framework-skill/SKILL.md +31 -0
  114. package/skills/joktec-framework-skill/agents/openai.yaml +4 -0
  115. package/skills/joktec-framework-skill/references/framework-map.md +25 -0
  116. package/skills/joktec-integration-skill/SKILL.md +24 -0
  117. package/skills/joktec-integration-skill/agents/openai.yaml +4 -0
  118. package/skills/joktec-integration-skill/references/integrations.md +9 -0
  119. package/skills/joktec-mongo-skill/SKILL.md +22 -0
  120. package/skills/joktec-mongo-skill/agents/openai.yaml +4 -0
  121. package/skills/joktec-mongo-skill/references/repository.md +20 -0
  122. package/skills/joktec-mongo-skill/references/schema-and-plugins.md +17 -0
  123. package/skills/joktec-mysql-skill/SKILL.md +22 -0
  124. package/skills/joktec-mysql-skill/agents/openai.yaml +4 -0
  125. package/skills/joktec-mysql-skill/references/entities.md +15 -0
  126. package/skills/joktec-mysql-skill/references/repository.md +23 -0
  127. package/skills/joktec-tool-skill/SKILL.md +25 -0
  128. package/skills/joktec-tool-skill/agents/openai.yaml +4 -0
  129. package/skills/joktec-tool-skill/references/tools.md +13 -0
@@ -0,0 +1,58 @@
1
+ # JokTec Framework Skill
2
+
3
+ Use when working in a consumer project that uses @joktec/* packages and the agent needs to choose the right JokTec package skill, understand package boundaries, wire modules, or avoid mixing app logic into reusable JokTec infrastructure.
4
+
5
+ Start here when a task mentions JokTec generally, multiple `@joktec/*` packages, or a consumer app that needs framework wiring.
6
+
7
+ ## Select The Focused Skill
8
+
9
+ - For `@joktec/core`, `@joktec/utils`, or `@joktec/cron`, use `joktec-common-skill`.
10
+ - For `@joktec/mongo`, use `joktec-mongo-skill`.
11
+ - For `@joktec/mysql`, use `joktec-mysql-skill`.
12
+ - For Kafka, RabbitMQ, SQS, or Redcast, use `joktec-broker-skill`.
13
+ - For cache, mail, notification, or storage adapters, use `joktec-adapter-skill`.
14
+ - For Elastic, Arango, or BigQuery, use `joktec-database-extended-skill`.
15
+ - For Firebase or GPT integrations, use `joktec-integration-skill`.
16
+ - For HTTP, file, or alert utilities, use `joktec-tool-skill`.
17
+
18
+ ## Core Rules
19
+
20
+ - Treat `joktec-framework` code, package README files, and agent docs as source-of-truth.
21
+ - Keep consumer app business logic in the app; do not move it into `@joktec/*` packages.
22
+ - Prefer config-driven module setup and `conId` when a package supports multiple clients.
23
+ - Preserve NestJS module boundaries, dependency injection, lifecycle hooks, and exported package APIs.
24
+ - Do not invent behavior for unfinished or missing packages.
25
+
26
+ ## Reference
27
+
28
+ Read `references/framework-map.md` when the task needs package selection, dependency flow, or a quick map from requirement to package.
29
+
30
+ ## Bundled References
31
+
32
+ ### references/framework-map.md
33
+
34
+ # JokTec Framework Map
35
+
36
+ ## Package Families
37
+
38
+ - `@joktec/core`: bootstrap, config, logger, metrics, guards, base abstractions, transports, pagination, Bull.
39
+ - `@joktec/utils`: low-level helpers, validators, conversion utilities.
40
+ - `@joktec/cron`: cron decorators, schedulers, job workers.
41
+ - `@joktec/mongo`: Mongoose/Typegoose database adapter and repository.
42
+ - `@joktec/mysql`: TypeORM relational adapter and repository.
43
+ - `@joktec/kafka`, `@joktec/rabbit`, `@joktec/sqs`, `@joktec/redcast`: broker clients and decorators.
44
+ - `@joktec/cacher`, `@joktec/mailer`, `@joktec/notifier`, `@joktec/storage`: external capability adapters.
45
+ - `@joktec/elastic`, `@joktec/arango`, `@joktec/bigquery`: extended database clients.
46
+ - `@joktec/firebase`, `@joktec/gpt`: third-party integrations.
47
+ - `@joktec/http`, `@joktec/file`, `@joktec/alert`: reusable tools.
48
+
49
+ ## Dependency Direction
50
+
51
+ 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
+
53
+ ## Common Consumer App Pattern
54
+
55
+ 1. Register package modules in the app module or repository module.
56
+ 2. Keep app schemas/entities and app repositories in the consumer app.
57
+ 3. Extend the package repository base class when the package provides one.
58
+ 4. Use `BaseService`, `BaseController`, or transport helpers from `@joktec/core` when the app follows standard CRUD or message patterns.
@@ -0,0 +1,35 @@
1
+ # JokTec Integration Skill
2
+
3
+ Use when wiring or using JokTec integration packages @joktec/firebase or @joktec/gpt, including validated config, SDK client lifecycle, app-neutral integration services, credentials handling, and consumer app composition.
4
+
5
+ Use this skill for third-party integration packages.
6
+
7
+ ## Packages
8
+
9
+ - `@joktec/firebase`: Firebase Admin SDK integration.
10
+ - `@joktec/gpt`: GPT/OpenAI-style client integration.
11
+
12
+ ## Rules
13
+
14
+ - Keep credentials config-driven and never commit real credentials.
15
+ - Use package services instead of direct SDK initialization in app code.
16
+ - Preserve app-neutral service behavior; consumer apps own domain workflows.
17
+ - Verify current package README/source before relying on advanced provider features.
18
+
19
+ ## Reference
20
+
21
+ Read `references/integrations.md` for provider-specific notes.
22
+
23
+ ## Bundled References
24
+
25
+ ### references/integrations.md
26
+
27
+ # Integration Usage
28
+
29
+ ## Firebase
30
+
31
+ Use the integration module and service to initialize Firebase Admin clients from validated config. Keep credential files local or environment-provided.
32
+
33
+ ## GPT
34
+
35
+ Use the integration package for reusable GPT client setup. Keep prompt/business policy in the consumer app, not in the generic package.
@@ -0,0 +1,64 @@
1
+ # JokTec Mongo Skill
2
+
3
+ Use when working with @joktec/mongo in a consumer app, including MongoModule setup, Typegoose schema decorators, MongoRepo, MongoService, MongoHelper, plugins, ObjectId/query safety, soft delete, strict references, and cursor pagination.
4
+
5
+ Use this skill for MongoDB-backed resources that rely on JokTec's Mongoose/Typegoose wrapper.
6
+
7
+ ## Rules
8
+
9
+ - Register app schema classes through `MongoModule.forRoot(...)`.
10
+ - Keep schema classes, app repositories, and app-specific queries in the consumer app.
11
+ - Extend `MongoRepo<T, ID>` for app repositories.
12
+ - Preserve `conId` when the app has multiple Mongo connections.
13
+ - Use schema-first decorators when a schema class should be reused as a DTO source.
14
+ - Treat ObjectId casting and regex behavior as safety-sensitive.
15
+
16
+ ## References
17
+
18
+ - Read `references/repository.md` for `MongoService`, `MongoRepo`, query parsing, and cursor pagination.
19
+ - Read `references/schema-and-plugins.md` for decorators, paranoid soft delete, strict references, transform behavior, and debug output.
20
+
21
+ ## Bundled References
22
+
23
+ ### references/repository.md
24
+
25
+ # Mongo Repository Usage
26
+
27
+ ## Module Setup
28
+
29
+ Register schemas with `MongoModule.forRoot({ conId, models: [...] })`. Use the same `conId` in app repositories when using non-default connections.
30
+
31
+ ## Repository Pattern
32
+
33
+ Extend `MongoRepo` and pass the schema class to the base constructor. Services can then use `BaseService` from `@joktec/core`.
34
+
35
+ ## Query Safety
36
+
37
+ - Root `id` can act as an API alias for `_id` in query conditions.
38
+ - ObjectId casting should be schema-aware and limited to `_id`, ObjectId paths, or explicitly configured paths.
39
+ - `$like`, `$begin`, and `$end` escape regex input by default.
40
+ - Do not rely on broad conversion when storing raw snapshots, maps, or nested subdocuments.
41
+
42
+ ## Pagination
43
+
44
+ `MongoRepo.paginate` supports page, offset, and cursor responses. Cursor mode defaults to `_id`; custom `cursorKey` appends `_id` as a tie-breaker.
45
+
46
+ ### references/schema-and-plugins.md
47
+
48
+ # Mongo Schema And Plugins
49
+
50
+ ## Schema Decorators
51
+
52
+ Use `@Schema` and `@Prop` wrappers from `@joktec/mongo` for Typegoose schema metadata plus validation, transform, and Swagger metadata.
53
+
54
+ Avoid mutating shared option objects across multiple properties.
55
+
56
+ ## Plugins
57
+
58
+ - Paranoid plugin handles soft delete filtering and must respect aggregate first-stage constraints such as `$geoNear`.
59
+ - Strict reference plugin validates referenced documents and must resolve models through the active connection.
60
+ - Transform plugin centralizes common document transformation and should not break Mongo update operators.
61
+
62
+ ## Debug Output
63
+
64
+ Use `mongoDebug(collection, method, ...args)` when a Mongoose debug callback should be rendered as a Mongo shell-friendly command.
@@ -0,0 +1,65 @@
1
+ # JokTec MySQL Skill
2
+
3
+ Use when working with @joktec/mysql in a consumer app, including MysqlModule setup, TypeORM entities, schema-first @Column/@PrimaryColumn decorators, MysqlRepo, MysqlService, transactions, dialect support, uuidv7 ids, query safety, and cursor pagination.
4
+
5
+ Use this skill for relational resources backed by JokTec's TypeORM wrapper.
6
+
7
+ ## Rules
8
+
9
+ - Register app entities through `MysqlModule.forRoot(...)`.
10
+ - Keep entities, app repositories, and app-specific SQL in the consumer app.
11
+ - Extend `MysqlRepo<T, ID>` for app repositories.
12
+ - Treat `mysql`, `mariadb`, and `postgres` as the first-class dialects.
13
+ - Keep `sync` explicit and normally enabled only by an owner process or development bootstrap.
14
+ - Do not add new behavior to deprecated `MysqlFinder`; use `MysqlRepo.qb()` and `MysqlHelper` paths.
15
+
16
+ ## References
17
+
18
+ - Read `references/repository.md` for connection lifecycle, repository usage, query safety, transaction, and cursor behavior.
19
+ - Read `references/entities.md` for `@Tables`, `@Column`, `@PrimaryColumn`, uuidv7, and dialect guidance.
20
+
21
+ ## Bundled References
22
+
23
+ ### references/entities.md
24
+
25
+ # MySQL Entity Decorators
26
+
27
+ ## Schema-First Entity Pattern
28
+
29
+ Use `@Tables`, `@Column`, and `@PrimaryColumn` from `@joktec/mysql` when an entity should also act as the source class for mapped DTOs.
30
+
31
+ ## Primary Keys
32
+
33
+ - Prefer numeric auto-increment keys for write-heavy MySQL tables.
34
+ - Use UUIDs when the app needs globally unique or public identifiers.
35
+ - Prefer `uuidv7` over random UUIDs when the id participates in ordered indexes or cursor-like access.
36
+
37
+ ## Dialects
38
+
39
+ 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.
40
+
41
+ ### references/repository.md
42
+
43
+ # MySQL Repository Usage
44
+
45
+ ## Module Setup
46
+
47
+ Register entities with `MysqlModule.forRoot({ conId, models: [...] })`. Use `conId` for multiple DataSources.
48
+
49
+ ## Repository Pattern
50
+
51
+ Extend `MysqlRepo` and pass the entity class to the base constructor. Services can use `BaseService` when CRUD behavior follows the shared contract.
52
+
53
+ ## Query Safety
54
+
55
+ - Validate field paths against TypeORM metadata before interpolating SQL identifiers.
56
+ - Use parameter binding for values.
57
+ - Keep logical operators such as `$and` and `$or` grouped through QueryBuilder behavior.
58
+
59
+ ## Pagination
60
+
61
+ `MysqlRepo.paginate` supports page, offset, and cursor responses. Cursor mode defaults to `createdAt` plus primary key columns. Custom cursor keys must be mapped columns.
62
+
63
+ ## Transactions
64
+
65
+ When using transaction-scoped operations, pass the manager or query runner through repository options so pre-read and write operations use the same context.
@@ -0,0 +1,40 @@
1
+ # JokTec Tool Skill
2
+
3
+ Use when wiring or using JokTec tool packages @joktec/http, @joktec/file, or @joktec/alert, including Axios-backed HTTP clients, file classification helpers, Slack-compatible alert webhooks, config-driven lifecycle, and app-neutral utility services.
4
+
5
+ Use this skill for reusable utility services.
6
+
7
+ ## Packages
8
+
9
+ - `@joktec/http`: Axios-backed HTTP client wrapper.
10
+ - `@joktec/file`: file classification and local file helpers.
11
+ - `@joktec/alert`: alert delivery through Slack-compatible webhooks.
12
+
13
+ ## Rules
14
+
15
+ - Keep tools app-neutral and reusable.
16
+ - Use config-driven clients instead of direct ad hoc setup in app code.
17
+ - Preserve retry, metrics, proxy, and upload behavior where the package exposes it.
18
+ - Keep alert tokens and webhook URLs in runtime config only.
19
+
20
+ ## Reference
21
+
22
+ Read `references/tools.md` for package-specific usage notes.
23
+
24
+ ## Bundled References
25
+
26
+ ### references/tools.md
27
+
28
+ # Tool Usage
29
+
30
+ ## HTTP
31
+
32
+ Use `@joktec/http` for Axios-backed requests, uploads, proxy agent support, retry config, and metrics where exposed.
33
+
34
+ ## File
35
+
36
+ Use `@joktec/file` for shared file helpers and classification behavior instead of duplicating local utility code.
37
+
38
+ ## Alert
39
+
40
+ Use `@joktec/alert` for Slack-compatible webhook alerts. Keep webhook URLs and credentials out of source control.
package/package.json ADDED
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "@joktec/skills",
3
+ "version": "0.1.0",
4
+ "private": false,
5
+ "description": "Hybrid agent skill pack for using @joktec/* libraries in consumer projects.",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "packageManager": "pnpm@11.8.0",
9
+ "engines": {
10
+ "node": ">=18.18"
11
+ },
12
+ "keywords": [
13
+ "joktec",
14
+ "skills",
15
+ "agent",
16
+ "codex",
17
+ "claude",
18
+ "cursor",
19
+ "gemini",
20
+ "copilot",
21
+ "windsurf"
22
+ ],
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/joktec/joktec-skills.git"
26
+ },
27
+ "bugs": {
28
+ "url": "https://github.com/joktec/joktec-skills/issues"
29
+ },
30
+ "homepage": "https://github.com/joktec/joktec-skills#readme",
31
+ "publishConfig": {
32
+ "access": "public",
33
+ "registry": "https://registry.npmjs.org/"
34
+ },
35
+ "bin": {
36
+ "skills": "./bin/joktec-skills.mjs",
37
+ "joktec-skills": "./bin/joktec-skills.mjs"
38
+ },
39
+ "files": [
40
+ "AGENTS.md",
41
+ "LICENSE",
42
+ "README.md",
43
+ "adapters",
44
+ "bin",
45
+ "dist",
46
+ "scripts",
47
+ "skill-pack.json",
48
+ "skills"
49
+ ],
50
+ "scripts": {
51
+ "check": "node scripts/validate-skills.mjs && node scripts/sync-from-joktec-framework.mjs --check",
52
+ "validate": "node scripts/validate-skills.mjs",
53
+ "build": "node scripts/build-skill-folders.mjs && node scripts/build-cursor-rules.mjs && node scripts/build-gemini-md.mjs && node scripts/build-copilot-instructions.mjs && node scripts/build-windsurf-rules.mjs",
54
+ "build:skills": "node scripts/build-skill-folders.mjs",
55
+ "build:cursor": "node scripts/build-cursor-rules.mjs",
56
+ "build:gemini": "node scripts/build-gemini-md.mjs",
57
+ "build:copilot": "node scripts/build-copilot-instructions.mjs",
58
+ "build:windsurf": "node scripts/build-windsurf-rules.mjs",
59
+ "sync:check": "node scripts/sync-from-joktec-framework.mjs --check",
60
+ "prepack": "pnpm run build && pnpm run check",
61
+ "pack:check": "pnpm pack --dry-run",
62
+ "prepublish:check": "pnpm run build && pnpm run check && pnpm pack --dry-run",
63
+ "publish:dry-run": "pnpm run prepublish:check && pnpm publish --dry-run --no-git-checks --access public --registry https://registry.npmjs.org/",
64
+ "publish:registry": "pnpm run prepublish:check && pnpm publish --access public --registry https://registry.npmjs.org/",
65
+ "release:patch": "pnpm version patch && pnpm run publish:registry",
66
+ "release:minor": "pnpm version minor && pnpm run publish:registry",
67
+ "release:major": "pnpm version major && pnpm run publish:registry"
68
+ }
69
+ }
@@ -0,0 +1,22 @@
1
+ import path from 'node:path';
2
+ import { DIST_DIR, ensureDir, loadSkills, outputEnabled, renderSkillWithReferences, writeFile } from './lib.mjs';
3
+
4
+ const outDir = path.join(DIST_DIR, 'copilot', '.github');
5
+ ensureDir(outDir);
6
+
7
+ const { skills } = loadSkills();
8
+ const sections = skills
9
+ .filter(item => outputEnabled(item, 'copilot'))
10
+ .map(skill => `## ${skill.meta.title}\n\n${renderSkillWithReferences(skill, { stripTitle: true })}`);
11
+
12
+ writeFile(
13
+ path.join(outDir, 'copilot-instructions.md'),
14
+ `# JokTec Copilot Instructions
15
+
16
+ Use these instructions when working in repositories that consume \`@joktec/*\` packages.
17
+
18
+ ${sections.join('\n\n---\n\n')}
19
+ `,
20
+ );
21
+
22
+ console.log(`Generated Copilot instructions: ${path.join(outDir, 'copilot-instructions.md')}`);
@@ -0,0 +1,23 @@
1
+ import path from 'node:path';
2
+ import { DIST_DIR, cleanDir, loadSkills, outputEnabled, renderSkillWithReferences, writeFile } from './lib.mjs';
3
+
4
+ const outDir = path.join(DIST_DIR, 'cursor', '.cursor', 'rules');
5
+ cleanDir(outDir);
6
+
7
+ const { skills } = loadSkills();
8
+ for (const skill of skills.filter(item => outputEnabled(item, 'cursor'))) {
9
+ const globs = skill.meta.scope?.paths?.join(',') || '**/*';
10
+ const content = `---
11
+ description: ${skill.frontmatter.description}
12
+ globs: ${globs}
13
+ alwaysApply: false
14
+ ---
15
+
16
+ # ${skill.meta.title}
17
+
18
+ ${renderSkillWithReferences(skill, { stripTitle: true })}
19
+ `;
20
+ writeFile(path.join(outDir, `${skill.id}.mdc`), content);
21
+ }
22
+
23
+ console.log(`Generated Cursor rules: ${outDir}`);
@@ -0,0 +1,22 @@
1
+ import path from 'node:path';
2
+ import { DIST_DIR, ensureDir, loadSkills, outputEnabled, renderSkillWithReferences, writeFile } from './lib.mjs';
3
+
4
+ const outDir = path.join(DIST_DIR, 'gemini');
5
+ ensureDir(outDir);
6
+
7
+ const { pack, skills } = loadSkills();
8
+ const sections = skills
9
+ .filter(item => outputEnabled(item, 'gemini'))
10
+ .map(skill => `## ${skill.meta.title}\n\nPackages: ${skill.meta.packages.join(', ')}\n\n${renderSkillWithReferences(skill, { stripTitle: true })}`);
11
+
12
+ writeFile(
13
+ path.join(outDir, 'GEMINI.md'),
14
+ `# ${pack.name}
15
+
16
+ Use these instructions when working in a project that consumes JokTec packages.
17
+
18
+ ${sections.join('\n\n---\n\n')}
19
+ `,
20
+ );
21
+
22
+ console.log(`Generated Gemini context: ${path.join(outDir, 'GEMINI.md')}`);
@@ -0,0 +1,16 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import { DIST_DIR, SKILLS_DIR, cleanDir, ensureDir } from './lib.mjs';
4
+
5
+ for (const target of ['codex', 'claude']) {
6
+ const outDir = path.join(DIST_DIR, target, 'skills');
7
+ cleanDir(outDir);
8
+
9
+ for (const item of fs.readdirSync(SKILLS_DIR, { withFileTypes: true })) {
10
+ if (!item.isDirectory()) continue;
11
+ fs.cpSync(path.join(SKILLS_DIR, item.name), path.join(outDir, item.name), { recursive: true });
12
+ }
13
+
14
+ ensureDir(outDir);
15
+ console.log(`Generated ${target} skill folders: ${outDir}`);
16
+ }
@@ -0,0 +1,18 @@
1
+ import path from 'node:path';
2
+ import { DIST_DIR, cleanDir, loadSkills, outputEnabled, renderSkillWithReferences, writeFile } from './lib.mjs';
3
+
4
+ const outDir = path.join(DIST_DIR, 'windsurf', '.windsurf', 'rules');
5
+ cleanDir(outDir);
6
+
7
+ const { skills } = loadSkills();
8
+ for (const skill of skills.filter(item => outputEnabled(item, 'windsurf'))) {
9
+ const content = `# ${skill.meta.title}
10
+
11
+ ${skill.frontmatter.description}
12
+
13
+ ${renderSkillWithReferences(skill, { stripTitle: true })}
14
+ `;
15
+ writeFile(path.join(outDir, `${skill.id}.md`), content);
16
+ }
17
+
18
+ console.log(`Generated Windsurf rules: ${outDir}`);
@@ -0,0 +1,110 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+
4
+ export const ROOT = path.resolve(new URL('..', import.meta.url).pathname);
5
+ export const SKILLS_DIR = path.join(ROOT, 'skills');
6
+ export const DIST_DIR = path.join(ROOT, 'dist');
7
+ export const PACK_PATH = path.join(ROOT, 'skill-pack.json');
8
+
9
+ export function readJson(file) {
10
+ return JSON.parse(fs.readFileSync(file, 'utf8'));
11
+ }
12
+
13
+ export function ensureDir(dir) {
14
+ fs.mkdirSync(dir, { recursive: true });
15
+ }
16
+
17
+ export function listSkillDirs() {
18
+ return fs
19
+ .readdirSync(SKILLS_DIR, { withFileTypes: true })
20
+ .filter(item => item.isDirectory())
21
+ .map(item => path.join(SKILLS_DIR, item.name))
22
+ .sort();
23
+ }
24
+
25
+ export function parseSkill(file) {
26
+ const raw = fs.readFileSync(file, 'utf8');
27
+ const match = raw.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/);
28
+ if (!match) throw new Error(`Missing frontmatter: ${file}`);
29
+
30
+ const frontmatter = {};
31
+ for (const line of match[1].split('\n')) {
32
+ const idx = line.indexOf(':');
33
+ if (idx === -1) continue;
34
+ const key = line.slice(0, idx).trim();
35
+ const value = line.slice(idx + 1).trim().replace(/^["']|["']$/g, '');
36
+ frontmatter[key] = value;
37
+ }
38
+
39
+ return {
40
+ file,
41
+ dir: path.dirname(file),
42
+ raw,
43
+ frontmatter,
44
+ body: match[2].trim(),
45
+ };
46
+ }
47
+
48
+ export function loadSkills() {
49
+ const pack = readJson(PACK_PATH);
50
+ const skillsById = new Map(listSkillDirs().map(dir => {
51
+ const skill = parseSkill(path.join(dir, 'SKILL.md'));
52
+ const id = path.basename(dir);
53
+ const meta = pack.skills.find(item => item.id === id);
54
+ if (!meta) throw new Error(`Missing skill-pack metadata for ${id}`);
55
+ return [id, { id, meta, ...skill }];
56
+ }));
57
+
58
+ const skills = pack.skills.map(meta => {
59
+ const skill = skillsById.get(meta.id);
60
+ if (!skill) throw new Error(`Missing skill directory for ${meta.id}`);
61
+ return skill;
62
+ });
63
+
64
+ return { pack, skills };
65
+ }
66
+
67
+ export function readReferences(skill) {
68
+ const refDir = path.join(skill.dir, 'references');
69
+ if (!fs.existsSync(refDir)) return [];
70
+
71
+ return fs
72
+ .readdirSync(refDir, { withFileTypes: true })
73
+ .filter(item => item.isFile() && item.name.endsWith('.md'))
74
+ .map(item => {
75
+ const file = path.join(refDir, item.name);
76
+ return {
77
+ name: item.name,
78
+ rel: path.relative(skill.dir, file),
79
+ content: fs.readFileSync(file, 'utf8').trim(),
80
+ };
81
+ })
82
+ .sort((a, b) => a.name.localeCompare(b.name));
83
+ }
84
+
85
+ function stripLeadingHeading(content) {
86
+ return content.replace(/^# .+\n+/, '').trim();
87
+ }
88
+
89
+ export function renderSkillWithReferences(skill, options = {}) {
90
+ const refs = readReferences(skill);
91
+ const body = options.stripTitle ? stripLeadingHeading(skill.body) : skill.body;
92
+ const refText = refs.length
93
+ ? `\n\n## Bundled References\n\n${refs.map(ref => `### ${ref.rel}\n\n${ref.content}`).join('\n\n')}`
94
+ : '';
95
+ return `${body}${refText}`.trim();
96
+ }
97
+
98
+ export function writeFile(file, content) {
99
+ ensureDir(path.dirname(file));
100
+ fs.writeFileSync(file, `${content.replace(/\s+$/g, '')}\n`);
101
+ }
102
+
103
+ export function cleanDir(dir) {
104
+ fs.rmSync(dir, { recursive: true, force: true });
105
+ ensureDir(dir);
106
+ }
107
+
108
+ export function outputEnabled(skill, target) {
109
+ return Boolean(skill.meta.outputs?.[target]);
110
+ }
@@ -0,0 +1,53 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import { DIST_DIR, ROOT, ensureDir, readJson, writeFile } from './lib.mjs';
4
+
5
+ const args = new Set(process.argv.slice(2));
6
+ const checkOnly = args.has('--check');
7
+ const pack = readJson(path.join(ROOT, 'skill-pack.json'));
8
+ const sourceRoot = path.resolve(ROOT, pack.sourceOfTruth);
9
+
10
+ const requiredFiles = [
11
+ 'AGENTS.md',
12
+ 'docs/agents/ARCHITECTURE.md',
13
+ 'docs/agents/PROJECT_CONTEXT.md',
14
+ 'docs/agents/RUNTIME.md',
15
+ 'docs/agents/CONTRACTS.md',
16
+ 'packages/common/AGENTS.md',
17
+ 'packages/common/core/AGENTS.md',
18
+ 'packages/databases/mongo/AGENTS.md',
19
+ 'packages/databases/mongo/README.md',
20
+ 'packages/databases/mysql/AGENTS.md',
21
+ 'packages/databases/mysql/README.md',
22
+ 'packages/brokers/AGENTS.md',
23
+ 'packages/adapters/AGENTS.md',
24
+ 'packages/integrations/AGENTS.md',
25
+ 'packages/tools/AGENTS.md'
26
+ ];
27
+
28
+ const missing = requiredFiles.filter(file => !fs.existsSync(path.join(sourceRoot, file)));
29
+ if (missing.length) {
30
+ console.error(`Missing source files from ${sourceRoot}:\n${missing.map(file => `- ${file}`).join('\n')}`);
31
+ process.exit(1);
32
+ }
33
+
34
+ const index = requiredFiles.map(file => {
35
+ const abs = path.join(sourceRoot, file);
36
+ const content = fs.readFileSync(abs, 'utf8');
37
+ return {
38
+ file,
39
+ bytes: Buffer.byteLength(content),
40
+ lines: content.split(/\r?\n/).length,
41
+ headings: content
42
+ .split(/\r?\n/)
43
+ .filter(line => /^#{1,3}\s+/.test(line))
44
+ .slice(0, 20),
45
+ };
46
+ });
47
+
48
+ if (!checkOnly) {
49
+ ensureDir(path.join(DIST_DIR, 'source'));
50
+ writeFile(path.join(DIST_DIR, 'source', 'joktec-framework-index.json'), JSON.stringify(index, null, 2));
51
+ }
52
+
53
+ console.log(`Source sync check passed for ${requiredFiles.length} files from ${sourceRoot}`);