contextos-agents 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (310) hide show
  1. package/.agents/AGENTS.md +421 -0
  2. package/.agents/adapters/aider/export.js +137 -0
  3. package/.agents/adapters/claude/export.js +55 -0
  4. package/.agents/adapters/copilot/export.js +107 -0
  5. package/.agents/adapters/cursor/export.js +210 -0
  6. package/.agents/adapters/gemini/export.js +115 -0
  7. package/.agents/adapters/shared.js +119 -0
  8. package/.agents/adapters/zed/export.js +111 -0
  9. package/.agents/core/profiles/backend.yaml +47 -0
  10. package/.agents/core/profiles/enterprise.yaml +46 -0
  11. package/.agents/core/profiles/frontend.yaml +46 -0
  12. package/.agents/core/profiles/hackathon.yaml +45 -0
  13. package/.agents/core/profiles/mvp.yaml +43 -0
  14. package/.agents/core/profiles/startup.yaml +48 -0
  15. package/.agents/core/skills/adapters/EXAMPLES.md +19 -0
  16. package/.agents/core/skills/adapters/SKILL.md +105 -0
  17. package/.agents/core/skills/adapters/TROUBLESHOOTING.md +7 -0
  18. package/.agents/core/skills/adapters/VALIDATION.json +12 -0
  19. package/.agents/core/skills/adapters/skill.yaml +10 -0
  20. package/.agents/core/skills/architecture-diagrams/SKILL.md +108 -0
  21. package/.agents/core/skills/architecture-diagrams/VALIDATION.json +12 -0
  22. package/.agents/core/skills/architecture-diagrams/skill.yaml +8 -0
  23. package/.agents/core/skills/brutalist-design/SKILL.md +150 -0
  24. package/.agents/core/skills/brutalist-design/VALIDATION.json +12 -0
  25. package/.agents/core/skills/brutalist-design/skill.yaml +8 -0
  26. package/.agents/core/skills/context-manager/EXAMPLES.md +19 -0
  27. package/.agents/core/skills/context-manager/SKILL.md +126 -0
  28. package/.agents/core/skills/context-manager/TROUBLESHOOTING.md +7 -0
  29. package/.agents/core/skills/context-manager/VALIDATION.json +12 -0
  30. package/.agents/core/skills/context-manager/skill.yaml +10 -0
  31. package/.agents/core/skills/context-os/EXAMPLES.md +21 -0
  32. package/.agents/core/skills/context-os/SKILL.md +169 -0
  33. package/.agents/core/skills/context-os/TROUBLESHOOTING.md +7 -0
  34. package/.agents/core/skills/context-os/VALIDATION.json +12 -0
  35. package/.agents/core/skills/context-os/packs.yaml +59 -0
  36. package/.agents/core/skills/context-os/references/context-rules.md +68 -0
  37. package/.agents/core/skills/context-os/references/pipeline.md +119 -0
  38. package/.agents/core/skills/context-os/references/project-graph.md +103 -0
  39. package/.agents/core/skills/context-os/rules.yaml +135 -0
  40. package/.agents/core/skills/context-os/skill.yaml +10 -0
  41. package/.agents/core/skills/database/EXAMPLES.md +74 -0
  42. package/.agents/core/skills/database/SKILL.md +101 -0
  43. package/.agents/core/skills/database/TROUBLESHOOTING.md +18 -0
  44. package/.agents/core/skills/database/VALIDATION.json +11 -0
  45. package/.agents/core/skills/database/skill.yaml +25 -0
  46. package/.agents/core/skills/ddd/EXAMPLES.md +42 -0
  47. package/.agents/core/skills/ddd/SKILL.md +247 -0
  48. package/.agents/core/skills/ddd/TROUBLESHOOTING.md +19 -0
  49. package/.agents/core/skills/ddd/VALIDATION.json +12 -0
  50. package/.agents/core/skills/ddd/ddd.md +178 -0
  51. package/.agents/core/skills/ddd/skill.yaml +10 -0
  52. package/.agents/core/skills/decisions/EXAMPLES.md +35 -0
  53. package/.agents/core/skills/decisions/SKILL.md +90 -0
  54. package/.agents/core/skills/decisions/TROUBLESHOOTING.md +13 -0
  55. package/.agents/core/skills/decisions/VALIDATION.json +12 -0
  56. package/.agents/core/skills/decisions/skill.yaml +10 -0
  57. package/.agents/core/skills/docker/EXAMPLES.md +56 -0
  58. package/.agents/core/skills/docker/SKILL.md +63 -0
  59. package/.agents/core/skills/docker/TROUBLESHOOTING.md +18 -0
  60. package/.agents/core/skills/docker/VALIDATION.json +11 -0
  61. package/.agents/core/skills/docker/skill.yaml +23 -0
  62. package/.agents/core/skills/engineering-workflow/EXAMPLES.md +57 -0
  63. package/.agents/core/skills/engineering-workflow/SKILL.md +343 -0
  64. package/.agents/core/skills/engineering-workflow/TROUBLESHOOTING.md +19 -0
  65. package/.agents/core/skills/engineering-workflow/VALIDATION.json +12 -0
  66. package/.agents/core/skills/engineering-workflow/skill.yaml +13 -0
  67. package/.agents/core/skills/fastapi/EXAMPLES.md +36 -0
  68. package/.agents/core/skills/fastapi/SKILL.md +148 -0
  69. package/.agents/core/skills/fastapi/TROUBLESHOOTING.md +19 -0
  70. package/.agents/core/skills/fastapi/VALIDATION.json +12 -0
  71. package/.agents/core/skills/fastapi/fastapi.md +112 -0
  72. package/.agents/core/skills/fastapi/skill.yaml +10 -0
  73. package/.agents/core/skills/gemini-precision/SKILL.md +169 -0
  74. package/.agents/core/skills/gemini-precision/VALIDATION.json +12 -0
  75. package/.agents/core/skills/gemini-precision/skill.yaml +9 -0
  76. package/.agents/core/skills/generators/EXAMPLES.md +19 -0
  77. package/.agents/core/skills/generators/SKILL.md +112 -0
  78. package/.agents/core/skills/generators/TROUBLESHOOTING.md +7 -0
  79. package/.agents/core/skills/generators/VALIDATION.json +12 -0
  80. package/.agents/core/skills/generators/skill.yaml +10 -0
  81. package/.agents/core/skills/generators/templates/API.md +77 -0
  82. package/.agents/core/skills/generators/templates/ARCHITECTURE.md +70 -0
  83. package/.agents/core/skills/generators/templates/DATABASE.md +42 -0
  84. package/.agents/core/skills/generators/templates/DECISION.md +46 -0
  85. package/.agents/core/skills/generators/templates/PRD.md +67 -0
  86. package/.agents/core/skills/generators/templates/PROJECT_GRAPH.md +56 -0
  87. package/.agents/core/skills/generators/templates/ROADMAP.md +51 -0
  88. package/.agents/core/skills/generators/templates/TASKS.md +43 -0
  89. package/.agents/core/skills/generators/templates/UI.md +73 -0
  90. package/.agents/core/skills/graphify/EXAMPLES.md +73 -0
  91. package/.agents/core/skills/graphify/SKILL.md +130 -0
  92. package/.agents/core/skills/graphify/VALIDATION.json +12 -0
  93. package/.agents/core/skills/graphify/skill.yaml +13 -0
  94. package/.agents/core/skills/gstack-roles/EXAMPLES.md +23 -0
  95. package/.agents/core/skills/gstack-roles/SKILL.md +152 -0
  96. package/.agents/core/skills/gstack-roles/TROUBLESHOOTING.md +13 -0
  97. package/.agents/core/skills/gstack-roles/VALIDATION.json +12 -0
  98. package/.agents/core/skills/gstack-roles/skill.yaml +12 -0
  99. package/.agents/core/skills/impeccable-design/EXAMPLES.md +26 -0
  100. package/.agents/core/skills/impeccable-design/SKILL.md +201 -0
  101. package/.agents/core/skills/impeccable-design/TROUBLESHOOTING.md +19 -0
  102. package/.agents/core/skills/impeccable-design/VALIDATION.json +12 -0
  103. package/.agents/core/skills/impeccable-design/skill.yaml +14 -0
  104. package/.agents/core/skills/interview-me/SKILL.md +97 -0
  105. package/.agents/core/skills/interview-me/VALIDATION.json +12 -0
  106. package/.agents/core/skills/interview-me/skill.yaml +8 -0
  107. package/.agents/core/skills/microservices/EXAMPLES.md +38 -0
  108. package/.agents/core/skills/microservices/SKILL.md +164 -0
  109. package/.agents/core/skills/microservices/TROUBLESHOOTING.md +19 -0
  110. package/.agents/core/skills/microservices/VALIDATION.json +12 -0
  111. package/.agents/core/skills/microservices/microservices.md +119 -0
  112. package/.agents/core/skills/microservices/skill.yaml +10 -0
  113. package/.agents/core/skills/minimalist-design/SKILL.md +113 -0
  114. package/.agents/core/skills/minimalist-design/VALIDATION.json +12 -0
  115. package/.agents/core/skills/minimalist-design/skill.yaml +8 -0
  116. package/.agents/core/skills/nestjs/EXAMPLES.md +40 -0
  117. package/.agents/core/skills/nestjs/SKILL.md +139 -0
  118. package/.agents/core/skills/nestjs/TROUBLESHOOTING.md +19 -0
  119. package/.agents/core/skills/nestjs/VALIDATION.json +12 -0
  120. package/.agents/core/skills/nestjs/nestjs.md +103 -0
  121. package/.agents/core/skills/nestjs/skill.yaml +10 -0
  122. package/.agents/core/skills/nextjs/EXAMPLES.md +40 -0
  123. package/.agents/core/skills/nextjs/SKILL.md +163 -0
  124. package/.agents/core/skills/nextjs/TROUBLESHOOTING.md +19 -0
  125. package/.agents/core/skills/nextjs/VALIDATION.json +12 -0
  126. package/.agents/core/skills/nextjs/nextjs.md +67 -0
  127. package/.agents/core/skills/nextjs/skill.yaml +10 -0
  128. package/.agents/core/skills/node/EXAMPLES.md +80 -0
  129. package/.agents/core/skills/node/SKILL.md +128 -0
  130. package/.agents/core/skills/node/TROUBLESHOOTING.md +19 -0
  131. package/.agents/core/skills/node/VALIDATION.json +12 -0
  132. package/.agents/core/skills/node/node.md +87 -0
  133. package/.agents/core/skills/node/skill.yaml +10 -0
  134. package/.agents/core/skills/performance/EXAMPLES.md +30 -0
  135. package/.agents/core/skills/performance/SKILL.md +75 -0
  136. package/.agents/core/skills/performance/TROUBLESHOOTING.md +19 -0
  137. package/.agents/core/skills/performance/VALIDATION.json +12 -0
  138. package/.agents/core/skills/performance/performance.md +52 -0
  139. package/.agents/core/skills/performance/skill.yaml +10 -0
  140. package/.agents/core/skills/ponytail-mindset/EXAMPLES.md +45 -0
  141. package/.agents/core/skills/ponytail-mindset/SKILL.md +193 -0
  142. package/.agents/core/skills/ponytail-mindset/TROUBLESHOOTING.md +19 -0
  143. package/.agents/core/skills/ponytail-mindset/VALIDATION.json +12 -0
  144. package/.agents/core/skills/ponytail-mindset/skill.yaml +14 -0
  145. package/.agents/core/skills/react/EXAMPLES.md +79 -0
  146. package/.agents/core/skills/react/SKILL.md +132 -0
  147. package/.agents/core/skills/react/TROUBLESHOOTING.md +19 -0
  148. package/.agents/core/skills/react/VALIDATION.json +12 -0
  149. package/.agents/core/skills/react/react.md +93 -0
  150. package/.agents/core/skills/react/skill.yaml +10 -0
  151. package/.agents/core/skills/react-best-practices/SKILL.md +155 -0
  152. package/.agents/core/skills/react-best-practices/VALIDATION.json +12 -0
  153. package/.agents/core/skills/react-best-practices/skill.yaml +10 -0
  154. package/.agents/core/skills/redesign-audit/SKILL.md +117 -0
  155. package/.agents/core/skills/redesign-audit/VALIDATION.json +12 -0
  156. package/.agents/core/skills/redesign-audit/skill.yaml +8 -0
  157. package/.agents/core/skills/security/EXAMPLES.md +64 -0
  158. package/.agents/core/skills/security/SKILL.md +158 -0
  159. package/.agents/core/skills/security/TROUBLESHOOTING.md +19 -0
  160. package/.agents/core/skills/security/VALIDATION.json +12 -0
  161. package/.agents/core/skills/security/security.md +106 -0
  162. package/.agents/core/skills/security/skill.yaml +10 -0
  163. package/.agents/core/skills/soft-design/SKILL.md +108 -0
  164. package/.agents/core/skills/soft-design/VALIDATION.json +12 -0
  165. package/.agents/core/skills/soft-design/skill.yaml +8 -0
  166. package/.agents/core/skills/state-management/EXAMPLES.md +56 -0
  167. package/.agents/core/skills/state-management/SKILL.md +48 -0
  168. package/.agents/core/skills/state-management/TROUBLESHOOTING.md +18 -0
  169. package/.agents/core/skills/state-management/VALIDATION.json +11 -0
  170. package/.agents/core/skills/state-management/skill.yaml +22 -0
  171. package/.agents/core/skills/subagent-orchestrator/SKILL.md +100 -0
  172. package/.agents/core/skills/subagent-orchestrator/VALIDATION.json +12 -0
  173. package/.agents/core/skills/subagent-orchestrator/skill.yaml +8 -0
  174. package/.agents/core/skills/system-design/EXAMPLES.md +75 -0
  175. package/.agents/core/skills/system-design/SKILL.md +419 -0
  176. package/.agents/core/skills/system-design/TROUBLESHOOTING.md +19 -0
  177. package/.agents/core/skills/system-design/VALIDATION.json +12 -0
  178. package/.agents/core/skills/system-design/skill.yaml +13 -0
  179. package/.agents/core/skills/system-design/system-design.md +112 -0
  180. package/.agents/core/skills/testing/EXAMPLES.md +71 -0
  181. package/.agents/core/skills/testing/SKILL.md +70 -0
  182. package/.agents/core/skills/testing/TROUBLESHOOTING.md +18 -0
  183. package/.agents/core/skills/testing/VALIDATION.json +11 -0
  184. package/.agents/core/skills/testing/skill.yaml +26 -0
  185. package/.agents/core/skills/typescript/EXAMPLES.md +64 -0
  186. package/.agents/core/skills/typescript/SKILL.md +112 -0
  187. package/.agents/core/skills/typescript/TROUBLESHOOTING.md +19 -0
  188. package/.agents/core/skills/typescript/VALIDATION.json +12 -0
  189. package/.agents/core/skills/typescript/skill.yaml +10 -0
  190. package/.agents/core/skills/typescript/typescript.md +71 -0
  191. package/.agents/core/skills/ui-design/EXAMPLES.md +21 -0
  192. package/.agents/core/skills/ui-design/SKILL.md +124 -0
  193. package/.agents/core/skills/ui-design/TROUBLESHOOTING.md +19 -0
  194. package/.agents/core/skills/ui-design/VALIDATION.json +12 -0
  195. package/.agents/core/skills/ui-design/skill.yaml +10 -0
  196. package/.agents/core/skills/ui-design/ui.md +88 -0
  197. package/.agents/core/skills/ui-ux-pro/EXAMPLES.md +62 -0
  198. package/.agents/core/skills/ui-ux-pro/SKILL.md +375 -0
  199. package/.agents/core/skills/ui-ux-pro/TROUBLESHOOTING.md +19 -0
  200. package/.agents/core/skills/ui-ux-pro/VALIDATION.json +12 -0
  201. package/.agents/core/skills/ui-ux-pro/skill.yaml +13 -0
  202. package/.agents/core/skills/ux-design/EXAMPLES.md +36 -0
  203. package/.agents/core/skills/ux-design/SKILL.md +116 -0
  204. package/.agents/core/skills/ux-design/TROUBLESHOOTING.md +19 -0
  205. package/.agents/core/skills/ux-design/VALIDATION.json +12 -0
  206. package/.agents/core/skills/ux-design/skill.yaml +10 -0
  207. package/.agents/core/skills/ux-design/ux.md +80 -0
  208. package/.agents/core/skills/vercel-optimize/SKILL.md +83 -0
  209. package/.agents/core/skills/vercel-optimize/VALIDATION.json +12 -0
  210. package/.agents/core/skills/vercel-optimize/skill.yaml +10 -0
  211. package/.agents/core/skills/web-accessibility/EXAMPLES.md +39 -0
  212. package/.agents/core/skills/web-accessibility/SKILL.md +170 -0
  213. package/.agents/core/skills/web-accessibility/TROUBLESHOOTING.md +19 -0
  214. package/.agents/core/skills/web-accessibility/VALIDATION.json +12 -0
  215. package/.agents/core/skills/web-accessibility/accessibility.md +63 -0
  216. package/.agents/core/skills/web-accessibility/skill.yaml +10 -0
  217. package/.agents/ctx.js +370 -0
  218. package/.agents/generated/claude/skills/adapters/SKILL.md +126 -0
  219. package/.agents/generated/claude/skills/architecture-diagrams/SKILL.md +101 -0
  220. package/.agents/generated/claude/skills/brutalist-design/SKILL.md +145 -0
  221. package/.agents/generated/claude/skills/context-manager/SKILL.md +147 -0
  222. package/.agents/generated/claude/skills/context-os/SKILL.md +191 -0
  223. package/.agents/generated/claude/skills/database/SKILL.md +191 -0
  224. package/.agents/generated/claude/skills/ddd/SKILL.md +305 -0
  225. package/.agents/generated/claude/skills/decisions/SKILL.md +134 -0
  226. package/.agents/generated/claude/skills/docker/SKILL.md +135 -0
  227. package/.agents/generated/claude/skills/engineering-workflow/SKILL.md +414 -0
  228. package/.agents/generated/claude/skills/fastapi/SKILL.md +200 -0
  229. package/.agents/generated/claude/skills/gemini-precision/SKILL.md +161 -0
  230. package/.agents/generated/claude/skills/generators/SKILL.md +133 -0
  231. package/.agents/generated/claude/skills/graphify/SKILL.md +198 -0
  232. package/.agents/generated/claude/skills/gstack-roles/SKILL.md +184 -0
  233. package/.agents/generated/claude/skills/impeccable-design/SKILL.md +241 -0
  234. package/.agents/generated/claude/skills/interview-me/SKILL.md +90 -0
  235. package/.agents/generated/claude/skills/microservices/SKILL.md +218 -0
  236. package/.agents/generated/claude/skills/minimalist-design/SKILL.md +108 -0
  237. package/.agents/generated/claude/skills/nestjs/SKILL.md +195 -0
  238. package/.agents/generated/claude/skills/nextjs/SKILL.md +219 -0
  239. package/.agents/generated/claude/skills/node/SKILL.md +224 -0
  240. package/.agents/generated/claude/skills/performance/SKILL.md +121 -0
  241. package/.agents/generated/claude/skills/ponytail-mindset/SKILL.md +252 -0
  242. package/.agents/generated/claude/skills/react/SKILL.md +227 -0
  243. package/.agents/generated/claude/skills/react-best-practices/SKILL.md +146 -0
  244. package/.agents/generated/claude/skills/redesign-audit/SKILL.md +112 -0
  245. package/.agents/generated/claude/skills/security/SKILL.md +237 -0
  246. package/.agents/generated/claude/skills/soft-design/SKILL.md +103 -0
  247. package/.agents/generated/claude/skills/state-management/SKILL.md +120 -0
  248. package/.agents/generated/claude/skills/subagent-orchestrator/SKILL.md +93 -0
  249. package/.agents/generated/claude/skills/system-design/SKILL.md +507 -0
  250. package/.agents/generated/claude/skills/testing/SKILL.md +157 -0
  251. package/.agents/generated/claude/skills/typescript/SKILL.md +192 -0
  252. package/.agents/generated/claude/skills/ui-design/SKILL.md +161 -0
  253. package/.agents/generated/claude/skills/ui-ux-pro/SKILL.md +451 -0
  254. package/.agents/generated/claude/skills/ux-design/SKILL.md +168 -0
  255. package/.agents/generated/claude/skills/vercel-optimize/SKILL.md +76 -0
  256. package/.agents/generated/claude/skills/web-accessibility/SKILL.md +225 -0
  257. package/.agents/generated/gemini/skills/adapters/SKILL.md +135 -0
  258. package/.agents/generated/gemini/skills/architecture-diagrams/SKILL.md +107 -0
  259. package/.agents/generated/gemini/skills/brutalist-design/SKILL.md +151 -0
  260. package/.agents/generated/gemini/skills/context-manager/SKILL.md +156 -0
  261. package/.agents/generated/gemini/skills/context-os/SKILL.md +200 -0
  262. package/.agents/generated/gemini/skills/database/SKILL.md +200 -0
  263. package/.agents/generated/gemini/skills/ddd/SKILL.md +314 -0
  264. package/.agents/generated/gemini/skills/decisions/SKILL.md +143 -0
  265. package/.agents/generated/gemini/skills/docker/SKILL.md +144 -0
  266. package/.agents/generated/gemini/skills/engineering-workflow/SKILL.md +423 -0
  267. package/.agents/generated/gemini/skills/fastapi/SKILL.md +209 -0
  268. package/.agents/generated/gemini/skills/gemini-precision/SKILL.md +167 -0
  269. package/.agents/generated/gemini/skills/generators/SKILL.md +142 -0
  270. package/.agents/generated/gemini/skills/graphify/SKILL.md +205 -0
  271. package/.agents/generated/gemini/skills/gstack-roles/SKILL.md +193 -0
  272. package/.agents/generated/gemini/skills/impeccable-design/SKILL.md +250 -0
  273. package/.agents/generated/gemini/skills/interview-me/SKILL.md +96 -0
  274. package/.agents/generated/gemini/skills/microservices/SKILL.md +227 -0
  275. package/.agents/generated/gemini/skills/minimalist-design/SKILL.md +114 -0
  276. package/.agents/generated/gemini/skills/nestjs/SKILL.md +204 -0
  277. package/.agents/generated/gemini/skills/nextjs/SKILL.md +298 -0
  278. package/.agents/generated/gemini/skills/node/SKILL.md +323 -0
  279. package/.agents/generated/gemini/skills/performance/SKILL.md +185 -0
  280. package/.agents/generated/gemini/skills/ponytail-mindset/SKILL.md +261 -0
  281. package/.agents/generated/gemini/skills/react/SKILL.md +332 -0
  282. package/.agents/generated/gemini/skills/react-best-practices/SKILL.md +152 -0
  283. package/.agents/generated/gemini/skills/redesign-audit/SKILL.md +118 -0
  284. package/.agents/generated/gemini/skills/security/SKILL.md +355 -0
  285. package/.agents/generated/gemini/skills/soft-design/SKILL.md +109 -0
  286. package/.agents/generated/gemini/skills/state-management/SKILL.md +129 -0
  287. package/.agents/generated/gemini/skills/subagent-orchestrator/SKILL.md +99 -0
  288. package/.agents/generated/gemini/skills/system-design/SKILL.md +631 -0
  289. package/.agents/generated/gemini/skills/testing/SKILL.md +166 -0
  290. package/.agents/generated/gemini/skills/typescript/SKILL.md +275 -0
  291. package/.agents/generated/gemini/skills/ui-design/SKILL.md +170 -0
  292. package/.agents/generated/gemini/skills/ui-ux-pro/SKILL.md +460 -0
  293. package/.agents/generated/gemini/skills/ux-design/SKILL.md +177 -0
  294. package/.agents/generated/gemini/skills/vercel-optimize/SKILL.md +82 -0
  295. package/.agents/generated/gemini/skills/web-accessibility/SKILL.md +300 -0
  296. package/.agents/mcp/runtime.py +454 -0
  297. package/.agents/mcp/server.mjs +189373 -0
  298. package/.agents/plugins.js +574 -0
  299. package/.agents/profiles.js +267 -0
  300. package/.agents/resolver.js +336 -0
  301. package/.agents/skills-index.json +200 -0
  302. package/.agents/skills.json +6 -0
  303. package/.agents/validate.js +500 -0
  304. package/LICENSE +21 -0
  305. package/README.md +415 -0
  306. package/benchmarks/gemini-issues.js +533 -0
  307. package/bin/index.js +458 -0
  308. package/package.json +70 -0
  309. package/registry.json +53 -0
  310. package/registry.schema.json +32 -0
