contextos-agents 1.6.1 → 2.0.0-beta.2

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 (323) hide show
  1. package/.agents/AGENTS.md +6 -1
  2. package/.agents/adapters/aider/export.js +117 -97
  3. package/.agents/adapters/claude/export.js +68 -26
  4. package/.agents/adapters/copilot/export.js +90 -51
  5. package/.agents/adapters/cursor/export.js +83 -68
  6. package/.agents/adapters/drift-detector.js +196 -0
  7. package/.agents/adapters/gemini/export.js +76 -45
  8. package/.agents/adapters/pure-compiler.js +443 -0
  9. package/.agents/adapters/zed/export.js +109 -62
  10. package/.agents/compiled/registry.v2.json +504 -0
  11. package/.agents/compiled/registry.v2.sha256 +1 -0
  12. package/.agents/compiler/manifest-compiler.js +963 -0
  13. package/.agents/compiler/vendor/yaml.LICENSE.txt +13 -0
  14. package/.agents/compiler/vendor/yaml.SBOM.json +6 -0
  15. package/.agents/compiler/vendor/yaml.js +139 -0
  16. package/.agents/core/profiles/init.yaml +25 -0
  17. package/.agents/core/skills/context-manager/references/context-rules.md +59 -0
  18. package/.agents/core/skills/context-manager/skill.yaml +10 -5
  19. package/.agents/core/skills/context-os/SKILL.md +3 -6
  20. package/.agents/core/skills/context-os/skill.yaml +14 -8
  21. package/.agents/core/skills/engineering-workflow/SKILL.md +1 -1
  22. package/.agents/core/skills/engineering-workflow/skill.yaml +7 -7
  23. package/.agents/core/skills/gemini-precision/SKILL.md +4 -0
  24. package/.agents/core/skills/gemini-precision/skill.yaml +5 -6
  25. package/.agents/core/skills/gstack-roles/SKILL.md +3 -1
  26. package/.agents/core/skills/gstack-roles/skill.yaml +9 -6
  27. package/.agents/core/skills/ponytail-mindset/skill.yaml +7 -7
  28. package/.agents/core/skills/security/skill.yaml +21 -2
  29. package/.agents/ctx.js +587 -111
  30. package/.agents/customization-dx.js +282 -0
  31. package/.agents/doctor.js +877 -33
  32. package/.agents/filesystem/index.js +71 -0
  33. package/.agents/filesystem/journaled-transaction.js +451 -0
  34. package/.agents/filesystem/lockfile-v2.js +275 -0
  35. package/.agents/filesystem/platform-hardening.js +222 -0
  36. package/.agents/filesystem/project-lock.js +218 -0
  37. package/.agents/filesystem/safe-path.js +256 -0
  38. package/.agents/generated/claude/skills/context-os/SKILL.md +1 -1
  39. package/.agents/generated/claude/skills/engineering-workflow/SKILL.md +1 -1
  40. package/.agents/generated/claude/skills/gemini-precision/SKILL.md +4 -0
  41. package/.agents/generated/claude/skills/gstack-roles/SKILL.md +3 -1
  42. package/.agents/generated/gemini/skills/context-os/SKILL.md +2 -2
  43. package/.agents/generated/gemini/skills/engineering-workflow/SKILL.md +1 -1
  44. package/.agents/generated/gemini/skills/gemini-precision/SKILL.md +4 -0
  45. package/.agents/generated/gemini/skills/gstack-roles/SKILL.md +3 -1
  46. package/.agents/plugins/contextos/hooks.json +25 -0
  47. package/.agents/plugins/contextos/plugin.json +19 -0
  48. package/.agents/plugins.js +432 -73
  49. package/.agents/profiles.js +507 -46
  50. package/.agents/resolver.js +50 -414
  51. package/.agents/schemas/attestation.review.v1.json +111 -0
  52. package/.agents/schemas/attestation.verification.v1.json +85 -0
  53. package/.agents/schemas/lockfile.v2.schema.json +134 -0
  54. package/.agents/schemas/profile.v2.schema.json +114 -0
  55. package/.agents/schemas/runtime.thread.v1.json +192 -0
  56. package/.agents/schemas/skill.manifest.v2.json +177 -0
  57. package/.agents/schemas/verification.spec.v1.json +39 -0
  58. package/.agents/schemas/workspace.graph.schema.json +106 -0
  59. package/.agents/stats.js +22 -9
  60. package/.agents/transaction-core/event-store.js +288 -0
  61. package/.agents/transaction-core/idempotency.js +129 -0
  62. package/.agents/transaction-core/ipc-lock.js +311 -0
  63. package/.agents/transaction-core/plugin-supply-chain-bundle.js +436 -0
  64. package/.agents/validate.js +143 -14
  65. package/.agents/watch.js +354 -102
  66. package/.agents/workspace/workspace-graph.js +778 -0
  67. package/README.md +59 -387
  68. package/benchmarks/v2/analysis/statistics.js +140 -0
  69. package/benchmarks/v2/analysis/stats.js +69 -0
  70. package/benchmarks/v2/arms/arm-definitions.js +79 -0
  71. package/benchmarks/v2/dataset.schema.json +34 -0
  72. package/benchmarks/v2/evaluators/index.js +25 -0
  73. package/benchmarks/v2/evaluators/verified-success.js +116 -0
  74. package/benchmarks/v2/harness/runner.js +88 -0
  75. package/benchmarks/v2/pilot-tasks.json +392 -0
  76. package/bin/commands/recover.js +88 -0
  77. package/bin/commands/uninstall.js +207 -0
  78. package/bin/commands/update.js +325 -0
  79. package/bin/commands.js +342 -0
  80. package/bin/index.js +326 -149
  81. package/bin/lib/detector.js +106 -0
  82. package/bin/lib/lockfile.js +253 -0
  83. package/bin/lib/safe-writer.js +290 -0
  84. package/package.json +85 -73
  85. package/registry.json +15 -7
  86. package/registry.schema.json +3 -1
  87. package/registry.v2.schema.json +86 -0
  88. package/.agents/core/profiles/backend.yaml +0 -47
  89. package/.agents/core/profiles/enterprise.yaml +0 -46
  90. package/.agents/core/profiles/frontend.yaml +0 -46
  91. package/.agents/core/profiles/hackathon.yaml +0 -45
  92. package/.agents/core/profiles/mvp.yaml +0 -44
  93. package/.agents/core/profiles/startup.yaml +0 -48
  94. package/.agents/core/skills/adapters/EXAMPLES.md +0 -19
  95. package/.agents/core/skills/adapters/SKILL.md +0 -105
  96. package/.agents/core/skills/adapters/TROUBLESHOOTING.md +0 -7
  97. package/.agents/core/skills/adapters/VALIDATION.json +0 -12
  98. package/.agents/core/skills/adapters/skill.yaml +0 -10
  99. package/.agents/core/skills/architecture-diagrams/SKILL.md +0 -108
  100. package/.agents/core/skills/architecture-diagrams/VALIDATION.json +0 -12
  101. package/.agents/core/skills/architecture-diagrams/skill.yaml +0 -8
  102. package/.agents/core/skills/brutalist-design/SKILL.md +0 -150
  103. package/.agents/core/skills/brutalist-design/VALIDATION.json +0 -12
  104. package/.agents/core/skills/brutalist-design/skill.yaml +0 -8
  105. package/.agents/core/skills/database/EXAMPLES.md +0 -74
  106. package/.agents/core/skills/database/SKILL.md +0 -101
  107. package/.agents/core/skills/database/TROUBLESHOOTING.md +0 -18
  108. package/.agents/core/skills/database/VALIDATION.json +0 -11
  109. package/.agents/core/skills/database/skill.yaml +0 -25
  110. package/.agents/core/skills/ddd/EXAMPLES.md +0 -42
  111. package/.agents/core/skills/ddd/SKILL.md +0 -247
  112. package/.agents/core/skills/ddd/TROUBLESHOOTING.md +0 -19
  113. package/.agents/core/skills/ddd/VALIDATION.json +0 -12
  114. package/.agents/core/skills/ddd/ddd.md +0 -178
  115. package/.agents/core/skills/ddd/skill.yaml +0 -10
  116. package/.agents/core/skills/decisions/EXAMPLES.md +0 -35
  117. package/.agents/core/skills/decisions/SKILL.md +0 -90
  118. package/.agents/core/skills/decisions/TROUBLESHOOTING.md +0 -13
  119. package/.agents/core/skills/decisions/VALIDATION.json +0 -12
  120. package/.agents/core/skills/decisions/skill.yaml +0 -10
  121. package/.agents/core/skills/docker/EXAMPLES.md +0 -56
  122. package/.agents/core/skills/docker/SKILL.md +0 -63
  123. package/.agents/core/skills/docker/TROUBLESHOOTING.md +0 -18
  124. package/.agents/core/skills/docker/VALIDATION.json +0 -11
  125. package/.agents/core/skills/docker/skill.yaml +0 -23
  126. package/.agents/core/skills/fastapi/EXAMPLES.md +0 -36
  127. package/.agents/core/skills/fastapi/SKILL.md +0 -148
  128. package/.agents/core/skills/fastapi/TROUBLESHOOTING.md +0 -19
  129. package/.agents/core/skills/fastapi/VALIDATION.json +0 -12
  130. package/.agents/core/skills/fastapi/fastapi.md +0 -112
  131. package/.agents/core/skills/fastapi/skill.yaml +0 -10
  132. package/.agents/core/skills/generators/EXAMPLES.md +0 -19
  133. package/.agents/core/skills/generators/SKILL.md +0 -112
  134. package/.agents/core/skills/generators/TROUBLESHOOTING.md +0 -7
  135. package/.agents/core/skills/generators/VALIDATION.json +0 -12
  136. package/.agents/core/skills/generators/skill.yaml +0 -10
  137. package/.agents/core/skills/generators/templates/API.md +0 -77
  138. package/.agents/core/skills/generators/templates/ARCHITECTURE.md +0 -70
  139. package/.agents/core/skills/generators/templates/DATABASE.md +0 -42
  140. package/.agents/core/skills/generators/templates/DECISION.md +0 -46
  141. package/.agents/core/skills/generators/templates/PRD.md +0 -67
  142. package/.agents/core/skills/generators/templates/PROJECT_GRAPH.md +0 -56
  143. package/.agents/core/skills/generators/templates/ROADMAP.md +0 -51
  144. package/.agents/core/skills/generators/templates/TASKS.md +0 -43
  145. package/.agents/core/skills/generators/templates/UI.md +0 -73
  146. package/.agents/core/skills/graphify/EXAMPLES.md +0 -73
  147. package/.agents/core/skills/graphify/SKILL.md +0 -130
  148. package/.agents/core/skills/graphify/VALIDATION.json +0 -12
  149. package/.agents/core/skills/graphify/skill.yaml +0 -13
  150. package/.agents/core/skills/impeccable-design/EXAMPLES.md +0 -26
  151. package/.agents/core/skills/impeccable-design/SKILL.md +0 -201
  152. package/.agents/core/skills/impeccable-design/TROUBLESHOOTING.md +0 -19
  153. package/.agents/core/skills/impeccable-design/VALIDATION.json +0 -12
  154. package/.agents/core/skills/impeccable-design/skill.yaml +0 -14
  155. package/.agents/core/skills/interview-me/SKILL.md +0 -97
  156. package/.agents/core/skills/interview-me/VALIDATION.json +0 -12
  157. package/.agents/core/skills/interview-me/skill.yaml +0 -8
  158. package/.agents/core/skills/microservices/EXAMPLES.md +0 -38
  159. package/.agents/core/skills/microservices/SKILL.md +0 -164
  160. package/.agents/core/skills/microservices/TROUBLESHOOTING.md +0 -19
  161. package/.agents/core/skills/microservices/VALIDATION.json +0 -12
  162. package/.agents/core/skills/microservices/microservices.md +0 -119
  163. package/.agents/core/skills/microservices/skill.yaml +0 -10
  164. package/.agents/core/skills/minimalist-design/SKILL.md +0 -113
  165. package/.agents/core/skills/minimalist-design/VALIDATION.json +0 -12
  166. package/.agents/core/skills/minimalist-design/skill.yaml +0 -8
  167. package/.agents/core/skills/nestjs/EXAMPLES.md +0 -40
  168. package/.agents/core/skills/nestjs/SKILL.md +0 -139
  169. package/.agents/core/skills/nestjs/TROUBLESHOOTING.md +0 -19
  170. package/.agents/core/skills/nestjs/VALIDATION.json +0 -12
  171. package/.agents/core/skills/nestjs/nestjs.md +0 -103
  172. package/.agents/core/skills/nestjs/skill.yaml +0 -10
  173. package/.agents/core/skills/nextjs/EXAMPLES.md +0 -40
  174. package/.agents/core/skills/nextjs/SKILL.md +0 -163
  175. package/.agents/core/skills/nextjs/TROUBLESHOOTING.md +0 -19
  176. package/.agents/core/skills/nextjs/VALIDATION.json +0 -12
  177. package/.agents/core/skills/nextjs/nextjs.md +0 -67
  178. package/.agents/core/skills/nextjs/skill.yaml +0 -10
  179. package/.agents/core/skills/node/EXAMPLES.md +0 -80
  180. package/.agents/core/skills/node/SKILL.md +0 -128
  181. package/.agents/core/skills/node/TROUBLESHOOTING.md +0 -19
  182. package/.agents/core/skills/node/VALIDATION.json +0 -12
  183. package/.agents/core/skills/node/node.md +0 -87
  184. package/.agents/core/skills/node/skill.yaml +0 -10
  185. package/.agents/core/skills/performance/EXAMPLES.md +0 -30
  186. package/.agents/core/skills/performance/SKILL.md +0 -75
  187. package/.agents/core/skills/performance/TROUBLESHOOTING.md +0 -19
  188. package/.agents/core/skills/performance/VALIDATION.json +0 -12
  189. package/.agents/core/skills/performance/performance.md +0 -52
  190. package/.agents/core/skills/performance/skill.yaml +0 -10
  191. package/.agents/core/skills/react/EXAMPLES.md +0 -79
  192. package/.agents/core/skills/react/SKILL.md +0 -132
  193. package/.agents/core/skills/react/TROUBLESHOOTING.md +0 -19
  194. package/.agents/core/skills/react/VALIDATION.json +0 -12
  195. package/.agents/core/skills/react/react.md +0 -93
  196. package/.agents/core/skills/react/skill.yaml +0 -10
  197. package/.agents/core/skills/react-best-practices/SKILL.md +0 -155
  198. package/.agents/core/skills/react-best-practices/VALIDATION.json +0 -12
  199. package/.agents/core/skills/react-best-practices/skill.yaml +0 -10
  200. package/.agents/core/skills/redesign-audit/SKILL.md +0 -117
  201. package/.agents/core/skills/redesign-audit/VALIDATION.json +0 -12
  202. package/.agents/core/skills/redesign-audit/skill.yaml +0 -8
  203. package/.agents/core/skills/soft-design/SKILL.md +0 -108
  204. package/.agents/core/skills/soft-design/VALIDATION.json +0 -12
  205. package/.agents/core/skills/soft-design/skill.yaml +0 -8
  206. package/.agents/core/skills/state-management/EXAMPLES.md +0 -56
  207. package/.agents/core/skills/state-management/SKILL.md +0 -48
  208. package/.agents/core/skills/state-management/TROUBLESHOOTING.md +0 -18
  209. package/.agents/core/skills/state-management/VALIDATION.json +0 -11
  210. package/.agents/core/skills/state-management/skill.yaml +0 -22
  211. package/.agents/core/skills/subagent-orchestrator/SKILL.md +0 -100
  212. package/.agents/core/skills/subagent-orchestrator/VALIDATION.json +0 -12
  213. package/.agents/core/skills/subagent-orchestrator/skill.yaml +0 -8
  214. package/.agents/core/skills/system-design/EXAMPLES.md +0 -75
  215. package/.agents/core/skills/system-design/SKILL.md +0 -419
  216. package/.agents/core/skills/system-design/TROUBLESHOOTING.md +0 -19
  217. package/.agents/core/skills/system-design/VALIDATION.json +0 -12
  218. package/.agents/core/skills/system-design/skill.yaml +0 -13
  219. package/.agents/core/skills/system-design/system-design.md +0 -112
  220. package/.agents/core/skills/testing/EXAMPLES.md +0 -71
  221. package/.agents/core/skills/testing/SKILL.md +0 -70
  222. package/.agents/core/skills/testing/TROUBLESHOOTING.md +0 -18
  223. package/.agents/core/skills/testing/VALIDATION.json +0 -11
  224. package/.agents/core/skills/testing/skill.yaml +0 -26
  225. package/.agents/core/skills/typescript/EXAMPLES.md +0 -64
  226. package/.agents/core/skills/typescript/SKILL.md +0 -112
  227. package/.agents/core/skills/typescript/TROUBLESHOOTING.md +0 -19
  228. package/.agents/core/skills/typescript/VALIDATION.json +0 -12
  229. package/.agents/core/skills/typescript/skill.yaml +0 -10
  230. package/.agents/core/skills/typescript/typescript.md +0 -71
  231. package/.agents/core/skills/ui-design/EXAMPLES.md +0 -21
  232. package/.agents/core/skills/ui-design/SKILL.md +0 -124
  233. package/.agents/core/skills/ui-design/TROUBLESHOOTING.md +0 -19
  234. package/.agents/core/skills/ui-design/VALIDATION.json +0 -12
  235. package/.agents/core/skills/ui-design/skill.yaml +0 -10
  236. package/.agents/core/skills/ui-design/ui.md +0 -88
  237. package/.agents/core/skills/ui-ux-pro/EXAMPLES.md +0 -62
  238. package/.agents/core/skills/ui-ux-pro/SKILL.md +0 -375
  239. package/.agents/core/skills/ui-ux-pro/TROUBLESHOOTING.md +0 -19
  240. package/.agents/core/skills/ui-ux-pro/VALIDATION.json +0 -12
  241. package/.agents/core/skills/ui-ux-pro/skill.yaml +0 -13
  242. package/.agents/core/skills/ux-design/EXAMPLES.md +0 -36
  243. package/.agents/core/skills/ux-design/SKILL.md +0 -116
  244. package/.agents/core/skills/ux-design/TROUBLESHOOTING.md +0 -19
  245. package/.agents/core/skills/ux-design/VALIDATION.json +0 -12
  246. package/.agents/core/skills/ux-design/skill.yaml +0 -10
  247. package/.agents/core/skills/ux-design/ux.md +0 -80
  248. package/.agents/core/skills/vercel-optimize/SKILL.md +0 -83
  249. package/.agents/core/skills/vercel-optimize/VALIDATION.json +0 -12
  250. package/.agents/core/skills/vercel-optimize/skill.yaml +0 -10
  251. package/.agents/core/skills/web-accessibility/EXAMPLES.md +0 -39
  252. package/.agents/core/skills/web-accessibility/SKILL.md +0 -170
  253. package/.agents/core/skills/web-accessibility/TROUBLESHOOTING.md +0 -19
  254. package/.agents/core/skills/web-accessibility/VALIDATION.json +0 -12
  255. package/.agents/core/skills/web-accessibility/accessibility.md +0 -63
  256. package/.agents/core/skills/web-accessibility/skill.yaml +0 -10
  257. package/.agents/generated/claude/skills/adapters/SKILL.md +0 -126
  258. package/.agents/generated/claude/skills/architecture-diagrams/SKILL.md +0 -101
  259. package/.agents/generated/claude/skills/brutalist-design/SKILL.md +0 -145
  260. package/.agents/generated/claude/skills/database/SKILL.md +0 -191
  261. package/.agents/generated/claude/skills/ddd/SKILL.md +0 -305
  262. package/.agents/generated/claude/skills/decisions/SKILL.md +0 -134
  263. package/.agents/generated/claude/skills/docker/SKILL.md +0 -135
  264. package/.agents/generated/claude/skills/fastapi/SKILL.md +0 -200
  265. package/.agents/generated/claude/skills/generators/SKILL.md +0 -133
  266. package/.agents/generated/claude/skills/graphify/SKILL.md +0 -198
  267. package/.agents/generated/claude/skills/impeccable-design/SKILL.md +0 -241
  268. package/.agents/generated/claude/skills/interview-me/SKILL.md +0 -90
  269. package/.agents/generated/claude/skills/microservices/SKILL.md +0 -218
  270. package/.agents/generated/claude/skills/minimalist-design/SKILL.md +0 -108
  271. package/.agents/generated/claude/skills/nestjs/SKILL.md +0 -195
  272. package/.agents/generated/claude/skills/nextjs/SKILL.md +0 -219
  273. package/.agents/generated/claude/skills/node/SKILL.md +0 -224
  274. package/.agents/generated/claude/skills/performance/SKILL.md +0 -121
  275. package/.agents/generated/claude/skills/react/SKILL.md +0 -227
  276. package/.agents/generated/claude/skills/react-best-practices/SKILL.md +0 -146
  277. package/.agents/generated/claude/skills/redesign-audit/SKILL.md +0 -112
  278. package/.agents/generated/claude/skills/soft-design/SKILL.md +0 -103
  279. package/.agents/generated/claude/skills/state-management/SKILL.md +0 -120
  280. package/.agents/generated/claude/skills/subagent-orchestrator/SKILL.md +0 -93
  281. package/.agents/generated/claude/skills/system-design/SKILL.md +0 -507
  282. package/.agents/generated/claude/skills/testing/SKILL.md +0 -157
  283. package/.agents/generated/claude/skills/typescript/SKILL.md +0 -192
  284. package/.agents/generated/claude/skills/ui-design/SKILL.md +0 -161
  285. package/.agents/generated/claude/skills/ui-ux-pro/SKILL.md +0 -451
  286. package/.agents/generated/claude/skills/ux-design/SKILL.md +0 -168
  287. package/.agents/generated/claude/skills/vercel-optimize/SKILL.md +0 -76
  288. package/.agents/generated/claude/skills/web-accessibility/SKILL.md +0 -225
  289. package/.agents/generated/gemini/skills/adapters/SKILL.md +0 -135
  290. package/.agents/generated/gemini/skills/architecture-diagrams/SKILL.md +0 -107
  291. package/.agents/generated/gemini/skills/brutalist-design/SKILL.md +0 -151
  292. package/.agents/generated/gemini/skills/database/SKILL.md +0 -200
  293. package/.agents/generated/gemini/skills/ddd/SKILL.md +0 -314
  294. package/.agents/generated/gemini/skills/decisions/SKILL.md +0 -143
  295. package/.agents/generated/gemini/skills/docker/SKILL.md +0 -144
  296. package/.agents/generated/gemini/skills/fastapi/SKILL.md +0 -209
  297. package/.agents/generated/gemini/skills/generators/SKILL.md +0 -142
  298. package/.agents/generated/gemini/skills/graphify/SKILL.md +0 -205
  299. package/.agents/generated/gemini/skills/impeccable-design/SKILL.md +0 -250
  300. package/.agents/generated/gemini/skills/interview-me/SKILL.md +0 -96
  301. package/.agents/generated/gemini/skills/microservices/SKILL.md +0 -227
  302. package/.agents/generated/gemini/skills/minimalist-design/SKILL.md +0 -114
  303. package/.agents/generated/gemini/skills/nestjs/SKILL.md +0 -204
  304. package/.agents/generated/gemini/skills/nextjs/SKILL.md +0 -298
  305. package/.agents/generated/gemini/skills/node/SKILL.md +0 -323
  306. package/.agents/generated/gemini/skills/performance/SKILL.md +0 -185
  307. package/.agents/generated/gemini/skills/react/SKILL.md +0 -332
  308. package/.agents/generated/gemini/skills/react-best-practices/SKILL.md +0 -152
  309. package/.agents/generated/gemini/skills/redesign-audit/SKILL.md +0 -118
  310. package/.agents/generated/gemini/skills/soft-design/SKILL.md +0 -109
  311. package/.agents/generated/gemini/skills/state-management/SKILL.md +0 -129
  312. package/.agents/generated/gemini/skills/subagent-orchestrator/SKILL.md +0 -99
  313. package/.agents/generated/gemini/skills/system-design/SKILL.md +0 -631
  314. package/.agents/generated/gemini/skills/testing/SKILL.md +0 -166
  315. package/.agents/generated/gemini/skills/typescript/SKILL.md +0 -275
  316. package/.agents/generated/gemini/skills/ui-design/SKILL.md +0 -170
  317. package/.agents/generated/gemini/skills/ui-ux-pro/SKILL.md +0 -460
  318. package/.agents/generated/gemini/skills/ux-design/SKILL.md +0 -177
  319. package/.agents/generated/gemini/skills/vercel-optimize/SKILL.md +0 -82
  320. package/.agents/generated/gemini/skills/web-accessibility/SKILL.md +0 -300
  321. package/.agents/mcp/runtime.py +0 -470
  322. package/.agents/mcp/server.mjs +0 -189271
  323. package/benchmarks/gemini-issues.js +0 -533
