@ngxtm/devkit 2.0.2 → 3.0.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 (534) hide show
  1. package/cli/detect.js +292 -0
  2. package/cli/index.js +205 -80
  3. package/cli/init.js +245 -0
  4. package/cli/install.js +231 -53
  5. package/cli/update.js +243 -0
  6. package/cli/utils.js +195 -0
  7. package/package.json +16 -20
  8. package/rules-index.json +76 -0
  9. package/scripts/generate-index.js +223 -0
  10. package/scripts/merge-commands.js +290 -0
  11. package/scripts/organize-rules.js +226 -0
  12. package/templates/base/hooks/lib/ck-config-utils.cjs +769 -0
  13. package/templates/base/hooks/lib/ck-paths.cjs +110 -0
  14. package/templates/base/hooks/lib/colors.cjs +95 -0
  15. package/templates/base/hooks/lib/config-counter.cjs +103 -0
  16. package/templates/base/hooks/lib/context-builder.cjs +600 -0
  17. package/templates/base/hooks/lib/context-tracker.cjs +335 -0
  18. package/templates/base/hooks/lib/privacy-checker.cjs +297 -0
  19. package/templates/base/hooks/lib/project-detector.cjs +430 -0
  20. package/templates/base/hooks/lib/scout-checker.cjs +172 -0
  21. package/templates/base/hooks/lib/transcript-parser.cjs +164 -0
  22. package/templates/base/hooks/privacy-block.cjs +145 -0
  23. package/agents/backend-engineer.md +0 -154
  24. package/agents/brainstormer.md +0 -169
  25. package/agents/business-analyst.md +0 -166
  26. package/agents/database-architect.md +0 -159
  27. package/agents/debugger.md +0 -155
  28. package/agents/designer.md +0 -150
  29. package/agents/devops-engineer.md +0 -155
  30. package/agents/docs-manager.md +0 -171
  31. package/agents/frontend-engineer.md +0 -159
  32. package/agents/game-engineer.md +0 -148
  33. package/agents/mobile-engineer.md +0 -149
  34. package/agents/performance-engineer.md +0 -152
  35. package/agents/planner.md +0 -161
  36. package/agents/project-manager.md +0 -160
  37. package/agents/researcher.md +0 -146
  38. package/agents/reviewer.md +0 -155
  39. package/agents/scouter.md +0 -157
  40. package/agents/security-engineer.md +0 -154
  41. package/agents/tech-lead.md +0 -159
  42. package/agents/tester.md +0 -157
  43. package/agents-claudekit/brainstormer.md +0 -113
  44. package/agents-claudekit/code-reviewer.md +0 -157
  45. package/agents-claudekit/code-simplifier.md +0 -42
  46. package/agents-claudekit/copywriter.md +0 -110
  47. package/agents-claudekit/database-admin.md +0 -92
  48. package/agents-claudekit/debugger.md +0 -137
  49. package/agents-claudekit/docs-manager.md +0 -208
  50. package/agents-claudekit/fullstack-developer.md +0 -95
  51. package/agents-claudekit/git-manager.md +0 -394
  52. package/agents-claudekit/journal-writer.md +0 -113
  53. package/agents-claudekit/mcp-manager.md +0 -93
  54. package/agents-claudekit/planner.md +0 -108
  55. package/agents-claudekit/project-manager.md +0 -125
  56. package/agents-claudekit/researcher.md +0 -38
  57. package/agents-claudekit/scout-external.md +0 -141
  58. package/agents-claudekit/scout.md +0 -107
  59. package/agents-claudekit/tester.md +0 -105
  60. package/agents-claudekit/ui-ux-designer.md +0 -236
  61. package/commands/ask.md +0 -64
  62. package/commands/brainstorm.md +0 -64
  63. package/commands/code.md +0 -64
  64. package/commands/cook.md +0 -64
  65. package/commands/debug.md +0 -64
  66. package/commands/design/fast.md +0 -134
  67. package/commands/fix/fast.md +0 -84
  68. package/commands/fix/hard.md +0 -116
  69. package/commands/fix.md +0 -64
  70. package/commands/plan/fast.md +0 -78
  71. package/commands/plan/hard.md +0 -131
  72. package/commands/plan.md +0 -64
  73. package/commands/test.md +0 -64
  74. package/matrix-skills/_index.yaml +0 -275
  75. package/matrix-skills/ai-ml.yaml +0 -353
  76. package/matrix-skills/architecture.yaml +0 -93
  77. package/matrix-skills/backend.yaml +0 -280
  78. package/matrix-skills/cloud.yaml +0 -112
  79. package/matrix-skills/data.yaml +0 -74
  80. package/matrix-skills/design.yaml +0 -98
  81. package/matrix-skills/devops.yaml +0 -200
  82. package/matrix-skills/frontend.yaml +0 -200
  83. package/matrix-skills/gaming.yaml +0 -39
  84. package/matrix-skills/languages.yaml +0 -160
  85. package/matrix-skills/management.yaml +0 -50
  86. package/matrix-skills/mcp.yaml +0 -82
  87. package/matrix-skills/mobile.yaml +0 -85
  88. package/matrix-skills/performance.yaml +0 -23
  89. package/matrix-skills/planning.yaml +0 -117
  90. package/matrix-skills/quality.yaml +0 -195
  91. package/matrix-skills/research.yaml +0 -106
  92. package/matrix-skills/security.yaml +0 -293
  93. package/matrix-skills/tools.yaml +0 -352
  94. package/output-styles/coding-level-0-eli5.md +0 -103
  95. package/output-styles/coding-level-1-junior.md +0 -124
  96. package/output-styles/coding-level-2-mid.md +0 -146
  97. package/output-styles/coding-level-3-senior.md +0 -148
  98. package/output-styles/coding-level-4-lead.md +0 -159
  99. package/output-styles/coding-level-5-god.md +0 -91
  100. package/rules/README.md +0 -141
  101. package/rules/metadata.json +0 -54
  102. package/settings.json +0 -3
  103. package/statusline.cjs +0 -500
  104. package/statusline.ps1 +0 -307
  105. package/statusline.sh +0 -237
  106. package/workflows/development-rules.md +0 -42
  107. package/workflows/documentation-management.md +0 -121
  108. package/workflows/orchestration-protocol.md +0 -16
  109. package/workflows/primary-workflow.md +0 -45
  110. /package/{commands → merged-commands}/ask/fast.md +0 -0
  111. /package/{commands → merged-commands}/ask/hard.md +0 -0
  112. /package/{commands-claudekit → merged-commands}/ask.md +0 -0
  113. /package/{commands → merged-commands}/auto.md +0 -0
  114. /package/{commands-claudekit → merged-commands}/bootstrap/auto/fast.md +0 -0
  115. /package/{commands-claudekit → merged-commands}/bootstrap/auto/parallel.md +0 -0
  116. /package/{commands-claudekit → merged-commands}/bootstrap/auto.md +0 -0
  117. /package/{commands-claudekit → merged-commands}/bootstrap.md +0 -0
  118. /package/{commands → merged-commands}/brainstorm/fast.md +0 -0
  119. /package/{commands → merged-commands}/brainstorm/hard.md +0 -0
  120. /package/{commands-claudekit → merged-commands}/brainstorm.md +0 -0
  121. /package/{commands-claudekit → merged-commands}/ck-help.md +0 -0
  122. /package/{commands-claudekit → merged-commands}/code/auto.md +0 -0
  123. /package/{commands → merged-commands}/code/fast.md +0 -0
  124. /package/{commands → merged-commands}/code/hard.md +0 -0
  125. /package/{commands-claudekit → merged-commands}/code/no-test.md +0 -0
  126. /package/{commands-claudekit → merged-commands}/code/parallel.md +0 -0
  127. /package/{commands-claudekit → merged-commands}/code.md +0 -0
  128. /package/{commands-claudekit → merged-commands}/coding-level.md +0 -0
  129. /package/{commands-claudekit → merged-commands}/content/cro.md +0 -0
  130. /package/{commands-claudekit → merged-commands}/content/enhance.md +0 -0
  131. /package/{commands-claudekit → merged-commands}/content/fast.md +0 -0
  132. /package/{commands-claudekit → merged-commands}/content/good.md +0 -0
  133. /package/{commands-claudekit → merged-commands}/cook/auto/fast.md +0 -0
  134. /package/{commands-claudekit → merged-commands}/cook/auto/parallel.md +0 -0
  135. /package/{commands-claudekit → merged-commands}/cook/auto.md +0 -0
  136. /package/{commands → merged-commands}/cook/fast.md +0 -0
  137. /package/{commands → merged-commands}/cook/hard.md +0 -0
  138. /package/{commands-claudekit → merged-commands}/cook.md +0 -0
  139. /package/{commands → merged-commands}/debug/fast.md +0 -0
  140. /package/{commands → merged-commands}/debug/hard.md +0 -0
  141. /package/{commands-claudekit → merged-commands}/debug.md +0 -0
  142. /package/{commands → merged-commands}/deploy/check.md +0 -0
  143. /package/{commands → merged-commands}/deploy/preview.md +0 -0
  144. /package/{commands → merged-commands}/deploy/production.md +0 -0
  145. /package/{commands → merged-commands}/deploy/rollback.md +0 -0
  146. /package/{commands → merged-commands}/deploy.md +0 -0
  147. /package/{commands-claudekit → merged-commands}/design/3d.md +0 -0
  148. /package/{commands-claudekit → merged-commands}/design/describe.md +0 -0
  149. /package/{commands-claudekit → merged-commands}/design/fast.md +0 -0
  150. /package/{commands-claudekit → merged-commands}/design/good.md +0 -0
  151. /package/{commands → merged-commands}/design/hard.md +0 -0
  152. /package/{commands-claudekit → merged-commands}/design/screenshot.md +0 -0
  153. /package/{commands-claudekit → merged-commands}/design/video.md +0 -0
  154. /package/{commands → merged-commands}/design.md +0 -0
  155. /package/{commands → merged-commands}/docs/audit.md +0 -0
  156. /package/{commands → merged-commands}/docs/business.md +0 -0
  157. /package/{commands → merged-commands}/docs/core.md +0 -0
  158. /package/{commands-claudekit → merged-commands}/docs/init.md +0 -0
  159. /package/{commands-claudekit → merged-commands}/docs/summarize.md +0 -0
  160. /package/{commands-claudekit → merged-commands}/docs/update.md +0 -0
  161. /package/{commands → merged-commands}/docs.md +0 -0
  162. /package/{commands-claudekit → merged-commands}/fix/ci.md +0 -0
  163. /package/{commands-claudekit → merged-commands}/fix/fast.md +0 -0
  164. /package/{commands-claudekit → merged-commands}/fix/hard.md +0 -0
  165. /package/{commands-claudekit → merged-commands}/fix/logs.md +0 -0
  166. /package/{commands-claudekit → merged-commands}/fix/parallel.md +0 -0
  167. /package/{commands-claudekit → merged-commands}/fix/test.md +0 -0
  168. /package/{commands-claudekit → merged-commands}/fix/types.md +0 -0
  169. /package/{commands-claudekit → merged-commands}/fix/ui.md +0 -0
  170. /package/{commands-claudekit → merged-commands}/fix.md +0 -0
  171. /package/{commands-claudekit → merged-commands}/git/cm.md +0 -0
  172. /package/{commands-claudekit → merged-commands}/git/cp.md +0 -0
  173. /package/{commands-claudekit → merged-commands}/git/merge.md +0 -0
  174. /package/{commands-claudekit → merged-commands}/git/pr.md +0 -0
  175. /package/{commands-claudekit → merged-commands}/integrate/polar.md +0 -0
  176. /package/{commands-claudekit → merged-commands}/integrate/sepay.md +0 -0
  177. /package/{commands-claudekit → merged-commands}/journal.md +0 -0
  178. /package/{commands-claudekit → merged-commands}/kanban.md +0 -0
  179. /package/{commands-claudekit → merged-commands}/plan/archive.md +0 -0
  180. /package/{commands-claudekit → merged-commands}/plan/ci.md +0 -0
  181. /package/{commands-claudekit → merged-commands}/plan/cro.md +0 -0
  182. /package/{commands-claudekit → merged-commands}/plan/fast.md +0 -0
  183. /package/{commands-claudekit → merged-commands}/plan/hard.md +0 -0
  184. /package/{commands-claudekit → merged-commands}/plan/parallel.md +0 -0
  185. /package/{commands-claudekit → merged-commands}/plan/two.md +0 -0
  186. /package/{commands-claudekit → merged-commands}/plan/validate.md +0 -0
  187. /package/{commands-claudekit → merged-commands}/plan.md +0 -0
  188. /package/{commands-claudekit → merged-commands}/preview.md +0 -0
  189. /package/{commands-claudekit → merged-commands}/review/codebase/parallel.md +0 -0
  190. /package/{commands-claudekit → merged-commands}/review/codebase.md +0 -0
  191. /package/{commands → merged-commands}/review/fast.md +0 -0
  192. /package/{commands → merged-commands}/review/hard.md +0 -0
  193. /package/{commands → merged-commands}/review.md +0 -0
  194. /package/{commands-claudekit → merged-commands}/scout/ext.md +0 -0
  195. /package/{commands-claudekit → merged-commands}/scout.md +0 -0
  196. /package/{commands-claudekit → merged-commands}/skill/add.md +0 -0
  197. /package/{commands-claudekit → merged-commands}/skill/create.md +0 -0
  198. /package/{commands-claudekit → merged-commands}/skill/fix-logs.md +0 -0
  199. /package/{commands-claudekit → merged-commands}/skill/optimize/auto.md +0 -0
  200. /package/{commands-claudekit → merged-commands}/skill/optimize.md +0 -0
  201. /package/{commands-claudekit → merged-commands}/skill/plan.md +0 -0
  202. /package/{commands-claudekit → merged-commands}/skill/update.md +0 -0
  203. /package/{commands → merged-commands}/test/fast.md +0 -0
  204. /package/{commands → merged-commands}/test/hard.md +0 -0
  205. /package/{commands-claudekit → merged-commands}/test/ui.md +0 -0
  206. /package/{commands-claudekit → merged-commands}/test.md +0 -0
  207. /package/{commands-claudekit → merged-commands}/use-mcp.md +0 -0
  208. /package/{commands-claudekit → merged-commands}/watzup.md +0 -0
  209. /package/{commands-claudekit → merged-commands}/worktree.md +0 -0
  210. /package/{rules → templates/dart/rules}/dart/best-practices/SKILL.md +0 -0
  211. /package/{rules → templates/dart/rules}/dart/language/SKILL.md +0 -0
  212. /package/{rules → templates/dart/rules}/dart/tooling/SKILL.md +0 -0
  213. /package/{rules → templates/flutter/rules}/flutter/auto-route-navigation/SKILL.md +0 -0
  214. /package/{rules → templates/flutter/rules}/flutter/auto-route-navigation/references/REFERENCE.md +0 -0
  215. /package/{rules → templates/flutter/rules}/flutter/auto-route-navigation/references/router-config.md +0 -0
  216. /package/{rules → templates/flutter/rules}/flutter/bloc-state-management/SKILL.md +0 -0
  217. /package/{rules → templates/flutter/rules}/flutter/bloc-state-management/references/REFERENCE.md +0 -0
  218. /package/{rules → templates/flutter/rules}/flutter/bloc-state-management/references/auth-bloc-example.md +0 -0
  219. /package/{rules → templates/flutter/rules}/flutter/bloc-state-management/references/equatable-usage.md +0 -0
  220. /package/{rules → templates/flutter/rules}/flutter/bloc-state-management/references/property-based-state.md +0 -0
  221. /package/{rules → templates/flutter/rules}/flutter/bloc.rule.md +0 -0
  222. /package/{rules → templates/flutter/rules}/flutter/cicd/SKILL.md +0 -0
  223. /package/{rules → templates/flutter/rules}/flutter/cicd/references/advanced-workflow.md +0 -0
  224. /package/{rules → templates/flutter/rules}/flutter/cicd/references/fastlane.md +0 -0
  225. /package/{rules → templates/flutter/rules}/flutter/cicd/references/github-actions.md +0 -0
  226. /package/{rules → templates/flutter/rules}/flutter/dependency-injection/SKILL.md +0 -0
  227. /package/{rules → templates/flutter/rules}/flutter/dependency-injection/references/REFERENCE.md +0 -0
  228. /package/{rules → templates/flutter/rules}/flutter/dependency-injection/references/modules.md +0 -0
  229. /package/{rules → templates/flutter/rules}/flutter/error-handling/SKILL.md +0 -0
  230. /package/{rules → templates/flutter/rules}/flutter/error-handling/references/REFERENCE.md +0 -0
  231. /package/{rules → templates/flutter/rules}/flutter/error-handling/references/error-mapping.md +0 -0
  232. /package/{rules → templates/flutter/rules}/flutter/feature-based-clean-architecture/SKILL.md +0 -0
  233. /package/{rules → templates/flutter/rules}/flutter/feature-based-clean-architecture/references/REFERENCE.md +0 -0
  234. /package/{rules → templates/flutter/rules}/flutter/feature-based-clean-architecture/references/folder-structure.md +0 -0
  235. /package/{rules → templates/flutter/rules}/flutter/getx-navigation/SKILL.md +0 -0
  236. /package/{rules → templates/flutter/rules}/flutter/getx-navigation/references/app-pages.md +0 -0
  237. /package/{rules → templates/flutter/rules}/flutter/getx-navigation/references/middleware-example.md +0 -0
  238. /package/{rules → templates/flutter/rules}/flutter/getx-state-management/SKILL.md +0 -0
  239. /package/{rules → templates/flutter/rules}/flutter/getx-state-management/references/binding-example.md +0 -0
  240. /package/{rules → templates/flutter/rules}/flutter/getx-state-management/references/reactive-vs-simple.md +0 -0
  241. /package/{rules → templates/flutter/rules}/flutter/go-router-navigation/SKILL.md +0 -0
  242. /package/{rules → templates/flutter/rules}/flutter/idiomatic-flutter/SKILL.md +0 -0
  243. /package/{rules → templates/flutter/rules}/flutter/layer-based-clean-architecture/SKILL.md +0 -0
  244. /package/{rules → templates/flutter/rules}/flutter/layer-based-clean-architecture/references/REFERENCE.md +0 -0
  245. /package/{rules → templates/flutter/rules}/flutter/layer-based-clean-architecture/references/repository-mapping.md +0 -0
  246. /package/{rules → templates/flutter/rules}/flutter/localization/SKILL.md +0 -0
  247. /package/{rules → templates/flutter/rules}/flutter/localization/references/REFERENCE.md +0 -0
  248. /package/{rules → templates/flutter/rules}/flutter/localization/references/sheet-loader.md +0 -0
  249. /package/{rules → templates/flutter/rules}/flutter/navigator-v1-navigation/SKILL.md +0 -0
  250. /package/{rules → templates/flutter/rules}/flutter/navigator-v1-navigation/references/on-generate-route.md +0 -0
  251. /package/{rules → templates/flutter/rules}/flutter/performance/SKILL.md +0 -0
  252. /package/{rules → templates/flutter/rules}/flutter/retrofit-networking/SKILL.md +0 -0
  253. /package/{rules → templates/flutter/rules}/flutter/retrofit-networking/references/REFERENCE.md +0 -0
  254. /package/{rules → templates/flutter/rules}/flutter/retrofit-networking/references/token-refresh.md +0 -0
  255. /package/{rules → templates/flutter/rules}/flutter/riverpod-state-management/SKILL.md +0 -0
  256. /package/{rules → templates/flutter/rules}/flutter/riverpod-state-management/references/architecture.md +0 -0
  257. /package/{rules → templates/flutter/rules}/flutter/riverpod-state-management/references/best-practices.md +0 -0
  258. /package/{rules → templates/flutter/rules}/flutter/riverpod-state-management/references/testing.md +0 -0
  259. /package/{rules → templates/flutter/rules}/flutter/riverpod.rule.md +0 -0
  260. /package/{rules → templates/flutter/rules}/flutter/security/SKILL.md +0 -0
  261. /package/{rules → templates/flutter/rules}/flutter/security/references/REFERENCE.md +0 -0
  262. /package/{rules → templates/flutter/rules}/flutter/security/references/network-security.md +0 -0
  263. /package/{rules → templates/flutter/rules}/flutter/testing/SKILL.md +0 -0
  264. /package/{rules → templates/flutter/rules}/flutter/testing/references/REFERENCE.md +0 -0
  265. /package/{rules → templates/flutter/rules}/flutter/testing/references/bloc-testing.md +0 -0
  266. /package/{rules → templates/flutter/rules}/flutter/testing/references/integration-testing.md +0 -0
  267. /package/{rules → templates/flutter/rules}/flutter/testing/references/robot-pattern.md +0 -0
  268. /package/{rules → templates/flutter/rules}/flutter/testing/references/unit-testing.md +0 -0
  269. /package/{rules → templates/flutter/rules}/flutter/testing/references/widget-testing.md +0 -0
  270. /package/{rules → templates/flutter/rules}/flutter/widgets/SKILL.md +0 -0
  271. /package/{rules → templates/golang/rules}/golang/chi-router/SKILL.md +0 -0
  272. /package/{rules → templates/golang/rules}/golang/chi-router/references/REFERENCE.md +0 -0
  273. /package/{rules → templates/golang/rules}/golang/chi-router/references/routing-patterns.md +0 -0
  274. /package/{rules → templates/golang/rules}/golang/cobra-cli/SKILL.md +0 -0
  275. /package/{rules → templates/golang/rules}/golang/cobra-cli/references/REFERENCE.md +0 -0
  276. /package/{rules → templates/golang/rules}/golang/cobra-cli/references/command-patterns.md +0 -0
  277. /package/{rules → templates/golang/rules}/golang/core/SKILL.md +0 -0
  278. /package/{rules → templates/golang/rules}/golang/core/references/REFERENCE.md +0 -0
  279. /package/{rules → templates/golang/rules}/golang/core/references/concurrency-patterns.md +0 -0
  280. /package/{rules → templates/golang/rules}/golang/core/references/error-handling.md +0 -0
  281. /package/{rules → templates/golang/rules}/golang/echo-framework/SKILL.md +0 -0
  282. /package/{rules → templates/golang/rules}/golang/echo-framework/references/REFERENCE.md +0 -0
  283. /package/{rules → templates/golang/rules}/golang/echo-framework/references/middleware-patterns.md +0 -0
  284. /package/{rules → templates/golang/rules}/golang/echo-framework/references/routing-patterns.md +0 -0
  285. /package/{rules → templates/golang/rules}/golang/ent-orm/SKILL.md +0 -0
  286. /package/{rules → templates/golang/rules}/golang/ent-orm/references/REFERENCE.md +0 -0
  287. /package/{rules → templates/golang/rules}/golang/ent-orm/references/schema-patterns.md +0 -0
  288. /package/{rules → templates/golang/rules}/golang/fiber-framework/SKILL.md +0 -0
  289. /package/{rules → templates/golang/rules}/golang/fiber-framework/references/REFERENCE.md +0 -0
  290. /package/{rules → templates/golang/rules}/golang/fiber-framework/references/routing-patterns.md +0 -0
  291. /package/{rules → templates/golang/rules}/golang/gin-framework/SKILL.md +0 -0
  292. /package/{rules → templates/golang/rules}/golang/gin-framework/references/REFERENCE.md +0 -0
  293. /package/{rules → templates/golang/rules}/golang/gin-framework/references/middleware-patterns.md +0 -0
  294. /package/{rules → templates/golang/rules}/golang/gorm-orm/SKILL.md +0 -0
  295. /package/{rules → templates/golang/rules}/golang/gorm-orm/references/REFERENCE.md +0 -0
  296. /package/{rules → templates/golang/rules}/golang/gorm-orm/references/model-definitions.md +0 -0
  297. /package/{rules → templates/golang/rules}/golang/gorm-orm/references/query-patterns.md +0 -0
  298. /package/{rules → templates/golang/rules}/golang/grpc/SKILL.md +0 -0
  299. /package/{rules → templates/golang/rules}/golang/grpc/references/REFERENCE.md +0 -0
  300. /package/{rules → templates/golang/rules}/golang/grpc/references/service-patterns.md +0 -0
  301. /package/{rules → templates/golang/rules}/golang/testify/SKILL.md +0 -0
  302. /package/{rules → templates/golang/rules}/golang/testify/references/REFERENCE.md +0 -0
  303. /package/{rules → templates/golang/rules}/golang/testify/references/assert-patterns.md +0 -0
  304. /package/{rules → templates/golang/rules}/golang/validator/SKILL.md +0 -0
  305. /package/{rules → templates/golang/rules}/golang/validator/references/REFERENCE.md +0 -0
  306. /package/{rules → templates/golang/rules}/golang/validator/references/validation-tags.md +0 -0
  307. /package/{rules → templates/golang/rules}/golang/viper-config/SKILL.md +0 -0
  308. /package/{rules → templates/golang/rules}/golang/viper-config/references/REFERENCE.md +0 -0
  309. /package/{rules → templates/golang/rules}/golang/viper-config/references/config-loading.md +0 -0
  310. /package/{rules → templates/golang/rules}/golang/wire-di/SKILL.md +0 -0
  311. /package/{rules → templates/golang/rules}/golang/wire-di/references/REFERENCE.md +0 -0
  312. /package/{rules → templates/golang/rules}/golang/wire-di/references/provider-patterns.md +0 -0
  313. /package/{rules → templates/golang/rules}/golang/zap-logging/SKILL.md +0 -0
  314. /package/{rules → templates/golang/rules}/golang/zap-logging/references/REFERENCE.md +0 -0
  315. /package/{rules → templates/golang/rules}/golang/zap-logging/references/logger-config.md +0 -0
  316. /package/{rules → templates/java/rules}/java/build-gradle/SKILL.md +0 -0
  317. /package/{rules → templates/java/rules}/java/build-gradle/references/REFERENCE.md +0 -0
  318. /package/{rules → templates/java/rules}/java/build-gradle/references/kotlin-dsl.md +0 -0
  319. /package/{rules → templates/java/rules}/java/build-gradle/references/task-configuration.md +0 -0
  320. /package/{rules → templates/java/rules}/java/build-maven/SKILL.md +0 -0
  321. /package/{rules → templates/java/rules}/java/build-maven/references/REFERENCE.md +0 -0
  322. /package/{rules → templates/java/rules}/java/build-maven/references/dependency-management.md +0 -0
  323. /package/{rules → templates/java/rules}/java/build-maven/references/lifecycle-phases.md +0 -0
  324. /package/{rules → templates/java/rules}/java/graalvm-native/SKILL.md +0 -0
  325. /package/{rules → templates/java/rules}/java/graalvm-native/references/REFERENCE.md +0 -0
  326. /package/{rules → templates/java/rules}/java/java-collections-streams/SKILL.md +0 -0
  327. /package/{rules → templates/java/rules}/java/java-collections-streams/references/REFERENCE.md +0 -0
  328. /package/{rules → templates/java/rules}/java/java-collections-streams/references/collectors-patterns.md +0 -0
  329. /package/{rules → templates/java/rules}/java/java-collections-streams/references/stream-pipelines.md +0 -0
  330. /package/{rules → templates/java/rules}/java/java-concurrency/SKILL.md +0 -0
  331. /package/{rules → templates/java/rules}/java/java-concurrency/references/REFERENCE.md +0 -0
  332. /package/{rules → templates/java/rules}/java/java-concurrency/references/completable-future.md +0 -0
  333. /package/{rules → templates/java/rules}/java/java-concurrency/references/executor-patterns.md +0 -0
  334. /package/{rules → templates/java/rules}/java/java-concurrency/references/virtual-threads.md +0 -0
  335. /package/{rules → templates/java/rules}/java/java-core-language/SKILL.md +0 -0
  336. /package/{rules → templates/java/rules}/java/java-core-language/references/REFERENCE.md +0 -0
  337. /package/{rules → templates/java/rules}/java/java-core-language/references/jvm-memory-model.md +0 -0
  338. /package/{rules → templates/java/rules}/java/java-core-language/references/modern-java-features.md +0 -0
  339. /package/{rules → templates/java/rules}/java/java-project-structure/SKILL.md +0 -0
  340. /package/{rules → templates/java/rules}/java/java-project-structure/references/REFERENCE.md +0 -0
  341. /package/{rules → templates/java/rules}/java/java-project-structure/references/maven-project-layout.md +0 -0
  342. /package/{rules → templates/java/rules}/java/java-project-structure/references/module-system.md +0 -0
  343. /package/{rules → templates/java/rules}/java/micronaut-core/SKILL.md +0 -0
  344. /package/{rules → templates/java/rules}/java/micronaut-core/references/REFERENCE.md +0 -0
  345. /package/{rules → templates/java/rules}/java/micronaut-reactive/SKILL.md +0 -0
  346. /package/{rules → templates/java/rules}/java/micronaut-reactive/references/REFERENCE.md +0 -0
  347. /package/{rules → templates/java/rules}/java/quarkus-core/SKILL.md +0 -0
  348. /package/{rules → templates/java/rules}/java/quarkus-core/references/REFERENCE.md +0 -0
  349. /package/{rules → templates/java/rules}/java/quarkus-reactive/SKILL.md +0 -0
  350. /package/{rules → templates/java/rules}/java/quarkus-reactive/references/REFERENCE.md +0 -0
  351. /package/{rules → templates/java/rules}/java/spring-batch/SKILL.md +0 -0
  352. /package/{rules → templates/java/rules}/java/spring-batch/references/REFERENCE.md +0 -0
  353. /package/{rules → templates/java/rules}/java/spring-boot-architecture/SKILL.md +0 -0
  354. /package/{rules → templates/java/rules}/java/spring-boot-architecture/references/REFERENCE.md +0 -0
  355. /package/{rules → templates/java/rules}/java/spring-boot-architecture/references/auto-configuration.md +0 -0
  356. /package/{rules → templates/java/rules}/java/spring-boot-architecture/references/configuration-properties.md +0 -0
  357. /package/{rules → templates/java/rules}/java/spring-boot-web/SKILL.md +0 -0
  358. /package/{rules → templates/java/rules}/java/spring-boot-web/references/REFERENCE.md +0 -0
  359. /package/{rules → templates/java/rules}/java/spring-cloud/SKILL.md +0 -0
  360. /package/{rules → templates/java/rules}/java/spring-cloud/references/REFERENCE.md +0 -0
  361. /package/{rules → templates/java/rules}/java/spring-data-jpa/SKILL.md +0 -0
  362. /package/{rules → templates/java/rules}/java/spring-data-jpa/references/REFERENCE.md +0 -0
  363. /package/{rules → templates/java/rules}/java/spring-security/SKILL.md +0 -0
  364. /package/{rules → templates/java/rules}/java/spring-security/references/REFERENCE.md +0 -0
  365. /package/{rules → templates/java/rules}/java/spring-security/references/jwt-auth-flow.md +0 -0
  366. /package/{rules → templates/java/rules}/java/testing-junit-mockito/SKILL.md +0 -0
  367. /package/{rules → templates/java/rules}/java/testing-junit-mockito/references/REFERENCE.md +0 -0
  368. /package/{rules → templates/java/rules}/java/testing-junit-mockito/references/junit5-patterns.md +0 -0
  369. /package/{rules → templates/java/rules}/java/testing-junit-mockito/references/mockito-patterns.md +0 -0
  370. /package/{rules → templates/java/rules}/java/testing-junit-mockito/references/spring-boot-testing.md +0 -0
  371. /package/{rules → templates/javascript/rules}/javascript/best-practices/SKILL.md +0 -0
  372. /package/{rules → templates/javascript/rules}/javascript/best-practices/references/REFERENCE.md +0 -0
  373. /package/{rules → templates/javascript/rules}/javascript/language/SKILL.md +0 -0
  374. /package/{rules → templates/javascript/rules}/javascript/language/references/REFERENCE.md +0 -0
  375. /package/{rules → templates/javascript/rules}/javascript/tooling/SKILL.md +0 -0
  376. /package/{rules → templates/javascript/rules}/javascript/tooling/references/REFERENCE.md +0 -0
  377. /package/{rules → templates/nestjs/rules}/nestjs/api-standards/SKILL.md +0 -0
  378. /package/{rules → templates/nestjs/rules}/nestjs/api-standards/references/pagination-wrapper.md +0 -0
  379. /package/{rules → templates/nestjs/rules}/nestjs/architecture/SKILL.md +0 -0
  380. /package/{rules → templates/nestjs/rules}/nestjs/architecture/references/dynamic-module.md +0 -0
  381. /package/{rules → templates/nestjs/rules}/nestjs/caching/SKILL.md +0 -0
  382. /package/{rules → templates/nestjs/rules}/nestjs/caching/references/REFERENCE.md +0 -0
  383. /package/{rules → templates/nestjs/rules}/nestjs/caching/references/cache-patterns.md +0 -0
  384. /package/{rules → templates/nestjs/rules}/nestjs/configuration/SKILL.md +0 -0
  385. /package/{rules → templates/nestjs/rules}/nestjs/configuration/references/REFERENCE.md +0 -0
  386. /package/{rules → templates/nestjs/rules}/nestjs/configuration/references/config-patterns.md +0 -0
  387. /package/{rules → templates/nestjs/rules}/nestjs/controllers-services/SKILL.md +0 -0
  388. /package/{rules → templates/nestjs/rules}/nestjs/controllers-services/references/REFERENCE.md +0 -0
  389. /package/{rules → templates/nestjs/rules}/nestjs/controllers-services/references/controller-patterns.md +0 -0
  390. /package/{rules → templates/nestjs/rules}/nestjs/controllers-services/references/service-patterns.md +0 -0
  391. /package/{rules → templates/nestjs/rules}/nestjs/database/SKILL.md +0 -0
  392. /package/{rules → templates/nestjs/rules}/nestjs/database/references/REFERENCE.md +0 -0
  393. /package/{rules → templates/nestjs/rules}/nestjs/database/references/typeorm-patterns.md +0 -0
  394. /package/{rules → templates/nestjs/rules}/nestjs/deployment/SKILL.md +0 -0
  395. /package/{rules → templates/nestjs/rules}/nestjs/deployment/references/REFERENCE.md +0 -0
  396. /package/{rules → templates/nestjs/rules}/nestjs/deployment/references/deployment-patterns.md +0 -0
  397. /package/{rules → templates/nestjs/rules}/nestjs/documentation/SKILL.md +0 -0
  398. /package/{rules → templates/nestjs/rules}/nestjs/documentation/references/REFERENCE.md +0 -0
  399. /package/{rules → templates/nestjs/rules}/nestjs/documentation/references/swagger-patterns.md +0 -0
  400. /package/{rules → templates/nestjs/rules}/nestjs/error-handling/SKILL.md +0 -0
  401. /package/{rules → templates/nestjs/rules}/nestjs/error-handling/references/REFERENCE.md +0 -0
  402. /package/{rules → templates/nestjs/rules}/nestjs/error-handling/references/exception-filters.md +0 -0
  403. /package/{rules → templates/nestjs/rules}/nestjs/file-uploads/SKILL.md +0 -0
  404. /package/{rules → templates/nestjs/rules}/nestjs/file-uploads/references/REFERENCE.md +0 -0
  405. /package/{rules → templates/nestjs/rules}/nestjs/file-uploads/references/upload-patterns.md +0 -0
  406. /package/{rules → templates/nestjs/rules}/nestjs/observability/SKILL.md +0 -0
  407. /package/{rules → templates/nestjs/rules}/nestjs/observability/references/REFERENCE.md +0 -0
  408. /package/{rules → templates/nestjs/rules}/nestjs/observability/references/logging-metrics.md +0 -0
  409. /package/{rules → templates/nestjs/rules}/nestjs/performance/SKILL.md +0 -0
  410. /package/{rules → templates/nestjs/rules}/nestjs/performance/references/REFERENCE.md +0 -0
  411. /package/{rules → templates/nestjs/rules}/nestjs/performance/references/performance-patterns.md +0 -0
  412. /package/{rules → templates/nestjs/rules}/nestjs/real-time/SKILL.md +0 -0
  413. /package/{rules → templates/nestjs/rules}/nestjs/real-time/references/REFERENCE.md +0 -0
  414. /package/{rules → templates/nestjs/rules}/nestjs/real-time/references/websocket-patterns.md +0 -0
  415. /package/{rules → templates/nestjs/rules}/nestjs/scheduling/SKILL.md +0 -0
  416. /package/{rules → templates/nestjs/rules}/nestjs/scheduling/references/REFERENCE.md +0 -0
  417. /package/{rules → templates/nestjs/rules}/nestjs/scheduling/references/scheduling-patterns.md +0 -0
  418. /package/{rules → templates/nestjs/rules}/nestjs/search/SKILL.md +0 -0
  419. /package/{rules → templates/nestjs/rules}/nestjs/search/references/REFERENCE.md +0 -0
  420. /package/{rules → templates/nestjs/rules}/nestjs/search/references/search-patterns.md +0 -0
  421. /package/{rules → templates/nestjs/rules}/nestjs/security/SKILL.md +0 -0
  422. /package/{rules → templates/nestjs/rules}/nestjs/security/references/REFERENCE.md +0 -0
  423. /package/{rules → templates/nestjs/rules}/nestjs/security/references/authentication.md +0 -0
  424. /package/{rules → templates/nestjs/rules}/nestjs/testing/SKILL.md +0 -0
  425. /package/{rules → templates/nestjs/rules}/nestjs/testing/references/REFERENCE.md +0 -0
  426. /package/{rules → templates/nestjs/rules}/nestjs/testing/references/unit-testing.md +0 -0
  427. /package/{rules → templates/nestjs/rules}/nestjs/transport/SKILL.md +0 -0
  428. /package/{rules → templates/nestjs/rules}/nestjs/transport/references/REFERENCE.md +0 -0
  429. /package/{rules → templates/nestjs/rules}/nestjs/transport/references/microservices-patterns.md +0 -0
  430. /package/{rules → templates/nextjs/rules}/nextjs/app-router/SKILL.md +0 -0
  431. /package/{rules → templates/nextjs/rules}/nextjs/app-router/references/REFERENCE.md +0 -0
  432. /package/{rules → templates/nextjs/rules}/nextjs/app-router/references/routing-patterns.md +0 -0
  433. /package/{rules → templates/nextjs/rules}/nextjs/architecture/SKILL.md +0 -0
  434. /package/{rules → templates/nextjs/rules}/nextjs/architecture/references/fsd-structure.md +0 -0
  435. /package/{rules → templates/nextjs/rules}/nextjs/authentication/SKILL.md +0 -0
  436. /package/{rules → templates/nextjs/rules}/nextjs/authentication/references/auth-implementation.md +0 -0
  437. /package/{rules → templates/nextjs/rules}/nextjs/caching/SKILL.md +0 -0
  438. /package/{rules → templates/nextjs/rules}/nextjs/caching/references/REFERENCE.md +0 -0
  439. /package/{rules → templates/nextjs/rules}/nextjs/caching/references/cache-strategies.md +0 -0
  440. /package/{rules → templates/nextjs/rules}/nextjs/data-access-layer/SKILL.md +0 -0
  441. /package/{rules → templates/nextjs/rules}/nextjs/data-access-layer/references/patterns.md +0 -0
  442. /package/{rules → templates/nextjs/rules}/nextjs/data-fetching/SKILL.md +0 -0
  443. /package/{rules → templates/nextjs/rules}/nextjs/data-fetching/references/REFERENCE.md +0 -0
  444. /package/{rules → templates/nextjs/rules}/nextjs/data-fetching/references/fetch-patterns.md +0 -0
  445. /package/{rules → templates/nextjs/rules}/nextjs/internationalization/SKILL.md +0 -0
  446. /package/{rules → templates/nextjs/rules}/nextjs/internationalization/references/REFERENCE.md +0 -0
  447. /package/{rules → templates/nextjs/rules}/nextjs/internationalization/references/i18n-patterns.md +0 -0
  448. /package/{rules → templates/nextjs/rules}/nextjs/optimization/SKILL.md +0 -0
  449. /package/{rules → templates/nextjs/rules}/nextjs/optimization/references/REFERENCE.md +0 -0
  450. /package/{rules → templates/nextjs/rules}/nextjs/optimization/references/optimization-patterns.md +0 -0
  451. /package/{rules → templates/nextjs/rules}/nextjs/rendering/SKILL.md +0 -0
  452. /package/{rules → templates/nextjs/rules}/nextjs/rendering/references/REFERENCE.md +0 -0
  453. /package/{rules → templates/nextjs/rules}/nextjs/rendering/references/rendering-modes.md +0 -0
  454. /package/{rules → templates/nextjs/rules}/nextjs/server-actions/SKILL.md +0 -0
  455. /package/{rules → templates/nextjs/rules}/nextjs/server-actions/references/REFERENCE.md +0 -0
  456. /package/{rules → templates/nextjs/rules}/nextjs/server-actions/references/action-patterns.md +0 -0
  457. /package/{rules → templates/nextjs/rules}/nextjs/server-components/SKILL.md +0 -0
  458. /package/{rules → templates/nextjs/rules}/nextjs/server-components/references/REFERENCE.md +0 -0
  459. /package/{rules → templates/nextjs/rules}/nextjs/server-components/references/component-patterns.md +0 -0
  460. /package/{rules → templates/nextjs/rules}/nextjs/state-management/SKILL.md +0 -0
  461. /package/{rules → templates/nextjs/rules}/nextjs/state-management/references/REFERENCE.md +0 -0
  462. /package/{rules → templates/nextjs/rules}/nextjs/state-management/references/state-patterns.md +0 -0
  463. /package/{rules → templates/nextjs/rules}/nextjs/styling/SKILL.md +0 -0
  464. /package/{rules → templates/nextjs/rules}/nextjs/styling/references/implementation.md +0 -0
  465. /package/{rules → templates/react/rules}/react/component-patterns/SKILL.md +0 -0
  466. /package/{rules → templates/react/rules}/react/component-patterns/references/REFERENCE.md +0 -0
  467. /package/{rules → templates/react/rules}/react/hooks/SKILL.md +0 -0
  468. /package/{rules → templates/react/rules}/react/hooks/references/REFERENCE.md +0 -0
  469. /package/{rules → templates/react/rules}/react/hooks.rule.md +0 -0
  470. /package/{rules → templates/react/rules}/react/performance/SKILL.md +0 -0
  471. /package/{rules → templates/react/rules}/react/performance/references/REFERENCE.md +0 -0
  472. /package/{rules → templates/react/rules}/react/security/SKILL.md +0 -0
  473. /package/{rules → templates/react/rules}/react/security/references/REFERENCE.md +0 -0
  474. /package/{rules → templates/react/rules}/react/state-management/SKILL.md +0 -0
  475. /package/{rules → templates/react/rules}/react/state-management/references/REFERENCE.md +0 -0
  476. /package/{rules → templates/react/rules}/react/testing/SKILL.md +0 -0
  477. /package/{rules → templates/react/rules}/react/testing/references/REFERENCE.md +0 -0
  478. /package/{rules → templates/react/rules}/react/tooling/SKILL.md +0 -0
  479. /package/{rules → templates/react/rules}/react/typescript/SKILL.md +0 -0
  480. /package/{rules → templates/rust/rules}/rust/actix-web/SKILL.md +0 -0
  481. /package/{rules → templates/rust/rules}/rust/actix-web/references/REFERENCE.md +0 -0
  482. /package/{rules → templates/rust/rules}/rust/actix-web/references/handler-patterns.md +0 -0
  483. /package/{rules → templates/rust/rules}/rust/async-graphql/SKILL.md +0 -0
  484. /package/{rules → templates/rust/rules}/rust/async-graphql/references/REFERENCE.md +0 -0
  485. /package/{rules → templates/rust/rules}/rust/async-graphql/references/schema-patterns.md +0 -0
  486. /package/{rules → templates/rust/rules}/rust/axum/SKILL.md +0 -0
  487. /package/{rules → templates/rust/rules}/rust/axum/references/REFERENCE.md +0 -0
  488. /package/{rules → templates/rust/rules}/rust/axum/references/handler-patterns.md +0 -0
  489. /package/{rules → templates/rust/rules}/rust/bevy/SKILL.md +0 -0
  490. /package/{rules → templates/rust/rules}/rust/bevy/references/REFERENCE.md +0 -0
  491. /package/{rules → templates/rust/rules}/rust/bevy/references/ecs-patterns.md +0 -0
  492. /package/{rules → templates/rust/rules}/rust/clap/SKILL.md +0 -0
  493. /package/{rules → templates/rust/rules}/rust/clap/references/REFERENCE.md +0 -0
  494. /package/{rules → templates/rust/rules}/rust/clap/references/derive-patterns.md +0 -0
  495. /package/{rules → templates/rust/rules}/rust/core/SKILL.md +0 -0
  496. /package/{rules → templates/rust/rules}/rust/core/references/REFERENCE.md +0 -0
  497. /package/{rules → templates/rust/rules}/rust/core/references/error-handling.md +0 -0
  498. /package/{rules → templates/rust/rules}/rust/diesel-orm/SKILL.md +0 -0
  499. /package/{rules → templates/rust/rules}/rust/diesel-orm/references/REFERENCE.md +0 -0
  500. /package/{rules → templates/rust/rules}/rust/diesel-orm/references/schema-patterns.md +0 -0
  501. /package/{rules → templates/rust/rules}/rust/rocket/SKILL.md +0 -0
  502. /package/{rules → templates/rust/rules}/rust/rocket/references/REFERENCE.md +0 -0
  503. /package/{rules → templates/rust/rules}/rust/rocket/references/handler-patterns.md +0 -0
  504. /package/{rules → templates/rust/rules}/rust/sea-orm/SKILL.md +0 -0
  505. /package/{rules → templates/rust/rules}/rust/sea-orm/references/REFERENCE.md +0 -0
  506. /package/{rules → templates/rust/rules}/rust/sea-orm/references/entity-patterns.md +0 -0
  507. /package/{rules → templates/rust/rules}/rust/serde-serialization/SKILL.md +0 -0
  508. /package/{rules → templates/rust/rules}/rust/serde-serialization/references/REFERENCE.md +0 -0
  509. /package/{rules → templates/rust/rules}/rust/serde-serialization/references/serialization-patterns.md +0 -0
  510. /package/{rules → templates/rust/rules}/rust/sqlx-database/SKILL.md +0 -0
  511. /package/{rules → templates/rust/rules}/rust/sqlx-database/references/REFERENCE.md +0 -0
  512. /package/{rules → templates/rust/rules}/rust/sqlx-database/references/query-patterns.md +0 -0
  513. /package/{rules → templates/rust/rules}/rust/tauri/SKILL.md +0 -0
  514. /package/{rules → templates/rust/rules}/rust/tauri/references/REFERENCE.md +0 -0
  515. /package/{rules → templates/rust/rules}/rust/tauri/references/command-patterns.md +0 -0
  516. /package/{rules → templates/rust/rules}/rust/tokio-runtime/SKILL.md +0 -0
  517. /package/{rules → templates/rust/rules}/rust/tokio-runtime/references/REFERENCE.md +0 -0
  518. /package/{rules → templates/rust/rules}/rust/tokio-runtime/references/async-patterns.md +0 -0
  519. /package/{rules → templates/rust/rules}/rust/tokio-runtime/references/synchronization.md +0 -0
  520. /package/{rules → templates/rust/rules}/rust/tonic/SKILL.md +0 -0
  521. /package/{rules → templates/rust/rules}/rust/tonic/references/REFERENCE.md +0 -0
  522. /package/{rules → templates/rust/rules}/rust/tonic/references/service-patterns.md +0 -0
  523. /package/{rules → templates/rust/rules}/rust/tracing/SKILL.md +0 -0
  524. /package/{rules → templates/rust/rules}/rust/tracing/references/REFERENCE.md +0 -0
  525. /package/{rules → templates/rust/rules}/rust/tracing/references/instrumentation.md +0 -0
  526. /package/{rules → templates/typescript/rules}/typescript/best-practices/SKILL.md +0 -0
  527. /package/{rules → templates/typescript/rules}/typescript/best-practices/references/REFERENCE.md +0 -0
  528. /package/{rules → templates/typescript/rules}/typescript/language/SKILL.md +0 -0
  529. /package/{rules → templates/typescript/rules}/typescript/language/references/REFERENCE.md +0 -0
  530. /package/{rules → templates/typescript/rules}/typescript/patterns.rule.md +0 -0
  531. /package/{rules → templates/typescript/rules}/typescript/security/SKILL.md +0 -0
  532. /package/{rules → templates/typescript/rules}/typescript/security/references/REFERENCE.md +0 -0
  533. /package/{rules → templates/typescript/rules}/typescript/tooling/SKILL.md +0 -0
  534. /package/{rules → templates/typescript/rules}/typescript/tooling/references/REFERENCE.md +0 -0
