@kb-labs/devkit 1.4.0 → 2.9.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 (231) hide show
  1. package/assets/claude/CLAUDE.md.snippet +30 -0
  2. package/assets/claude/manifest.json +47 -0
  3. package/assets/claude/skills/kb-labs-create-plugin/SKILL.md +144 -0
  4. package/assets/claude/skills/kb-labs-create-product/SKILL.md +144 -0
  5. package/assets/claude/skills/kb-labs-explore/SKILL.md +119 -0
  6. package/assets/claude/skills/kb-labs-quickstart/SKILL.md +72 -0
  7. package/assets/claude/skills/kb-labs-troubleshoot/SKILL.md +150 -0
  8. package/assets/claude/skills/kb-labs-update/SKILL.md +89 -0
  9. package/package.json +29 -29
  10. package/tsconfig/spa.json +7 -0
  11. package/vitest/node.js +8 -2
  12. package/vitest/react.js +8 -2
  13. package/.cursorrules +0 -32
  14. package/.github/CODEOWNERS +0 -2
  15. package/.github/actions/setup-node-pnpm/action.yml +0 -47
  16. package/.github/workflow-templates/ci.yml +0 -13
  17. package/.github/workflow-templates/deploy.yml +0 -28
  18. package/.github/workflow-templates/docker-build.yml +0 -25
  19. package/.github/workflow-templates/drift-check.yml +0 -10
  20. package/.github/workflow-templates/profiles-validate.yml +0 -16
  21. package/.github/workflow-templates/release.yml +0 -8
  22. package/.github/workflows/ci-reusable.yml +0 -131
  23. package/.github/workflows/deploy-reusable.yml +0 -110
  24. package/.github/workflows/docker-build-reusable.yml +0 -110
  25. package/.github/workflows/drift-check-reusable.yml +0 -23
  26. package/.github/workflows/fixtures.yml +0 -74
  27. package/.github/workflows/profiles-validate-reusable.yml +0 -67
  28. package/.github/workflows/release-reusable.yml +0 -50
  29. package/.vscode/settings.json +0 -23
  30. package/tsconfig/dist/__tests__/cache.spec.d.ts +0 -6
  31. package/tsconfig/dist/__tests__/cache.spec.d.ts.map +0 -1
  32. package/tsconfig/dist/__tests__/cache.spec.js +0 -85
  33. package/tsconfig/dist/__tests__/cache.spec.js.map +0 -1
  34. package/tsconfig/dist/__tests__/fs-atomic.spec.d.ts +0 -6
  35. package/tsconfig/dist/__tests__/fs-atomic.spec.d.ts.map +0 -1
  36. package/tsconfig/dist/__tests__/fs-atomic.spec.js +0 -153
  37. package/tsconfig/dist/__tests__/fs-atomic.spec.js.map +0 -1
  38. package/tsconfig/dist/__tests__/init-workspace.spec.d.ts +0 -6
  39. package/tsconfig/dist/__tests__/init-workspace.spec.d.ts.map +0 -1
  40. package/tsconfig/dist/__tests__/init-workspace.spec.js +0 -99
  41. package/tsconfig/dist/__tests__/init-workspace.spec.js.map +0 -1
  42. package/tsconfig/dist/__tests__/kb-error.spec.d.ts +0 -6
  43. package/tsconfig/dist/__tests__/kb-error.spec.d.ts.map +0 -1
  44. package/tsconfig/dist/__tests__/kb-error.spec.js +0 -190
  45. package/tsconfig/dist/__tests__/kb-error.spec.js.map +0 -1
  46. package/tsconfig/dist/__tests__/preset-lockfile.spec.d.ts +0 -6
  47. package/tsconfig/dist/__tests__/preset-lockfile.spec.d.ts.map +0 -1
  48. package/tsconfig/dist/__tests__/preset-lockfile.spec.js +0 -142
  49. package/tsconfig/dist/__tests__/preset-lockfile.spec.js.map +0 -1
  50. package/tsconfig/dist/__tests__/product-config-profiles.spec.d.ts +0 -6
  51. package/tsconfig/dist/__tests__/product-config-profiles.spec.d.ts.map +0 -1
  52. package/tsconfig/dist/__tests__/product-config-profiles.spec.js +0 -100
  53. package/tsconfig/dist/__tests__/product-config-profiles.spec.js.map +0 -1
  54. package/tsconfig/dist/__tests__/product-config.spec.d.ts +0 -6
  55. package/tsconfig/dist/__tests__/product-config.spec.d.ts.map +0 -1
  56. package/tsconfig/dist/__tests__/product-config.spec.js +0 -298
  57. package/tsconfig/dist/__tests__/product-config.spec.js.map +0 -1
  58. package/tsconfig/dist/__tests__/runtime.spec.d.ts +0 -2
  59. package/tsconfig/dist/__tests__/runtime.spec.d.ts.map +0 -1
  60. package/tsconfig/dist/__tests__/runtime.spec.js +0 -127
  61. package/tsconfig/dist/__tests__/runtime.spec.js.map +0 -1
  62. package/tsconfig/dist/__tests__/upsert-lockfile.spec.d.ts +0 -6
  63. package/tsconfig/dist/__tests__/upsert-lockfile.spec.d.ts.map +0 -1
  64. package/tsconfig/dist/__tests__/upsert-lockfile.spec.js +0 -251
  65. package/tsconfig/dist/__tests__/upsert-lockfile.spec.js.map +0 -1
  66. package/tsconfig/dist/__tests__/validate-config.spec.d.ts +0 -2
  67. package/tsconfig/dist/__tests__/validate-config.spec.d.ts.map +0 -1
  68. package/tsconfig/dist/__tests__/validate-config.spec.js +0 -14
  69. package/tsconfig/dist/__tests__/validate-config.spec.js.map +0 -1
  70. package/tsconfig/dist/api/init-workspace.d.ts +0 -10
  71. package/tsconfig/dist/api/init-workspace.d.ts.map +0 -1
  72. package/tsconfig/dist/api/init-workspace.js +0 -191
  73. package/tsconfig/dist/api/init-workspace.js.map +0 -1
  74. package/tsconfig/dist/api/product-config.d.ts +0 -21
  75. package/tsconfig/dist/api/product-config.d.ts.map +0 -1
  76. package/tsconfig/dist/api/product-config.js +0 -192
  77. package/tsconfig/dist/api/product-config.js.map +0 -1
  78. package/tsconfig/dist/api/read-config.d.ts +0 -22
  79. package/tsconfig/dist/api/read-config.d.ts.map +0 -1
  80. package/tsconfig/dist/api/read-config.js +0 -105
  81. package/tsconfig/dist/api/read-config.js.map +0 -1
  82. package/tsconfig/dist/api/upsert-lockfile.d.ts +0 -10
  83. package/tsconfig/dist/api/upsert-lockfile.d.ts.map +0 -1
  84. package/tsconfig/dist/api/upsert-lockfile.js +0 -63
  85. package/tsconfig/dist/api/upsert-lockfile.js.map +0 -1
  86. package/tsconfig/dist/cache/fs-cache.d.ts +0 -38
  87. package/tsconfig/dist/cache/fs-cache.d.ts.map +0 -1
  88. package/tsconfig/dist/cache/fs-cache.js +0 -142
  89. package/tsconfig/dist/cache/fs-cache.js.map +0 -1
  90. package/tsconfig/dist/errors/kb-error.d.ts +0 -32
  91. package/tsconfig/dist/errors/kb-error.d.ts.map +0 -1
  92. package/tsconfig/dist/errors/kb-error.js +0 -54
  93. package/tsconfig/dist/errors/kb-error.js.map +0 -1
  94. package/tsconfig/dist/fs/__tests__/fs.spec.d.ts +0 -2
  95. package/tsconfig/dist/fs/__tests__/fs.spec.d.ts.map +0 -1
  96. package/tsconfig/dist/fs/__tests__/fs.spec.js +0 -22
  97. package/tsconfig/dist/fs/__tests__/fs.spec.js.map +0 -1
  98. package/tsconfig/dist/fs/fs.d.ts +0 -6
  99. package/tsconfig/dist/fs/fs.d.ts.map +0 -1
  100. package/tsconfig/dist/fs/fs.js +0 -12
  101. package/tsconfig/dist/fs/fs.js.map +0 -1
  102. package/tsconfig/dist/fs/index.d.ts +0 -2
  103. package/tsconfig/dist/fs/index.d.ts.map +0 -1
  104. package/tsconfig/dist/fs/index.js +0 -2
  105. package/tsconfig/dist/fs/index.js.map +0 -1
  106. package/tsconfig/dist/hash/config-hash.d.ts +0 -17
  107. package/tsconfig/dist/hash/config-hash.d.ts.map +0 -1
  108. package/tsconfig/dist/hash/config-hash.js +0 -55
  109. package/tsconfig/dist/hash/config-hash.js.map +0 -1
  110. package/tsconfig/dist/index.d.ts +0 -5
  111. package/tsconfig/dist/index.d.ts.map +0 -1
  112. package/tsconfig/dist/index.js +0 -5
  113. package/tsconfig/dist/index.js.map +0 -1
  114. package/tsconfig/dist/lockfile/lockfile.d.ts +0 -54
  115. package/tsconfig/dist/lockfile/lockfile.d.ts.map +0 -1
  116. package/tsconfig/dist/lockfile/lockfile.js +0 -141
  117. package/tsconfig/dist/lockfile/lockfile.js.map +0 -1
  118. package/tsconfig/dist/logging/__tests__/logger.spec.d.ts +0 -2
  119. package/tsconfig/dist/logging/__tests__/logger.spec.d.ts.map +0 -1
  120. package/tsconfig/dist/logging/__tests__/logger.spec.js +0 -65
  121. package/tsconfig/dist/logging/__tests__/logger.spec.js.map +0 -1
  122. package/tsconfig/dist/logging/__tests__/redaction.spec.d.ts +0 -2
  123. package/tsconfig/dist/logging/__tests__/redaction.spec.d.ts.map +0 -1
  124. package/tsconfig/dist/logging/__tests__/redaction.spec.js +0 -34
  125. package/tsconfig/dist/logging/__tests__/redaction.spec.js.map +0 -1
  126. package/tsconfig/dist/logging/__tests__/sinks-and-env.spec.d.ts +0 -2
  127. package/tsconfig/dist/logging/__tests__/sinks-and-env.spec.d.ts.map +0 -1
  128. package/tsconfig/dist/logging/__tests__/sinks-and-env.spec.js +0 -90
  129. package/tsconfig/dist/logging/__tests__/sinks-and-env.spec.js.map +0 -1
  130. package/tsconfig/dist/logging/index.d.ts +0 -6
  131. package/tsconfig/dist/logging/index.d.ts.map +0 -1
  132. package/tsconfig/dist/logging/index.js +0 -6
  133. package/tsconfig/dist/logging/index.js.map +0 -1
  134. package/tsconfig/dist/logging/logger.d.ts +0 -9
  135. package/tsconfig/dist/logging/logger.d.ts.map +0 -1
  136. package/tsconfig/dist/logging/logger.js +0 -101
  137. package/tsconfig/dist/logging/logger.js.map +0 -1
  138. package/tsconfig/dist/logging/redaction.d.ts +0 -7
  139. package/tsconfig/dist/logging/redaction.d.ts.map +0 -1
  140. package/tsconfig/dist/logging/redaction.js +0 -23
  141. package/tsconfig/dist/logging/redaction.js.map +0 -1
  142. package/tsconfig/dist/logging/sinks/json.d.ts +0 -4
  143. package/tsconfig/dist/logging/sinks/json.d.ts.map +0 -1
  144. package/tsconfig/dist/logging/sinks/json.js +0 -23
  145. package/tsconfig/dist/logging/sinks/json.js.map +0 -1
  146. package/tsconfig/dist/logging/sinks/stdout.d.ts +0 -3
  147. package/tsconfig/dist/logging/sinks/stdout.d.ts.map +0 -1
  148. package/tsconfig/dist/logging/sinks/stdout.js +0 -24
  149. package/tsconfig/dist/logging/sinks/stdout.js.map +0 -1
  150. package/tsconfig/dist/logging/types/index.d.ts +0 -2
  151. package/tsconfig/dist/logging/types/index.d.ts.map +0 -1
  152. package/tsconfig/dist/logging/types/index.js +0 -2
  153. package/tsconfig/dist/logging/types/index.js.map +0 -1
  154. package/tsconfig/dist/logging/types/types.d.ts +0 -37
  155. package/tsconfig/dist/logging/types/types.d.ts.map +0 -1
  156. package/tsconfig/dist/logging/types/types.js +0 -2
  157. package/tsconfig/dist/logging/types/types.js.map +0 -1
  158. package/tsconfig/dist/merge/layered-merge.d.ts +0 -16
  159. package/tsconfig/dist/merge/layered-merge.d.ts.map +0 -1
  160. package/tsconfig/dist/merge/layered-merge.js +0 -97
  161. package/tsconfig/dist/merge/layered-merge.js.map +0 -1
  162. package/tsconfig/dist/preset/resolve-preset.d.ts +0 -29
  163. package/tsconfig/dist/preset/resolve-preset.d.ts.map +0 -1
  164. package/tsconfig/dist/preset/resolve-preset.js +0 -104
  165. package/tsconfig/dist/preset/resolve-preset.js.map +0 -1
  166. package/tsconfig/dist/repo/__tests__/repo.spec.d.ts +0 -2
  167. package/tsconfig/dist/repo/__tests__/repo.spec.d.ts.map +0 -1
  168. package/tsconfig/dist/repo/__tests__/repo.spec.js +0 -25
  169. package/tsconfig/dist/repo/__tests__/repo.spec.js.map +0 -1
  170. package/tsconfig/dist/repo/index.d.ts +0 -2
  171. package/tsconfig/dist/repo/index.d.ts.map +0 -1
  172. package/tsconfig/dist/repo/index.js +0 -2
  173. package/tsconfig/dist/repo/index.js.map +0 -1
  174. package/tsconfig/dist/repo/repo.d.ts +0 -6
  175. package/tsconfig/dist/repo/repo.d.ts.map +0 -1
  176. package/tsconfig/dist/repo/repo.js +0 -25
  177. package/tsconfig/dist/repo/repo.js.map +0 -1
  178. package/tsconfig/dist/runtime/index.d.ts +0 -2
  179. package/tsconfig/dist/runtime/index.d.ts.map +0 -1
  180. package/tsconfig/dist/runtime/index.js +0 -2
  181. package/tsconfig/dist/runtime/index.js.map +0 -1
  182. package/tsconfig/dist/runtime/runtime.d.ts +0 -46
  183. package/tsconfig/dist/runtime/runtime.d.ts.map +0 -1
  184. package/tsconfig/dist/runtime/runtime.js +0 -126
  185. package/tsconfig/dist/runtime/runtime.js.map +0 -1
  186. package/tsconfig/dist/tsconfig.tools.tsbuildinfo +0 -1
  187. package/tsconfig/dist/tsconfig.tsbuildinfo +0 -1
  188. package/tsconfig/dist/types/index.d.ts +0 -2
  189. package/tsconfig/dist/types/index.d.ts.map +0 -1
  190. package/tsconfig/dist/types/index.js +0 -2
  191. package/tsconfig/dist/types/index.js.map +0 -1
  192. package/tsconfig/dist/types/init.d.ts +0 -34
  193. package/tsconfig/dist/types/init.d.ts.map +0 -1
  194. package/tsconfig/dist/types/init.js +0 -6
  195. package/tsconfig/dist/types/init.js.map +0 -1
  196. package/tsconfig/dist/types/preset.d.ts +0 -27
  197. package/tsconfig/dist/types/preset.d.ts.map +0 -1
  198. package/tsconfig/dist/types/preset.js +0 -6
  199. package/tsconfig/dist/types/preset.js.map +0 -1
  200. package/tsconfig/dist/types/types.d.ts +0 -6
  201. package/tsconfig/dist/types/types.d.ts.map +0 -1
  202. package/tsconfig/dist/types/types.js +0 -2
  203. package/tsconfig/dist/types/types.js.map +0 -1
  204. package/tsconfig/dist/utils/__tests__/env.spec.d.ts +0 -2
  205. package/tsconfig/dist/utils/__tests__/env.spec.d.ts.map +0 -1
  206. package/tsconfig/dist/utils/__tests__/env.spec.js +0 -33
  207. package/tsconfig/dist/utils/__tests__/env.spec.js.map +0 -1
  208. package/tsconfig/dist/utils/env.d.ts +0 -7
  209. package/tsconfig/dist/utils/env.d.ts.map +0 -1
  210. package/tsconfig/dist/utils/env.js +0 -25
  211. package/tsconfig/dist/utils/env.js.map +0 -1
  212. package/tsconfig/dist/utils/fs-atomic.d.ts +0 -15
  213. package/tsconfig/dist/utils/fs-atomic.d.ts.map +0 -1
  214. package/tsconfig/dist/utils/fs-atomic.js +0 -45
  215. package/tsconfig/dist/utils/fs-atomic.js.map +0 -1
  216. package/tsconfig/dist/utils/index.d.ts +0 -3
  217. package/tsconfig/dist/utils/index.d.ts.map +0 -1
  218. package/tsconfig/dist/utils/index.js +0 -3
  219. package/tsconfig/dist/utils/index.js.map +0 -1
  220. package/tsconfig/dist/utils/paths.d.ts +0 -21
  221. package/tsconfig/dist/utils/paths.d.ts.map +0 -1
  222. package/tsconfig/dist/utils/paths.js +0 -32
  223. package/tsconfig/dist/utils/paths.js.map +0 -1
  224. package/tsconfig/dist/utils/product-normalize.d.ts +0 -27
  225. package/tsconfig/dist/utils/product-normalize.d.ts.map +0 -1
  226. package/tsconfig/dist/utils/product-normalize.js +0 -45
  227. package/tsconfig/dist/utils/product-normalize.js.map +0 -1
  228. package/tsconfig/dist/validation/validate-config.d.ts +0 -7
  229. package/tsconfig/dist/validation/validate-config.d.ts.map +0 -1
  230. package/tsconfig/dist/validation/validate-config.js +0 -22
  231. package/tsconfig/dist/validation/validate-config.js.map +0 -1