@@ -1,103 +0,0 @@
1
- # NestJS — Best Practices
2
-
3
- ## Module Architecture
4
-
5
- - **One module per domain** — `UsersModule`, `AuthModule`, `OrdersModule`
6
- - **Feature modules** — encapsulate related controllers, services, repositories
7
- - **Shared module** — for cross-cutting concerns (logging, config, utils)
8
- - **Core module** — singleton services (database, auth guards)
9
-
10
- ```
11
- src/
12
- ├── modules/
13
- │ ├── users/
14
- │ │ ├── users.module.ts
15
- │ │ ├── users.controller.ts
16
- │ │ ├── users.service.ts
17
- │ │ ├── users.repository.ts
18
- │ │ ├── dto/
19
- │ │ │ ├── create-user.dto.ts
20
- │ │ │ └── update-user.dto.ts
21
- │ │ ├── entities/
22
- │ │ │ └── user.entity.ts
23
- │ │ └── users.spec.ts
24
- │ └── auth/
25
- ├── shared/
26
- │ ├── guards/
27
- │ ├── interceptors/
28
- │ ├── pipes/
29
- │ └── filters/
30
- ├── config/
31
- └── app.module.ts
32
- ```
33
-
34
- ## Dependency Injection
35
-
36
- ```typescript
37
- @Injectable()
38
- export class UsersService {
39
- constructor(
40
- @InjectRepository(User) private readonly usersRepo: Repository<User>,
41
- private readonly configService: ConfigService,
42
- ) {}
43
- }
44
- ```
45
-
46
- - Prefer constructor injection
47
- - Use custom providers for complex setup
48
- - Scope: default is Singleton, use REQUEST scope only when needed
49
-
50
- ## DTOs and Validation
51
-
52
- ```typescript
53
- import { IsEmail, IsString, MinLength } from 'class-validator';
54
-
55
- export class CreateUserDto {
56
- @IsEmail()
57
- email: string;
58
-
59
- @IsString()
60
- @MinLength(2)
61
- name: string;
62
- }
63
- ```
64
-
65
- - Always use DTOs for request validation
66
- - Use `ValidationPipe` globally
67
- - Separate Create/Update/Response DTOs
68
-
69
- ## Guards, Interceptors, Pipes
70
-
71
- | Type | Purpose |
72
- | --- | --- |
73
- | **Guards** | Authentication, authorization |
74
- | **Interceptors** | Logging, transformation, caching |
75
- | **Pipes** | Validation, transformation |
76
- | **Filters** | Exception handling |
77
-
78
- Execution order: Guards → Interceptors → Pipes → Handler → Interceptors → Filters
79
-
80
- ## Error Handling
81
-
82
- ```typescript
83
- @Catch()
84
- export class AllExceptionsFilter implements ExceptionFilter {
85
- catch(exception: unknown, host: ArgumentsHost) {
86
- // Transform to standard error format
87
- }
88
- }
89
- ```
90
-
91
- ## Testing
92
-
93
- - **Unit tests** — mock dependencies with `Test.createTestingModule()`
94
- - **E2E tests** — use `supertest` with a test module
95
- - **Mock everything** — services should be testable in isolation
96
-
97
- ## Anti-Patterns
98
-
99
- - [FAIL] Business logic in controllers — use services
100
- - [FAIL] Direct database access in controllers — use repositories
101
- - [FAIL] Circular dependencies — refactor module structure
102
- - [FAIL] God modules — split large modules by domain
103
- - [FAIL] Not using DTOs — always validate input
@@ -1,10 +0,0 @@
1
- id: nestjs
2
- name: NestJS
3
- category: backend
4
- tags: [backend, nodejs, typescript, enterprise, di, decorators]
5
- requires: [typescript, node]
6
- optional: [postgres, redis, docker, graphql]
7
- conflicts: [fastapi, express]
8
- weight: 8
9
- documents:
10
- - nestjs.md
@@ -1,40 +0,0 @@
1
- # nextjs Examples — Anti-patterns vs ContextOS Standard
2
-
3
- ## Example 1: Server Components vs Client Components
4
-
5
- ### Anti-pattern: Marking the Entire Page as Client Component
6
-
7
- ```tsx
8
- // BAD: app/dashboard/page.tsx with 'use client' at top
9
- // Bloats client bundle, loses SEO benefits, eliminates direct DB access
10
- 'use client';
11
-
12
- export default function DashboardPage() {
13
- const [data, setData] = useState(null);
14
- useEffect(() => { fetch('/api/dashboard').then(...) }, []);
15
- return <div>...</div>;
16
- }
17
- ```
18
-
19
- ### Best practice: ContextOS Standard (RSC by Default, Client Leaf Nodes)
20
-
21
- ```tsx
22
- // GOOD: Server Component fetches data directly with zero bundle cost
23
- // app/dashboard/page.tsx (Server Component)
24
- import { Suspense } from 'react';
25
- import { db } from '@/lib/db';
26
- import { InteractiveChart } from './InteractiveChart'; // 'use client' leaf component
27
-
28
- export default async function DashboardPage() {
29
- const stats = await db.analytics.getStats();
30
- return (
31
- <main>
32
- <h1>Dashboard</h1>
33
- <p>Total Revenue: {stats.revenue}</p>
34
- <Suspense fallback={<ChartSkeleton />}>
35
- <InteractiveChart initialData={stats.chartData} />
36
- </Suspense>
37
- </main>
38
- );
39
- }
40
- ```
@@ -1,163 +0,0 @@
1
- ---
2
- name: Next.js
3
- description: >
4
- ContextOS skill for Next.js App Router, Server Components, Server Actions, performance optimization, and Vercel best practices.
5
- ---
6
-
7
- # Next.js App Router Best Practices
8
-
9
- ## Overview
10
-
11
- Enforces high-performance architectural patterns for Next.js App Router based on Vercel Engineering guidelines: React Server Components (RSC), zero-waterfall async pipelines, request deduplication via `React.cache()`, bundle optimization, and secure Server Actions.
12
-
13
- ## When to Use
14
-
15
- Activate whenever building, refactoring, or reviewing Next.js pages, layouts, Route Handlers (`app/api`), Server Actions, or components in the `app/` directory.
16
-
17
- ## Negative Constraints (What NOT to Do)
18
-
19
- 1. **NEVER use barrel imports for UI libraries**: Avoid `import { Button, Dialog } from '@/components'`. Import directly from the exact file (`import { Button } from '@/components/ui/button'`) to prevent bundler tree-shaking failures and trace bloat.
20
- 2. **NEVER trust client-provided data or session state in Server Actions**: Always authenticate session and authorize tenant ownership inside the Server Action handler itself before mutating data.
21
- 3. **NEVER introduce sequential `await` waterfalls for independent data**: Always use `Promise.all()` or parallel streaming `<Suspense>` boundaries.
22
- 4. **NEVER pass large unneeded serialized data from Server to Client Components**: Only pass the specific primitive fields required by the client component (`server-dedup-props`).
23
- 5. **NEVER use `useEffect` for data fetching**: Fetch directly in Server Components or use TanStack Query / SWR for client-side queries.
24
- 6. **NEVER import server-only modules in client components**: Use the `server-only` package in data access layers to catch accidental client imports at build time.
25
-
26
- ## Rules & Patterns
27
-
28
- ### 1. Eliminating Async Waterfalls (Critical)
29
-
30
- - **Parallel Fetching**: Fetch independent data concurrently at the top of the route or component.
31
- - **Granular Streaming**: Wrap slow, non-critical subtrees in `<Suspense fallback={<Skeleton />}>` so critical above-the-fold content streams immediately.
32
- - **Defer Awaits**: Check cheap synchronous conditions before awaiting remote resources.
33
-
34
- ### 2. Request Deduplication & Caching (`server-cache-react`)
35
-
36
- - Use `React.cache()` to deduplicate identical database or service calls across multiple components rendered in the same server request lifecycle.
37
-
38
- ```tsx
39
- import { cache } from 'react';
40
- import { db } from '@/lib/db';
41
-
42
- export const getCurrentUser = cache(async (userId: string) => {
43
- return await db.user.findUnique({
44
- where: { id: userId },
45
- select: { id: true, name: true, role: true, email: true }
46
- });
47
- });
48
- ```
49
-
50
- ### 3. Secure Server Actions (`server-auth-actions`)
51
-
52
- - Treat every Server Action as a public HTTP endpoint. Always validate session, authorization, and input schema with Zod.
53
-
54
- ```tsx
55
- 'use server';
56
-
57
- import { z } from 'zod';
58
- import { auth } from '@/lib/auth';
59
- import { db } from '@/lib/db';
60
- import { revalidatePath } from 'next/cache';
61
-
62
- const UpdateProfileSchema = z.object({
63
- name: z.string().min(2).max(50),
64
- });
65
-
66
- export async function updateProfile(formData: FormData) {
67
- const session = await auth();
68
- if (!session?.userId) throw new Error('Unauthorized');
69
-
70
- const result = UpdateProfileSchema.safeParse({ name: formData.get('name') });
71
- if (!result.success) return { error: 'Invalid input', issues: result.error.flatten() };
72
-
73
- await db.user.update({
74
- where: { id: session.userId },
75
- data: { name: result.data.name },
76
- });
77
-
78
- revalidatePath('/settings');
79
- return { success: true };
80
- }
81
- ```
82
-
83
- ### 4. Bundle Optimization & Dynamic Imports (`bundle-dynamic-imports`)
84
-
85
- - Heavy interactive client components (charts, rich-text editors, video players) must be dynamically loaded with `next/dynamic`.
86
-
87
- ```tsx
88
- import dynamic from 'next/dynamic';
89
-
90
- const AnalyticsChart = dynamic(
91
- () => import('@/components/analytics/chart').then(mod => mod.AnalyticsChart),
92
- {
93
- loading: () => <div className="h-64 animate-pulse bg-muted rounded-lg" />,
94
- ssr: false,
95
- }
96
- );
97
- ```
98
-
99
- ### 5. Next.js 15+ Async Request APIs (`async-params`)
100
-
101
- In Next.js 15+, `params`, `searchParams`, `cookies()`, and `headers()` are asynchronous and must be awaited:
102
-
103
- ```tsx
104
- // [GOOD] Next.js 15+ Page Component
105
- interface PageProps {
106
- params: Promise<{ id: string }>;
107
- searchParams: Promise<{ [key: string]: string | string[] | undefined }>;
108
- }
109
-
110
- export default async function UserPage({ params, searchParams }: PageProps) {
111
- const { id } = await params;
112
- const { tab } = await searchParams;
113
- const user = await getUser(id);
114
-
115
- return <UserProfile user={user} activeTab={tab as string} />;
116
- }
117
- ```
118
-
119
- ### 6. Non-Blocking Background Tasks with `after()`
120
-
121
- To execute logging, analytics, or cache priming without delaying the user's HTTP response:
122
-
123
- ```typescript
124
- import { after } from 'next/server';
125
-
126
- export async function POST(request: Request) {
127
- const data = await request.json();
128
- const result = await processOrder(data);
129
-
130
- // Executes asynchronously AFTER the response stream has completed
131
- after(async () => {
132
- await sendSlackNotification(result);
133
- await indexOrderInSearch(result.id);
134
- });
135
-
136
- return Response.json({ success: true, orderId: result.id });
137
- }
138
- ```
139
-
140
- ---
141
-
142
- ## Code Examples
143
-
144
- See `EXAMPLES.md` for detailed code examples and component templates.
145
-
146
- ## Validation Checklist
147
-
148
- - [ ] All database queries in RSC layers use `React.cache()` if called across multiple components.
149
- - [ ] No barrel imports (`from '@/components'`); all imports point to exact component modules.
150
- - [ ] Server Actions have explicit auth checks and Zod input validation.
151
- - [ ] Heavy client widgets (charts, editors) use `next/dynamic`.
152
- - [ ] Images use `next/image` with explicit `sizes` and `priority` on LCP elements.
153
-
154
- ## Common Mistakes
155
-
156
- - Using `'use client'` at page level instead of leaf components.
157
- - Relying on client-side authentication checks for Server Actions without server-side validation.
158
- - Chaining sequential awaits for independent data models.
159
-
160
- ## Integration Notes
161
-
162
- - Pairs with `react` and `ui-ux-pro` for component design and state management.
163
- - Pairs with `security` for session authorization and input sanitization.
@@ -1,19 +0,0 @@
1
- # nextjs Troubleshooting & Common Mistakes
2
-
3
- ## 1. Hydration Mismatch Errors
4
-
5
- - **Symptom**: "Text content does not match server-rendered HTML".
6
- - **Root Cause**: Rendering dates, window dimensions, or local storage data that differs between server render and client hydration.
7
- - **Fix**: Use suppressHydrationWarning on localized timestamps or load client-only state inside a useEffect after mount.
8
-
9
- ## 2. Accidental Server Code Bundled to Client
10
-
11
- - **Symptom**: "Module not found: Can't resolve 'fs' or 'pg' in client bundle".
12
- - **Root Cause**: Client component importing a utility that transitively imports server-only database code.
13
- - **Fix**: Separate server utilities into *.server.ts and install import 'server-only'; at the top of server files.
14
-
15
- ## 3. Waterfall Fetches in Server Components
16
-
17
- - **Symptom**: Page takes 3 seconds to load due to sequential await statements.
18
- - **Root Cause**: Awaiting independent data sources one after another.
19
- - **Fix**: Use Promise.all([fetchUsers(), fetchProducts()]) or separate into nested <Suspense> boundaries.
@@ -1,12 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "type": "object",
4
- "properties": {
5
- "rules_followed": {
6
- "type": "boolean"
7
- }
8
- },
9
- "required": [
10
- "rules_followed"
11
- ]
12
- }
@@ -1,67 +0,0 @@
1
- # Next.js — Best Practices (App Router)
2
-
3
- ## Routing
4
-
5
- - Use **App Router** (`app/` directory) — not Pages Router
6
- - **Layouts** — shared UI in `layout.tsx`, nested layouts for sections
7
- - **Loading states** — `loading.tsx` for Suspense boundaries
8
- - **Error handling** — `error.tsx` for error boundaries per route
9
- - **Not found** — `not-found.tsx` for 404 pages
10
-
11
- ## Server vs Client Components
12
-
13
- - **Default to Server Components** — they're server by default
14
- - **Use `'use client'`** only when you need: event handlers, useState, useEffect, browser APIs
15
- - **Push client boundaries down** — keep as much as possible on the server
16
- - **Don't pass functions** from Server to Client components
17
-
18
- ## Data Fetching
19
-
20
- - **Server Components** — fetch directly, no useEffect
21
- - **Server Actions** — for mutations (`'use server'`)
22
- - **Route Handlers** — `app/api/` for REST endpoints
23
- - **Parallel fetching** — use Promise.all for independent requests
24
- - **Caching** — leverage Next.js cache, revalidate strategically
25
-
26
- ```tsx
27
- // Server Component — direct fetch
28
- async function UserProfile({ id }: { id: string }) {
29
- const user = await getUser(id); // No useEffect needed
30
- return <div>{user.name}</div>;
31
- }
32
- ```
33
-
34
- ## File Structure
35
-
36
- ```
37
- app/
38
- ├── layout.tsx # Root layout
39
- ├── page.tsx # Home page
40
- ├── globals.css
41
- ├── (auth)/ # Route group (no URL impact)
42
- │ ├── login/page.tsx
43
- │ └── register/page.tsx
44
- ├── dashboard/
45
- │ ├── layout.tsx # Dashboard layout
46
- │ ├── page.tsx # Dashboard home
47
- │ └── settings/page.tsx
48
- ├── api/
49
- │ └── users/route.ts # API route
50
- └── components/ # Shared components
51
- ```
52
-
53
- ## Performance
54
-
55
- - **Image optimization** — always use `next/image`
56
- - **Font optimization** — use `next/font`
57
- - **Metadata** — export metadata object from pages
58
- - **Static generation** — prefer SSG over SSR when possible
59
- - **Edge runtime** — for latency-sensitive routes
60
-
61
- ## Anti-Patterns
62
-
63
- - [FAIL] Using `useEffect` for data fetching in Server Components
64
- - [FAIL] Making everything a Client Component
65
- - [FAIL] Not using `loading.tsx` and `error.tsx`
66
- - [FAIL] Importing server-only code in Client Components
67
- - [FAIL] Not leveraging caching and revalidation
@@ -1,10 +0,0 @@
1
- id: nextjs
2
- name: Next.js
3
- category: frontend
4
- tags: [frontend, ssr, ssg, fullstack, react, app-router]
5
- requires: [react, typescript]
6
- optional: [tailwind, prisma, next-auth, react-query]
7
- conflicts: [vue, angular, remix]
8
- weight: 9
9
- documents:
10
- - nextjs.md
@@ -1,80 +0,0 @@
1
- # Node.js Examples — Anti-patterns vs ContextOS Standard
2
-
3
- ## Example 1: Graceful Process Shutdown
4
-
5
- ### Anti-pattern: Anti-pattern (Abruptly killing process and dropping in-flight requests)
6
-
7
- ```javascript
8
- // BAD: drops active database transactions and in-flight HTTP connections
9
- process.on('SIGTERM', () => {
10
- process.exit(0);
11
- });
12
- ```
13
-
14
- ### Best practice: ContextOS Standard (Graceful connection draining)
15
-
16
- ```typescript
17
- // GOOD: drains active requests, closes database connections, and exits safely
18
- import http from 'http';
19
- import { prisma } from './db';
20
- import { logger } from './logger';
21
-
22
- export function setupGracefulShutdown(server: http.Server) {
23
- const shutdown = async (signal: string) => {
24
- logger.info(`Received ${signal}. Starting graceful shutdown...`);
25
-
26
- server.close(async () => {
27
- logger.info('HTTP server closed.');
28
- try {
29
- await prisma.$disconnect();
30
- logger.info('Database pool closed.');
31
- process.exit(0);
32
- } catch (err) {
33
- logger.error('Error during database disconnect:', err);
34
- process.exit(1);
35
- }
36
- });
37
-
38
- // Force shutdown after timeout if connections hang
39
- setTimeout(() => {
40
- logger.error('Forceful shutdown timeout reached.');
41
- process.exit(1);
42
- }, 10_000).unref();
43
- };
44
-
45
- process.on('SIGTERM', () => shutdown('SIGTERM'));
46
- process.on('SIGINT', () => shutdown('SIGINT'));
47
- }
48
- ```
49
-
50
- ---
51
-
52
- ## Example 2: Stream-based File Processing
53
-
54
- ### Anti-pattern: Anti-pattern (Loading entire 500MB file into buffer)
55
-
56
- ```typescript
57
- // BAD: easily causes Out Of Memory (OOM) crashes under concurrency
58
- app.get('/download/:file', async (req, res) => {
59
- const data = await fs.promises.readFile(`/uploads/${req.params.file}`);
60
- res.send(data);
61
- });
62
- ```
63
-
64
- ### Best practice: ContextOS Standard (Piping read stream with pipeline)
65
-
66
- ```typescript
67
- // GOOD: constant memory usage (O(1) RAM) regardless of file size
68
- import fs from 'fs';
69
- import { pipeline } from 'stream/promises';
70
-
71
- app.get('/download/:file', async (req, res, next) => {
72
- try {
73
- const filePath = `/uploads/${req.params.file}`;
74
- const readStream = fs.createReadStream(filePath);
75
- await pipeline(readStream, res);
76
- } catch (err) {
77
- next(err);
78
- }
79
- });
80
- ```
@@ -1,128 +0,0 @@
1
- ---
2
- name: Node.js
3
- description: >
4
- ContextOS skill for Node.js
5
- ---
6
-
7
- # Node.js
8
-
9
- ## Overview
10
-
11
- Production-grade Node.js runtime and server standard. Enforces async event loop non-blocking hygiene, graceful shutdown, structured JSON logging with correlation IDs, and unhandled rejection guards.
12
-
13
- ## When to Use
14
-
15
- Activate when developing Node.js HTTP servers, Express/Fastify APIs, background workers, CLI tools, or stream-based data pipelines.
16
-
17
- ## Negative Constraints (What NOT to Do)
18
-
19
- 1. **NEVER execute synchronous filesystem/crypto calls in request handlers (`fs.readFileSync`)**: Always use async promises (`fs.promises.*`) to avoid blocking the event loop.
20
- 2. **NEVER leave uncaught promise rejections**: Every async route must use `express-async-errors` or wrap operations in try/catch calling `next(err)`.
21
- 3. **NEVER buffer large files/payloads entirely in memory (`fs.readFile`)**: Always use Streams or Pipelines (`stream.pipeline`) for processing large files.
22
- 4. **NEVER store in-memory session or user state on a single process instance**: Use Redis or an external state store to allow multi-instance scaling.
23
- 5. **NEVER ignore `SIGTERM` / `SIGINT` shutdown signals**: Always implement graceful shutdown to close open DB pools and drain active HTTP connections.
24
-
25
- ## Rules & Patterns
26
-
27
- ## Architecture
28
-
29
- - **Layered architecture**: Routes → Controllers → Services → Repositories
30
- - **Dependency injection** — don't import dependencies directly in services
31
- - **Config from environment** — never hardcode secrets, use env variables
32
- - **Graceful shutdown** — handle SIGTERM, close connections, drain requests
33
-
34
- ## Error Handling
35
-
36
- - **Never swallow errors** — always handle or re-throw
37
- - **Custom error classes** — extend Error with HTTP status codes
38
- - **Global error handler** — catch unhandled rejections and uncaught exceptions
39
- - **Structured logging** — JSON logs with request ID, timestamp, level
40
-
41
- ```typescript
42
- class AppError extends Error {
43
- constructor(
44
- public message: string,
45
- public statusCode: number = 500,
46
- public code: string = 'INTERNAL_ERROR'
47
- ) {
48
- super(message);
49
- this.name = 'AppError';
50
- }
51
- }
52
- ```
53
-
54
- ## API Design
55
-
56
- - **RESTful conventions** — GET (read), POST (create), PUT (full update), PATCH (partial), DELETE
57
- - **Consistent response format** — `{ data, error, pagination }`
58
- - **Validation at the edge** — validate request body/params with Zod or Joi
59
- - **Rate limiting** — protect against abuse
60
- - **CORS** — configure explicitly, never use `*` in production
61
-
62
- ## Security
63
-
64
- - **Helmet.js** — security headers
65
- - **Input validation** — never trust client input
66
- - **SQL injection** — always use parameterized queries
67
- - **XSS** — sanitize output, use Content-Security-Policy
68
- - **Authentication** — JWT with short expiry + refresh tokens
69
- - **Secrets** — environment variables, never in code
70
-
71
- ## Database
72
-
73
- - **Connection pooling** — don't create connections per request
74
- - **Migrations** — version-controlled schema changes
75
- - **Transactions** — for multi-step operations
76
- - **Indexes** — add indexes for frequently queried columns
77
-
78
- ## Performance
79
-
80
- - **Async/await** — never block the event loop
81
- - **Streaming** — for large files and data sets
82
- - **Caching** — Redis for frequently accessed data
83
- - **Clustering** — use PM2 or cluster module for multi-core
84
-
85
- ## Testing
86
-
87
- - **Unit tests** — services and utilities
88
- - **Integration tests** — API endpoints with test database
89
- - **Test isolation** — each test should be independent
90
- - **Fixtures** — use factories, not shared state
91
-
92
- ## File Structure
93
-
94
- ```
95
- src/
96
- ├── config/ # Configuration
97
- ├── modules/ # Feature modules
98
- │ └── users/
99
- │ ├── users.controller.ts
100
- │ ├── users.service.ts
101
- │ ├── users.repository.ts
102
- │ ├── users.routes.ts
103
- │ ├── users.types.ts
104
- │ └── users.test.ts
105
- ├── shared/ # Shared utilities
106
- │ ├── middleware/
107
- │ ├── errors/
108
- │ └── utils/
109
- ├── types/ # Global types
110
- └── app.ts # App entry point
111
- ```
112
-
113
-
114
- ## Code Examples
115
-
116
- See `EXAMPLES.md` for detailed code examples.
117
-
118
- ## Validation Checklist
119
-
120
- What to verify during the review phase before completing the task.
121
-
122
- ## Common Mistakes
123
-
124
- Anti-patterns and things to explicitly avoid. See `TROUBLESHOOTING.md`.
125
-
126
- ## Integration Notes
127
-
128
- How this skill interacts with other skills.
@@ -1,19 +0,0 @@
1
- # node Troubleshooting & Common Mistakes
2
-
3
- ## 1. Unhandled Promise Rejections Crashing the Process
4
-
5
- - **Symptom**: Node process crashes abruptly without clear stack trace in production.
6
- - **Root Cause**: Missing `process.on('unhandledRejection')` handler in Node.js >= 15.
7
- - **Fix**: Always register top-level unhandledRejection and uncaughtException logging before exiting cleanly.
8
-
9
- ## 2. Event Loop Starvation
10
-
11
- - **Symptom**: API endpoints stop responding or latency spikes to 10+ seconds.
12
- - **Root Cause**: Heavy synchronous operations (`JSON.parse` on a 50MB file, sync bcrypt hashing, or regex catastrophic backtracking).
13
- - **Fix**: Offload CPU-heavy tasks to Worker Threads or use async worker queues.
14
-
15
- ## 3. Memory Leaks in Event Emitters
16
-
17
- - **Symptom**: "MaxListenersExceededWarning: Possible EventEmitter memory leak detected".
18
- - **Root Cause**: Adding listeners inside request handlers without removing them on close.
19
- - **Fix**: Remove listeners in cleanup callbacks or use `AbortController` signals.
@@ -1,12 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "type": "object",
4
- "properties": {
5
- "rules_followed": {
6
- "type": "boolean"
7
- }
8
- },
9
- "required": [
10
- "rules_followed"
11
- ]
12
- }