prjct-cli 0.11.4 → 0.12.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 (385) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/README.md +81 -25
  3. package/bin/dev.js +1 -1
  4. package/bin/generate-views.js +209 -0
  5. package/bin/migrate-to-json.js +742 -0
  6. package/bin/prjct +5 -5
  7. package/bin/serve.js +246 -54
  8. package/core/__tests__/agentic/{memory-system.test.js → memory-system.test.ts} +12 -23
  9. package/core/__tests__/agentic/{plan-mode.test.js → plan-mode.test.ts} +26 -24
  10. package/core/__tests__/agentic/{prompt-builder.test.js → prompt-builder.test.ts} +3 -8
  11. package/core/__tests__/utils/date-helper.test.ts +405 -0
  12. package/core/__tests__/utils/{output.test.js → output.test.ts} +12 -24
  13. package/core/agentic/agent-router.ts +137 -0
  14. package/core/agentic/chain-of-thought.ts +228 -0
  15. package/core/agentic/command-executor/command-executor.ts +384 -0
  16. package/core/agentic/command-executor/index.ts +16 -0
  17. package/core/agentic/command-executor/status-signal.ts +38 -0
  18. package/core/agentic/command-executor/types.ts +79 -0
  19. package/core/agentic/command-executor.ts +8 -0
  20. package/core/agentic/{context-builder.js → context-builder.ts} +99 -89
  21. package/core/agentic/context-filter.ts +365 -0
  22. package/core/agentic/ground-truth/index.ts +76 -0
  23. package/core/agentic/ground-truth/types.ts +33 -0
  24. package/core/agentic/ground-truth/utils.ts +48 -0
  25. package/core/agentic/ground-truth/verifiers/analyze.ts +54 -0
  26. package/core/agentic/ground-truth/verifiers/done.ts +75 -0
  27. package/core/agentic/ground-truth/verifiers/feature.ts +70 -0
  28. package/core/agentic/ground-truth/verifiers/index.ts +37 -0
  29. package/core/agentic/ground-truth/verifiers/init.ts +52 -0
  30. package/core/agentic/ground-truth/verifiers/now.ts +57 -0
  31. package/core/agentic/ground-truth/verifiers/ship.ts +85 -0
  32. package/core/agentic/ground-truth/verifiers/spec.ts +45 -0
  33. package/core/agentic/ground-truth/verifiers/sync.ts +47 -0
  34. package/core/agentic/ground-truth/verifiers.ts +6 -0
  35. package/core/agentic/ground-truth.ts +8 -0
  36. package/core/agentic/loop-detector/error-analysis.ts +97 -0
  37. package/core/agentic/loop-detector/hallucination.ts +71 -0
  38. package/core/agentic/loop-detector/index.ts +41 -0
  39. package/core/agentic/loop-detector/loop-detector.ts +222 -0
  40. package/core/agentic/loop-detector/types.ts +66 -0
  41. package/core/agentic/loop-detector.ts +8 -0
  42. package/core/agentic/memory-system/history.ts +53 -0
  43. package/core/agentic/memory-system/index.ts +192 -0
  44. package/core/agentic/memory-system/patterns.ts +156 -0
  45. package/core/agentic/memory-system/semantic-memories.ts +277 -0
  46. package/core/agentic/memory-system/session.ts +21 -0
  47. package/core/agentic/memory-system/types.ts +159 -0
  48. package/core/agentic/memory-system.ts +8 -0
  49. package/core/agentic/parallel-tools.ts +165 -0
  50. package/core/agentic/plan-mode/approval.ts +57 -0
  51. package/core/agentic/plan-mode/constants.ts +44 -0
  52. package/core/agentic/plan-mode/index.ts +28 -0
  53. package/core/agentic/plan-mode/plan-mode.ts +406 -0
  54. package/core/agentic/plan-mode/types.ts +193 -0
  55. package/core/agentic/plan-mode.ts +8 -0
  56. package/core/agentic/prompt-builder.ts +566 -0
  57. package/core/agentic/response-templates.ts +164 -0
  58. package/core/agentic/semantic-compression.ts +273 -0
  59. package/core/agentic/services.ts +206 -0
  60. package/core/agentic/smart-context.ts +476 -0
  61. package/core/agentic/{template-loader.js → template-loader.ts} +35 -18
  62. package/core/agentic/think-blocks.ts +202 -0
  63. package/core/agentic/tool-registry.ts +119 -0
  64. package/core/agentic/validation-rules.ts +313 -0
  65. package/core/agents/index.ts +28 -0
  66. package/core/agents/performance.ts +444 -0
  67. package/core/agents/types.ts +126 -0
  68. package/core/bus/{index.js → index.ts} +57 -61
  69. package/core/command-registry/categories.ts +23 -0
  70. package/core/command-registry/commands.ts +15 -0
  71. package/core/command-registry/core-commands.ts +319 -0
  72. package/core/command-registry/index.ts +158 -0
  73. package/core/command-registry/optional-commands.ts +119 -0
  74. package/core/command-registry/setup-commands.ts +53 -0
  75. package/core/command-registry/types.ts +59 -0
  76. package/core/command-registry.ts +9 -0
  77. package/core/commands/analysis.ts +298 -0
  78. package/core/commands/analytics.ts +288 -0
  79. package/core/commands/base.ts +273 -0
  80. package/core/commands/index.ts +211 -0
  81. package/core/commands/maintenance.ts +226 -0
  82. package/core/commands/planning.ts +311 -0
  83. package/core/commands/setup.ts +309 -0
  84. package/core/commands/shipping.ts +188 -0
  85. package/core/commands/types.ts +183 -0
  86. package/core/commands/workflow.ts +226 -0
  87. package/core/commands.ts +11 -0
  88. package/core/constants/formats.ts +187 -0
  89. package/core/constants/index.ts +7 -0
  90. package/core/{context-sync.js → context-sync.ts} +59 -26
  91. package/core/data/agents-manager.ts +76 -0
  92. package/core/data/analysis-manager.ts +83 -0
  93. package/core/data/base-manager.ts +156 -0
  94. package/core/data/ideas-manager.ts +81 -0
  95. package/core/data/index.ts +32 -0
  96. package/core/data/outcomes-manager.ts +96 -0
  97. package/core/data/project-manager.ts +75 -0
  98. package/core/data/roadmap-manager.ts +118 -0
  99. package/core/data/shipped-manager.ts +65 -0
  100. package/core/data/state-manager.ts +214 -0
  101. package/core/domain/{agent-generator.js → agent-generator.ts} +77 -57
  102. package/core/domain/{agent-loader.js → agent-loader.ts} +65 -56
  103. package/core/domain/{agent-matcher.js → agent-matcher.ts} +51 -24
  104. package/core/domain/{agent-validator.js → agent-validator.ts} +70 -37
  105. package/core/domain/{analyzer.js → analyzer.ts} +91 -85
  106. package/core/domain/{architect-session.js → architect-session.ts} +49 -34
  107. package/core/domain/{architecture-generator.js → architecture-generator.ts} +25 -13
  108. package/core/domain/{context-estimator.js → context-estimator.ts} +57 -36
  109. package/core/domain/{product-standards.js → product-standards.ts} +40 -26
  110. package/core/domain/{smart-cache.js → smart-cache.ts} +39 -30
  111. package/core/domain/{snapshot-manager.js → snapshot-manager.ts} +103 -100
  112. package/core/domain/{task-analyzer.js → task-analyzer.ts} +82 -43
  113. package/core/domain/task-stack/index.ts +19 -0
  114. package/core/domain/task-stack/parser.ts +86 -0
  115. package/core/domain/task-stack/storage.ts +123 -0
  116. package/core/domain/task-stack/task-stack.ts +340 -0
  117. package/core/domain/task-stack/types.ts +51 -0
  118. package/core/domain/task-stack.ts +8 -0
  119. package/core/{index.js → index.ts} +61 -18
  120. package/core/infrastructure/{agent-detector.js → agent-detector.ts} +62 -23
  121. package/core/infrastructure/agents/{claude-agent.js → claude-agent.ts} +61 -21
  122. package/core/infrastructure/{author-detector.js → author-detector.ts} +42 -49
  123. package/core/infrastructure/{capability-installer.js → capability-installer.ts} +51 -27
  124. package/core/infrastructure/{command-installer.js → command-installer/command-installer.ts} +43 -144
  125. package/core/infrastructure/command-installer/global-config.ts +106 -0
  126. package/core/infrastructure/command-installer/index.ts +25 -0
  127. package/core/infrastructure/command-installer/types.ts +41 -0
  128. package/core/infrastructure/command-installer.ts +8 -0
  129. package/core/infrastructure/{config-manager.js → config-manager.ts} +60 -80
  130. package/core/infrastructure/{editors-config.js → editors-config.ts} +33 -31
  131. package/core/infrastructure/legacy-installer-detector/cleanup.ts +216 -0
  132. package/core/infrastructure/legacy-installer-detector/detection.ts +95 -0
  133. package/core/infrastructure/legacy-installer-detector/index.ts +171 -0
  134. package/core/infrastructure/legacy-installer-detector/migration.ts +87 -0
  135. package/core/infrastructure/legacy-installer-detector/types.ts +42 -0
  136. package/core/infrastructure/legacy-installer-detector.ts +7 -0
  137. package/core/infrastructure/migrator/file-operations.ts +125 -0
  138. package/core/infrastructure/migrator/index.ts +288 -0
  139. package/core/infrastructure/migrator/project-scanner.ts +89 -0
  140. package/core/infrastructure/migrator/reports.ts +117 -0
  141. package/core/infrastructure/migrator/types.ts +124 -0
  142. package/core/infrastructure/migrator/validation.ts +94 -0
  143. package/core/infrastructure/migrator/version-migration.ts +117 -0
  144. package/core/infrastructure/migrator.ts +10 -0
  145. package/core/infrastructure/{path-manager.js → path-manager.ts} +51 -91
  146. package/core/infrastructure/session-manager/index.ts +23 -0
  147. package/core/infrastructure/session-manager/migration.ts +88 -0
  148. package/core/infrastructure/session-manager/session-manager.ts +307 -0
  149. package/core/infrastructure/session-manager/types.ts +45 -0
  150. package/core/infrastructure/session-manager.ts +8 -0
  151. package/core/infrastructure/{setup.js → setup.ts} +29 -21
  152. package/core/infrastructure/{update-checker.js → update-checker.ts} +40 -18
  153. package/core/outcomes/analyzer.ts +333 -0
  154. package/core/outcomes/index.ts +34 -0
  155. package/core/outcomes/recorder.ts +194 -0
  156. package/core/outcomes/types.ts +145 -0
  157. package/core/plugin/{hooks.js → hooks.ts} +56 -58
  158. package/core/plugin/{index.js → index.ts} +19 -8
  159. package/core/plugin/{loader.js → loader.ts} +87 -69
  160. package/core/plugin/{registry.js → registry.ts} +49 -45
  161. package/core/plugins/{webhook.js → webhook.ts} +43 -27
  162. package/core/schemas/agents.ts +27 -0
  163. package/core/schemas/analysis.ts +41 -0
  164. package/core/schemas/ideas.ts +83 -0
  165. package/core/schemas/index.ts +73 -0
  166. package/core/schemas/outcomes.ts +22 -0
  167. package/core/schemas/project.ts +26 -0
  168. package/core/schemas/roadmap.ts +90 -0
  169. package/core/schemas/shipped.ts +82 -0
  170. package/core/schemas/state.ts +107 -0
  171. package/core/session/index.ts +17 -0
  172. package/core/session/{metrics.js → metrics.ts} +64 -46
  173. package/core/session/{index.js → session-manager.ts} +51 -117
  174. package/core/session/types.ts +29 -0
  175. package/core/session/utils.ts +57 -0
  176. package/core/state/index.ts +25 -0
  177. package/core/state/manager.ts +376 -0
  178. package/core/state/types.ts +185 -0
  179. package/core/tsconfig.json +22 -0
  180. package/core/types/index.ts +506 -0
  181. package/core/utils/{animations.js → animations.ts} +74 -28
  182. package/core/utils/{branding.js → branding.ts} +29 -4
  183. package/core/utils/{date-helper.js → date-helper.ts} +31 -74
  184. package/core/utils/file-helper.ts +262 -0
  185. package/core/utils/{jsonl-helper.js → jsonl-helper.ts} +71 -107
  186. package/core/utils/{logger.js → logger.ts} +24 -12
  187. package/core/utils/{output.js → output.ts} +25 -13
  188. package/core/utils/{project-capabilities.js → project-capabilities.ts} +31 -18
  189. package/core/utils/{session-helper.js → session-helper.ts} +79 -66
  190. package/core/utils/{version.js → version.ts} +23 -31
  191. package/core/view-generator.ts +536 -0
  192. package/package.json +23 -17
  193. package/packages/shared/.turbo/turbo-build.log +14 -0
  194. package/packages/shared/dist/index.d.ts +8 -613
  195. package/packages/shared/dist/index.d.ts.map +1 -0
  196. package/packages/shared/dist/index.js +4110 -118
  197. package/packages/shared/dist/schemas.d.ts +408 -0
  198. package/packages/shared/dist/schemas.d.ts.map +1 -0
  199. package/packages/shared/dist/types.d.ts +144 -0
  200. package/packages/shared/dist/types.d.ts.map +1 -0
  201. package/packages/shared/dist/unified.d.ts +139 -0
  202. package/packages/shared/dist/unified.d.ts.map +1 -0
  203. package/packages/shared/dist/utils.d.ts +60 -0
  204. package/packages/shared/dist/utils.d.ts.map +1 -0
  205. package/packages/shared/package.json +4 -4
  206. package/packages/shared/src/index.ts +1 -0
  207. package/packages/shared/src/unified.ts +174 -0
  208. package/packages/web/app/api/claude/sessions/route.ts +1 -1
  209. package/packages/web/app/api/claude/status/route.ts +1 -1
  210. package/packages/web/app/api/migrate/route.ts +46 -0
  211. package/packages/web/app/api/projects/[id]/route.ts +1 -1
  212. package/packages/web/app/api/projects/[id]/stats/route.ts +30 -2
  213. package/packages/web/app/api/projects/[id]/status/route.ts +1 -1
  214. package/packages/web/app/api/projects/route.ts +1 -1
  215. package/packages/web/app/api/settings/route.ts +97 -0
  216. package/packages/web/app/api/v2/projects/[id]/unified/route.ts +57 -0
  217. package/packages/web/app/globals.css +38 -0
  218. package/packages/web/app/layout.tsx +10 -2
  219. package/packages/web/app/page.tsx +9 -224
  220. package/packages/web/app/project/[id]/page.tsx +191 -63
  221. package/packages/web/app/project/[id]/stats/loading.tsx +43 -0
  222. package/packages/web/app/project/[id]/stats/page.tsx +203 -403
  223. package/packages/web/app/settings/page.tsx +222 -2
  224. package/packages/web/components/ActivityTimeline/ActivityTimeline.constants.ts +2 -0
  225. package/packages/web/components/ActivityTimeline/ActivityTimeline.tsx +50 -0
  226. package/packages/web/components/ActivityTimeline/ActivityTimeline.types.ts +8 -0
  227. package/packages/web/components/ActivityTimeline/hooks/index.ts +2 -0
  228. package/packages/web/components/ActivityTimeline/hooks/useExpandable.ts +9 -0
  229. package/packages/web/components/ActivityTimeline/hooks/useGroupedEvents.ts +23 -0
  230. package/packages/web/components/ActivityTimeline/index.ts +2 -0
  231. package/packages/web/components/AgentsCard/AgentsCard.tsx +63 -0
  232. package/packages/web/components/AgentsCard/AgentsCard.types.ts +13 -0
  233. package/packages/web/components/AgentsCard/index.ts +2 -0
  234. package/packages/web/components/AppSidebar/AppSidebar.tsx +134 -0
  235. package/packages/web/components/AppSidebar/index.ts +1 -0
  236. package/packages/web/components/BackLink/BackLink.tsx +18 -0
  237. package/packages/web/components/BackLink/BackLink.types.ts +5 -0
  238. package/packages/web/components/BackLink/index.ts +2 -0
  239. package/packages/web/components/BentoCard/BentoCard.constants.ts +16 -0
  240. package/packages/web/components/BentoCard/BentoCard.tsx +47 -0
  241. package/packages/web/components/BentoCard/BentoCard.types.ts +15 -0
  242. package/packages/web/components/BentoCard/index.ts +2 -0
  243. package/packages/web/components/BentoCardSkeleton/BentoCardSkeleton.constants.ts +9 -0
  244. package/packages/web/components/BentoCardSkeleton/BentoCardSkeleton.tsx +18 -0
  245. package/packages/web/components/BentoCardSkeleton/BentoCardSkeleton.types.ts +5 -0
  246. package/packages/web/components/BentoCardSkeleton/index.ts +2 -0
  247. package/packages/web/components/BentoGrid/BentoGrid.tsx +18 -0
  248. package/packages/web/components/BentoGrid/BentoGrid.types.ts +4 -0
  249. package/packages/web/components/BentoGrid/index.ts +2 -0
  250. package/packages/web/components/CommandButton/index.ts +1 -0
  251. package/packages/web/components/ConnectionStatus/index.ts +1 -0
  252. package/packages/web/components/DashboardContent/DashboardContent.tsx +254 -0
  253. package/packages/web/components/DashboardContent/index.ts +1 -0
  254. package/packages/web/components/DateGroup/DateGroup.tsx +18 -0
  255. package/packages/web/components/DateGroup/DateGroup.types.ts +6 -0
  256. package/packages/web/components/DateGroup/DateGroup.utils.ts +11 -0
  257. package/packages/web/components/DateGroup/index.ts +2 -0
  258. package/packages/web/components/EmptyState/EmptyState.tsx +58 -0
  259. package/packages/web/components/EmptyState/EmptyState.types.ts +10 -0
  260. package/packages/web/components/EmptyState/index.ts +2 -0
  261. package/packages/web/components/EventRow/EventRow.constants.ts +10 -0
  262. package/packages/web/components/EventRow/EventRow.tsx +49 -0
  263. package/packages/web/components/EventRow/EventRow.types.ts +7 -0
  264. package/packages/web/components/EventRow/EventRow.utils.ts +49 -0
  265. package/packages/web/components/EventRow/index.ts +2 -0
  266. package/packages/web/components/ExpandButton/ExpandButton.tsx +18 -0
  267. package/packages/web/components/ExpandButton/ExpandButton.types.ts +6 -0
  268. package/packages/web/components/ExpandButton/index.ts +2 -0
  269. package/packages/web/components/HealthGradientBackground/HealthGradientBackground.tsx +14 -0
  270. package/packages/web/components/HealthGradientBackground/HealthGradientBackground.types.ts +5 -0
  271. package/packages/web/components/HealthGradientBackground/HealthGradientBackground.utils.ts +13 -0
  272. package/packages/web/components/HealthGradientBackground/index.ts +2 -0
  273. package/packages/web/components/HeroSection/HeroSection.tsx +55 -0
  274. package/packages/web/components/HeroSection/HeroSection.types.ts +14 -0
  275. package/packages/web/components/HeroSection/HeroSection.utils.ts +7 -0
  276. package/packages/web/components/HeroSection/hooks/index.ts +2 -0
  277. package/packages/web/components/HeroSection/hooks/useCountUp.ts +45 -0
  278. package/packages/web/components/HeroSection/hooks/useWeeklyActivity.ts +18 -0
  279. package/packages/web/components/HeroSection/index.ts +2 -0
  280. package/packages/web/components/IdeasCard/IdeasCard.tsx +48 -0
  281. package/packages/web/components/IdeasCard/IdeasCard.types.ts +9 -0
  282. package/packages/web/components/IdeasCard/index.ts +2 -0
  283. package/packages/web/components/InsightMessage/InsightMessage.tsx +9 -0
  284. package/packages/web/components/InsightMessage/InsightMessage.types.ts +3 -0
  285. package/packages/web/components/InsightMessage/index.ts +2 -0
  286. package/packages/web/components/Logo/index.ts +1 -0
  287. package/packages/web/components/MarkdownContent/index.ts +1 -0
  288. package/packages/web/components/NowCard/NowCard.tsx +93 -0
  289. package/packages/web/components/NowCard/NowCard.types.ts +15 -0
  290. package/packages/web/components/NowCard/index.ts +2 -0
  291. package/packages/web/components/ProgressRing/ProgressRing.constants.ts +20 -0
  292. package/packages/web/components/ProgressRing/ProgressRing.tsx +51 -0
  293. package/packages/web/components/ProgressRing/ProgressRing.types.ts +11 -0
  294. package/packages/web/components/ProgressRing/index.ts +2 -0
  295. package/packages/web/components/ProjectAvatar/index.ts +1 -0
  296. package/packages/web/components/Providers/index.ts +1 -0
  297. package/packages/web/components/QueueCard/QueueCard.tsx +72 -0
  298. package/packages/web/components/QueueCard/QueueCard.types.ts +11 -0
  299. package/packages/web/components/QueueCard/QueueCard.utils.ts +12 -0
  300. package/packages/web/components/QueueCard/index.ts +2 -0
  301. package/packages/web/components/RoadmapCard/RoadmapCard.tsx +77 -0
  302. package/packages/web/components/RoadmapCard/RoadmapCard.types.ts +15 -0
  303. package/packages/web/components/RoadmapCard/index.ts +2 -0
  304. package/packages/web/components/ShipsCard/ShipsCard.tsx +52 -0
  305. package/packages/web/components/ShipsCard/ShipsCard.types.ts +12 -0
  306. package/packages/web/components/ShipsCard/ShipsCard.utils.ts +4 -0
  307. package/packages/web/components/ShipsCard/index.ts +2 -0
  308. package/packages/web/components/SparklineChart/SparklineChart.tsx +38 -0
  309. package/packages/web/components/SparklineChart/SparklineChart.types.ts +6 -0
  310. package/packages/web/components/SparklineChart/index.ts +2 -0
  311. package/packages/web/components/StreakCard/StreakCard.constants.ts +2 -0
  312. package/packages/web/components/StreakCard/StreakCard.tsx +53 -0
  313. package/packages/web/components/StreakCard/StreakCard.types.ts +4 -0
  314. package/packages/web/components/StreakCard/index.ts +2 -0
  315. package/packages/web/components/TasksCounter/TasksCounter.tsx +14 -0
  316. package/packages/web/components/TasksCounter/TasksCounter.types.ts +3 -0
  317. package/packages/web/components/TasksCounter/index.ts +2 -0
  318. package/packages/web/components/TechStackBadges/index.ts +1 -0
  319. package/packages/web/components/{TerminalTab.tsx → TerminalTabs/TerminalTab.tsx} +11 -0
  320. package/packages/web/components/{TerminalTabs.tsx → TerminalTabs/TerminalTabs.tsx} +29 -28
  321. package/packages/web/components/TerminalTabs/index.ts +1 -0
  322. package/packages/web/components/VelocityBadge/VelocityBadge.tsx +27 -0
  323. package/packages/web/components/VelocityBadge/VelocityBadge.types.ts +3 -0
  324. package/packages/web/components/VelocityBadge/index.ts +2 -0
  325. package/packages/web/components/VelocityCard/VelocityCard.tsx +71 -0
  326. package/packages/web/components/VelocityCard/VelocityCard.types.ts +7 -0
  327. package/packages/web/components/VelocityCard/index.ts +2 -0
  328. package/packages/web/components/WeeklySparkline/WeeklySparkline.tsx +13 -0
  329. package/packages/web/components/WeeklySparkline/WeeklySparkline.types.ts +3 -0
  330. package/packages/web/components/WeeklySparkline/index.ts +2 -0
  331. package/packages/web/components/ui/input.tsx +21 -0
  332. package/packages/web/components/ui/tooltip.tsx +2 -2
  333. package/packages/web/context/TerminalTabsContext.tsx +46 -1
  334. package/packages/web/hooks/useClaudeTerminal.ts +71 -21
  335. package/packages/web/hooks/useProjectStats.ts +55 -0
  336. package/packages/web/hooks/useProjects.ts +6 -6
  337. package/packages/web/lib/actions/projects.ts +15 -0
  338. package/packages/web/lib/json-loader.ts +630 -0
  339. package/packages/web/lib/services/index.ts +9 -0
  340. package/packages/web/lib/services/migration.server.ts +598 -0
  341. package/packages/web/lib/services/projects.server.ts +52 -0
  342. package/packages/web/lib/services/stats.server.ts +264 -0
  343. package/packages/web/lib/unified-loader.ts +396 -0
  344. package/packages/web/next-env.d.ts +1 -1
  345. package/packages/web/package.json +10 -6
  346. package/packages/web/server.ts +36 -6
  347. package/templates/commands/done.md +76 -32
  348. package/templates/commands/feature.md +121 -47
  349. package/templates/commands/idea.md +81 -8
  350. package/templates/commands/now.md +41 -17
  351. package/templates/commands/ship.md +64 -25
  352. package/templates/commands/sync.md +28 -3
  353. package/core/agentic/agent-router.js +0 -128
  354. package/core/agentic/chain-of-thought.js +0 -578
  355. package/core/agentic/command-executor.js +0 -421
  356. package/core/agentic/context-filter.js +0 -354
  357. package/core/agentic/ground-truth.js +0 -591
  358. package/core/agentic/loop-detector.js +0 -406
  359. package/core/agentic/memory-system.js +0 -850
  360. package/core/agentic/parallel-tools.js +0 -366
  361. package/core/agentic/plan-mode.js +0 -572
  362. package/core/agentic/prompt-builder.js +0 -338
  363. package/core/agentic/response-templates.js +0 -290
  364. package/core/agentic/semantic-compression.js +0 -517
  365. package/core/agentic/think-blocks.js +0 -657
  366. package/core/agentic/tool-registry.js +0 -184
  367. package/core/agentic/validation-rules.js +0 -380
  368. package/core/command-registry.js +0 -698
  369. package/core/commands.js +0 -2237
  370. package/core/domain/task-stack.js +0 -497
  371. package/core/infrastructure/legacy-installer-detector.js +0 -546
  372. package/core/infrastructure/migrator.js +0 -799
  373. package/core/infrastructure/session-manager.js +0 -390
  374. package/core/utils/file-helper.js +0 -329
  375. package/packages/web/app/api/projects/[id]/delete/route.ts +0 -21
  376. package/packages/web/app/api/stats/route.ts +0 -38
  377. package/packages/web/components/AppSidebar.tsx +0 -113
  378. package/packages/web/hooks/useStats.ts +0 -28
  379. /package/packages/web/components/{CommandButton.tsx → CommandButton/CommandButton.tsx} +0 -0
  380. /package/packages/web/components/{ConnectionStatus.tsx → ConnectionStatus/ConnectionStatus.tsx} +0 -0
  381. /package/packages/web/components/{Logo.tsx → Logo/Logo.tsx} +0 -0
  382. /package/packages/web/components/{MarkdownContent.tsx → MarkdownContent/MarkdownContent.tsx} +0 -0
  383. /package/packages/web/components/{ProjectAvatar.tsx → ProjectAvatar/ProjectAvatar.tsx} +0 -0
  384. /package/packages/web/components/{providers.tsx → Providers/Providers.tsx} +0 -0
  385. /package/packages/web/components/{TechStackBadges.tsx → TechStackBadges/TechStackBadges.tsx} +0 -0