@@ -0,0 +1,150 @@
1
+ ---
2
+ name: kb-labs-troubleshoot
3
+ description: Use when the user reports a KB Labs problem — service stuck, build failing, command not found, port conflict, plugin not discovered, kb-dev reports failed, pnpm install errors, or asks "what is wrong with kb-labs".
4
+ user-invocable: true
5
+ ---
6
+
7
+ # KB Labs Troubleshooter
8
+
9
+ Diagnose and fix common KB Labs platform issues. Work systematically from
10
+ environment → services → plugins → build.
11
+
12
+ ## Step 0: Always start with doctor
13
+
14
+ ```bash
15
+ kb-create doctor
16
+ ```
17
+
18
+ This checks: node version, pnpm version, platform directory, installed manifest,
19
+ git status of key files. Most problems surface here.
20
+
21
+ ## Step 1: "Command not found" or "Unknown command"
22
+
23
+ Most common cause: **stale plugin registry cache after building a plugin**.
24
+
25
+ ```bash
26
+ pnpm kb marketplace clear-cache
27
+ ```
28
+
29
+ If that does not help, deep clear:
30
+
31
+ ```bash
32
+ pnpm kb marketplace clear-cache --deep
33
+ ```
34
+
35
+ Then retry the command. If it is still missing:
36
+
37
+ ```bash
38
+ pnpm kb --help # is the group even present?
39
+ pnpm kb <group> --help # is the command in the group?
40
+ pnpm kb plugins list # is the plugin installed?
41
+ ```
42
+
43
+ ## Step 2: "Plugin not found" or wrong plugins in the available list
44
+
45
+ Symptom: `Plugin not found: @kb-labs/qa` or the available list shows only
46
+ test/workspace plugins.
47
+
48
+ Cause: zombie host-agent daemon processes connected to Gateway are intercepting
49
+ plugin execution with a stale local resolver.
50
+
51
+ Fix:
52
+
53
+ ```bash
54
+ pkill -9 -f "host-agent-app/dist/index.js"
55
+ ps aux | grep host-agent | grep -v grep # must be empty
56
+ pnpm kb marketplace clear-cache --deep
57
+ ```
58
+
59
+ Then retry the command.
60
+
61
+ ## Step 3: Service stuck in `failed` / `starting` / "port in use"
62
+
63
+ ```bash
64
+ pnpm kb-dev status
65
+ pnpm kb-dev logs <service>
66
+ pnpm kb-dev doctor
67
+ ```
68
+
69
+ Common fixes:
70
+
71
+ ```bash
72
+ pnpm kb-dev start <service> --force # kill port conflicts then start
73
+ pnpm kb-dev restart <service> # restart + cascade dependents
74
+ pnpm kb-dev stop <service> --cascade # stop service + dependents
75
+ ```
76
+
77
+ Rules:
78
+ - Never start services with raw `node` or `pnpm *:dev` — always use `kb-dev`.
79
+ - If the service crashes repeatedly, run with `pnpm kb-dev start --watch` and
80
+ inspect the crash logs.
81
+
82
+ ## Step 4: Dirty submodule / "worktree has modifications"
83
+
84
+ Cause: runtime files inside `.kb/` that are accidentally tracked or cross-repo
85
+ link: paths that are stale.
86
+
87
+ ```bash
88
+ git status
89
+ pnpm kb devlink status
90
+ pnpm kb devlink switch --mode=local --install
91
+ ```
92
+
93
+ If the user is on a worktree, `pnpm done` style scripts intentionally skip
94
+ certain QA stages — this is expected and not a bug.
95
+
96
+ ## Step 5: Build failures — "Cannot find module @kb-labs/..."
97
+
98
+ Cause: wrong build order. Dependencies are not built before dependents.
99
+
100
+ ```bash
101
+ npx kb-devkit-build-order --package=<your-package>
102
+ npx kb-devkit-build-order --package=<your-package> --script | bash
103
+ ```
104
+
105
+ Never run `pnpm -r build` for cross-repo build order — it does not understand
106
+ dts dependency chains. Always use the devkit build-order tool.
107
+
108
+ ## Step 6: Type errors after a core change
109
+
110
+ ```bash
111
+ npx kb-devkit-types-audit --package=<your-package>
112
+ npx kb-devkit-types-order --package=<your-package>
113
+ ```
114
+
115
+ Rebuild in types order.
116
+
117
+ ## Step 7: Cannot find `.kb/kb.config.json`
118
+
119
+ This file is the platform's main configuration. **Do not try to recreate it.**
120
+
121
+ - If the user accidentally deleted it → ask them to restore from backup or git.
122
+ - If it was never created → run `kb-create` from the project root again.
123
+ - Do not fabricate its contents.
124
+
125
+ ## Step 8: pnpm install errors with "workspace:" protocol
126
+
127
+ Usually means the project's workspace yaml is missing cross-repo paths.
128
+
129
+ ```bash
130
+ pnpm kb devlink switch --mode=local --install
131
+ ```
132
+
133
+ ## Step 9: Still stuck
134
+
135
+ Collect diagnostics and suggest the user open an issue:
136
+
137
+ ```bash
138
+ kb-create doctor --json > /tmp/kb-doctor.json
139
+ pnpm kb-dev status --json > /tmp/kb-dev-status.json
140
+ pnpm kb-dev logs <service> | tail -100 > /tmp/kb-service.log
141
+ ```
142
+
143
+ ## Important rules
144
+
145
+ - **Never delete `.kb/kb.config.json`** under any circumstance.
146
+ - **Never delete `.kb/mind/` or `.kb/cache/`** without asking — they may hold
147
+ expensive precomputed state.
148
+ - **Never edit files inside `.kb/` by hand** — it is platform runtime state.
149
+ - Prefer `kb-dev` commands over raw shell kills for service management.
150
+ - Prefer `kb devlink` over manually editing package.json workspace entries.
@@ -0,0 +1,89 @@
1
+ ---
2
+ name: kb-labs-update
3
+ description: Use when the user wants to update the installed KB Labs platform, upgrade to a new version, or asks "is there an update". Do not use for updating plugins (handled by the marketplace) or for pnpm-level dependency bumps.
4
+ user-invocable: true
5
+ ---
6
+
7
+ # Update the KB Labs Platform
8
+
9
+ Guide the user through a safe platform update using `kb-create update`.
10
+
11
+ ## Step 1: Show current install
12
+
13
+ Before updating, show what is currently installed so the user can confirm:
14
+
15
+ ```bash
16
+ kb-create status
17
+ ```
18
+
19
+ ## Step 2: Run the update with a dry diff
20
+
21
+ `kb-create update` already computes and prints the diff before applying
22
+ anything. Run it:
23
+
24
+ ```bash
25
+ kb-create update
26
+ ```
27
+
28
+ Expected output:
29
+
30
+ - a list of added / updated / removed packages
31
+ - a confirmation prompt before applying
32
+
33
+ Review the diff with the user. Watch for:
34
+
35
+ - **Removed packages** — was this intentional? If not, abort.
36
+ - **Major version bumps** — check release notes before accepting.
37
+ - **Core packages** (`@kb-labs/core-*`) — these affect plugin compatibility.
38
+
39
+ If the user is unsure, they can abort at the prompt — nothing has been written
40
+ at that point.
41
+
42
+ ## Step 3: Apply the update
43
+
44
+ Confirm at the prompt. After `kb-create` finishes, it will also refresh Claude
45
+ Code assets under `.claude/skills/kb-labs-*` and the managed CLAUDE.md section.
46
+
47
+ ## Step 4: Verify the update
48
+
49
+ ```bash
50
+ kb-create doctor
51
+ kb-create status
52
+ pnpm kb --help
53
+ ```
54
+
55
+ If services are configured:
56
+
57
+ ```bash
58
+ pnpm kb-dev restart
59
+ pnpm kb-dev status
60
+ ```
61
+
62
+ ## Step 5: Clear stale caches
63
+
64
+ After an update, plugin manifests may have changed:
65
+
66
+ ```bash
67
+ pnpm kb marketplace clear-cache
68
+ ```
69
+
70
+ ## If the update fails partway
71
+
72
+ Do not try to fix things by hand. Run:
73
+
74
+ ```bash
75
+ kb-create doctor --json
76
+ ```
77
+
78
+ and switch to the `kb-labs-troubleshoot` skill.
79
+
80
+ ## Important rules
81
+
82
+ - Never bypass `kb-create update` by running `pnpm update @kb-labs/*` manually —
83
+ the launcher tracks state and resolves cross-package versions; manual bumps
84
+ will desynchronise the install.
85
+ - Never delete `.kb/kb.config.json` to "start fresh" — it is the main platform
86
+ config and cannot be trivially recreated.
87
+ - If the user wants to downgrade, the cleanest path is `kb-create uninstall`
88
+ followed by `kb-create` at the desired version. Warn them that project state
89
+ under `.kb/` is preserved by default but plugin data may be incompatible.
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@kb-labs/devkit",
3
- "version": "1.4.0",
3
+ "version": "2.9.0",
4
4
  "type": "module",