@@ -0,0 +1,305 @@
1
+ # Domain-Driven Design
2
+
3
+ ## Overview
4
+
5
+ Domain-Driven Design standard for robust business software. Enforces separation between domain logic (Entities, Value Objects, Aggregates, Domain Events) and infrastructure frameworks, preventing leaky abstractions.
6
+
7
+ ## When to Use
8
+
9
+ Activate when designing core business domain models, transactional consistency boundaries, enterprise APIs, or complex aggregate hierarchies.
10
+
11
+ ## Rules & Patterns
12
+ <!-- Source: ddd.md -->
13
+
14
+ ## Domain-Driven Design — Patterns & Practices
15
+
16
+ ## When to Use DDD
17
+
18
+ **Use when:**
19
+
20
+ - Complex business logic that goes beyond CRUD
21
+ - Multiple domain experts with different vocabularies
22
+ - The domain model is the competitive advantage
23
+ - Enterprise-grade applications
24
+
25
+ **Don't use when:**
26
+
27
+ - Simple CRUD applications
28
+ - Hackathon/MVP (overkill)
29
+ - No domain expert available
30
+
31
+ ## Strategic Design
32
+
33
+ ### Bounded Contexts
34
+
35
+ The single most important DDD concept. A Bounded Context is a boundary within which a particular model is defined and applicable.
36
+
37
+ **Example — E-Commerce:**
38
+
39
+ ```
40
+ [Order Context] [Payment Context] [Shipping Context]
41
+ - Order - Payment - Shipment
42
+ - OrderItem - Transaction - TrackingNumber
43
+ - Customer (ref) - Refund - Address
44
+ - Address (value) - Invoice - Carrier
45
+ ```
46
+
47
+ `Customer` means different things in each context:
48
+
49
+ - Order Context: name, email, shipping preference
50
+ - Payment Context: billing info, payment methods
51
+ - Support Context: ticket history, satisfaction score
52
+
53
+ ### Context Map
54
+
55
+ ```
56
+ [Order] ←→ [Payment] # Partnership
57
+ [Order] → [Shipping] # Customer-Supplier
58
+ [Order] → [Legacy CRM] # Anti-Corruption Layer
59
+ ```
60
+
61
+ ## Tactical Design
62
+
63
+ ### Entities
64
+
65
+ Objects with identity. Two entities with the same attributes but different IDs are different.
66
+
67
+ ```typescript
68
+ class User {
69
+ readonly id: UserId;
70
+ name: string;
71
+ email: Email; // Value Object
72
+ }
73
+ ```
74
+
75
+ ### Value Objects
76
+
77
+ Objects defined by their attributes, not identity. Immutable.
78
+
79
+ ```typescript
80
+ class Email {
81
+ constructor(readonly value: string) {
82
+ if (!isValidEmail(value)) throw new InvalidEmailError(value);
83
+ }
84
+ equals(other: Email): boolean {
85
+ return this.value === other.value;
86
+ }
87
+ }
88
+ ```
89
+
90
+ ### Aggregates
91
+
92
+ A cluster of entities and value objects with a single root entity (Aggregate Root). All access goes through the root.
93
+
94
+ ```typescript
95
+ class Order { // Aggregate Root
96
+ private items: OrderItem[] = [];
97
+
98
+ addItem(product: ProductRef, quantity: number): void {
99
+ // Business logic HERE, not in a service
100
+ if (quantity <= 0) throw new InvalidQuantityError();
101
+ this.items.push(new OrderItem(product, quantity));
102
+ }
103
+
104
+ get total(): Money {
105
+ return this.items.reduce((sum, item) => sum.add(item.subtotal), Money.zero());
106
+ }
107
+ }
108
+ ```
109
+
110
+ **Aggregate Rules:**
111
+
112
+ 1. Reference other aggregates by ID only
113
+ 2. One aggregate per transaction
114
+ 3. Eventual consistency between aggregates
115
+
116
+ ### Domain Events
117
+
118
+ Something that happened in the domain that domain experts care about.
119
+
120
+ ```typescript
121
+ class OrderPlaced implements DomainEvent {
122
+ constructor(
123
+ readonly orderId: OrderId,
124
+ readonly customerId: CustomerId,
125
+ readonly total: Money,
126
+ readonly occurredAt: Date
127
+ ) {}
128
+ }
129
+ ```
130
+
131
+ ### Domain Services
132
+
133
+ Business logic that doesn't naturally belong to an entity or value object.
134
+
135
+ ```typescript
136
+ class PricingService {
137
+ calculatePrice(order: Order, customer: Customer, promotions: Promotion[]): Money {
138
+ // Complex pricing logic involving multiple aggregates
139
+ }
140
+ }
141
+ ```
142
+
143
+ ### Repositories
144
+
145
+ Abstraction over data access. One repository per aggregate root.
146
+
147
+ ```typescript
148
+ interface OrderRepository {
149
+ findById(id: OrderId): Promise<Order | null>;
150
+ save(order: Order): Promise<void>;
151
+ delete(id: OrderId): Promise<void>;
152
+ }
153
+ ```
154
+
155
+ ## Directory Structure (DDD)
156
+
157
+ ```
158
+ src/
159
+ ├── modules/
160
+ │ └── orders/ # Bounded Context
161
+ │ ├── domain/
162
+ │ │ ├── entities/
163
+ │ │ │ └── order.ts # Aggregate Root
164
+ │ │ ├── value-objects/
165
+ │ │ │ └── money.ts
166
+ │ │ ├── events/
167
+ │ │ │ └── order-placed.ts
168
+ │ │ ├── services/
169
+ │ │ │ └── pricing.ts
170
+ │ │ └── repositories/
171
+ │ │ └── order.repository.ts # Interface
172
+ │ ├── application/
173
+ │ │ ├── commands/
174
+ │ │ │ └── place-order.ts
175
+ │ │ ├── queries/
176
+ │ │ │ └── get-order.ts
177
+ │ │ └── handlers/
178
+ │ │ └── place-order.handler.ts
179
+ │ └── infrastructure/
180
+ │ ├── persistence/
181
+ │ │ └── order.repository.impl.ts # Implementation
182
+ │ └── api/
183
+ │ └── orders.controller.ts
184
+ ```
185
+
186
+ ### The Clean Architecture Dependency Rule
187
+
188
+ In DDD, dependencies **MUST strictly point inward**:
189
+
190
+ ```
191
+ [ Frameworks & Drivers (Web, DB, UI) ]
192
+ └──▶ [ Interface Adapters (Controllers, Gateways) ]
193
+ └──▶ [ Application (Use Cases, CQRS Handlers) ]
194
+ └──▶ [ Domain (Entities, Value Objects) ]
195
+ ```
196
+
197
+ - The **Domain layer** has ZERO dependencies on ORMs (Prisma, TypeORM), HTTP frameworks (Express, NestJS), or external SDKs.
198
+ - Repositories are defined as interfaces in the domain/application layer and implemented in the infrastructure layer.
199
+
200
+ ### Domain Events vs Integration Events
201
+
202
+ 1. **Domain Events**: Represent state changes inside a single Bounded Context.
203
+ - Raised directly inside the Aggregate Root (`order.addItem(...)` raises `OrderItemAdded`).
204
+ - Dispatched in-process before transaction commit.
205
+ 2. **Integration Events**: Published across Bounded Context boundaries to communicate with other services.
206
+ - Dispatched via Transactional Outbox pattern to message brokers.
207
+ - Must use backward-compatible schemas with versioning.
208
+
209
+ ### Anti-Corruption Layer (ACL)
210
+
211
+ When consuming data from an external bounded context or 3rd-party vendor API (e.g. Stripe, Salesforce):
212
+
213
+ - NEVER import external domain models directly into your domain.
214
+ - Create an **ACL Translator / Adapter** in the infrastructure layer to convert external DTOs into your own Value Objects and Entities.
215
+
216
+ ---
217
+
218
+ ## Anti-Patterns
219
+
220
+ - [FAIL] Anemic domain model — entities with only getters/setters, all logic in services
221
+ - [FAIL] Big aggregate — aggregates should be small, focused on invariants
222
+ - [FAIL] Cross-aggregate transactions — use eventual consistency
223
+ - [FAIL] DDD everywhere — use DDD only where complexity justifies it
224
+ - [FAIL] ORM entities leaking into Domain — domain entities must not depend on `@Entity()` or ORM decorators
225
+
226
+
227
+ ## Code Examples
228
+
229
+ See `EXAMPLES.md` for detailed code examples.
230
+
231
+ ## Validation Checklist
232
+
233
+ What to verify during the review phase before completing the task.
234
+
235
+ ## Common Mistakes
236
+
237
+ Anti-patterns and things to explicitly avoid. See `TROUBLESHOOTING.md`.
238
+
239
+ ## Integration Notes
240
+
241
+ How this skill interacts with other skills.
242
+
243
+
244
+ # ddd Examples — Anti-patterns vs ContextOS Standard
245
+
246
+ ## Example 1: Domain Entities vs Anemic Models
247
+
248
+ ### Anti-pattern: Anemic Domain Model with Leaky Setters
249
+
250
+ ```typescript
251
+ // BAD: Zero business invariants; any caller can corrupt state
252
+ class BankAccount {
253
+ public balance: number = 0;
254
+ public isFrozen: boolean = false;
255
+ }
256
+
257
+ // Logic leaked into controller or service
258
+ account.balance -= 500; // Overdraft not checked!
259
+ ```
260
+
261
+ ### Best practice: ContextOS Standard (Rich Domain Model with Guarded Invariants)
262
+
263
+ ```typescript
264
+ // GOOD: Invariants strictly enforced inside Aggregate Root
265
+ class BankAccount {
266
+ private _balance: number;
267
+ private _isFrozen: boolean;
268
+
269
+ constructor(id: string, initialDeposit: Money) {
270
+ this._balance = initialDeposit.amount;
271
+ this._isFrozen = false;
272
+ }
273
+
274
+ public withdraw(amount: Money): void {
275
+ if (this._isFrozen) {
276
+ throw new AccountFrozenException('Cannot withdraw from a frozen account');
277
+ }
278
+ if (this._balance < amount.amount) {
279
+ throw new InsufficientFundsException('Insufficient funds for withdrawal');
280
+ }
281
+ this._balance -= amount.amount;
282
+ this.addDomainEvent(new MoneyWithdrawnEvent(this.id, amount));
283
+ }
284
+ }
285
+ ```
286
+
287
+ # ddd Troubleshooting & Common Mistakes
288
+
289
+ ## 1. God Aggregates
290
+
291
+ - **Symptom**: Aggregate Root contains 20 child entities and loading it requires joining dozens of tables.
292
+ - **Root Cause**: Treating ERD tables as aggregate boundaries rather than transactional consistency units.
293
+ - **Fix**: Design small aggregates. Reference other aggregates by ID only, not by object reference.
294
+
295
+ ## 2. Leaking Infrastructure into Domain Layer
296
+
297
+ - **Symptom**: Domain entities import Prisma, TypeORM decorators, or Express Request objects.
298
+ - **Root Cause**: Inverting Clean Architecture boundaries.
299
+ - **Fix**: The Domain layer must be pure TypeScript with zero external framework dependencies.
300
+
301
+ ## 3. Transaction Spanning Multiple Aggregates
302
+
303
+ - **Symptom**: High database lock contention and deadlocks under concurrent transactions.
304
+ - **Root Cause**: Modifying multiple aggregate roots within the same database transaction.
305
+ - **Fix**: Rule of thumb: Exactly one Aggregate Root modified per transaction. Use Domain Events for eventual consistency across other aggregates.
@@ -0,0 +1,134 @@
1
+ # decision-engine
2
+
3
+ ## Overview
4
+
5
+ Architecture Decision Record (ADR) system following Michael Nygard format. Captures context, options considered, tradeoffs, and consequences to prevent architectural regression and knowledge loss across AI sessions.
6
+
7
+ ## When to Use
8
+
9
+ Activate when choosing or switching database engines, authentication strategies, state libraries, or significant architectural patterns.
10
+
11
+ ## Rules & Patterns
12
+
13
+ You manage **Architecture Decision Records** (ADRs).
14
+
15
+ ## Why Decisions Matter
16
+
17
+ Without ADRs, the AI agent sees:
18
+
19
+ - "Database: PostgreSQL" — but doesn't know WHY
20
+ - "Auth: JWT" — but doesn't know what alternatives were considered
21
+ - "Framework: Next.js" — but doesn't know the tradeoffs
22
+
23
+ With ADRs, the agent understands the reasoning and won't accidentally contradict prior decisions.
24
+
25
+ ## Commands
26
+
27
+ ### Create a Decision
28
+
29
+ When an architectural choice is made during any pipeline stage:
30
+
31
+ 1. Auto-increment the decision number
32
+ 2. Use the template from `generators/templates/DECISION.md`
33
+ 3. Save to `docs/decisions/NNNN-decision-name.md`
34
+ 4. Update the Project Graph if the decision affects modules
35
+
36
+ **Naming convention:** `docs/decisions/0001-use-postgresql.md`
37
+
38
+ ### Query Decisions
39
+
40
+ Before making changes that touch architecture:
41
+
42
+ 1. Check `docs/decisions/` for related decisions
43
+ 2. If a decision exists, follow it
44
+ 3. If a decision needs to change, create a new ADR that **supersedes** the old one
45
+
46
+ ### Decision Lifecycle
47
+
48
+ ```
49
+ proposed → accepted → [deprecated | superseded]
50
+ ```
51
+
52
+ - **proposed**: Under discussion, not yet committed
53
+ - **accepted**: The team agreed, this is the standard
54
+ - **deprecated**: No longer relevant (project evolved)
55
+ - **superseded**: Replaced by a newer decision (link to it)
56
+
57
+ ## Auto-Detection
58
+
59
+ The Decision Engine should suggest creating an ADR when it detects:
60
+
61
+ - A new database/ORM is introduced
62
+ - A new framework is added
63
+ - Authentication strategy changes
64
+ - API versioning approach is chosen
65
+ - Deployment strategy is decided
66
+ - A significant library is added (state management, testing framework, etc.)
67
+
68
+
69
+ ## Code Examples
70
+
71
+ See `EXAMPLES.md` for detailed code examples.
72
+
73
+ ## Validation Checklist
74
+
75
+ What to verify during the review phase before completing the task.
76
+
77
+ ## Common Mistakes
78
+
79
+ Anti-patterns and things to explicitly avoid. See `TROUBLESHOOTING.md`.
80
+
81
+ ## Integration Notes
82
+
83
+ How this skill interacts with other skills.
84
+
85
+
86
+ # decisions Examples — Anti-patterns vs ContextOS Standard
87
+
88
+ ## Example 1: Documenting Tech Choices
89
+
90
+ ### Anti-pattern: Tribal Knowledge & Undocumented Decisions
91
+
92
+ ```text
93
+ "We switched to Redis for session storage last month because Dan said so on Slack."
94
+ Three months later, Dan leaves and nobody knows why the config is set up this way.
95
+ ```
96
+
97
+ ### Best practice: ContextOS Standard (MADR Architecture Decision Record)
98
+
99
+ ```markdown
100
+ # ADR 0003: Use Redis for Distributed Session Storage
101
+
102
+ ## Context and Problem Statement
103
+ Our application is transitioning from a single server to horizontally auto-scaled instances.
104
+ Sticky sessions on load balancer cause uneven distribution and drop sessions on node recycling.
105
+
106
+ ## Considered Options
107
+ 1. PostgreSQL session table
108
+ 2. Redis cluster
109
+ 3. JWT stateless tokens in cookies
110
+
111
+ ## Decision Outcome
112
+ Chosen option: "Redis cluster", because:
113
+ - Sub-millisecond read/write latency compared to relational DB queries.
114
+ - Built-in TTL automatically handles session expiration without cron cleanup.
115
+ - Avoids security risks of client-stored JWT revocation.
116
+
117
+ ## Consequences
118
+ - Positive: Stateless web tier, zero session drops on deployment.
119
+ - Negative: Adds operational dependency on Redis cluster infrastructure.
120
+ ```
121
+
122
+ # decisions Troubleshooting & Common Mistakes
123
+
124
+ ## 1. Post-Hoc Justifications
125
+
126
+ - **Symptom**: ADR written weeks after code is merged, omitting all rejected options.
127
+ - **Root Cause**: Treating ADRs as paperwork rather than decision-making tools.
128
+ - **Fix**: Write the ADR during the PLAN phase _before_ implementing the decision.
129
+
130
+ ## 2. Omitting Trade-offs
131
+
132
+ - **Symptom**: ADR lists only benefits, claiming the chosen tech has zero downsides.
133
+ - **Root Cause**: Confirmation bias.
134
+ - **Fix**: Every architecture decision has costs. Explicitly document negative trade-offs and operational overhead.
@@ -0,0 +1,135 @@
1
+ # Docker
2
+
3
+ ## Overview
4
+
5
+ Containerization, Dockerfile architecture, security best practices, and container orchestration for production workloads.
6
+
7
+ ## When to Use
8
+
9
+ Activate when creating or optimizing Dockerfiles, docker-compose configurations, container security audits, or CI/CD container builds.
10
+
11
+ ## Rules & Patterns
12
+
13
+ ### Negative Constraints (What NOT to Do)
14
+
15
+ 1. **NEVER run containers as `root` in production**: Always create and switch to an unprivileged non-root user (e.g. `USER node` or `USER nonroot`).
16
+ 2. **NEVER use the `latest` tag**: Always pin base images to specific immutable version digests or explicit minor tags (e.g. `node:20.12.2-alpine3.19`).
17
+ 3. **NEVER copy source code before `package.json`**: Always copy lockfiles and install dependencies first to leverage Docker's layer caching.
18
+ 4. **NEVER bake secrets, API keys, or `.env` files into image layers**: Pass secrets via build-time secret mounts (`--mount=type=secret`) or runtime environment variables.
19
+ 5. **NEVER include build tools or devDependencies in the final runner image**: Always use multi-stage builds to discard compilers and package managers from production images.
20
+
21
+ ### Multi-Stage Standard Pattern
22
+
23
+ ```dockerfile
24
+ FROM node:20.12.2-alpine3.19 AS builder
25
+ WORKDIR /app
26
+ COPY package.json package-lock.json ./
27
+ RUN npm ci
28
+ COPY . .
29
+ RUN npm run build && npm prune --production
30
+
31
+ FROM node:20.12.2-alpine3.19 AS runner
32
+ WORKDIR /app
33
+ ENV NODE_ENV=production
34
+ RUN addgroup -S -g 1001 appgroup && adduser -S -u 1001 appuser -G appgroup
35
+ COPY --from=builder --chown=appuser:appgroup /app/dist ./dist
36
+ COPY --from=builder --chown=appuser:appgroup /app/node_modules ./node_modules
37
+ USER appuser
38
+ CMD ["node", "dist/index.js"]
39
+ ```
40
+
41
+ ## Code Examples
42
+
43
+ See `EXAMPLES.md` for production Dockerfiles and dockerignore patterns.
44
+
45
+ ## Validation Checklist
46
+
47
+ - [ ] Multi-stage build separates build tools from runtime
48
+ - [ ] Non-root `USER` directive active in final stage
49
+ - [ ] Base images pinned to exact versions
50
+ - [ ] `.dockerignore` file prevents leaking node_modules or secrets
51
+
52
+ ## Common Mistakes
53
+
54
+ - Copying entire workspace before `npm ci`, breaking Docker cache. See `TROUBLESHOOTING.md`.
55
+
56
+ ## Integration Notes
57
+
58
+ Interacts with `security` (container hardening) and `node` / `nextjs` / `fastapi`.
59
+
60
+
61
+ # Docker Examples — Anti-patterns vs ContextOS Standard
62
+
63
+ ## Example 1: Multi-Stage Build & Layer Caching
64
+
65
+ ### Anti-pattern: Anti-pattern (Fat single-stage image running as root)
66
+
67
+ ```dockerfile
68
+ # BAD: 1.2GB image, runs as root, breaks caching on every file edit
69
+ FROM node:latest
70
+ WORKDIR /app
71
+ COPY . .
72
+ RUN npm install
73
+ RUN npm run build
74
+ EXPOSE 3000
75
+ CMD ["npm", "start"]
76
+ ```
77
+
78
+ ### Best practice: ContextOS Standard (Slim multi-stage build with non-root user)
79
+
80
+ ```dockerfile
81
+ # GOOD: 95MB image, non-root user, optimized layer caching
82
+ FROM node:20.12.2-alpine3.19 AS builder
83
+ WORKDIR /app
84
+ COPY package.json package-lock.json ./
85
+ RUN npm ci
86
+ COPY . .
87
+ RUN npm run build && npm prune --production
88
+
89
+ FROM node:20.12.2-alpine3.19 AS runner
90
+ WORKDIR /app
91
+ ENV NODE_ENV=production
92
+ RUN addgroup -S -g 1001 appgroup && adduser -S -u 1001 appuser -G appgroup
93
+ COPY --from=builder --chown=appuser:appgroup /app/dist ./dist
94
+ COPY --from=builder --chown=appuser:appgroup /app/node_modules ./node_modules
95
+ USER appuser
96
+ CMD ["node", "dist/main.js"]
97
+ ```
98
+
99
+ ---
100
+
101
+ ## Example 2: Docker Ignore File (`.dockerignore`)
102
+
103
+ ### Best practice: ContextOS Standard `.dockerignore`
104
+
105
+ ```gitignore
106
+ node_modules
107
+ npm-debug.log
108
+ .git
109
+ .gitignore
110
+ .env
111
+ .env.*
112
+ dist
113
+ coverage
114
+ .DS_Store
115
+ *.md
116
+ ```
117
+
118
+ # Docker Troubleshooting Guide
119
+
120
+ ## Common Issues & Fixes
121
+
122
+ ### 1. Slow Docker builds rebuilding node_modules every time
123
+
124
+ - **Cause**: Copying the entire directory (`COPY . .`) before running `npm ci`.
125
+ - **Fix**: Copy `package.json` and `package-lock.json` separately first, run `npm ci`, and only then copy application source code.
126
+
127
+ ### 2. Permission Denied Errors with Non-Root Users
128
+
129
+ - **Cause**: Files copied from builder without changing ownership.
130
+ - **Fix**: Always use `--chown=appuser:appgroup` when copying files in Dockerfile.
131
+
132
+ ### 3. Missing native build dependencies on Alpine Linux
133
+
134
+ - **Cause**: Packages requiring C bindings (e.g. `sharp`, `bcrypt`) fail on musl libc.
135
+ - **Fix**: Add `RUN apk add --no-cache libc6-compat python3 make g++` in the builder stage.