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,156 @@
1
+ ---
2
+ name: context-manager
3
+ description: >
4
+ Smart context selection engine. Analyzes the current task, consults the Project Graph, and returns only the documents and skills needed to prevent token overflow.
5
+ ---
6
+ # context-manager
7
+
8
+ ## Overview
9
+
10
+ Deterministic context window optimizer. Analyzes user task intent and queries project dependency graphs to inject minimal relevant files and skills, preventing LLM attention loss and context pollution.
11
+
12
+ ## When to Use
13
+
14
+ Activate during multi-file investigations, large refactorings, or complex tasks where dumping entire directory trees would blow past context budgets.
15
+
16
+ ## Rules & Patterns
17
+
18
+ You are the **Context Manager**. Your job is to prevent context overload.
19
+
20
+ ## How It Works
21
+
22
+ When given a task:
23
+
24
+ ### Step 1: Classify the task
25
+
26
+ ```yaml
27
+ task:
28
+ type: [frontend | backend | fullstack | architecture | bugfix | refactor | deploy | review]
29
+ scope: [module | feature | file | project-wide]
30
+ module: {{module_name from Project Graph}}
31
+ ```
32
+
33
+ ### Step 2: Consult the Project Graph
34
+
35
+ If `docs/PROJECT_GRAPH.md` or `.graphify/graph.json` exists (or activate `graphify` skill to extract AST dependencies):
36
+
37
+ 1. Find the module this task belongs to
38
+ 2. Get the module's dependencies
39
+ 3. Get the module's required skills
40
+ 4. Get the files this task will likely touch
41
+
42
+ ### Step 3: Apply Context Rules
43
+
44
+ Load `references/context-rules.md` and apply the task type → document mapping.
45
+
46
+ ### Step 4: Return Context Package
47
+
48
+ Output a context package:
49
+
50
+ ```yaml
51
+ context:
52
+ documents:
53
+ required:
54
+ - docs/API.md # sections: [appointments]
55
+ - docs/ARCHITECTURE.md # sections: [backend, api-layer]
56
+ optional:
57
+ - docs/decisions/0003-postgres.md
58
+ skipped:
59
+ - docs/UI.md # reason: backend task
60
+ - docs/DATABASE.md # reason: no schema change
61
+
62
+ skills:
63
+ loaded: [typescript, node, postgres, testing]
64
+ skipped: [react, tailwind] # reason: backend task
65
+
66
+ project_graph:
67
+ module: appointments
68
+ dependencies: [auth, patients]
69
+ affected_files:
70
+ - src/modules/appointments/api/**
71
+ - src/modules/appointments/services/**
72
+ ```
73
+
74
+ ### Step 5: Validate Budget
75
+
76
+ Check total token count. If over budget (see context-rules.md):
77
+
78
+ 1. Trim Level 1 docs to summaries
79
+ 2. Load only affected sections of Level 2 docs
80
+ 3. Keep Level 3 (skills) at full detail
81
+
82
+ ## Context Caching
83
+
84
+ After first compilation for a module, cache the result:
85
+
86
+ ```
87
+ .cache/
88
+ frontend.context.yaml
89
+ backend.context.yaml
90
+ appointments.context.yaml
91
+ ```
92
+
93
+ Invalidate cache when:
94
+
95
+ - A document is updated
96
+ - A skill is added/removed
97
+ - The Project Graph changes
98
+ - A Decision Record is added
99
+
100
+ ## Questions the Context Manager Can Answer
101
+
102
+ - "What documents do I need for this task?"
103
+ - "Which skills should be loaded?"
104
+ - "What modules are affected by this change?"
105
+ - "Is this context package within budget?"
106
+ - "Why was this document skipped?"
107
+
108
+
109
+ ## Code Examples
110
+
111
+ See `EXAMPLES.md` for detailed code examples.
112
+
113
+ ## Validation Checklist
114
+
115
+ What to verify during the review phase before completing the task.
116
+
117
+ ## Common Mistakes
118
+
119
+ Anti-patterns and things to explicitly avoid. See `TROUBLESHOOTING.md`.
120
+
121
+ ## Integration Notes
122
+
123
+ How this skill interacts with other skills.
124
+
125
+
126
+ <!-- Source: EXAMPLES.md -->
127
+
128
+ # context-manager Examples — Anti-patterns vs ContextOS Standard
129
+
130
+ ## Example 1: Context Selection
131
+
132
+ ### Anti-pattern: Context Window Dumping
133
+
134
+ ```text
135
+ Agent reads all 180 files in src/ into context to debug a single button click handler.
136
+ Result: Exhausts 150k tokens, reaches rate limits, and forgets user instructions.
137
+ ```
138
+
139
+ ### Best practice: ContextOS Standard (Targeted AST Traversal)
140
+
141
+ ```text
142
+ 1. Inspect package.json and AGENTS.md.
143
+ 2. Grep for target symbol: grep_search for 'SubmitButton'.
144
+ 3. Read ONLY components/SubmitButton.tsx and its direct import types/button.ts.
145
+ Total tokens used: <1,500 tokens. Fast, accurate, zero hallucinations.
146
+ ```
147
+
148
+ <!-- Source: TROUBLESHOOTING.md -->
149
+
150
+ # context-manager Troubleshooting & Common Mistakes
151
+
152
+ ## 1. Token Budget Blowout
153
+
154
+ - **Symptom**: Model performance drops significantly, losing earlier conversational context.
155
+ - **Root Cause**: Loading large JSON mocks, lockfiles, or build directories into prompt.
156
+ - **Fix**: Never read package-lock.json, dist/, or build artifacts unless explicitly debugging bundle outputs.
@@ -0,0 +1,200 @@
1
+ ---
2
+ name: context-os
3
+ description: >
4
+ AI Project Operating System context compiler that transforms user intent into minimal, relevant context for any AI agent across the full development lifecycle.
5
+ ---
6
+ # context-os
7
+
8
+ ## Overview
9
+
10
+ Operating system and context orchestration layer for AI coding assistants. Standardizes software engineering workflows across requirements, architecture, atomic task planning, implementation, verification, and release.
11
+
12
+ ## When to Use
13
+
14
+ Activate as the root meta-orchestrator across all development phases to ensure role consistency, quality gates, and structured execution.
15
+
16
+ ## Rules & Patterns
17
+
18
+ You are the **Context Compiler**. Your job is NOT to know everything. Your job is to **assemble the minimum context** needed for the current task.
19
+
20
+ ## Pipeline
21
+
22
+ When a user gives you a task, follow this pipeline:
23
+
24
+ ### Stage 1: Intent Analysis
25
+
26
+ Analyze the user's prompt and determine:
27
+
28
+ ```yaml
29
+ intent:
30
+ project_type: [webapp, api, mobile, cli, library, saas, crm, ecommerce]
31
+ industry: [healthcare, fintech, education, social, general]
32
+ layers:
33
+ frontend: true/false
34
+ backend: true/false
35
+ database: true/false
36
+ auth: true/false
37
+ ai: true/false
38
+ payments: true/false
39
+ realtime: true/false
40
+ scope: [new_project, feature, bugfix, refactor, architecture]
41
+ ```
42
+
43
+ ### Stage 2: Dependency Resolution
44
+
45
+ For each required layer, load the skill graph:
46
+
47
+ 1. Read `skill.yaml` from each relevant skill directory
48
+ 2. Resolve `requires` — load mandatory dependencies
49
+ 3. Check `conflicts` — ensure no incompatible skills are loaded
50
+ 4. Apply `optional` — suggest but don't force
51
+ 5. Respect project profile (if set) — apply rules from `profiles/`
52
+
53
+ **Dependency resolution example:**
54
+
55
+ ```
56
+ Need: nextjs
57
+ → requires: react, typescript
58
+ → react requires: typescript (already loaded)
59
+ → optional: tailwind, prisma, next-auth
60
+
61
+ Loaded: [nextjs, react, typescript]
62
+ Suggested: [tailwind, prisma, next-auth]
63
+ ```
64
+
65
+ ### Stage 3: Context Compilation
66
+
67
+ Assemble context from three levels:
68
+
69
+ **Level 1 — Vision (always available):**
70
+
71
+ - `docs/PRD.md` — what are we building
72
+ - `docs/ROADMAP.md` — where are we going
73
+ - `docs/PROJECT_GRAPH.md` — project structure
74
+
75
+ **Level 2 — Architecture (load when needed):**
76
+
77
+ - `docs/ARCHITECTURE.md` — system design
78
+ - `docs/DATABASE.md` — data model
79
+ - `docs/API.md` — API contracts
80
+ - `docs/decisions/` — prior decisions
81
+
82
+ **Level 3 — Development (load per task):**
83
+
84
+ - Relevant skill `.md` files
85
+ - `docs/UI.md` — for frontend tasks
86
+ - `docs/TASKS.md` — current sprint
87
+
88
+ **Context Filtering Rules:**
89
+ See `references/context-rules.md` for the full mapping of task types to required documents.
90
+
91
+ ### Stage 4: Prompt Optimization
92
+
93
+ Before sending to the AI agent:
94
+
95
+ 1. Remove sections not relevant to the current task
96
+ 2. Prioritize: current task context > architecture > vision
97
+ 3. Include recent Decision Records that affect the current task
98
+ 4. Add coding rules from the loaded skills
99
+
100
+ ## Commands
101
+
102
+ | Command | Action |
103
+ | --- | --- |
104
+ | `ctx init` | Analyze project idea, generate all docs |
105
+ | `ctx plan` | Generate development plan from PRD |
106
+ | `ctx compile` | Compile context for a specific task |
107
+ | `ctx update` | Update changed documents |
108
+ | `ctx graph` | Show/update Project Graph |
109
+ | `ctx doctor` | Validate skill dependencies, check for conflicts |
110
+ | `ctx explain` | Explain why specific context was loaded |
111
+
112
+ ## Project Initialization Flow
113
+
114
+ When user says something like "Сделай CRM для стоматологии" or "Build a Trello clone":
115
+
116
+ 1. **Analyze intent** (Stage 1)
117
+ 2. **Ask clarifying questions:**
118
+ - Users and roles?
119
+ - Tech stack preference?
120
+ - Mobile app needed?
121
+ - AI features?
122
+ - Authentication type?
123
+ - Expected load?
124
+ - MVP or Production?
125
+ 3. **Select profile** (startup/enterprise/mvp/hackathon)
126
+ 4. **Resolve skills** (Stage 2)
127
+ 5. **Generate all documents** using `generators/` skill
128
+ 6. **Create Project Graph** — the master map of modules → features → tasks → files → skills
129
+ 7. **Output agent config** using `adapters/` skill
130
+
131
+ ## Skill Discovery
132
+
133
+ Skills are discovered by scanning `.agents/skills/*/skill.yaml`. Each `skill.yaml` defines:
134
+
135
+ ```yaml
136
+ id: react
137
+ name: React
138
+ category: frontend
139
+ tags: [frontend, spa, jsx, components]
140
+ requires: [typescript]
141
+ optional: [tailwind, next-auth, react-query]
142
+ conflicts: [vue, angular, svelte]
143
+ weight: 8
144
+ documents:
145
+ - react.md
146
+ ```
147
+
148
+ The compiler builds a dependency graph from all discovered skills and resolves it for each task.
149
+
150
+
151
+ ## Code Examples
152
+
153
+ See `EXAMPLES.md` for detailed code examples.
154
+
155
+ ## Validation Checklist
156
+
157
+ What to verify during the review phase before completing the task.
158
+
159
+ ## Common Mistakes
160
+
161
+ Anti-patterns and things to explicitly avoid. See `TROUBLESHOOTING.md`.
162
+
163
+ ## Integration Notes
164
+
165
+ How this skill interacts with other skills.
166
+
167
+
168
+ <!-- Source: EXAMPLES.md -->
169
+
170
+ # context-os Examples — Anti-patterns vs ContextOS Standard
171
+
172
+ ## Example 1: Project Lifecycle Management
173
+
174
+ ### Anti-pattern: Ad-hoc Unstructured Development
175
+
176
+ ```text
177
+ Coding -> Modifying DB -> Debugging -> Redesigning UI -> Changing Architecture
178
+ All in one unstructured stream of consciousness.
179
+ ```
180
+
181
+ ### Best practice: ContextOS Standard (Phase-Gated Development)
182
+
183
+ ```text
184
+ Phase 1: DEFINE (PRD & Requirements)
185
+ Phase 2: PLAN (Atomic Tasks & ADRs)
186
+ Phase 3: BUILD (TDD & Minimalist Implementation)
187
+ Phase 4: VERIFY (Automated Test Proof)
188
+ Phase 5: REVIEW (Design QA & Code Review)
189
+ Phase 6: SHIP (Production Release)
190
+ ```
191
+
192
+ <!-- Source: TROUBLESHOOTING.md -->
193
+
194
+ # context-os Troubleshooting & Common Mistakes
195
+
196
+ ## 1. Stale Compiled Artifacts
197
+
198
+ - **Symptom**: Editor rules don't reflect newly updated skills.
199
+ - **Root Cause**: Modifying .agents/core/skills/ without recompiling exports.
200
+ - **Fix**: Run node .agents/ctx.js export all whenever source skills are updated.
@@ -0,0 +1,200 @@
1
+ ---
2
+ name: database
3
+ description: >
4
+ Database architecture, schema design, Prisma, Drizzle ORM, indexing strategies, migrations, and N+1 query resolution.
5
+ ---
6
+ # database
7
+
8
+ ## Overview
9
+
10
+ Relational database design, query optimization, migration safety, connection pooling in serverless environments, and ORM usage across PostgreSQL, Prisma, and Drizzle.
11
+
12
+ ## When to Use
13
+
14
+ Activate for tasks involving database schema design, migrations, indexing, relational models, ORM queries, transactions, or query performance tuning.
15
+
16
+ ## Rules & Patterns
17
+
18
+ ### Negative Constraints (What NOT to Do)
19
+
20
+ 1. **NEVER do `SELECT *` in production**: Always select explicit columns required by the caller to minimize memory bandwidth and lock footprint.
21
+ 2. **NEVER run destructive migrations without backward compatibility**: Always follow expand-and-contract (Phase 1: add new column as nullable; Phase 2: backfill; Phase 3: make non-nullable & remove old column).
22
+ 3. **NEVER execute queries in loops (The N+1 Anti-Pattern)**: Always use batch loading (`inArray`, `DataLoader`, or relational `include` / `JOIN`).
23
+ 4. **NEVER leave foreign keys without indexes**: In PostgreSQL/MySQL, child foreign key columns must always have an index to prevent table-level locking on cascade deletes.
24
+ 5. **NEVER perform multi-entity writes without a database transaction**: Any operation touching multiple records must use `prisma.$transaction` or `db.transaction`.
25
+ 6. **NEVER open unpooled database connections in Serverless / Edge functions**: Serverless scale-outs will instantly exhaust PostgreSQL's `max_connections`.
26
+
27
+ ---
28
+
29
+ ### Zero-Downtime Migrations (Expand-and-Contract)
30
+
31
+ When modifying schemas with zero downtime:
32
+
33
+ 1. **Phase 1 (Expand)**: Add the new column as `NULLABLE` (or with a default value). Deploy the application code that reads from old column and writes to both old and new.
34
+ 2. **Phase 2 (Backfill)**: Run an asynchronous batch migration job in chunks (e.g. 1000 rows at a time) to populate data from old column to new column.
35
+ 3. **Phase 3 (Contract)**: Update application code to read and write exclusively from the new column.
36
+ 4. **Phase 4 (Cleanup)**: Once traffic is fully shifted, remove the old column and mark the new column as `NOT NULL` in a separate migration.
37
+
38
+ ---
39
+
40
+ ### Serverless & Edge Connection Pooling
41
+
42
+ In serverless environments (AWS Lambda, Vercel Functions):
43
+
44
+ - Always connect via a connection pooler:
45
+ - **Prisma**: Use Prisma Accelerate or configure transaction mode connection URLs.
46
+ - **Drizzle / Node-Postgres**: Use `@neondatabase/serverless` or connect to PgBouncer pooler port (`6543`) with `max: 1` per serverless container.
47
+ - Set strict statement timeouts (e.g. `statement_timeout = '5000'`) to prevent hanging queries from exhausting pool capacity.
48
+
49
+ ---
50
+
51
+ ### Indexing & Performance Rules
52
+
53
+ - **B-Tree Indexes**: For high-cardinality filters (`status`, `user_id`, `created_at`).
54
+ - **Composite Indexes**: When querying multiple columns together (`WHERE organization_id = ? AND status = ?`), order columns in index by equality first, range second.
55
+ - **Partial Indexes**: For sparse boolean flags (`WHERE is_processed = false`).
56
+ - **Covering Indexes**: Include frequently selected columns (`INCLUDE (title, created_at)`) to enable index-only scans without table heap access.
57
+
58
+ ---
59
+
60
+ ## Code Examples
61
+
62
+ ### Zero-Downtime Column Rename (Drizzle ORM)
63
+
64
+ ```typescript
65
+ // Step 1 (Expand): Keep old column, add new column
66
+ export const users = pgTable('users', {
67
+ id: uuid('id').primaryKey().defaultRandom(),
68
+ fullName: varchar('full_name', { length: 255 }), // new column
69
+ name: varchar('name', { length: 255 }), // old column kept during transition
70
+ });
71
+
72
+ // App write logic during transition:
73
+ await db.insert(users).values({
74
+ name: input.name,
75
+ fullName: input.name
76
+ });
77
+ ```
78
+
79
+ ---
80
+
81
+ ## Validation Checklist
82
+
83
+ - [ ] All database queries select explicit required columns (no `SELECT *`).
84
+ - [ ] Foreign keys have matching indexes on child tables.
85
+ - [ ] Multi-table writes wrapped in ACID transactions.
86
+ - [ ] No N+1 queries in loops.
87
+ - [ ] Schema migrations tested against expand-and-contract pattern.
88
+ - [ ] Serverless database connection string uses pooling proxy.
89
+
90
+ ---
91
+
92
+ ## Common Mistakes
93
+
94
+ - **Missing pagination limits**: Unbounded `findMany()` calls leading to Out-Of-Memory crashes under production volume.
95
+ - **Locking entire tables**: Adding `NOT NULL` columns with heavy compute defaults in PostgreSQL without concurrent index creation.
96
+
97
+ ---
98
+
99
+ ## Integration Notes
100
+
101
+ - Interacts with `system-design`, `ddd`, and `security` (multi-tenant tenantId scoping).
102
+
103
+
104
+ <!-- Source: EXAMPLES.md -->
105
+
106
+ # Database Examples — Anti-patterns vs ContextOS Standard
107
+
108
+ ## Example 1: Solving the N+1 Query Problem
109
+
110
+ ### Anti-pattern: Anti-pattern (N+1 database queries in a loop)
111
+
112
+ ```typescript
113
+ // BAD: 1 query for users + N queries for posts!
114
+ const users = await prisma.user.findMany();
115
+ const usersWithPosts = [];
116
+ for (const user of users) {
117
+ const posts = await prisma.post.findMany({ where: { userId: user.id } }); // N queries!
118
+ usersWithPosts.push({ ...user, posts });
119
+ }
120
+ ```
121
+
122
+ ### Best practice: ContextOS Standard (Batch query or relational include)
123
+
124
+ ```typescript
125
+ // GOOD: 1 single optimized batch query
126
+ const usersWithPosts = await prisma.user.findMany({
127
+ where: { isActive: true },
128
+ select: {
129
+ id: true,
130
+ name: true,
131
+ email: true,
132
+ posts: {
133
+ where: { published: true },
134
+ select: { id: true, title: true, createdAt: true },
135
+ take: 5
136
+ }
137
+ }
138
+ });
139
+ ```
140
+
141
+ ---
142
+
143
+ ## Example 2: Safe Atomic Transactions with Locking
144
+
145
+ ### Anti-pattern: Anti-pattern (Unprotected read-modify-write race condition)
146
+
147
+ ```typescript
148
+ // BAD: race condition between reading balance and updating
149
+ const account = await prisma.account.findUnique({ where: { id } });
150
+ if (account.balance >= amount) {
151
+ await prisma.account.update({
152
+ where: { id },
153
+ data: { balance: account.balance - amount }
154
+ });
155
+ }
156
+ ```
157
+
158
+ ### Best practice: ContextOS Standard (Atomic conditional update in transaction)
159
+
160
+ ```typescript
161
+ // GOOD: atomic database transaction with invariant check
162
+ export async function deductBalance(accountId: string, amount: number) {
163
+ return await prisma.$transaction(async (tx) => {
164
+ const updated = await tx.account.updateMany({
165
+ where: {
166
+ id: accountId,
167
+ balance: { gte: amount }
168
+ },
169
+ data: {
170
+ balance: { decrement: amount }
171
+ }
172
+ });
173
+
174
+ if (updated.count === 0) {
175
+ throw new InsufficientFundsError(accountId);
176
+ }
177
+ });
178
+ }
179
+ ```
180
+
181
+ <!-- Source: TROUBLESHOOTING.md -->
182
+
183
+ # Database Troubleshooting Guide
184
+
185
+ ## Common Issues & Fixes
186
+
187
+ ### 1. Connection Pool Exhaustion in Serverless / Edge
188
+
189
+ - **Cause**: Creating a new PrismaClient / DB connection instance on every serverless function invocation.
190
+ - **Fix**: Declare PrismaClient as a global singleton across warm lambdas, and enable PgBouncer or Prisma Accelerate.
191
+
192
+ ### 2. Slow Queries on Large Tables
193
+
194
+ - **Cause**: Missing composite index on filtered and ordered columns.
195
+ - **Fix**: Run `EXPLAIN ANALYZE <query>` and add targeted indexes matching the WHERE and ORDER BY columns.
196
+
197
+ ### 3. Database Deadlocks during Concurrent Transactions
198
+
199
+ - **Cause**: Different transactions updating resources in different orders.
200
+ - **Fix**: Always acquire locks and update entities in a deterministic alphabetical or ID-ordered sequence.