5
5
  "description": "Shared developer toolkit for KB Labs projects: TS/ESLint/Prettier/Vitest/Tsup presets and reusable GitHub Actions.",
6
6
  "files": [
7
7
  "agents",
8
- ".cursorrules",
8
+ "assets",
9
9
  "tsconfig",
10
10
  "eslint",
11
11
  "prettier",
@@ -14,7 +14,6 @@
14
14
  "tsup",
15
15
  "templates",
16
16
  ".github",
17
- ".vscode",
18
17
  "bin",
19
18
  "sync",
20
19
  "AGENTS.md",
@@ -61,6 +60,7 @@
61
60
  "./tsconfig/node.json": "./tsconfig/node.json",
62
61
  "./tsconfig/react-lib.json": "./tsconfig/react-lib.json",
63
62
  "./tsconfig/react-app.json": "./tsconfig/react-app.json",
63
+ "./tsconfig/spa.json": "./tsconfig/spa.json",
64
64
  "./tsconfig/test.json": "./tsconfig/test.json",
65
65
  "./eslint/": "./eslint/",
66
66
  "./eslint/node.js": "./eslint/node.js",
@@ -91,8 +91,8 @@
91
91
  "./tsup/sdk": "./tsup/sdk.js",
92
92
  "./tsup/dual": "./tsup/dual.js",
93
93
  "./agents/": "./agents/",
94
- "./cursorrules": "./.cursorrules",
95
- "./.vscode/settings.json": "./.vscode/settings.json",
94
+ "./assets/": "./assets/",
95
+ "./assets/claude/manifest.json": "./assets/claude/manifest.json",
96
96
  "./AGENTS.md": "./AGENTS.md",
97
97
  "./bin/devkit-sync.mjs": "./bin/devkit-sync.mjs",
98
98
  "./bin/devkit-paths.mjs": "./bin/devkit-paths.mjs",
@@ -103,26 +103,6 @@
103
103
  "./tsup/external-sync": "./tsup/external-sync.mjs",
104
104
  "./sync": "./sync/index.mjs"
105
105
  },
