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,164 +0,0 @@
1
- ---
2
- name: Microservices
3
- description: >
4
- ContextOS skill for Microservices
5
- ---
6
-
7
- # Microservices
8
-
9
- ## Overview
10
-
11
- Distributed systems architecture standard. Enforces bounded context isolation, asynchronous event-driven messaging (Kafka, RabbitMQ), Saga distributed transactions, API gateways, and outbox patterns.
12
-
13
- ## When to Use
14
-
15
- Activate when decomposing monoliths into independent services, designing inter-service communications, or building scalable distributed systems.
16
-
17
- ## Rules & Patterns
18
- <!-- Source: microservices.md -->
19
-
20
- ## Microservices — Architecture Guide
21
-
22
- ## When to Use Microservices
23
-
24
- **Use when:**
25
-
26
- - Team > 10 engineers working on the same product
27
- - Independent deployment of components is critical
28
- - Different components have different scaling needs
29
- - Different components need different tech stacks
30
-
31
- **Don't use when:**
32
-
33
- - Small team (< 5 engineers)
34
- - MVP or prototype
35
- - No operational expertise (monitoring, tracing, deployment)
36
- - Tight coupling between components
37
-
38
- ## Core Principles
39
-
40
- ### 1. Single Responsibility
41
-
42
- Each service does ONE thing well.
43
-
44
- ### 2. Own Your Data
45
-
46
- Each service has its own database. No shared databases.
47
-
48
- ### 3. API Contracts
49
-
50
- Services communicate through well-defined APIs. Internal implementation is hidden.
51
-
52
- ### 4. Autonomous Deployment
53
-
54
- Each service can be deployed independently.
55
-
56
- ## Communication Patterns
57
-
58
- ### Synchronous (REST/gRPC)
59
-
60
- - **When**: Request needs immediate response
61
- - **Tools**: REST (HTTP), gRPC (high-performance)
62
- - **Risk**: Cascading failures, latency accumulation
63
-
64
- ### Asynchronous (Events/Messages)
65
-
66
- - **When**: Eventual consistency is acceptable
67
- - **Tools**: Kafka, RabbitMQ, Redis Streams, AWS SQS
68
- - **Benefit**: Loose coupling, resilience
69
-
70
- ### Saga Pattern (Distributed Transactions)
71
-
72
- ```
73
- Order Service → Payment Service → Inventory Service → Shipping Service
74
- ↓ (failure)
75
- Compensating transactions reverse each step
76
- ```
77
-
78
- 1. **Choreography (Event-Driven)**: Each service emits events, downstream services listen and react. Best for simple flows (≤ 3 steps) where a central coordinator adds unnecessary coupling.
79
- 2. **Orchestration (State Machine)**: A dedicated Saga Orchestrator controls the flow and explicitly triggers compensating transactions on failure (e.g., `RefundPayment`, `ReleaseInventoryReservation`). Mandatory for complex multi-step workflows.
80
-
81
- ### Dead Letter Queues (DLQ) & Poison Pill Handling
82
-
83
- - **Never retry infinitely**: Set max retries (e.g. 3) with exponential backoff and jitter.
84
- - After max retries, route failed messages to a **Dead Letter Queue (DLQ)** with error metadata.
85
- - Provide alerting on DLQ depth and an admin CLI/script to replay DLQ messages.
86
-
87
- ## CQRS (Command Query Responsibility Segregation)
88
-
89
- Separate read and write models:
90
-
91
- ```
92
- Command (Write) → Write Model → Event Store → Projections → Read Model → Query (Read)
93
- ```
94
-
95
- **When**: Read patterns differ significantly from write patterns.
96
-
97
- ## Event Sourcing
98
-
99
- Store events, not state:
100
-
101
- ```
102
- UserCreated → EmailUpdated → RoleChanged → PasswordReset
103
- ```
104
-
105
- Current state = replay all events. Full audit trail.
106
-
107
- ## Service Boundaries
108
-
109
- ### Bounded Contexts (from DDD)
110
-
111
- - Identify domain boundaries
112
- - Each service maps to a bounded context
113
- - Shared language within the context, translation at boundaries
114
-
115
- ### Anti-Corruption Layer
116
-
117
- When integrating with legacy or external systems, create an adapter that translates between models.
118
-
119
- ## Operational Concerns
120
-
121
- ### Observability (The Three Pillars)
122
-
123
- 1. **Logs** — structured JSON, correlated by request ID
124
- 2. **Metrics** — latency, error rate, throughput (RED)
125
- 3. **Traces** — distributed tracing across services (Jaeger, Zipkin)
126
-
127
- ### Resilience
128
-
129
- - **Circuit Breaker** — stop calling failing services
130
- - **Retry with Backoff** — exponential backoff + jitter
131
- - **Timeout** — every call has a timeout
132
- - **Bulkhead** — isolate failures
133
-
134
- ### Deployment
135
-
136
- - **Containers** — Docker for consistency
137
- - **Orchestration** — Kubernetes for production
138
- - **CI/CD** — independent pipelines per service
139
- - **Blue-Green / Canary** — safe rollouts
140
-
141
- ## Anti-Patterns
142
-
143
- - [FAIL] Distributed monolith — services that can't deploy independently
144
- - [FAIL] Shared database — defeats the purpose
145
- - [FAIL] Synchronous chains — A calls B calls C calls D
146
- - [FAIL] No versioning — breaking API changes
147
- - [FAIL] Premature microservices — start with a modular monolith
148
-
149
-
150
- ## Code Examples
151
-
152
- See `EXAMPLES.md` for detailed code examples.
153
-
154
- ## Validation Checklist
155
-
156
- What to verify during the review phase before completing the task.
157
-
158
- ## Common Mistakes
159
-
160
- Anti-patterns and things to explicitly avoid. See `TROUBLESHOOTING.md`.
161
-
162
- ## Integration Notes
163
-
164
- How this skill interacts with other skills.
@@ -1,19 +0,0 @@
1
- # microservices Troubleshooting & Common Mistakes
2
-
3
- ## 1. Missing Consumer Idempotency
4
-
5
- - **Symptom**: Users charged twice or duplicate records created when events are re-delivered.
6
- - **Root Cause**: Message brokers guarantee at-least-once delivery; network retries re-send events.
7
- - **Fix**: Store processed message/event IDs in a deduplication table with unique constraint.
8
-
9
- ## 2. Circular Service Dependencies
10
-
11
- - **Symptom**: Service A cannot boot or operate without Service B, and Service B depends on Service A.
12
- - **Root Cause**: Improper domain boundaries and coupled synchronous dependencies.
13
- - **Fix**: Invert dependency using domain events or introduce a composite BFF/Orchestrator.
14
-
15
- ## 3. Distributed Tracing Blindness
16
-
17
- - **Symptom**: Impossible to diagnose which downstream microservice caused a 500 error or latency spike.
18
- - **Root Cause**: HTTP headers and event messages do not propagate correlation IDs.
19
- - **Fix**: Propagate X-Correlation-ID / traceparent across all HTTP requests and event headers.
@@ -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,119 +0,0 @@
1
- # Microservices — Architecture Guide
2
-
3
- ## When to Use Microservices
4
-
5
- **Use when:**
6
-
7
- - Team > 10 engineers working on the same product
8
- - Independent deployment of components is critical
9
- - Different components have different scaling needs
10
- - Different components need different tech stacks
11
-
12
- **Don't use when:**
13
-
14
- - Small team (< 5 engineers)
15
- - MVP or prototype
16
- - No operational expertise (monitoring, tracing, deployment)
17
- - Tight coupling between components
18
-
19
- ## Core Principles
20
-
21
- ### 1. Single Responsibility
22
-
23
- Each service does ONE thing well.
24
-
25
- ### 2. Own Your Data
26
-
27
- Each service has its own database. No shared databases.
28
-
29
- ### 3. API Contracts
30
-
31
- Services communicate through well-defined APIs. Internal implementation is hidden.
32
-
33
- ### 4. Autonomous Deployment
34
-
35
- Each service can be deployed independently.
36
-
37
- ## Communication Patterns
38
-
39
- ### Synchronous (REST/gRPC)
40
-
41
- - **When**: Request needs immediate response
42
- - **Tools**: REST (HTTP), gRPC (high-performance)
43
- - **Risk**: Cascading failures, latency accumulation
44
-
45
- ### Asynchronous (Events/Messages)
46
-
47
- - **When**: Eventual consistency is acceptable
48
- - **Tools**: Kafka, RabbitMQ, Redis Streams, AWS SQS
49
- - **Benefit**: Loose coupling, resilience
50
-
51
- ### Saga Pattern (Distributed Transactions)
52
-
53
- ```
54
- Order Service → Payment Service → Inventory Service → Shipping Service
55
- ↓ (failure)
56
- Compensating transactions reverse each step
57
- ```
58
-
59
- ## CQRS (Command Query Responsibility Segregation)
60
-
61
- Separate read and write models:
62
-
63
- ```
64
- Command (Write) → Write Model → Event Store → Projections → Read Model → Query (Read)
65
- ```
66
-
67
- **When**: Read patterns differ significantly from write patterns.
68
-
69
- ## Event Sourcing
70
-
71
- Store events, not state:
72
-
73
- ```
74
- UserCreated → EmailUpdated → RoleChanged → PasswordReset
75
- ```
76
-
77
- Current state = replay all events. Full audit trail.
78
-
79
- ## Service Boundaries
80
-
81
- ### Bounded Contexts (from DDD)
82
-
83
- - Identify domain boundaries
84
- - Each service maps to a bounded context
85
- - Shared language within the context, translation at boundaries
86
-
87
- ### Anti-Corruption Layer
88
-
89
- When integrating with legacy or external systems, create an adapter that translates between models.
90
-
91
- ## Operational Concerns
92
-
93
- ### Observability (The Three Pillars)
94
-
95
- 1. **Logs** — structured JSON, correlated by request ID
96
- 2. **Metrics** — latency, error rate, throughput (RED)
97
- 3. **Traces** — distributed tracing across services (Jaeger, Zipkin)
98
-
99
- ### Resilience
100
-
101
- - **Circuit Breaker** — stop calling failing services
102
- - **Retry with Backoff** — exponential backoff + jitter
103
- - **Timeout** — every call has a timeout
104
- - **Bulkhead** — isolate failures
105
-
106
- ### Deployment
107
-
108
- - **Containers** — Docker for consistency
109
- - **Orchestration** — Kubernetes for production
110
- - **CI/CD** — independent pipelines per service
111
- - **Blue-Green / Canary** — safe rollouts
112
-
113
- ## Anti-Patterns
114
-
115
- - [FAIL] Distributed monolith — services that can't deploy independently
116
- - [FAIL] Shared database — defeats the purpose
117
- - [FAIL] Synchronous chains — A calls B calls C calls D
118
- - [FAIL] No versioning — breaking API changes
119
- - [FAIL] Premature microservices — start with a modular monolith
@@ -1,10 +0,0 @@
1
- id: microservices
2
- name: Microservices
3
- category: architecture
4
- tags: [architecture, microservices, distributed, event-driven, cqrs]
5
- requires: [system-design]
6
- optional: [docker, security]
7
- conflicts: []
8
- weight: 6
9
- documents:
10
- - microservices.md
@@ -1,113 +0,0 @@
1
- ---
2
- name: minimalist-ui
3
- description: Clean editorial-style interfaces. Warm monochrome palette, typographic contrast, flat bento grids, muted pastels. No gradients, no heavy shadows.
4
- ---
5
-
6
- # Protocol: Premium Utilitarian Minimalism UI Architect
7
-
8
- ## Overview
9
-
10
- An advanced frontend engineering directive for generating highly refined, ultra-minimalist, "document-style" web interfaces analogous to top-tier workspace platforms. This protocol strictly enforces a high-contrast warm monochrome palette, bespoke typographic hierarchies, meticulous structural macro-whitespace, bento-grid layouts, and an ultra-flat component architecture with deliberate muted pastel accents. It actively rejects standard generic SaaS design trends.
11
-
12
- ## When to Use
13
-
14
- - When designing clean, editorial, or Notion-like document interfaces, workspaces, or notes apps.
15
- - When creating minimalist SaaS dashboards, personal essays, portfolios, or agency landing pages.
16
- - When asked for a "clean", "minimalist", "warm monochrome", or "flat bento-box" layout.
17
-
18
- ## Rules & Patterns
19
-
20
- ### 1. Absolute Negative Constraints (Banned Elements)
21
-
22
- The AI must strictly avoid the following generic web development defaults:
23
-
24
- - DO NOT use the "Inter", "Roboto", or "Open Sans" typefaces.
25
- - DO NOT use generic, thin-line icon libraries like "Lucide", "Feather", or standard "Heroicons".
26
- - DO NOT use Tailwind's default heavy drop shadows (e.g., `shadow-md`, `shadow-lg`, `shadow-xl`). Shadows must be practically non-existent or heavily customized to be ultra-diffuse and low opacity (< 0.05).
27
- - DO NOT use primary colored backgrounds for large elements or sections (e.g., no bright blue, green, or red hero sections).
28
- - DO NOT use gradients, neon colors, or 3D glassmorphism (beyond subtle navbar blurs).
29
- - DO NOT use `rounded-full` (pill shapes) for large containers, cards, or primary buttons.
30
- - DO NOT use emojis anywhere in code, markup, text content, headings, or alt text. Replace with proper icons or clean SVG primitives.
31
- - DO NOT use generic placeholder names like "John Doe", "Acme Corp", or "Lorem Ipsum". Use realistic, contextual content.
32
- - DO NOT use AI copywriting clichés: "Elevate", "Seamless", "Unleash", "Next-Gen", "Game-changer", "Delve". Write plain, specific language.
33
-
34
- ### 2. Typographic Architecture
35
-
36
- The interface must rely on extreme typographic contrast and premium font selection to establish an editorial feel.
37
-
38
- - **Primary Sans-Serif (Body, UI, Buttons):** Use clean, geometric, or system-native fonts with character (`'SF Pro Display', 'Geist Sans', 'Helvetica Neue', 'Switzer', sans-serif`).
39
- - **Editorial Serif (Hero Headings & Quotes):** (`'Lyon Text', 'Newsreader', 'Playfair Display', 'Instrument Serif', serif`). Apply tight tracking (`-0.02em` to `-0.04em`) and tight line-height (`1.1`).
40
- - **Monospace (Code, Keystrokes, Meta-data):** (`'Geist Mono', 'SF Mono', 'JetBrains Mono', monospace`).
41
- - **Text Colors:** Body text must never be absolute black (`#000000`). Use off-black/charcoal (`#111111` or `#2F3437`) with a generous line-height of `1.6` for legibility. Secondary text should be muted gray (`#787774`).
42
-
43
- ### 3. Color Palette (Warm Monochrome + Spot Pastels)
44
-
45
- Color is a scarce resource, utilized only for semantic meaning or subtle accents.
46
-
47
- - **Canvas / Background:** Pure White `#FFFFFF` or Warm Bone/Off-White `#F7F6F3` / `#FBFBFA`.
48
- - **Primary Surface (Cards):** `#FFFFFF` or `#F9F9F8`.
49
- - **Structural Borders / Dividers:** Ultra-light gray `#EAEAEA` or `rgba(0,0,0,0.06)`.
50
- - **Accent Colors:** Exclusively use highly desaturated, washed-out pastels for tags, inline code backgrounds, or subtle icon backgrounds:
51
- - Pale Red: `#FDEBEC` (Text: `#9F2F2D`)
52
- - Pale Blue: `#E1F3FE` (Text: `#1F6C9F`)
53
- - Pale Green: `#EDF3EC` (Text: `#346538`)
54
- - Pale Yellow: `#FBF3DB` (Text: `#956400`)
55
-
56
- ### 4. Component Specifications
57
-
58
- - **Bento Box Feature Grids:** Asymmetrical CSS Grid layouts. Cards have `border: 1px solid #EAEAEA`, crisp border-radius (`8px` to `12px` max), and generous internal padding (`24px` to `40px`).
59
- - **Primary Call-To-Action (Buttons):** Solid `#111111`, text `#FFFFFF`, radius `4px` to `6px`, no box-shadow. Micro-scale `transform: scale(0.98)` on active.
60
- - **Tags & Status Badges:** Pill-shaped (`rounded-full`), small typography (`text-xs`), uppercase with wide tracking (`0.05em`), pastel background.
61
- - **Accordions (FAQ):** Separated by `border-bottom: 1px solid #EAEAEA` without card boxes. Crisp `+` / `-` toggle icons.
62
- - **Keystroke Micro-UIs:** `<kbd className="border border-[#EAEAEA] rounded bg-[#F7F6F3] font-mono px-1.5 py-0.5 text-xs">`.
63
-
64
- ### 5. Iconography & Imagery
65
-
66
- - **System Icons:** Phosphor Icons (Bold/Fill) or Radix UI Icons for crisp, technical strokes.
67
- - **Photography:** Desaturated images with warm tint and subtle grain overlay (`opacity: 0.04`).
68
- - **Depth:** Subtle ambient gradients (`radial-gradient` with warm tones at `opacity: 0.03`) or minimal geometric line patterns.
69
-
70
- ### 6. Subtle Motion & Micro-Animations
71
-
72
- - **Scroll Entry:** Fade-in + `translateY(12px)` over 600ms via `IntersectionObserver`.
73
- - **Hover States:** Subtle card lift with ultra-diffuse shadow (`0 2px 8px rgba(0,0,0,0.04)`).
74
- - **Staggered Reveals:** Cascading delay (`calc(var(--index) * 80ms)`).
75
-
76
- ## Code Examples
77
-
78
- ```tsx
79
- export function BentoFeatureCard({ title, description, badge, tagColor = "blue" }: { title: string; description: string; badge: string; tagColor?: string }) {
80
- return (
81
- <div className="bg-[#FFFFFF] border border-[#EAEAEA] rounded-xl p-8 hover:shadow-[0_2px_8px_rgba(0,0,0,0.04)] transition-all duration-200">
82
- <div className="flex items-center justify-between mb-4">
83
- <span className="text-xs uppercase tracking-wider font-mono font-medium px-2.5 py-0.5 rounded-full bg-[#E1F3FE] text-[#1F6C9F]">
84
- {badge}
85
- </span>
86
- </div>
87
- <h3 className="font-serif text-2xl tracking-tight text-[#111111] mb-2">{title}</h3>
88
- <p className="text-sm text-[#787774] leading-relaxed">{description}</p>
89
- </div>
90
- );
91
- }
92
- ```
93
-
94
- ## Validation Checklist
95
-
96
- - [ ] Macro-whitespace established with generous vertical section padding (`py-24` to `py-32`).
97
- - [ ] No pure black (`#000000`) for text or backgrounds.
98
- - [ ] Borders use crisp `1px solid #EAEAEA` or `rgba(0,0,0,0.06)`.
99
- - [ ] No generic AI buzzwords or emojis used in copy.
100
- - [ ] Typography uses editorial serif headers paired with clean sans-serif body.
101
- - [ ] Card corners constrained to crisp 8px-12px radius; no pill containers.
102
-
103
- ## Common Mistakes
104
-
105
- - Using heavy saturated primary colors for hero backgrounds.
106
- - Adding default Tailwind drop-shadows (`shadow-lg`).
107
- - Cluttering interfaces with emojis instead of clean SVG icons.
108
- - Using default Inter or Roboto fonts without editorial contrast.
109
-
110
- ## Integration Notes
111
-
112
- - Complements `ui-ux-pro` for color tokens and accessibility.
113
- - Integrates with `impeccable-design` for QA and anti-pattern enforcement.
@@ -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,8 +0,0 @@
1
- name: minimalist-design
2
- description: Clean editorial-style interfaces with warm monochrome palettes and flat bento grids.
3
- tags:
4
- - ui
5
- - design
6
- - minimalist
7
- - editorial
8
- version: 1.0.0
@@ -1,40 +0,0 @@
1
- # nestjs Examples — Anti-patterns vs ContextOS Standard
2
-
3
- ## Example 1: Input Validation and DTOs
4
-
5
- ### Anti-pattern: Untyped Body or Manual Validation in Controller
6
-
7
- ```typescript
8
- // BAD: No runtime validation, controller stuffed with business rules
9
- @Post('users')
10
- async create(@Body() body: any) {
11
- if (!body.email || !body.email.includes('@')) {
12
- throw new BadRequestException('Invalid email');
13
- }
14
- return this.usersService.create(body);
15
- }
16
- ```
17
-
18
- ### Best practice: ContextOS Standard (Class-Validator DTO + ValidationPipe)
19
-
20
- ```typescript
21
- // GOOD: Declarative runtime validation with clean separation
22
- export class CreateUserDto {
23
- @IsEmail({}, { message: 'A valid email is required' })
24
- email: string;
25
-
26
- @IsString()
27
- @MinLength(8, { message: 'Password must be at least 8 characters long' })
28
- password: string;
29
- }
30
-
31
- @Controller('users')
32
- export class UsersController {
33
- constructor(private readonly usersService: UsersService) {}
34
-
35
- @Post()
36
- async create(@Body() dto: CreateUserDto) {
37
- return this.usersService.create(dto);
38
- }
39
- }
40
- ```
@@ -1,139 +0,0 @@
1
- ---
2
- name: NestJS
3
- description: >
4
- ContextOS skill for NestJS
5
- ---
6
-
7
- # NestJS
8
-
9
- ## Overview
10
-
11
- Enterprise Node.js architecture standard using NestJS, TypeScript, and RxJS. Enforces strict modularity, dependency injection, repository pattern, DTO validation via class-validator, and clean layered architecture.
12
-
13
- ## When to Use
14
-
15
- Activate when building enterprise Node.js microservices, complex REST/GraphQL APIs, or scalable backends requiring strict architectural structure.
16
-
17
- ## Rules & Patterns
18
- <!-- Source: nestjs.md -->
19
-
20
- ## NestJS — Best Practices
21
-
22
- ## Module Architecture
23
-
24
- - **One module per domain** — `UsersModule`, `AuthModule`, `OrdersModule`
25
- - **Feature modules** — encapsulate related controllers, services, repositories
26
- - **Shared module** — for cross-cutting concerns (logging, config, utils)
27
- - **Core module** — singleton services (database, auth guards)
28
-
29
- ```
30
- src/
31
- ├── modules/
32
- │ ├── users/
33
- │ │ ├── users.module.ts
34
- │ │ ├── users.controller.ts
35
- │ │ ├── users.service.ts
36
- │ │ ├── users.repository.ts
37
- │ │ ├── dto/
38
- │ │ │ ├── create-user.dto.ts
39
- │ │ │ └── update-user.dto.ts
40
- │ │ ├── entities/
41
- │ │ │ └── user.entity.ts
42
- │ │ └── users.spec.ts
43
- │ └── auth/
44
- ├── shared/
45
- │ ├── guards/
46
- │ ├── interceptors/
47
- │ ├── pipes/
48
- │ └── filters/
49
- ├── config/
50
- └── app.module.ts
51
- ```
52
-
53
- ## Dependency Injection
54
-
55
- ```typescript
56
- @Injectable()
57
- export class UsersService {
58
- constructor(
59
- @InjectRepository(User) private readonly usersRepo: Repository<User>,
60
- private readonly configService: ConfigService,
61
- ) {}
62
- }
63
- ```
64
-
65
- - Prefer constructor injection
66
- - Use custom providers for complex setup
67
- - Scope: default is Singleton, use REQUEST scope only when needed
68
-
69
- ## DTOs and Validation
70
-
71
- ```typescript
72
- import { IsEmail, IsString, MinLength } from 'class-validator';
73
-
74
- export class CreateUserDto {
75
- @IsEmail()
76
- email: string;
77
-
78
- @IsString()
79
- @MinLength(2)
80
- name: string;
81
- }
82
- ```
83
-
84
- - Always use DTOs for request validation
85
- - Use `ValidationPipe` globally
86
- - Separate Create/Update/Response DTOs
87
-
88
- ## Guards, Interceptors, Pipes
89
-
90
- | Type | Purpose |
91
- | --- | --- |
92
- | **Guards** | Authentication, authorization |
93
- | **Interceptors** | Logging, transformation, caching |
94
- | **Pipes** | Validation, transformation |
95
- | **Filters** | Exception handling |
96
-
97
- Execution order: Guards → Interceptors → Pipes → Handler → Interceptors → Filters
98
-
99
- ## Error Handling
100
-
101
- ```typescript
102
- @Catch()
103
- export class AllExceptionsFilter implements ExceptionFilter {
104
- catch(exception: unknown, host: ArgumentsHost) {
105
- // Transform to standard error format
106
- }
107
- }
108
- ```
109
-
110
- ## Testing
111
-
112
- - **Unit tests** — mock dependencies with `Test.createTestingModule()`
113
- - **E2E tests** — use `supertest` with a test module
114
- - **Mock everything** — services should be testable in isolation
115
-
116
- ## Anti-Patterns
117
-
118
- - [FAIL] Business logic in controllers — use services
119
- - [FAIL] Direct database access in controllers — use repositories
120
- - [FAIL] Circular dependencies — refactor module structure
121
- - [FAIL] God modules — split large modules by domain
122
- - [FAIL] Not using DTOs — always validate input
123
-
124
-
125
- ## Code Examples
126
-
127
- See `EXAMPLES.md` for detailed code examples.
128
-
129
- ## Validation Checklist
130
-
131
- What to verify during the review phase before completing the task.
132
-
133
- ## Common Mistakes
134
-
135
- Anti-patterns and things to explicitly avoid. See `TROUBLESHOOTING.md`.
136
-
137
- ## Integration Notes
138
-
139
- How this skill interacts with other skills.
@@ -1,19 +0,0 @@
1
- # nestjs Troubleshooting & Common Mistakes
2
-
3
- ## 1. Circular Dependency Between Modules
4
-
5
- - **Symptom**: "Nest cannot create the module instance. Often, this is caused by circular dependencies".
6
- - **Root Cause**: Module A imports Module B, and Module B imports Module A.
7
- - **Fix**: Use `forwardRef(() => ModuleB)` in imports and `@Inject(forwardRef(() => ServiceB))` in constructors, or refactor shared logic into a separate CommonModule.
8
-
9
- ## 2. Memory Leaks from REQUEST Scope
10
-
11
- - **Symptom**: High memory usage and slow performance under load.
12
- - **Root Cause**: Providers declared with Scope.REQUEST recreate instances on every HTTP request.
13
- - **Fix**: Keep services as default Singletons whenever possible. Pass request-scoped parameters directly through method arguments.
14
-
15
- ## 3. Uncaught Domain Exceptions
16
-
17
- - **Symptom**: Custom domain exceptions bypass formatting and return generic 500 errors.
18
- - **Root Cause**: Missing custom Global Exception Filter.
19
- - **Fix**: Implement an AllExceptionsFilter implementing ExceptionFilter and bind it globally in main.ts.
@@ -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
- }