@@ -3,25 +3,46 @@
3
3
  * Handles conversational state for ARCHITECT MODE (Agent-based, not deterministic)
4
4
  */
5
5
 
6
- const fs = require('fs').promises
7
- const path = require('path')
6
+ import fs from 'fs/promises'
7
+ import path from 'path'
8
+
9
+ interface ConversationEntry {
10
+ question: string
11
+ answer: string
12
+ timestamp: string
13
+ }
14
+
15
+ interface ArchitectSessionData {
16
+ idea: string
17
+ projectType: string
18
+ active: boolean
19
+ startedAt: string
20
+ completedAt?: string
21
+ conversation: ConversationEntry[]
22
+ answers: Record<string, string>
23
+ }
24
+
25
+ interface SessionSummary {
26
+ idea: string
27
+ projectType: string
28
+ conversationLength: number
29
+ insights: number
30
+ startedAt: string
31
+ completedAt: string
32
+ }
8
33
 
9
34
  class ArchitectSession {
10
35
  /**
11
36
  * Initialize new architect session
12
- * @param {string} idea - Project idea
13
- * @param {string} projectType - Type of project (web, api, mobile, cli, data)
14
- * @param {string} globalPath - Global project path
15
- * @returns {Promise<Object>} Session object
16
37
  */
17
- async init(idea, projectType, globalPath) {
18
- const session = {
38
+ async init(idea: string, projectType: string, globalPath: string): Promise<ArchitectSessionData> {
39
+ const session: ArchitectSessionData = {
19
40
  idea,
20
41
  projectType,
21
42
  active: true,
22
43
  startedAt: new Date().toISOString(),
23
- conversation: [], // Free-form Q&A logging
24
- answers: {}, // Key insights for plan generation
44
+ conversation: [],
45
+ answers: {},
25
46
  }
26
47
 
27
48
  await this.save(session, globalPath)
@@ -31,7 +52,7 @@ class ArchitectSession {
31
52
  /**
32
53
  * Load active session
33
54
  */
34
- async load(globalPath) {
55
+ async load(globalPath: string): Promise<ArchitectSessionData | null> {
35
56
  try {
36
57
  const sessionPath = path.join(globalPath, 'planning', 'architect-session.json')
37
58
  const content = await fs.readFile(sessionPath, 'utf-8')
@@ -44,7 +65,7 @@ class ArchitectSession {
44
65
  /**
45
66
  * Save session to disk
46
67
  */
47
- async save(session, globalPath) {
68
+ async save(session: ArchitectSessionData, globalPath: string): Promise<void> {
48
69
  const planningDir = path.join(globalPath, 'planning')
49
70
  await fs.mkdir(planningDir, { recursive: true })
50
71
 
@@ -54,11 +75,8 @@ class ArchitectSession {
54
75
 
55
76
  /**
56
77
  * Log a Q&A pair to the conversation
57
- * @param {string} question - The question asked by Claude
58
- * @param {string} answer - User's answer
59
- * @param {string} globalPath - Global project path
60
78
  */
61
- async logQA(question, answer, globalPath) {
79
+ async logQA(question: string, answer: string, globalPath: string): Promise<void> {
62
80
  const session = await this.load(globalPath)
63
81
 
64
82
  if (!session || !session.active) {
@@ -76,11 +94,8 @@ class ArchitectSession {
76
94
 
77
95
  /**
78
96
  * Save key insight for plan generation
79
- * @param {string} key - Insight key (e.g., 'language', 'framework', 'database')
80
- * @param {string} value - Insight value
81
- * @param {string} globalPath - Global project path
82
97
  */
83
- async saveInsight(key, value, globalPath) {
98
+ async saveInsight(key: string, value: string, globalPath: string): Promise<void> {
84
99
  const session = await this.load(globalPath)
85
100
 
86
101
  if (!session || !session.active) {
@@ -93,10 +108,8 @@ class ArchitectSession {
93
108
 
94
109
  /**
95
110
  * Complete session and generate plan
96
- * @param {string} globalPath - Global project path
97
- * @returns {Promise<Object>} Summary object
98
111
  */
99
- async complete(globalPath) {
112
+ async complete(globalPath: string): Promise<SessionSummary> {
100
113
  const session = await this.load(globalPath)
101
114
 
102
115
  if (!session || !session.active) {
@@ -117,7 +130,7 @@ class ArchitectSession {
117
130
  /**
118
131
  * Generate architect plan MD file
119
132
  */
120
- async generatePlan(session, globalPath) {
133
+ async generatePlan(session: ArchitectSessionData, globalPath: string): Promise<void> {
121
134
  const plan = this.buildPlanMarkdown(session)
122
135
 
123
136
  const planPath = path.join(globalPath, 'planning', 'architect-session.md')
@@ -127,7 +140,7 @@ class ArchitectSession {
127
140
  /**
128
141
  * Build plan markdown content
129
142
  */
130
- buildPlanMarkdown(session) {
143
+ buildPlanMarkdown(session: ArchitectSessionData): string {
131
144
  const { projectType, idea, conversation, answers } = session
132
145
 
133
146
  // Build conversation log
@@ -192,8 +205,8 @@ Generated: ${new Date().toISOString()}
192
205
  /**
193
206
  * Build stack summary from answers
194
207
  */
195
- buildStackSummary(answers) {
196
- const parts = []
208
+ buildStackSummary(answers: Record<string, string>): string {
209
+ const parts: string[] = []
197
210
 
198
211
  for (const [key, value] of Object.entries(answers)) {
199
212
  if (value && value !== 'Ninguna' && value !== 'None' && value !== 'Otro') {
@@ -207,8 +220,8 @@ Generated: ${new Date().toISOString()}
207
220
  /**
208
221
  * Build Context7 queries from answers
209
222
  */
210
- buildContext7Queries(answers) {
211
- const queries = []
223
+ buildContext7Queries(answers: Record<string, string>): string[] {
224
+ const queries: string[] = []
212
225
 
213
226
  if (answers.framework) {
214
227
  queries.push(`${answers.framework} getting started`)
@@ -239,9 +252,9 @@ Generated: ${new Date().toISOString()}
239
252
  /**
240
253
  * Build implementation steps from session
241
254
  */
242
- buildImplementationSteps(session) {
255
+ buildImplementationSteps(session: ArchitectSessionData): string[] {
243
256
  const { answers } = session
244
- const steps = []
257
+ const steps: string[] = []
245
258
 
246
259
  // Generic steps - Claude will refine during execution
247
260
  if (answers.language) {
@@ -273,7 +286,7 @@ Generated: ${new Date().toISOString()}
273
286
  /**
274
287
  * Build summary of session
275
288
  */
276
- buildSummary(session) {
289
+ buildSummary(session: ArchitectSessionData): SessionSummary {
277
290
  return {
278
291
  idea: session.idea,
279
292
  projectType: session.projectType,
@@ -287,7 +300,7 @@ Generated: ${new Date().toISOString()}
287
300
  /**
288
301
  * Clear architect session
289
302
  */
290
- async clear(globalPath) {
303
+ async clear(globalPath: string): Promise<void> {
291
304
  try {
292
305
  const sessionPath = path.join(globalPath, 'planning', 'architect-session.json')
293
306
  await fs.unlink(sessionPath)
@@ -297,4 +310,6 @@ Generated: ${new Date().toISOString()}
297
310
  }
298
311
  }
299
312
 
300
- module.exports = new ArchitectSession()
313
+ const architectSession = new ArchitectSession()
314
+ export default architectSession
315
+ export { ArchitectSession }
@@ -4,10 +4,24 @@
4
4
  * This file only provides structure - real content from Claude
5
5
  */
6
6
 
7
- const path = require('path')
8
- const fs = require('fs').promises
7
+ import path from 'path'
8
+ import fs from 'fs/promises'
9
+
10
+ interface ArchitectureContext {
11
+ [key: string]: unknown
12
+ }
13
+
14
+ interface Architecture {
15
+ id: string
16
+ idea: string
17
+ createdAt: string
18
+ phases: Record<string, unknown>
19
+ _agenticNote: string
20
+ }
9
21
 
10
22
  class ArchitectureGenerator {
23
+ defaultPhases: string[]
24
+
11
25
  constructor() {
12
26
  // AGENTIC: Phases determined by Claude via templates/architect/phases.md
13
27
  this.defaultPhases = [
@@ -25,11 +39,8 @@ class ArchitectureGenerator {
25
39
  /**
26
40
  * Generate architecture skeleton
27
41
  * AGENTIC: Claude fills in content using templates
28
- * @param {string} idea - The initial idea
29
- * @param {object} context - Project context
30
- * @returns {Promise<object>} Architecture skeleton
31
42
  */
32
- async generateArchitecture(idea, context = {}) {
43
+ async generateArchitecture(idea: string, context: ArchitectureContext = {}): Promise<Architecture> {
33
44
  // Return skeleton - Claude generates actual content via templates
34
45
  return {
35
46
  id: `arch-${Date.now()}`,
@@ -37,15 +48,16 @@ class ArchitectureGenerator {
37
48
  createdAt: new Date().toISOString(),
38
49
  phases: {},
39
50
  // AGENTIC: Claude populates phases using templates/architect/*.md
40
- _agenticNote: 'Use templates/architect/phases.md to determine needed phases, then templates/architect/discovery.md etc for content',
51
+ _agenticNote:
52
+ 'Use templates/architect/phases.md to determine needed phases, then templates/architect/discovery.md etc for content',
41
53
  }
42
54
  }
43
55
 
44
56
  /**
45
57
  * Get template path for a phase
46
58
  */
47
- getPhaseTemplate(phase) {
48
- const templateMap = {
59
+ getPhaseTemplate(phase: string): string | null {
60
+ const templateMap: Record<string, string> = {
49
61
  discovery: 'templates/architect/discovery.md',
50
62
  'user-flows': 'templates/design/flow.md',
51
63
  'domain-modeling': 'templates/design/database.md',
@@ -62,7 +74,7 @@ class ArchitectureGenerator {
62
74
  * Save architecture to files
63
75
  * AGENTIC: Format determined by Claude based on content
64
76
  */
65
- async saveArchitecture(architecture, projectPath) {
77
+ async saveArchitecture(architecture: Architecture, projectPath: string): Promise<string> {
66
78
  const archPath = path.join(projectPath, 'planning', 'architectures', architecture.id)
67
79
  await fs.mkdir(archPath, { recursive: true })
68
80
 
@@ -76,8 +88,8 @@ class ArchitectureGenerator {
76
88
  /**
77
89
  * SQL type mapping utility
78
90
  */
79
- sqlType(type) {
80
- const typeMap = {
91
+ sqlType(type: string): string {
92
+ const typeMap: Record<string, string> = {
81
93
  uuid: 'UUID',
82
94
  string: 'VARCHAR(255)',
83
95
  text: 'TEXT',
@@ -90,4 +102,4 @@ class ArchitectureGenerator {
90
102
  }
91
103
  }
92
104
 
93
- module.exports = ArchitectureGenerator
105
+ export default ArchitectureGenerator
@@ -1,24 +1,45 @@
1
1
  /**
2
2
  * ContextEstimator - Pre-filter files before building context
3
- *
3
+ *
4
4
  * Estimates which files are needed based on task analysis
5
5
  * BEFORE building full context - saves I/O
6
- *
6
+ *
7
7
  * @version 1.0.0
8
8
  */
9
9
 
10
- const path = require('path')
11
- const { glob } = require('glob')
12
- const log = require('../utils/logger')
10
+ import path from 'path'
11
+ import { glob } from 'glob'
12
+ import log from '../utils/logger'
13
+
14
+ interface TaskAnalysis {
15
+ primaryDomain: string
16
+ projectTechnologies?: ProjectTech
17
+ semantic?: SemanticAnalysis
18
+ }
19
+
20
+ interface ProjectTech {
21
+ extensions?: Record<string, number>
22
+ directories?: string[]
23
+ [key: string]: unknown
24
+ }
25
+
26
+ interface SemanticAnalysis {
27
+ requiresMultipleAgents?: boolean
28
+ agents?: string[]
29
+ [key: string]: unknown
30
+ }
31
+
32
+ interface FilePatterns {
33
+ include: string[]
34
+ extensions: string[]
35
+ exclude: string[]
36
+ }
13
37
 
14
38
  class ContextEstimator {
15
39
  /**
16
40
  * Estimate which files are needed for a task
17
- * @param {Object} taskAnalysis - Task analysis result
18
- * @param {string} projectPath - Project path
19
- * @returns {Promise<Array<string>>} Estimated file paths
20
41
  */
21
- async estimateFiles(taskAnalysis, projectPath) {
42
+ async estimateFiles(taskAnalysis: TaskAnalysis, projectPath: string): Promise<string[]> {
22
43
  const domain = taskAnalysis.primaryDomain
23
44
  const projectTech = taskAnalysis.projectTechnologies || {}
24
45
  const semantic = taskAnalysis.semantic || {}
@@ -29,13 +50,16 @@ class ContextEstimator {
29
50
  // Expand with semantic understanding
30
51
  if (semantic.requiresMultipleAgents && semantic.agents) {
31
52
  // Multi-agent task - combine patterns
32
- const allPatterns = semantic.agents.reduce((acc, agentDomain) => {
33
- const agentPatterns = this.getPatternsForDomain(agentDomain, projectTech)
34
- return {
35
- include: [...acc.include, ...agentPatterns.include],
36
- extensions: [...acc.extensions, ...agentPatterns.extensions]
37
- }
38
- }, { include: [], extensions: [] })
53
+ const allPatterns = semantic.agents.reduce(
54
+ (acc, agentDomain) => {
55
+ const agentPatterns = this.getPatternsForDomain(agentDomain, projectTech)
56
+ return {
57
+ include: [...acc.include, ...agentPatterns.include],
58
+ extensions: [...acc.extensions, ...agentPatterns.extensions],
59
+ }
60
+ },
61
+ { include: [] as string[], extensions: [] as string[] }
62
+ )
39
63
 
40
64
  patterns.include = [...new Set(allPatterns.include)]
41
65
  patterns.extensions = [...new Set(allPatterns.extensions)]
@@ -55,35 +79,33 @@ class ContextEstimator {
55
79
  * 100% AGENTIC: Uses REAL project data, not hardcoded patterns.
56
80
  * No domain-specific assumptions or language→extension mapping.
57
81
  */
58
- getPatternsForDomain(domain, projectData) {
59
- const patterns = {
82
+ getPatternsForDomain(domain: string, projectData: ProjectTech): FilePatterns {
83
+ const patterns: FilePatterns = {
60
84
  include: [],
61
85
  extensions: [],
62
- exclude: ['node_modules', 'dist', 'build', '.git', '.next', 'target', 'vendor', 'coverage']
86
+ exclude: ['node_modules', 'dist', 'build', '.git', '.next', 'target', 'vendor', 'coverage'],
63
87
  }
64
88
 
65
89
  // Use REAL extensions from project (if provided in projectData)
66
90
  if (projectData && projectData.extensions) {
67
91
  // projectData.extensions is {'.js': 45, '.ts': 23, ...}
68
92
  patterns.extensions = Object.keys(projectData.extensions)
69
- .filter(ext => ext.startsWith('.'))
70
- .slice(0, 15); // Top 15 extensions
93
+ .filter((ext) => ext.startsWith('.'))
94
+ .slice(0, 15) // Top 15 extensions
71
95
  }
72
96
 
73
97
  // Use REAL directories from project (if provided in projectData)
74
98
  if (projectData && projectData.directories) {
75
- patterns.include = projectData.directories.filter(dir =>
76
- !patterns.exclude.includes(dir)
77
- );
99
+ patterns.include = projectData.directories.filter((dir) => !patterns.exclude.includes(dir))
78
100
  }
79
101
 
80
102
  // If no real data available, use minimal universal fallback
81
103
  if (patterns.extensions.length === 0) {
82
- patterns.extensions = ['*']; // All files
104
+ patterns.extensions = ['*'] // All files
83
105
  }
84
106
 
85
107
  if (patterns.include.length === 0) {
86
- patterns.include = ['.']; // Root directory
108
+ patterns.include = ['.'] // Root directory
87
109
  }
88
110
 
89
111
  // NO domain-specific hardcoding
@@ -95,12 +117,12 @@ class ContextEstimator {
95
117
  /**
96
118
  * Find files matching patterns
97
119
  */
98
- async findMatchingFiles(projectPath, patterns) {
99
- const files = []
120
+ async findMatchingFiles(projectPath: string, patterns: FilePatterns): Promise<string[]> {
121
+ const files: string[] = []
100
122
 
101
123
  try {
102
124
  // Build glob patterns
103
- const globPatterns = []
125
+ const globPatterns: string[] = []
104
126
 
105
127
  // Add include patterns
106
128
  for (const include of patterns.include) {
@@ -120,15 +142,15 @@ class ContextEstimator {
120
142
  try {
121
143
  const matches = await glob(pattern, {
122
144
  cwd: projectPath,
123
- ignore: patterns.exclude.map(ex => `**/${ex}/**`),
145
+ ignore: patterns.exclude.map((ex) => `**/${ex}/**`),
124
146
  nodir: true,
125
- follow: false
147
+ follow: false,
126
148
  })
127
149
 
128
150
  if (Array.isArray(matches)) {
129
151
  files.push(...matches)
130
152
  }
131
- } catch (error) {
153
+ } catch {
132
154
  // Skip invalid patterns
133
155
  }
134
156
  }
@@ -136,7 +158,7 @@ class ContextEstimator {
136
158
  // Remove duplicates and sort
137
159
  return [...new Set(files)].sort()
138
160
  } catch (error) {
139
- log.error('Error finding files:', error.message)
161
+ log.error('Error finding files:', (error as Error).message)
140
162
  return []
141
163
  }
142
164
  }
@@ -144,11 +166,10 @@ class ContextEstimator {
144
166
  /**
145
167
  * Estimate context size (number of files)
146
168
  */
147
- async estimateContextSize(taskAnalysis, projectPath) {
169
+ async estimateContextSize(taskAnalysis: TaskAnalysis, projectPath: string): Promise<number> {
148
170
  const files = await this.estimateFiles(taskAnalysis, projectPath)
149
171
  return files.length
150
172
  }
151
173
  }
152
174
 
153
- module.exports = ContextEstimator
154
-
175
+ export default ContextEstimator
@@ -4,13 +4,29 @@
4
4
  * Used to inject high standards into agent prompts.
5
5
  */
6
6
 
7
- const ProductStandards = {
7
+ interface DomainStandard {
8
+ title: string
9
+ rules: string[]
10
+ }
11
+
12
+ interface Standards {
13
+ title: string
14
+ rules: string[]
15
+ }
16
+
17
+ interface ProductStandardsType {
18
+ general: string[]
19
+ domains: Record<string, DomainStandard>
20
+ getStandards(domain?: string): Standards
21
+ }
22
+
23
+ const ProductStandards: ProductStandardsType = {
8
24
  // General standards applicable to all agents
9
25
  general: [
10
26
  'SHIP IT: Bias for action. Better to ship and iterate than perfect and delay.',
11
27
  'USER CENTRIC: Always ask "How does this help the user?"',
12
28
  'CLEAN CODE: Write code that is easy to read, test, and maintain.',
13
- 'NO BS: Avoid over-engineering. Simple is better than complex.'
29
+ 'NO BS: Avoid over-engineering. Simple is better than complex.',
14
30
  ],
15
31
 
16
32
  // Domain-specific standards
@@ -22,8 +38,8 @@ const ProductStandards = {
22
38
  'ACCESSIBILITY: Semantic HTML, ARIA labels, keyboard navigation (WCAG 2.1 AA).',
23
39
  'RESPONSIVE: Mobile-first design. Works on all devices.',
24
40
  'UX/UI: Smooth transitions, loading states, error boundaries. No dead clicks.',
25
- 'STATE: Local state for UI, Global state (Context/Zustand) for data. No prop drilling.'
26
- ]
41
+ 'STATE: Local state for UI, Global state (Context/Zustand) for data. No prop drilling.',
42
+ ],
27
43
  },
28
44
  backend: {
29
45
  title: 'Robust Backend Standards',
@@ -32,8 +48,8 @@ const ProductStandards = {
32
48
  'SCALABILITY: Stateless services. Caching strategies (Redis/CDN).',
33
49
  'RELIABILITY: Graceful error handling. Structured logging. Health checks.',
34
50
  'API DESIGN: RESTful or GraphQL best practices. Consistent response envelopes.',
35
- 'DB: Indexed queries. Migrations for schema changes. No N+1 queries.'
36
- ]
51
+ 'DB: Indexed queries. Migrations for schema changes. No N+1 queries.',
52
+ ],
37
53
  },
38
54
  database: {
39
55
  title: 'Data Integrity Standards',
@@ -41,8 +57,8 @@ const ProductStandards = {
41
57
  'INTEGRITY: Foreign keys, constraints, transactions.',
42
58
  'PERFORMANCE: Index usage analysis. Query optimization.',
43
59
  'BACKUPS: Point-in-time recovery awareness.',
44
- 'MIGRATIONS: Idempotent scripts. Zero-downtime changes.'
45
- ]
60
+ 'MIGRATIONS: Idempotent scripts. Zero-downtime changes.',
61
+ ],
46
62
  },
47
63
  devops: {
48
64
  title: 'Modern Ops Standards',
@@ -50,8 +66,8 @@ const ProductStandards = {
50
66
  'AUTOMATION: CI/CD for everything. No manual deployments.',
51
67
  'IaC: Infrastructure as Code (Terraform/Pulumi).',
52
68
  'OBSERVABILITY: Metrics, Logs, Traces (OpenTelemetry).',
53
- 'SECURITY: Least privilege access. Secrets management.'
54
- ]
69
+ 'SECURITY: Least privilege access. Secrets management.',
70
+ ],
55
71
  },
56
72
  qa: {
57
73
  title: 'Quality Assurance Standards',
@@ -59,8 +75,8 @@ const ProductStandards = {
59
75
  'PYRAMID: Many unit tests, some integration, few E2E.',
60
76
  'COVERAGE: Critical paths must be tested.',
61
77
  'REALISM: Test with realistic data and scenarios.',
62
- 'SPEED: Fast feedback loops. Parallel execution.'
63
- ]
78
+ 'SPEED: Fast feedback loops. Parallel execution.',
79
+ ],
64
80
  },
65
81
  architecture: {
66
82
  title: 'System Architecture Standards',
@@ -68,25 +84,23 @@ const ProductStandards = {
68
84
  'MODULARITY: High cohesion, low coupling.',
69
85
  'EVOLVABILITY: Easy to change. Hard to break.',
70
86
  'SIMPLICITY: Choose boring technology. Innovation tokens are limited.',
71
- 'DOCS: Architecture Decision Records (ADRs).'
72
- ]
73
- }
87
+ 'DOCS: Architecture Decision Records (ADRs).',
88
+ ],
89
+ },
74
90
  },
75
91
 
76
92
  /**
77
93
  * Get standards for a specific domain
78
- * @param {string} domain - The domain (frontend, backend, etc.)
79
- * @returns {Object} The standards object
80
94
  */
81
- getStandards(domain) {
82
- const key = domain?.toLowerCase();
83
- const specific = this.domains[key] || { title: 'General Standards', rules: [] };
84
-
95
+ getStandards(domain?: string): Standards {
96
+ const key = domain?.toLowerCase()
97
+ const specific = (key && this.domains[key]) || { title: 'General Standards', rules: [] }
98
+
85
99
  return {
86
100
  title: specific.title,
87
- rules: [...this.general, ...specific.rules]
88
- };
89
- }
90
- };
101
+ rules: [...this.general, ...specific.rules],
102
+ }
103
+ },
104
+ }
91
105
 
92
- module.exports = ProductStandards;
106
+ export default ProductStandards