106
- "scripts": {
107
- "clean": "rimraf dist",
108
- "build": "echo \"@kb-labs/devkit: nothing to build\"",
109
- "lint": "echo \"@kb-labs/devkit: lint skipped (plain JS/MJS, not TS project)\" && exit 0",
110
- "lint:fix": "eslint . --fix --ignore-pattern 'dist/**'",
111
- "test": "vitest run --passWithNoTests",
112
- "test:watch": "vitest --passWithNoTests",
113
- "paths": "node ./bin/devkit-paths.mjs",
114
- "fixtures": "node scripts/fixtures.js –help",
115
- "fixtures:check": "node scripts/fixtures.js –action=check",
116
- "fixtures:lint": "node scripts/fixtures.js –action=lint",
117
- "fixtures:test": "node scripts/fixtures.js –action=test",
118
- "fixtures:build": "node scripts/fixtures.js –action=build",
119
- "fixtures:bootstrap": "node scripts/fixtures.js –action=bootstrap",
120
- "fixtures:clean": "node scripts/fixtures.js –action=clean",
121
- "fixtures:ci": "node scripts/fixtures.js –action=check –since=${GITHUB_BASE_REF:-origin/main} –concurrency=3 || node scripts/fixtures.js –action=check",
122
- "postinstall": "kb-devkit-tsup-external --generate || true",
123
- "dev": "tsup --config tsup.config.ts --watch",
124
- "type-check": "echo \"@kb-labs/devkit: type-check skipped (plain JS/MJS, not TS project)\" && exit 0"
125
- },
126
106
  "peerDependencies": {
127
107
  "@playwright/test": "*",
128
108
  "eslint": "^9.35.0",
@@ -164,8 +144,8 @@
164
144
  "yaml": "^2.8.0"
165
145
  },