@@ -0,0 +1,600 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * context-builder.cjs - Context/reminder building for session injection
4
+ *
5
+ * Extracted from dev-rules-reminder.cjs for reuse in both Claude hooks and OpenCode plugins.
6
+ * Builds session context, rules, paths, and plan information.
7
+ *
8
+ * @module context-builder
9
+ */
10
+
11
+ const fs = require('fs');
12
+ const os = require('os');
13
+ const path = require('path');
14
+ const { execSync } = require('child_process');
15
+
16
+ // Usage cache file path (written by usage-context-awareness.cjs hook)
17
+ const USAGE_CACHE_FILE = path.join(os.tmpdir(), 'ck-usage-limits-cache.json');
18
+ const WARN_THRESHOLD = 70;
19
+ const CRITICAL_THRESHOLD = 90;
20
+ const {
21
+ loadConfig,
22
+ resolvePlanPath,
23
+ getReportsPath,
24
+ resolveNamingPattern,
25
+ normalizePath
26
+ } = require('./ck-config-utils.cjs');
27
+
28
+ // ═══════════════════════════════════════════════════════════════════════════
29
+ // HELPER FUNCTIONS
30
+ // ═══════════════════════════════════════════════════════════════════════════
31
+
32
+ /**
33
+ * Safely execute a command with timeout
34
+ * @param {string} cmd - Command to execute
35
+ * @returns {string|null} Output or null on error
36
+ */
37
+ function execSafe(cmd) {
38
+ try {
39
+ return execSync(cmd, { encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'] }).trim();
40
+ } catch (e) {
41
+ return null;
42
+ }
43
+ }
44
+
45
+ /**
46
+ * Resolve rules file path (local or global) with backward compat
47
+ * @param {string} filename - Rules filename
48
+ * @param {string} [configDirName='.claude'] - Config directory name
49
+ * @returns {string|null} Resolved path or null
50
+ */
51
+ function resolveRulesPath(filename, configDirName = '.claude') {
52
+ // Try rules/ first (new location)
53
+ const localRulesPath = path.join(process.cwd(), configDirName, 'rules', filename);
54
+ const globalRulesPath = path.join(os.homedir(), '.claude', 'rules', filename);
55
+
56
+ if (fs.existsSync(localRulesPath)) return `${configDirName}/rules/${filename}`;
57
+ if (fs.existsSync(globalRulesPath)) return `~/.claude/rules/${filename}`;
58
+
59
+ // Backward compat: try workflows/ (legacy location)
60
+ const localWorkflowsPath = path.join(process.cwd(), configDirName, 'workflows', filename);
61
+ const globalWorkflowsPath = path.join(os.homedir(), '.claude', 'workflows', filename);
62
+
63
+ if (fs.existsSync(localWorkflowsPath)) return `${configDirName}/workflows/${filename}`;
64
+ if (fs.existsSync(globalWorkflowsPath)) return `~/.claude/workflows/${filename}`;
65
+
66
+ return null;
67
+ }
68
+
69
+ /**
70
+ * Resolve script file path (local or global)
71
+ * @param {string} filename - Script filename
72
+ * @param {string} [configDirName='.claude'] - Config directory name
73
+ * @returns {string|null} Resolved path or null
74
+ */
75
+ function resolveScriptPath(filename, configDirName = '.claude') {
76
+ const localPath = path.join(process.cwd(), configDirName, 'scripts', filename);
77
+ const globalPath = path.join(os.homedir(), '.claude', 'scripts', filename);
78
+ if (fs.existsSync(localPath)) return `${configDirName}/scripts/${filename}`;
79
+ if (fs.existsSync(globalPath)) return `~/.claude/scripts/${filename}`;
80
+ return null;
81
+ }
82
+
83
+ /**
84
+ * Resolve skills venv Python path (local or global)
85
+ * @param {string} [configDirName='.claude'] - Config directory name
86
+ * @returns {string|null} Resolved venv Python path or null
87
+ */
88
+ function resolveSkillsVenv(configDirName = '.claude') {
89
+ const isWindows = process.platform === 'win32';
90
+ const venvBin = isWindows ? 'Scripts' : 'bin';
91
+ const pythonExe = isWindows ? 'python.exe' : 'python3';
92
+
93
+ const localVenv = path.join(process.cwd(), configDirName, 'skills', '.venv', venvBin, pythonExe);
94
+ const globalVenv = path.join(os.homedir(), '.claude', 'skills', '.venv', venvBin, pythonExe);
95
+
96
+ if (fs.existsSync(localVenv)) {
97
+ return isWindows
98
+ ? `${configDirName}\\skills\\.venv\\Scripts\\python.exe`
99
+ : `${configDirName}/skills/.venv/bin/python3`;
100
+ }
101
+ if (fs.existsSync(globalVenv)) {
102
+ return isWindows
103
+ ? '~\\.claude\\skills\\.venv\\Scripts\\python.exe'
104
+ : '~/.claude/skills/.venv/bin/python3';
105
+ }
106
+ return null;
107
+ }
108
+
109
+ /**
110
+ * Build plan context from config and git info
111
+ * @param {string|null} sessionId - Session ID
112
+ * @param {Object} config - Loaded config
113
+ * @returns {Object} Plan context object
114
+ */
115
+ function buildPlanContext(sessionId, config) {
116
+ const { plan, paths } = config;
117
+ const gitBranch = execSafe('git branch --show-current');
118
+ const resolved = resolvePlanPath(sessionId, config);
119
+ const reportsPath = getReportsPath(resolved.path, resolved.resolvedBy, plan, paths);
120
+
121
+ // Compute naming pattern directly for reliable injection
122
+ const namePattern = resolveNamingPattern(plan, gitBranch);
123
+
124
+ const planLine = resolved.resolvedBy === 'session'
125
+ ? `- Plan: ${resolved.path}`
126
+ : resolved.resolvedBy === 'branch'
127
+ ? `- Plan: none | Suggested: ${resolved.path}`
128
+ : `- Plan: none`;
129
+
130
+ // Validation config (injected so LLM can reference it)
131
+ const validation = plan.validation || {};
132
+ const validationMode = validation.mode || 'prompt';
133
+ const validationMin = validation.minQuestions || 3;
134
+ const validationMax = validation.maxQuestions || 8;
135
+
136
+ return { reportsPath, gitBranch, planLine, namePattern, validationMode, validationMin, validationMax };
137
+ }
138
+
139
+ /**
140
+ * Check if context was recently injected (prevent duplicate injection)
141
+ * @param {string} transcriptPath - Path to transcript file
142
+ * @returns {boolean} true if recently injected
143
+ */
144
+ function wasRecentlyInjected(transcriptPath) {
145
+ try {
146
+ if (!transcriptPath || !fs.existsSync(transcriptPath)) return false;
147
+ const transcript = fs.readFileSync(transcriptPath, 'utf-8');
148
+ // Check last 150 lines (hook output is ~30 lines, so this covers ~5 user prompts)
149
+ return transcript.split('\n').slice(-150).some(line => line.includes('[IMPORTANT] Consider Modularization'));
150
+ } catch (e) {
151
+ return false;
152
+ }
153
+ }
154
+
155
+ // ═══════════════════════════════════════════════════════════════════════════
156
+ // SECTION BUILDERS
157
+ // ═══════════════════════════════════════════════════════════════════════════
158
+
159
+ /**
160
+ * Build language section
161
+ * @param {Object} params
162
+ * @param {string} [params.thinkingLanguage] - Language for thinking
163
+ * @param {string} [params.responseLanguage] - Language for response
164
+ * @returns {string[]} Lines for language section
165
+ */
166
+ function buildLanguageSection({ thinkingLanguage, responseLanguage }) {
167
+ // Auto-default thinkingLanguage to 'en' when only responseLanguage is set
168
+ const effectiveThinking = thinkingLanguage || (responseLanguage ? 'en' : null);
169
+ const hasThinking = effectiveThinking && effectiveThinking !== responseLanguage;
170
+ const hasResponse = responseLanguage;
171
+ const lines = [];
172
+
173
+ if (hasThinking || hasResponse) {
174
+ lines.push(`## Language`);
175
+ if (hasThinking) {
176
+ lines.push(`- Thinking: Use ${effectiveThinking} for reasoning (logic, precision).`);
177
+ }
178
+ if (hasResponse) {
179
+ lines.push(`- Response: Respond in ${responseLanguage} (natural, fluent).`);
180
+ }
181
+ lines.push(``);
182
+ }
183
+
184
+ return lines;
185
+ }
186
+
187
+ /**
188
+ * Build session section
189
+ * @param {Object} [staticEnv] - Pre-computed static environment info
190
+ * @returns {string[]} Lines for session section
191
+ */
192
+ function buildSessionSection(staticEnv = {}) {
193
+ const memUsed = Math.round(process.memoryUsage().heapUsed / 1024 / 1024);
194
+ const memTotal = Math.round(os.totalmem() / 1024 / 1024);
195
+ const memPercent = Math.round((memUsed / memTotal) * 100);
196
+ const cpuUsage = Math.round((process.cpuUsage().user / 1000000) * 100);
197
+ const cpuSystem = Math.round((process.cpuUsage().system / 1000000) * 100);
198
+
199
+ return [
200
+ `## Session`,
201
+ `- DateTime: ${new Date().toLocaleString()}`,
202
+ `- CWD: ${staticEnv.cwd || process.cwd()}`,
203
+ `- Timezone: ${staticEnv.timezone || Intl.DateTimeFormat().resolvedOptions().timeZone}`,
204
+ `- Working directory: ${staticEnv.cwd || process.cwd()}`,
205
+ `- OS: ${staticEnv.osPlatform || process.platform}`,
206
+ `- User: ${staticEnv.user || process.env.USERNAME || process.env.USER}`,
207
+ `- Locale: ${staticEnv.locale || process.env.LANG || ''}`,
208
+ `- Memory usage: ${memUsed}MB/${memTotal}MB (${memPercent}%)`,
209
+ `- CPU usage: ${cpuUsage}% user / ${cpuSystem}% system`,
210
+ `- Spawning multiple subagents can cause performance issues, spawn and delegate tasks intelligently based on the available system resources.`,
211
+ `- Remember that each subagent only has 200K tokens in context window, spawn and delegate tasks intelligently to make sure their context windows don't get bloated.`,
212
+ `- IMPORTANT: Include these environment information when prompting subagents to perform tasks.`,
213
+ ``
214
+ ];
215
+ }
216
+
217
+ /**
218
+ * Read usage limits from cache file (written by usage-context-awareness.cjs)
219
+ * @returns {Object|null} Usage data or null if unavailable
220
+ */
221
+ function readUsageCache() {
222
+ try {
223
+ if (fs.existsSync(USAGE_CACHE_FILE)) {
224
+ const cache = JSON.parse(fs.readFileSync(USAGE_CACHE_FILE, 'utf-8'));
225
+ // Cache is valid for 5 minutes for injection purposes
226
+ if (Date.now() - cache.timestamp < 300000 && cache.data) {
227
+ return cache.data;
228
+ }
229
+ }
230
+ } catch { }
231
+ return null;
232
+ }
233
+
234
+ /**
235
+ * Format time until reset
236
+ * @param {string} resetAt - ISO timestamp
237
+ * @returns {string|null} Formatted time or null
238
+ */
239
+ function formatTimeUntilReset(resetAt) {
240
+ if (!resetAt) return null;
241
+ const resetTime = new Date(resetAt);
242
+ const remaining = Math.floor(resetTime.getTime() / 1000) - Math.floor(Date.now() / 1000);
243
+ if (remaining <= 0 || remaining > 18000) return null; // Only show if < 5 hours
244
+ const hours = Math.floor(remaining / 3600);
245
+ const mins = Math.floor((remaining % 3600) / 60);
246
+ return `${hours}h ${mins}m`;
247
+ }
248
+
249
+ /**
250
+ * Format percentage with warning level
251
+ * @param {number} value - Percentage value
252
+ * @param {string} label - Label prefix
253
+ * @returns {string} Formatted string with warning if applicable
254
+ */
255
+ function formatUsagePercent(value, label) {
256
+ const pct = Math.round(value);
257
+ if (pct >= CRITICAL_THRESHOLD) return `${label}: ${pct}% [CRITICAL]`;
258
+ if (pct >= WARN_THRESHOLD) return `${label}: ${pct}% [WARNING]`;
259
+ return `${label}: ${pct}%`;
260
+ }
261
+
262
+ /**
263
+ * Build context window section from statusline cache
264
+ * @param {string} sessionId - Session ID
265
+ * @returns {string[]} Lines for context section
266
+ */
267
+ function buildContextSection(sessionId) {
268
+ if (!sessionId) return [];
269
+
270
+ try {
271
+ const contextPath = path.join(os.tmpdir(), `ck-context-${sessionId}.json`);
272
+ if (!fs.existsSync(contextPath)) return [];
273
+
274
+ const data = JSON.parse(fs.readFileSync(contextPath, 'utf-8'));
275
+ // Only use fresh data (< 5 min old - statusline updates every 300ms when active)
276
+ if (Date.now() - data.timestamp > 300000) return [];
277
+
278
+ const lines = [`## Current Session's Context`];
279
+
280
+ // Format: 48% used (96K/200K tokens)
281
+ const usedK = Math.round(data.tokens / 1000);
282
+ const sizeK = Math.round(data.size / 1000);
283
+ lines.push(`- Context: ${data.percent}% used (${usedK}K/${sizeK}K tokens)`);
284
+ lines.push(`- **NOTE:** Optimize the workflow for token efficiency`);
285
+
286
+ // Warning if high usage
287
+ if (data.percent >= CRITICAL_THRESHOLD) {
288
+ lines.push(`- **CRITICAL:** Context nearly full - consider compaction or being concise, update current phase's status before the compaction.`);
289
+ } else if (data.percent >= WARN_THRESHOLD) {
290
+ lines.push(`- **WARNING:** Context usage moderate - being concise and optimize token efficiency.`);
291
+ }
292
+
293
+ lines.push(``);
294
+ return lines;
295
+ } catch {
296
+ return [];
297
+ }
298
+ }
299
+
300
+ /**
301
+ * Build usage section from cache
302
+ * @returns {string[]} Lines for usage section
303
+ */
304
+ function buildUsageSection() {
305
+ const usage = readUsageCache();
306
+ if (!usage) return [];
307
+
308
+ const lines = [];
309
+ const parts = [];
310
+
311
+ // 5-hour limit
312
+ if (usage.five_hour) {
313
+ const util = usage.five_hour.utilization;
314
+ if (typeof util === 'number') {
315
+ parts.push(formatUsagePercent(util, '5h'));
316
+ }
317
+ const timeLeft = formatTimeUntilReset(usage.five_hour.resets_at);
318
+ if (timeLeft) {
319
+ parts.push(`resets in ${timeLeft}`);
320
+ }
321
+ }
322
+
323
+ // 7-day limit
324
+ if (usage.seven_day?.utilization != null) {
325
+ parts.push(formatUsagePercent(usage.seven_day.utilization, '7d'));
326
+ }
327
+
328
+ if (parts.length > 0) {
329
+ lines.push(`## Usage Limits`);
330
+ lines.push(`- ${parts.join(' | ')}`);
331
+ lines.push(``);
332
+ }
333
+
334
+ return lines;
335
+ }
336
+
337
+ /**
338
+ * Build rules section
339
+ * @param {Object} params
340
+ * @param {string} [params.devRulesPath] - Path to dev rules
341
+ * @param {string} [params.catalogScript] - Path to catalog script
342
+ * @param {string} [params.skillsVenv] - Path to skills venv
343
+ * @returns {string[]} Lines for rules section
344
+ */
345
+ function buildRulesSection({ devRulesPath, catalogScript, skillsVenv }) {
346
+ const lines = [`## Rules`];
347
+
348
+ if (devRulesPath) {
349
+ lines.push(`- Read and follow development rules: "${devRulesPath}"`);
350
+ }
351
+
352
+ lines.push(`- Markdown files are organized in: Plans → "plans/" directory, Docs → "docs/" directory`);
353
+ lines.push(`- **IMPORTANT:** DO NOT create markdown files out of "plans/" or "docs/" directories UNLESS the user explicitly requests it.`);
354
+
355
+ if (catalogScript) {
356
+ lines.push(`- Activate skills: Run \`python ${catalogScript} --skills\` to generate a skills catalog and analyze it, then activate the relevant skills that are needed for the task during the process.`);
357
+ lines.push(`- Execute commands: Run \`python ${catalogScript} --commands\` to generate a commands catalog and analyze it, then execute the relevant SlashCommands that are needed for the task during the process.`);
358
+ }
359
+
360
+ if (skillsVenv) {
361
+ lines.push(`- Python scripts in .claude/skills/: Use \`${skillsVenv}\``);
362
+ }
363
+
364
+ lines.push(`- When skills' scripts are failed to execute, always fix them and run again, repeat until success.`);
365
+ lines.push(`- Follow **YAGNI (You Aren't Gonna Need It) - KISS (Keep It Simple, Stupid) - DRY (Don't Repeat Yourself)** principles`);
366
+ lines.push(`- Sacrifice grammar for the sake of concision when writing reports.`);
367
+ lines.push(`- In reports, list any unresolved questions at the end, if any.`);
368
+ lines.push(`- IMPORTANT: Ensure token consumption efficiency while maintaining high quality.`);
369
+ lines.push(``);
370
+
371
+ return lines;
372
+ }
373
+
374
+ /**
375
+ * Build modularization section
376
+ * @returns {string[]} Lines for modularization section
377
+ */
378
+ function buildModularizationSection() {
379
+ return [
380
+ `## **[IMPORTANT] Consider Modularization:**`,
381
+ `- Check existing modules before creating new`,
382
+ `- Analyze logical separation boundaries (functions, classes, concerns)`,
383
+ `- Use kebab-case naming with descriptive names, it's fine if the file name is long because this ensures file names are self-documenting for LLM tools (Grep, Glob, Search)`,
384
+ `- Write descriptive code comments`,
385
+ `- After modularization, continue with main task`,
386
+ `- When not to modularize: Markdown files, plain text files, bash scripts, configuration files, environment variables files, etc.`,
387
+ ``
388
+ ];
389
+ }
390
+
391
+ /**
392
+ * Build paths section
393
+ * @param {Object} params
394
+ * @param {string} params.reportsPath - Reports path
395
+ * @param {string} params.plansPath - Plans path
396
+ * @param {string} params.docsPath - Docs path
397
+ * @param {number} [params.docsMaxLoc=800] - Max lines of code for docs
398
+ * @returns {string[]} Lines for paths section
399
+ */
400
+ function buildPathsSection({ reportsPath, plansPath, docsPath, docsMaxLoc = 800 }) {
401
+ return [
402
+ `## Paths`,
403
+ `Reports: ${reportsPath} | Plans: ${plansPath}/ | Docs: ${docsPath}/ | docs.maxLoc: ${docsMaxLoc}`,
404
+ ``
405
+ ];
406
+ }
407
+
408
+ /**
409
+ * Build plan context section
410
+ * @param {Object} params
411
+ * @param {string} params.planLine - Plan status line
412
+ * @param {string} params.reportsPath - Reports path
413
+ * @param {string} [params.gitBranch] - Git branch
414
+ * @param {string} params.validationMode - Validation mode
415
+ * @param {number} params.validationMin - Min questions
416
+ * @param {number} params.validationMax - Max questions
417
+ * @returns {string[]} Lines for plan context section
418
+ */
419
+ function buildPlanContextSection({ planLine, reportsPath, gitBranch, validationMode, validationMin, validationMax }) {
420
+ const lines = [
421
+ `## Plan Context`,
422
+ planLine,
423
+ `- Reports: ${reportsPath}`
424
+ ];
425
+
426
+ if (gitBranch) {
427
+ lines.push(`- Branch: ${gitBranch}`);
428
+ }
429
+
430
+ lines.push(`- Validation: mode=${validationMode}, questions=${validationMin}-${validationMax}`);
431
+ lines.push(``);
432
+
433
+ return lines;
434
+ }
435
+
436
+ /**
437
+ * Build naming section
438
+ * @param {Object} params
439
+ * @param {string} params.reportsPath - Reports path
440
+ * @param {string} params.plansPath - Plans path
441
+ * @param {string} params.namePattern - Naming pattern
442
+ * @returns {string[]} Lines for naming section
443
+ */
444
+ function buildNamingSection({ reportsPath, plansPath, namePattern }) {
445
+ return [
446
+ `## Naming`,
447
+ `- Report: \`${reportsPath}{type}-${namePattern}.md\``,
448
+ `- Plan dir: \`${plansPath}/${namePattern}/\``,
449
+ `- Replace \`{type}\` with: agent name, report type, or context`,
450
+ `- Replace \`{slug}\` in pattern with: descriptive-kebab-slug`
451
+ ];
452
+ }
453
+
454
+ // ═══════════════════════════════════════════════════════════════════════════
455
+ // MAIN ENTRY POINTS
456
+ // ═══════════════════════════════════════════════════════════════════════════
457
+
458
+ /**
459
+ * Build full reminder content from all sections
460
+ * @param {Object} params - All parameters for building reminder
461
+ * @returns {string[]} Array of lines
462
+ */
463
+ function buildReminder(params) {
464
+ const {
465
+ sessionId,
466
+ thinkingLanguage,
467
+ responseLanguage,
468
+ devRulesPath,
469
+ catalogScript,
470
+ skillsVenv,
471
+ reportsPath,
472
+ plansPath,
473
+ docsPath,
474
+ docsMaxLoc,
475
+ planLine,
476
+ gitBranch,
477
+ namePattern,
478
+ validationMode,
479
+ validationMin,
480
+ validationMax,
481
+ staticEnv
482
+ } = params;
483
+
484
+ return [
485
+ ...buildLanguageSection({ thinkingLanguage, responseLanguage }),
486
+ ...buildSessionSection(staticEnv),
487
+ ...buildContextSection(sessionId),
488
+ ...buildUsageSection(),
489
+ ...buildRulesSection({ devRulesPath, catalogScript, skillsVenv }),
490
+ ...buildModularizationSection(),
491
+ ...buildPathsSection({ reportsPath, plansPath, docsPath, docsMaxLoc }),
492
+ ...buildPlanContextSection({ planLine, reportsPath, gitBranch, validationMode, validationMin, validationMax }),
493
+ ...buildNamingSection({ reportsPath, plansPath, namePattern })
494
+ ];
495
+ }
496
+
497
+ /**
498
+ * Build complete reminder context (unified entry point for plugins)
499
+ *
500
+ * @param {Object} [params]
501
+ * @param {string} [params.sessionId] - Session ID
502
+ * @param {Object} [params.config] - CK config (auto-loaded if not provided)
503
+ * @param {Object} [params.staticEnv] - Pre-computed static environment info
504
+ * @param {string} [params.configDirName='.claude'] - Config directory name
505
+ * @param {string} [params.baseDir] - Base directory for absolute path resolution (Issue #327)
506
+ * @returns {{
507
+ * content: string,
508
+ * lines: string[],
509
+ * sections: Object
510
+ * }}
511
+ */
512
+ function buildReminderContext({ sessionId, config, staticEnv, configDirName = '.claude', baseDir } = {}) {
513
+ // Load config if not provided
514
+ const cfg = config || loadConfig({ includeProject: false, includeAssertions: false });
515
+
516
+ // Resolve paths
517
+ const devRulesPath = resolveRulesPath('development-rules.md', configDirName);
518
+ const catalogScript = resolveScriptPath('generate_catalogs.py', configDirName);
519
+ const skillsVenv = resolveSkillsVenv(configDirName);
520
+
521
+ // Build plan context
522
+ const planCtx = buildPlanContext(sessionId, cfg);
523
+
524
+ // Issue #327: Use baseDir for absolute path resolution (subdirectory workflow support)
525
+ // If baseDir provided, resolve paths as absolute; otherwise use relative paths
526
+ const effectiveBaseDir = baseDir || null;
527
+ const plansPathRel = normalizePath(cfg.paths?.plans) || 'plans';
528
+ const docsPathRel = normalizePath(cfg.paths?.docs) || 'docs';
529
+
530
+ // Build all parameters with absolute paths if baseDir provided
531
+ const params = {
532
+ sessionId,
533
+ thinkingLanguage: cfg.locale?.thinkingLanguage,
534
+ responseLanguage: cfg.locale?.responseLanguage,
535
+ devRulesPath,
536
+ catalogScript,
537
+ skillsVenv,
538
+ reportsPath: effectiveBaseDir ? path.join(effectiveBaseDir, planCtx.reportsPath) : planCtx.reportsPath,
539
+ plansPath: effectiveBaseDir ? path.join(effectiveBaseDir, plansPathRel) : plansPathRel,
540
+ docsPath: effectiveBaseDir ? path.join(effectiveBaseDir, docsPathRel) : docsPathRel,
541
+ docsMaxLoc: Math.max(1, parseInt(cfg.docs?.maxLoc, 10) || 800),
542
+ planLine: planCtx.planLine,
543
+ gitBranch: planCtx.gitBranch,
544
+ namePattern: planCtx.namePattern,
545
+ validationMode: planCtx.validationMode,
546
+ validationMin: planCtx.validationMin,
547
+ validationMax: planCtx.validationMax,
548
+ staticEnv
549
+ };
550
+
551
+ const lines = buildReminder(params);
552
+
553
+ return {
554
+ content: lines.join('\n'),
555
+ lines,
556
+ sections: {
557
+ language: buildLanguageSection({ thinkingLanguage: params.thinkingLanguage, responseLanguage: params.responseLanguage }),
558
+ session: buildSessionSection(staticEnv),
559
+ context: buildContextSection(sessionId),
560
+ usage: buildUsageSection(),
561
+ rules: buildRulesSection({ devRulesPath, catalogScript, skillsVenv }),
562
+ modularization: buildModularizationSection(),
563
+ paths: buildPathsSection({ reportsPath: params.reportsPath, plansPath: params.plansPath, docsPath: params.docsPath, docsMaxLoc: params.docsMaxLoc }),
564
+ planContext: buildPlanContextSection(planCtx),
565
+ naming: buildNamingSection({ reportsPath: params.reportsPath, plansPath: params.plansPath, namePattern: params.namePattern })
566
+ }
567
+ };
568
+ }
569
+
570
+ // ═══════════════════════════════════════════════════════════════════════════
571
+ // EXPORTS
572
+ // ═══════════════════════════════════════════════════════════════════════════
573
+
574
+ module.exports = {
575
+ // Main entry points
576
+ buildReminderContext,
577
+ buildReminder,
578
+
579
+ // Section builders
580
+ buildLanguageSection,
581
+ buildSessionSection,
582
+ buildContextSection,
583
+ buildUsageSection,
584
+ buildRulesSection,
585
+ buildModularizationSection,
586
+ buildPathsSection,
587
+ buildPlanContextSection,
588
+ buildNamingSection,
589
+
590
+ // Helpers
591
+ execSafe,
592
+ resolveRulesPath,
593
+ resolveScriptPath,
594
+ resolveSkillsVenv,
595
+ buildPlanContext,
596
+ wasRecentlyInjected,
597
+
598
+ // Backward compat alias
599
+ resolveWorkflowPath: resolveRulesPath
600
+ };