166
146
  "devDependencies": {
167
- "@kb-labs/devkit": "link:./",
168
147
  "@types/node": "^24.3.3",
148
+ "@vitest/coverage-istanbul": "3.2.4",
169
149
  "@vitest/coverage-v8": "^3.2.4",
170
150
  "eslint": "^9.35.0",
171
151
  "eslint-plugin-filenames-simple": "^0.9.0",
@@ -177,9 +157,9 @@
177
157
  "tsup": "^8.5.0",
178
158
  "typescript": "^5.9.2",
179
159
  "typescript-eslint": "^8.44.0",
180
- "vitest": "^3.2.4"
160
+ "vitest": "^3.2.4",
161
+ "@kb-labs/devkit": "2.9.0"
181
162
  },
182
- "packageManager": "pnpm@9.11.0+sha512.0a203ffaed5a3f63242cd064c8fb5892366c103e328079318f78062f24ea8c9d50bc6a47aa3567cabefd824d170e78fa2745ed1f16b132e16436146b7688f19b",
183
163
  "engines": {
184
164
  "node": ">=20.0.0",
185
165
  "pnpm": ">=9.11.0"
@@ -187,5 +167,25 @@
187
167
  "license": "MIT",
188
168
  "publishConfig": {
189
169
  "access": "public"
170
+ },
171
+ "scripts": {
172
+ "clean": "rimraf dist",
173
+ "build": "echo \"@kb-labs/devkit: nothing to build\"",
174
+ "lint": "echo \"@kb-labs/devkit: lint skipped (plain JS/MJS, not TS project)\" && exit 0",
175
+ "lint:fix": "eslint . --fix --ignore-pattern 'dist/**'",
176
+ "test": "vitest run --passWithNoTests",
177
+ "test:watch": "vitest --passWithNoTests",
178
+ "paths": "node ./bin/devkit-paths.mjs",
179
+ "fixtures": "node scripts/fixtures.js –help",
180
+ "fixtures:check": "node scripts/fixtures.js –action=check",
181
+ "fixtures:lint": "node scripts/fixtures.js –action=lint",
182
+ "fixtures:test": "node scripts/fixtures.js –action=test",
183
+ "fixtures:build": "node scripts/fixtures.js –action=build",
184
+ "fixtures:bootstrap": "node scripts/fixtures.js –action=bootstrap",
185
+ "fixtures:clean": "node scripts/fixtures.js –action=clean",
186
+ "fixtures:ci": "node scripts/fixtures.js –action=check –since=${GITHUB_BASE_REF:-origin/main} –concurrency=3 || node scripts/fixtures.js –action=check",
187
+ "postinstall": "kb-devkit-tsup-external --generate || true",
188
+ "dev": "tsup --config tsup.config.ts --watch",
189
+ "type-check": "echo \"@kb-labs/devkit: type-check skipped (plain JS/MJS, not TS project)\" && exit 0"
190
190
  }
191
- }
191
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "./react-app.json",
3
+ "compilerOptions": {
4
+ "noEmit": true,
5
+ "declaration": false
6
+ }
7
+ }
package/vitest/node.js CHANGED
@@ -17,14 +17,20 @@ export default defineConfig({
17
17
  provider: 'v8',
18
18
  all: true,
19
19
  reportsDirectory: './coverage',
20
- reporter: ['text', 'html', 'lcov'],
20
+ reporter: ['text', 'json', 'lcov'],
21
21
  exclude: [
22
22
  '**/node_modules/**',
23
23
  '**/dist/**',
24
24
  '**/__tests__/**',
25
25
  '**/*.d.ts',
26
26
  '**/types.ts',
27
- '**/types/**'
27
+ '**/types/**',
28
+ '**/contracts.ts',
29
+ '**/contracts/**',
30
+ '**/constants.ts',
31
+ '**/constants/**',
32
+ '**/*.config.ts',
33
+ '**/*.config.js'
28
34
  ],
29
35
  thresholds: {
30
36
  statements: 90,
package/vitest/react.js CHANGED
@@ -18,14 +18,20 @@ export default defineConfig({
18
18
  provider: 'v8',
19
19
  all: true,
20
20
  reportsDirectory: './coverage',
21
- reporter: ['text', 'html', 'lcov'],
21
+ reporter: ['text', 'json', 'lcov'],
22
22
  exclude: [
23
23
  '**/node_modules/**',
24
24
  '**/dist/**',
25
25
  '**/__tests__/**',
26
26
  '**/*.d.ts',
27
27
  '**/types.ts',
28
- '**/types/**'
28
+ '**/types/**',
29
+ '**/contracts.ts',
30
+ '**/contracts/**',
31
+ '**/constants.ts',
32
+ '**/constants/**',
33
+ '**/*.config.ts',
34
+ '**/*.config.js'
29
35
  ],
30
36
  thresholds: {
31
37
  statements: 90,
package/.cursorrules DELETED
@@ -1,32 +0,0 @@
1
- # Global Cursor rules for KB Labs projects
2
- allow:
3
- - read: "src/**/*"
4
- - read: "packages/**/*"
5
- - read: "apps/**/*"
6
- - read: "docs/**/*"
7
- - read: "README.md"
8
- - read: "package.json"
9
- - read: "tsconfig*.json"
10
- - read: ".github/**/*"
11
- - read: ".cursorrules"
12
- - read: "agents/**/*"
13
- - write: "src/**/*"
14
- - write: "packages/**/*"
15
- - write: "apps/**/*"
16
- - write: "docs/**/*"
17
- - write: "README.md"
18
- - write: "CONTRIBUTING.md"
19
- - write: "AGENTS.md"
20
- - write: "docs/adr/**/*"
21
- - run: "pnpm *"
22
- - run: "git *"
23
- deny:
24
- - write: "node_modules/**/*"
25
- - write: "dist/**/*"
26
- - write: "coverage/**/*"
27
- - write: ".yalc/**/*"
28
- - run: "rm -rf *"
29
- notes:
30
- - Always prefer presets from @kb-labs/devkit (tsconfig/eslint/prettier/vitest/tsup).
31
- - Keep local configs as thin wrappers (import/extends from devkit).
32
- - Respect package.json "exports" (no deep imports).
@@ -1,2 +0,0 @@
1
- # Default owner for everything — change if/when you add collaborators
2
- * @KirillBaranov
@@ -1,47 +0,0 @@
1
- name: Setup Node & pnpm
2
- description: Install Node and pnpm with cache
3
-
4
- inputs:
5
- node-version:
6
- default: '20'
7
- package-json-path:
8
- default: 'package.json'
9
- fallback-pnpm-version:
10
- default: '9.15.0'
11
-
12
- runs:
13
- using: composite
14
- steps:
15
- - uses: actions/setup-node@v4
16
- with:
17
- node-version: ${{ inputs.node-version }}
18
- # cache: pnpm ← УДАЛИТЬ
19
-
20
- - name: Enable Corepack
21
- shell: bash
22
- run: |
23
- corepack enable
24
- echo "$HOME/.local/share/pnpm" >> "$GITHUB_PATH"
25
- echo "$HOME/.local/share/node" >> "$GITHUB_PATH"
26
-
27
- - name: Resolve PNPM version & activate via Corepack
28
- shell: bash
29
- run: |
30
- set -euo pipefail
31
- FILE="${{ inputs.package-json-path }}"
32
- VER=$(node -e "try{const pm=require('${FILE}').packageManager||''; const v=(pm.split('@')[1]||'').split('+')[0]; process.stdout.write(v);}catch(e){process.stdout.write('');}")
33
- [ -z "$VER" ] && VER="${{ inputs.fallback-pnpm-version }}"
34
- echo "Using pnpm@$VER"
35
- corepack prepare "pnpm@$VER" --activate
36
- pnpm -v
37
-
38
- - name: (opt) Cache pnpm store
39
- uses: actions/cache@v4
40
- with:
41
- path: ~/.pnpm-store
42
- key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
43
- restore-keys: |
44
- ${{ runner.os }}-pnpm-
45
- - name: (opt) Configure pnpm store
46
- shell: bash
47
- run: pnpm config set store-dir ~/.pnpm-store
@@ -1,13 +0,0 @@
1
- name: CI
2
- on:
3
- push:
4
- branches: [main]
5
- pull_request:
6
- workflow_dispatch: {}
7
-
8
- jobs:
9
- call:
10
- uses: KirillBaranov/kb-labs-devkit/.github/workflows/ci-reusable.yml@main
11
- with:
12
- node-version: '20'
13
- run-coverage: true
@@ -1,28 +0,0 @@
1
- name: Deploy
2
-
3
- # Deploys all services to VPS via docker compose
4
- # Triggered manually with a specific image tag
5
- #
6
- # Prerequisites:
7
- # Add secrets in GitHub → Settings → Secrets → Actions:
8
- # VPS_HOST - server IP or hostname
9
- # VPS_USER - SSH username (e.g. deploy)
10
- # VPS_SSH_KEY - SSH private key
11
-
12
- on:
13
- workflow_dispatch:
14
- inputs:
15
- tag:
16
- description: Image tag to deploy (e.g. release-1.0.0)
17
- required: true
18
- type: string
19
-
20
- jobs:
21
- call:
22
- uses: KirillBaranov/kb-labs-devkit/.github/workflows/deploy-reusable.yml@main
23
- with:
24
- image-tag: ${{ inputs.tag }}
25
- compose-file: docker-compose.production.yml
26
- deploy-dir: /opt/kb-labs
27
- health-check-url: http://localhost:5050/api/v1/health
28
- secrets: inherit
@@ -1,25 +0,0 @@
1
- name: Docker Build
2
-
3
- # Builds and pushes Docker image to ghcr.io
4
- #
5
- # Flow:
6
- # rc branch → build image tagged rc-<sha> (for testing)
7
- # release tag → build image tagged release-x.y.z + latest (for deploy)
8
- #
9
- # Configure:
10
- # - Set image-name to your service name (e.g. kb-labs-rest-api)
11
- # - Set dockerfile path if not at repo root
12
-
13
- on:
14
- push:
15
- branches: [rc]
16
- tags: ['release-*']
17
- workflow_dispatch: {}
18
-
19
- jobs:
20
- call:
21
- uses: KirillBaranov/kb-labs-devkit/.github/workflows/docker-build-reusable.yml@main
22
- with:
23
- image-name: kb-labs-my-service # TODO: change to your service name
24
- dockerfile: Dockerfile
25
- context: .
@@ -1,10 +0,0 @@
1
- name: Drift Check
2
- on:
3
- workflow_dispatch: {}
4
- schedule:
5
- - cron: '0 3 * * *' # nightly
6
- jobs:
7
- drift:
8
- uses: KirillBaranov/kb-labs-devkit/.github/workflows/drift-check-reusable.yml@main
9
- with:
10
- node-version: '20'
@@ -1,16 +0,0 @@
1
- name: Profiles Validate
2
- on:
3
- push:
4
- branches: [main]
5
- pull_request:
6
- workflow_dispatch: {}
7
-
8
- jobs:
9
- call:
10
- uses: KirillBaranov/kb-labs-devkit/.github/workflows/profiles-validate-reusable.yml@main
11
- with:
12
- node_version: '20'
13
- soft_fail: true
14
- working_directory: '.'
15
- fixtures_dir: ''
16
- log_level: 'info'
@@ -1,8 +0,0 @@
1
- name: Release
2
- on:
3
- push:
4
- tags: ['v*']
5
- workflow_dispatch: {}
6
- jobs:
7
- call:
8
- uses: KirillBaranov/kb-labs-devkit/.github/workflows/release-reusable.yml@main