@codeyam/codeyam-cli 0.1.0-staging.eb21b2f → 0.1.0-staging.f777668

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 (544) hide show
  1. package/analyzer-template/.build-info.json +7 -7
  2. package/analyzer-template/log.txt +3 -3
  3. package/analyzer-template/package.json +21 -21
  4. package/analyzer-template/packages/ai/package.json +2 -2
  5. package/analyzer-template/packages/ai/src/lib/astScopes/astScopeAnalyzer.ts +34 -3
  6. package/analyzer-template/packages/ai/src/lib/completionCall.ts +114 -113
  7. package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +259 -5
  8. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.ts +62 -0
  9. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.ts +35 -0
  10. package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +78 -2
  11. package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +0 -33
  12. package/analyzer-template/packages/analyze/src/lib/ProjectAnalyzer.ts +19 -7
  13. package/analyzer-template/packages/analyze/src/lib/asts/index.ts +7 -2
  14. package/analyzer-template/packages/analyze/src/lib/asts/nodes/getNodeType.ts +1 -0
  15. package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +9 -1
  16. package/analyzer-template/packages/analyze/src/lib/files/analyze/dependencyResolver.ts +0 -6
  17. package/analyzer-template/packages/analyze/src/lib/files/analyze/findOrCreateEntity.ts +12 -0
  18. package/analyzer-template/packages/analyze/src/lib/files/scenarios/TransformationTracer.ts +65 -28
  19. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +83 -0
  20. package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.ts +0 -98
  21. package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +23 -4
  22. package/analyzer-template/packages/aws/package.json +10 -10
  23. package/analyzer-template/packages/database/index.ts +1 -0
  24. package/analyzer-template/packages/database/package.json +3 -3
  25. package/analyzer-template/packages/database/src/lib/kysely/db.ts +8 -0
  26. package/analyzer-template/packages/database/src/lib/kysely/tables/editorScenariosTable.ts +68 -0
  27. package/analyzer-template/packages/database/src/lib/loadCommits.ts +31 -20
  28. package/analyzer-template/packages/database/src/lib/loadReadyToBeCapturedAnalyses.ts +0 -5
  29. package/analyzer-template/packages/database/src/lib/updateCommitMetadata.ts +151 -135
  30. package/analyzer-template/packages/database/src/lib/updateFreshAnalysisStatus.ts +58 -42
  31. package/analyzer-template/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.ts +81 -65
  32. package/analyzer-template/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.ts +29 -1
  33. package/analyzer-template/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.ts +33 -5
  34. package/analyzer-template/packages/github/dist/database/index.d.ts +1 -0
  35. package/analyzer-template/packages/github/dist/database/index.d.ts.map +1 -1
  36. package/analyzer-template/packages/github/dist/database/index.js +1 -0
  37. package/analyzer-template/packages/github/dist/database/index.js.map +1 -1
  38. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts +2 -0
  39. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts.map +1 -1
  40. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js +5 -0
  41. package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js.map +1 -1
  42. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts +22 -0
  43. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.d.ts.map +1 -0
  44. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js +51 -0
  45. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -0
  46. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts +5 -0
  47. package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/scenariosTable.d.ts.map +1 -1
  48. package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.d.ts.map +1 -1
  49. package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js +23 -13
  50. package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js.map +1 -1
  51. package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.d.ts.map +1 -1
  52. package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js +1 -4
  53. package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js.map +1 -1
  54. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.d.ts.map +1 -1
  55. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js +100 -89
  56. package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js.map +1 -1
  57. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.d.ts.map +1 -1
  58. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.js +41 -30
  59. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatus.js.map +1 -1
  60. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.d.ts.map +1 -1
  61. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.js +68 -57
  62. package/analyzer-template/packages/github/dist/database/src/lib/updateFreshAnalysisStatusWithScenarios.js.map +1 -1
  63. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.d.ts.map +1 -1
  64. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +29 -1
  65. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -1
  66. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.d.ts.map +1 -1
  67. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +33 -5
  68. package/analyzer-template/packages/github/dist/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
  69. package/analyzer-template/packages/github/dist/types/src/types/ProjectMetadata.d.ts +1 -0
  70. package/analyzer-template/packages/github/dist/types/src/types/ProjectMetadata.d.ts.map +1 -1
  71. package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts +10 -0
  72. package/analyzer-template/packages/github/dist/types/src/types/Scenario.d.ts.map +1 -1
  73. package/analyzer-template/packages/github/package.json +1 -1
  74. package/analyzer-template/packages/types/src/types/ProjectMetadata.ts +1 -0
  75. package/analyzer-template/packages/types/src/types/Scenario.ts +10 -0
  76. package/analyzer-template/packages/utils/dist/types/src/types/ProjectMetadata.d.ts +1 -0
  77. package/analyzer-template/packages/utils/dist/types/src/types/ProjectMetadata.d.ts.map +1 -1
  78. package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts +10 -0
  79. package/analyzer-template/packages/utils/dist/types/src/types/Scenario.d.ts.map +1 -1
  80. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.d.ts.map +1 -1
  81. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js +6 -2
  82. package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js.map +1 -1
  83. package/analyzer-template/packages/utils/src/lib/fs/rsyncCopy.ts +14 -2
  84. package/analyzer-template/playwright/captureFromUrl.ts +89 -82
  85. package/analyzer-template/project/constructMockCode.ts +168 -48
  86. package/analyzer-template/project/orchestrateCapture.ts +4 -1
  87. package/analyzer-template/project/reconcileMockDataKeys.ts +19 -14
  88. package/analyzer-template/project/start.ts +3 -0
  89. package/analyzer-template/project/startScenarioCapture.ts +9 -0
  90. package/analyzer-template/project/writeClientLogRoute.ts +125 -0
  91. package/analyzer-template/project/writeMockDataTsx.ts +17 -0
  92. package/analyzer-template/project/writeScenarioComponents.ts +96 -17
  93. package/analyzer-template/tsconfig.json +13 -1
  94. package/background/src/lib/virtualized/project/constructMockCode.js +143 -39
  95. package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
  96. package/background/src/lib/virtualized/project/orchestrateCapture.js +4 -1
  97. package/background/src/lib/virtualized/project/orchestrateCapture.js.map +1 -1
  98. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js +17 -11
  99. package/background/src/lib/virtualized/project/reconcileMockDataKeys.js.map +1 -1
  100. package/background/src/lib/virtualized/project/start.js +2 -0
  101. package/background/src/lib/virtualized/project/start.js.map +1 -1
  102. package/background/src/lib/virtualized/project/startScenarioCapture.js +5 -0
  103. package/background/src/lib/virtualized/project/startScenarioCapture.js.map +1 -1
  104. package/background/src/lib/virtualized/project/writeClientLogRoute.js +110 -0
  105. package/background/src/lib/virtualized/project/writeClientLogRoute.js.map +1 -0
  106. package/background/src/lib/virtualized/project/writeMockDataTsx.js +12 -0
  107. package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
  108. package/background/src/lib/virtualized/project/writeScenarioComponents.js +73 -12
  109. package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
  110. package/codeyam-cli/scripts/apply-setup.js +208 -11
  111. package/codeyam-cli/scripts/apply-setup.js.map +1 -1
  112. package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js +196 -0
  113. package/codeyam-cli/src/__tests__/memory-scripts/filter-session.test.js.map +1 -0
  114. package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js +114 -0
  115. package/codeyam-cli/src/__tests__/memory-scripts/read-json-field.test.js.map +1 -0
  116. package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js +149 -0
  117. package/codeyam-cli/src/__tests__/memory-scripts/ripgrep-fallback.test.js.map +1 -0
  118. package/codeyam-cli/src/cli.js +32 -25
  119. package/codeyam-cli/src/cli.js.map +1 -1
  120. package/codeyam-cli/src/commands/analyze.js +17 -7
  121. package/codeyam-cli/src/commands/analyze.js.map +1 -1
  122. package/codeyam-cli/src/commands/default.js +14 -2
  123. package/codeyam-cli/src/commands/default.js.map +1 -1
  124. package/codeyam-cli/src/commands/editor.js +2607 -0
  125. package/codeyam-cli/src/commands/editor.js.map +1 -0
  126. package/codeyam-cli/src/commands/init.js +40 -11
  127. package/codeyam-cli/src/commands/init.js.map +1 -1
  128. package/codeyam-cli/src/commands/memory.js +29 -58
  129. package/codeyam-cli/src/commands/memory.js.map +1 -1
  130. package/codeyam-cli/src/utils/__tests__/devServerState.test.js +134 -0
  131. package/codeyam-cli/src/utils/__tests__/devServerState.test.js.map +1 -0
  132. package/codeyam-cli/src/utils/__tests__/editorApi.test.js +127 -0
  133. package/codeyam-cli/src/utils/__tests__/editorApi.test.js.map +1 -0
  134. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +635 -0
  135. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -0
  136. package/codeyam-cli/src/utils/__tests__/editorCapture.test.js +93 -0
  137. package/codeyam-cli/src/utils/__tests__/editorCapture.test.js.map +1 -0
  138. package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js +155 -0
  139. package/codeyam-cli/src/utils/__tests__/editorDevServer.test.js.map +1 -0
  140. package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js +121 -0
  141. package/codeyam-cli/src/utils/__tests__/editorEntityChangeStatus.test.js.map +1 -0
  142. package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js +294 -0
  143. package/codeyam-cli/src/utils/__tests__/editorImageVerifier.test.js.map +1 -0
  144. package/codeyam-cli/src/utils/__tests__/editorJournal.test.js +542 -0
  145. package/codeyam-cli/src/utils/__tests__/editorJournal.test.js.map +1 -0
  146. package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js +393 -0
  147. package/codeyam-cli/src/utils/__tests__/editorLoaderHelpers.test.js.map +1 -0
  148. package/codeyam-cli/src/utils/__tests__/editorMockState.test.js +270 -0
  149. package/codeyam-cli/src/utils/__tests__/editorMockState.test.js.map +1 -0
  150. package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js +217 -0
  151. package/codeyam-cli/src/utils/__tests__/editorPreloadHelpers.test.js.map +1 -0
  152. package/codeyam-cli/src/utils/__tests__/editorPreview.test.js +266 -0
  153. package/codeyam-cli/src/utils/__tests__/editorPreview.test.js.map +1 -0
  154. package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js +139 -0
  155. package/codeyam-cli/src/utils/__tests__/editorScenarioLookup.test.js.map +1 -0
  156. package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js +221 -0
  157. package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js.map +1 -0
  158. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js +221 -0
  159. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js.map +1 -0
  160. package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js +213 -0
  161. package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js.map +1 -0
  162. package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js +1686 -0
  163. package/codeyam-cli/src/utils/__tests__/entityChangeStatus.test.js.map +1 -0
  164. package/codeyam-cli/src/utils/__tests__/git.editor.test.js +134 -0
  165. package/codeyam-cli/src/utils/__tests__/git.editor.test.js.map +1 -0
  166. package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js +107 -0
  167. package/codeyam-cli/src/utils/__tests__/journalCaptureStabilization.test.js.map +1 -0
  168. package/codeyam-cli/src/utils/__tests__/npmVersionCheck.test.js +6 -0
  169. package/codeyam-cli/src/utils/__tests__/npmVersionCheck.test.js.map +1 -1
  170. package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js +101 -0
  171. package/codeyam-cli/src/utils/__tests__/parseRegisterArg.test.js.map +1 -0
  172. package/codeyam-cli/src/utils/__tests__/pathIgnoring.test.js +9 -0
  173. package/codeyam-cli/src/utils/__tests__/pathIgnoring.test.js.map +1 -1
  174. package/codeyam-cli/src/utils/__tests__/project.test.js +65 -0
  175. package/codeyam-cli/src/utils/__tests__/project.test.js.map +1 -0
  176. package/codeyam-cli/src/utils/__tests__/scenarioMarkers.test.js +121 -0
  177. package/codeyam-cli/src/utils/__tests__/scenarioMarkers.test.js.map +1 -0
  178. package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js +246 -0
  179. package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js.map +1 -0
  180. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +50 -4
  181. package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
  182. package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js +50 -0
  183. package/codeyam-cli/src/utils/__tests__/templateConsistency.test.js.map +1 -0
  184. package/codeyam-cli/src/utils/backgroundServer.js +21 -5
  185. package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
  186. package/codeyam-cli/src/utils/buildFlags.js +4 -0
  187. package/codeyam-cli/src/utils/buildFlags.js.map +1 -0
  188. package/codeyam-cli/src/utils/devModeEvents.js +40 -0
  189. package/codeyam-cli/src/utils/devModeEvents.js.map +1 -0
  190. package/codeyam-cli/src/utils/devServerState.js +71 -0
  191. package/codeyam-cli/src/utils/devServerState.js.map +1 -0
  192. package/codeyam-cli/src/utils/editorApi.js +73 -0
  193. package/codeyam-cli/src/utils/editorApi.js.map +1 -0
  194. package/codeyam-cli/src/utils/editorAudit.js +159 -0
  195. package/codeyam-cli/src/utils/editorAudit.js.map +1 -0
  196. package/codeyam-cli/src/utils/editorCapture.js +102 -0
  197. package/codeyam-cli/src/utils/editorCapture.js.map +1 -0
  198. package/codeyam-cli/src/utils/editorDevServer.js +109 -0
  199. package/codeyam-cli/src/utils/editorDevServer.js.map +1 -0
  200. package/codeyam-cli/src/utils/editorEntityChangeStatus.js +44 -0
  201. package/codeyam-cli/src/utils/editorEntityChangeStatus.js.map +1 -0
  202. package/codeyam-cli/src/utils/editorImageVerifier.js +155 -0
  203. package/codeyam-cli/src/utils/editorImageVerifier.js.map +1 -0
  204. package/codeyam-cli/src/utils/editorJournal.js +225 -0
  205. package/codeyam-cli/src/utils/editorJournal.js.map +1 -0
  206. package/codeyam-cli/src/utils/editorLoaderHelpers.js +81 -0
  207. package/codeyam-cli/src/utils/editorLoaderHelpers.js.map +1 -0
  208. package/codeyam-cli/src/utils/editorMockState.js +248 -0
  209. package/codeyam-cli/src/utils/editorMockState.js.map +1 -0
  210. package/codeyam-cli/src/utils/editorPreloadHelpers.js +135 -0
  211. package/codeyam-cli/src/utils/editorPreloadHelpers.js.map +1 -0
  212. package/codeyam-cli/src/utils/editorPreview.js +106 -0
  213. package/codeyam-cli/src/utils/editorPreview.js.map +1 -0
  214. package/codeyam-cli/src/utils/editorScenarioSwitch.js +112 -0
  215. package/codeyam-cli/src/utils/editorScenarioSwitch.js.map +1 -0
  216. package/codeyam-cli/src/utils/editorScenarios.js +96 -0
  217. package/codeyam-cli/src/utils/editorScenarios.js.map +1 -0
  218. package/codeyam-cli/src/utils/editorSeedAdapter.js +173 -0
  219. package/codeyam-cli/src/utils/editorSeedAdapter.js.map +1 -0
  220. package/codeyam-cli/src/utils/entityChangeStatus.js +337 -0
  221. package/codeyam-cli/src/utils/entityChangeStatus.js.map +1 -0
  222. package/codeyam-cli/src/utils/entityChangeStatus.server.js +107 -0
  223. package/codeyam-cli/src/utils/entityChangeStatus.server.js.map +1 -0
  224. package/codeyam-cli/src/utils/fileMetadata.js +5 -0
  225. package/codeyam-cli/src/utils/fileMetadata.js.map +1 -1
  226. package/codeyam-cli/src/utils/fileWatcher.js +25 -9
  227. package/codeyam-cli/src/utils/fileWatcher.js.map +1 -1
  228. package/codeyam-cli/src/utils/git.js +103 -0
  229. package/codeyam-cli/src/utils/git.js.map +1 -1
  230. package/codeyam-cli/src/utils/install-skills.js +57 -15
  231. package/codeyam-cli/src/utils/install-skills.js.map +1 -1
  232. package/codeyam-cli/src/utils/interactiveSyncWatcher.js +126 -0
  233. package/codeyam-cli/src/utils/interactiveSyncWatcher.js.map +1 -0
  234. package/codeyam-cli/src/utils/npmVersionCheck.js +2 -2
  235. package/codeyam-cli/src/utils/npmVersionCheck.js.map +1 -1
  236. package/codeyam-cli/src/utils/parseRegisterArg.js +31 -0
  237. package/codeyam-cli/src/utils/parseRegisterArg.js.map +1 -0
  238. package/codeyam-cli/src/utils/pathIgnoring.js +19 -7
  239. package/codeyam-cli/src/utils/pathIgnoring.js.map +1 -1
  240. package/codeyam-cli/src/utils/project.js +15 -5
  241. package/codeyam-cli/src/utils/project.js.map +1 -1
  242. package/codeyam-cli/src/utils/queue/__tests__/heartbeat.test.js +11 -11
  243. package/codeyam-cli/src/utils/queue/__tests__/heartbeat.test.js.map +1 -1
  244. package/codeyam-cli/src/utils/queue/__tests__/manager.test.js +22 -0
  245. package/codeyam-cli/src/utils/queue/__tests__/manager.test.js.map +1 -1
  246. package/codeyam-cli/src/utils/queue/heartbeat.js +13 -5
  247. package/codeyam-cli/src/utils/queue/heartbeat.js.map +1 -1
  248. package/codeyam-cli/src/utils/queue/job.js +70 -1
  249. package/codeyam-cli/src/utils/queue/job.js.map +1 -1
  250. package/codeyam-cli/src/utils/queue/manager.js +7 -6
  251. package/codeyam-cli/src/utils/queue/manager.js.map +1 -1
  252. package/codeyam-cli/src/utils/requireSimulations.js +1 -1
  253. package/codeyam-cli/src/utils/requireSimulations.js.map +1 -1
  254. package/codeyam-cli/src/utils/ruleReflection/__tests__/contextBuilder.test.js +5 -6
  255. package/codeyam-cli/src/utils/ruleReflection/__tests__/contextBuilder.test.js.map +1 -1
  256. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/assertRules.js +1 -1
  257. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/assertRules.js.map +1 -1
  258. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/setupTempProject.js +0 -1
  259. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/helpers/setupTempProject.js.map +1 -1
  260. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/ruleReflectionE2E.test.js +2 -4
  261. package/codeyam-cli/src/utils/ruleReflection/__tests__/integration/ruleReflectionE2E.test.js.map +1 -1
  262. package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.js +2 -5
  263. package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.js.map +1 -1
  264. package/codeyam-cli/src/utils/rules/__tests__/parser.test.js +83 -0
  265. package/codeyam-cli/src/utils/rules/__tests__/parser.test.js.map +1 -0
  266. package/codeyam-cli/src/utils/rules/__tests__/pathMatcher.test.js +118 -0
  267. package/codeyam-cli/src/utils/rules/__tests__/pathMatcher.test.js.map +1 -0
  268. package/codeyam-cli/src/utils/rules/__tests__/rulePlacement.test.js +72 -0
  269. package/codeyam-cli/src/utils/rules/__tests__/rulePlacement.test.js.map +1 -0
  270. package/codeyam-cli/src/utils/rules/__tests__/sourceFiles.test.js +76 -0
  271. package/codeyam-cli/src/utils/rules/__tests__/sourceFiles.test.js.map +1 -0
  272. package/codeyam-cli/src/utils/rules/index.js +1 -0
  273. package/codeyam-cli/src/utils/rules/index.js.map +1 -1
  274. package/codeyam-cli/src/utils/rules/parser.js +14 -4
  275. package/codeyam-cli/src/utils/rules/parser.js.map +1 -1
  276. package/codeyam-cli/src/utils/rules/pathMatcher.js +34 -3
  277. package/codeyam-cli/src/utils/rules/pathMatcher.js.map +1 -1
  278. package/codeyam-cli/src/utils/rules/rulePlacement.js +65 -0
  279. package/codeyam-cli/src/utils/rules/rulePlacement.js.map +1 -0
  280. package/codeyam-cli/src/utils/rules/sourceFiles.js +43 -0
  281. package/codeyam-cli/src/utils/rules/sourceFiles.js.map +1 -0
  282. package/codeyam-cli/src/utils/scenarioMarkers.js +134 -0
  283. package/codeyam-cli/src/utils/scenarioMarkers.js.map +1 -0
  284. package/codeyam-cli/src/utils/scenariosManifest.js +112 -0
  285. package/codeyam-cli/src/utils/scenariosManifest.js.map +1 -0
  286. package/codeyam-cli/src/utils/serverState.js +27 -2
  287. package/codeyam-cli/src/utils/serverState.js.map +1 -1
  288. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +82 -11
  289. package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
  290. package/codeyam-cli/src/utils/simulationGateMiddleware.js +159 -0
  291. package/codeyam-cli/src/utils/simulationGateMiddleware.js.map +1 -0
  292. package/codeyam-cli/src/utils/syncMocksMiddleware.js +5 -24
  293. package/codeyam-cli/src/utils/syncMocksMiddleware.js.map +1 -1
  294. package/codeyam-cli/src/utils/testRunner.js +158 -0
  295. package/codeyam-cli/src/utils/testRunner.js.map +1 -0
  296. package/codeyam-cli/src/utils/transcriptPruning.js +67 -0
  297. package/codeyam-cli/src/utils/transcriptPruning.js.map +1 -0
  298. package/codeyam-cli/src/utils/versionInfo.js +21 -0
  299. package/codeyam-cli/src/utils/versionInfo.js.map +1 -1
  300. package/codeyam-cli/src/utils/webappDetection.js +14 -2
  301. package/codeyam-cli/src/utils/webappDetection.js.map +1 -1
  302. package/codeyam-cli/src/webserver/app/lib/database.js +41 -27
  303. package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
  304. package/codeyam-cli/src/webserver/app/lib/dbNotifier.js.map +1 -1
  305. package/codeyam-cli/src/webserver/app/lib/git.js +396 -0
  306. package/codeyam-cli/src/webserver/app/lib/git.js.map +1 -0
  307. package/codeyam-cli/src/webserver/backgroundServer.js +118 -18
  308. package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
  309. package/codeyam-cli/src/webserver/build/client/assets/{CopyButton-jNYXRRNI.js → CopyButton-DmJveP3T.js} +1 -1
  310. package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-bwuHPyTa.js → EntityItem-C76mRRiF.js} +1 -1
  311. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-CvzqMxcu.js → EntityTypeBadge-g3saevPb.js} +1 -1
  312. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-BH0XDim7.js → EntityTypeIcon-CobE682z.js} +1 -1
  313. package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-Bu6c6aDe.js +1 -0
  314. package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-yjIHlOGa.js → InteractivePreview-DYFW3lDD.js} +3 -3
  315. package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-Cq5o8jL4.js → LibraryFunctionPreview-DLeucoVX.js} +1 -1
  316. package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-BvMu2i-g.js → LoadingDots-BU_OAEMP.js} +1 -1
  317. package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-kgBTLoJD.js → LogViewer-ceAyBX-H.js} +1 -1
  318. package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-BzPgx-xO.js → ReportIssueModal-djPLI-WV.js} +1 -1
  319. package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-CwZrv-Ok.js → SafeScreenshot-BED4B6sP.js} +1 -1
  320. package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-BX2Ny2Qj.js → ScenarioViewer-ZlRKbhrq.js} +3 -3
  321. package/codeyam-cli/src/webserver/build/client/assets/Spinner-Bb5uFQ5V.js +34 -0
  322. package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-CDpEprKa.js → TruncatedFilePath-C8OKAR5x.js} +1 -1
  323. package/codeyam-cli/src/webserver/build/client/assets/ViewportInspectBar-oAf2Kqsf.js +1 -0
  324. package/codeyam-cli/src/webserver/build/client/assets/{_index-BRx8ZGZo.js → _index-C96V0n15.js} +1 -1
  325. package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-4S4yPfFw.js → activity.(_tab)-BpKzcsJz.js} +1 -1
  326. package/codeyam-cli/src/webserver/build/client/assets/addon-canvas-DpzMmAy5.js +1 -0
  327. package/codeyam-cli/src/webserver/build/client/assets/addon-fit-YJmn1quW.js +12 -0
  328. package/codeyam-cli/src/webserver/build/client/assets/addon-web-links-Duc5hnl7.js +1 -0
  329. package/codeyam-cli/src/webserver/build/client/assets/addon-webgl-DI8QOUvO.js +58 -0
  330. package/codeyam-cli/src/webserver/build/client/assets/agent-transcripts-D9hemwl6.js +22 -0
  331. package/codeyam-cli/src/webserver/build/client/assets/api.dev-mode-events-l0sNRNKZ.js +1 -0
  332. package/codeyam-cli/src/webserver/build/client/assets/api.editor-audit-l0sNRNKZ.js +1 -0
  333. package/codeyam-cli/src/webserver/build/client/assets/api.editor-capture-scenario-l0sNRNKZ.js +1 -0
  334. package/codeyam-cli/src/webserver/build/client/assets/api.editor-client-errors-l0sNRNKZ.js +1 -0
  335. package/codeyam-cli/src/webserver/build/client/assets/api.editor-commit-l0sNRNKZ.js +1 -0
  336. package/codeyam-cli/src/webserver/build/client/assets/api.editor-dev-server-l0sNRNKZ.js +1 -0
  337. package/codeyam-cli/src/webserver/build/client/assets/api.editor-entity-status-l0sNRNKZ.js +1 -0
  338. package/codeyam-cli/src/webserver/build/client/assets/api.editor-file-diff-l0sNRNKZ.js +1 -0
  339. package/codeyam-cli/src/webserver/build/client/assets/api.editor-file-l0sNRNKZ.js +1 -0
  340. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-entry-l0sNRNKZ.js +1 -0
  341. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-image._-l0sNRNKZ.js +1 -0
  342. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-l0sNRNKZ.js +1 -0
  343. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-screenshot-l0sNRNKZ.js +1 -0
  344. package/codeyam-cli/src/webserver/build/client/assets/api.editor-journal-update-l0sNRNKZ.js +1 -0
  345. package/codeyam-cli/src/webserver/build/client/assets/api.editor-load-commit-l0sNRNKZ.js +1 -0
  346. package/codeyam-cli/src/webserver/build/client/assets/api.editor-project-info-l0sNRNKZ.js +1 -0
  347. package/codeyam-cli/src/webserver/build/client/assets/api.editor-refresh-l0sNRNKZ.js +1 -0
  348. package/codeyam-cli/src/webserver/build/client/assets/api.editor-register-scenario-l0sNRNKZ.js +1 -0
  349. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-data-l0sNRNKZ.js +1 -0
  350. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenario-image._-l0sNRNKZ.js +1 -0
  351. package/codeyam-cli/src/webserver/build/client/assets/api.editor-scenarios-l0sNRNKZ.js +1 -0
  352. package/codeyam-cli/src/webserver/build/client/assets/api.editor-switch-scenario-l0sNRNKZ.js +1 -0
  353. package/codeyam-cli/src/webserver/build/client/assets/api.editor-test-results-l0sNRNKZ.js +1 -0
  354. package/codeyam-cli/src/webserver/build/client/assets/api.rule-path-l0sNRNKZ.js +1 -0
  355. package/codeyam-cli/src/webserver/build/client/assets/{book-open-D4IPYH_y.js → book-open-D_nMCFmP.js} +1 -1
  356. package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-CG65viiV.js → chevron-down-BH2h1Ea2.js} +1 -1
  357. package/codeyam-cli/src/webserver/build/client/assets/{chunk-JZWAC4HX-DB3aFuEO.js → chunk-JZWAC4HX-C4pqxYJB.js} +1 -1
  358. package/codeyam-cli/src/webserver/build/client/assets/{circle-check-igfMr5DY.js → circle-check-DyIKORY6.js} +1 -1
  359. package/codeyam-cli/src/webserver/build/client/assets/{copy-Coc4o_8c.js → copy-NDbZjXao.js} +1 -1
  360. package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-D1zB-pYc.js → createLucideIcon-CMT1jU2q.js} +1 -1
  361. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-CltMNppm.js +1 -0
  362. package/codeyam-cli/src/webserver/build/client/assets/editor-DTEBHY7Z.js +10 -0
  363. package/codeyam-cli/src/webserver/build/client/assets/editorPreview-B7ztwLut.js +41 -0
  364. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-B0h9AqE6.js → entity._sha._-DItJnD8s.js} +10 -10
  365. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.dev-D5rYBT5x.js +6 -0
  366. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-CF164ouH.js +6 -0
  367. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-p9hhkjJM.js +6 -0
  368. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-PePWg17F.js → entity._sha_.edit._scenarioId-BMvVHNXU.js} +2 -2
  369. package/codeyam-cli/src/webserver/build/client/assets/{entry.client-I-Wo99C_.js → entry.client-DTvKq3TY.js} +1 -1
  370. package/codeyam-cli/src/webserver/build/client/assets/{fileTableUtils-9sMMAiWJ.js → fileTableUtils-cPo8LiG3.js} +1 -1
  371. package/codeyam-cli/src/webserver/build/client/assets/{files-Co65J0s3.js → files-DO4CZ16O.js} +1 -1
  372. package/codeyam-cli/src/webserver/build/client/assets/git-CdN8sCqs.js +1 -0
  373. package/codeyam-cli/src/webserver/build/client/assets/globals-JMY99HpD.css +1 -0
  374. package/codeyam-cli/src/webserver/build/client/assets/{index-CUM5iXwc.js → index-10oVnAAH.js} +1 -1
  375. package/codeyam-cli/src/webserver/build/client/assets/{index-_417gcQW.js → index-BcvgDzbZ.js} +1 -1
  376. package/codeyam-cli/src/webserver/build/client/assets/index-yHOVb4rc.js +15 -0
  377. package/codeyam-cli/src/webserver/build/client/assets/labs-Zk7ryIM1.js +1 -0
  378. package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-TzRHMVog.js → loader-circle-BAXYRVEO.js} +1 -1
  379. package/codeyam-cli/src/webserver/build/client/assets/manifest-7aab51c4.js +1 -0
  380. package/codeyam-cli/src/webserver/build/client/assets/memory-Dg0mvYrI.js +96 -0
  381. package/codeyam-cli/src/webserver/build/client/assets/{pause-hjzB7t2z.js → pause-DTAcYxBt.js} +1 -1
  382. package/codeyam-cli/src/webserver/build/client/assets/root-FRztnN-P.js +67 -0
  383. package/codeyam-cli/src/webserver/build/client/assets/{search-DcAwD_Ln.js → search-fKo7v0Zo.js} +1 -1
  384. package/codeyam-cli/src/webserver/build/client/assets/settings-DfuTtcJP.js +1 -0
  385. package/codeyam-cli/src/webserver/build/client/assets/{simulations-DVNJVQgD.js → simulations-B3aOzpCZ.js} +1 -1
  386. package/codeyam-cli/src/webserver/build/client/assets/{terminal-DbEAHMbA.js → terminal-BG4heKCG.js} +1 -1
  387. package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-CAD5b1o_.js → triangle-alert-DtSmdtM4.js} +1 -1
  388. package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-CrAK28Bc.js +1 -0
  389. package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-C14nCb1q.js +2 -0
  390. package/codeyam-cli/src/webserver/build/client/assets/{useReportContext-DZlYx2c4.js → useReportContext-O-jkvSPx.js} +1 -1
  391. package/codeyam-cli/src/webserver/build/client/assets/{useToast-ihdMtlf6.js → useToast-9FIWuYfK.js} +1 -1
  392. package/codeyam-cli/src/webserver/build/client/assets/xterm-BqvuqXEL.js +27 -0
  393. package/codeyam-cli/src/webserver/build/server/assets/index-Cz751Dm2.js +1 -0
  394. package/codeyam-cli/src/webserver/build/server/assets/server-build-DSylnYVM.js +367 -0
  395. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  396. package/codeyam-cli/src/webserver/build-info.json +5 -5
  397. package/codeyam-cli/src/webserver/devServer.js +39 -5
  398. package/codeyam-cli/src/webserver/devServer.js.map +1 -1
  399. package/codeyam-cli/src/webserver/editorProxy.js +431 -0
  400. package/codeyam-cli/src/webserver/editorProxy.js.map +1 -0
  401. package/codeyam-cli/src/webserver/scripts/codeyam-preload.mjs +414 -0
  402. package/codeyam-cli/src/webserver/scripts/journalCapture.ts +230 -0
  403. package/codeyam-cli/src/webserver/server.js +258 -1
  404. package/codeyam-cli/src/webserver/server.js.map +1 -1
  405. package/codeyam-cli/src/webserver/terminalServer.js +706 -0
  406. package/codeyam-cli/src/webserver/terminalServer.js.map +1 -0
  407. package/codeyam-cli/templates/codeyam-editor-claude.md +68 -0
  408. package/codeyam-cli/templates/editor-step-hook.py +208 -0
  409. package/codeyam-cli/templates/hooks/staleness-check.sh +43 -0
  410. package/codeyam-cli/templates/isolation-route/next-app.tsx.template +80 -0
  411. package/codeyam-cli/templates/isolation-route/next-pages.tsx.template +79 -0
  412. package/codeyam-cli/templates/isolation-route/vite-react.tsx.template +78 -0
  413. package/codeyam-cli/templates/msw/browser-setup.ts.template +47 -0
  414. package/codeyam-cli/templates/msw/handler-router.ts.template +47 -0
  415. package/codeyam-cli/templates/msw/server-setup.ts.template +52 -0
  416. package/codeyam-cli/templates/nextjs-prisma-sqlite/PRISMA_SETUP.md +84 -0
  417. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/api/todos/route.ts +17 -0
  418. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/codeyam-isolate/layout.tsx +12 -0
  419. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/globals.css +26 -0
  420. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/layout.tsx +34 -0
  421. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/lib/prisma.ts +19 -0
  422. package/codeyam-cli/templates/nextjs-prisma-sqlite/app/page.tsx +10 -0
  423. package/codeyam-cli/templates/nextjs-prisma-sqlite/eslint.config.mjs +11 -0
  424. package/codeyam-cli/templates/nextjs-prisma-sqlite/gitignore +64 -0
  425. package/codeyam-cli/templates/nextjs-prisma-sqlite/next.config.ts +14 -0
  426. package/codeyam-cli/templates/nextjs-prisma-sqlite/package.json +38 -0
  427. package/codeyam-cli/templates/nextjs-prisma-sqlite/postcss.config.mjs +7 -0
  428. package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma/schema.prisma +27 -0
  429. package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma/seed.ts +37 -0
  430. package/codeyam-cli/templates/nextjs-prisma-sqlite/prisma.config.ts +12 -0
  431. package/codeyam-cli/templates/nextjs-prisma-sqlite/seed-adapter.ts +89 -0
  432. package/codeyam-cli/templates/nextjs-prisma-sqlite/tsconfig.json +34 -0
  433. package/codeyam-cli/templates/nextjs-prisma-sqlite/vitest.config.ts +13 -0
  434. package/codeyam-cli/templates/prompts/conversation-guidance.txt +44 -0
  435. package/codeyam-cli/templates/prompts/conversation-prompt.txt +28 -0
  436. package/codeyam-cli/templates/prompts/interruption-prompt.txt +31 -0
  437. package/codeyam-cli/templates/prompts/stale-rules-prompt.txt +24 -0
  438. package/codeyam-cli/templates/rule-notification-hook.py +44 -17
  439. package/codeyam-cli/templates/rule-reflection-hook.py +24 -4
  440. package/codeyam-cli/templates/rules-instructions.md +34 -88
  441. package/codeyam-cli/templates/skills/codeyam-dev-mode/SKILL.md +237 -0
  442. package/codeyam-cli/templates/skills/codeyam-editor/SKILL.md +136 -0
  443. package/codeyam-cli/templates/{codeyam-memory.md → skills/codeyam-memory/SKILL.md} +215 -0
  444. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/deprecated-prompt.md +100 -0
  445. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/detect-deprecated-patterns.mjs +139 -0
  446. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/find-exports.mjs +52 -0
  447. package/codeyam-cli/templates/skills/codeyam-memory/scripts/holistic-analysis/misleading-api-prompt.md +117 -0
  448. package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/read-json-field.mjs +61 -0
  449. package/codeyam-cli/templates/skills/codeyam-memory/scripts/lib/ripgrep-fallback.mjs +155 -0
  450. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/analyze-prompt.md +46 -0
  451. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/cleanup.mjs +13 -0
  452. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/filter-session.mjs +95 -0
  453. package/codeyam-cli/templates/skills/codeyam-memory/scripts/session-mining/preprocess.mjs +160 -0
  454. package/codeyam-cli/templates/{codeyam-new-rule.md → skills/codeyam-new-rule/SKILL.md} +0 -2
  455. package/package.json +21 -14
  456. package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js +22 -4
  457. package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js.map +1 -1
  458. package/packages/ai/src/lib/completionCall.js +10 -7
  459. package/packages/ai/src/lib/completionCall.js.map +1 -1
  460. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +234 -3
  461. package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
  462. package/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.js +54 -0
  463. package/packages/ai/src/lib/dataStructure/helpers/coercePrimitivesToArraysBySchema.js.map +1 -0
  464. package/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.js +34 -0
  465. package/packages/ai/src/lib/dataStructure/helpers/stripNullableMarkers.js.map +1 -0
  466. package/packages/ai/src/lib/generateEntityScenarioData.js +57 -2
  467. package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
  468. package/packages/ai/src/lib/generateExecutionFlows.js +0 -11
  469. package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -1
  470. package/packages/analyze/src/lib/ProjectAnalyzer.js +13 -4
  471. package/packages/analyze/src/lib/ProjectAnalyzer.js.map +1 -1
  472. package/packages/analyze/src/lib/asts/index.js +4 -2
  473. package/packages/analyze/src/lib/asts/index.js.map +1 -1
  474. package/packages/analyze/src/lib/asts/nodes/getNodeType.js +1 -0
  475. package/packages/analyze/src/lib/asts/nodes/getNodeType.js.map +1 -1
  476. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +8 -1
  477. package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
  478. package/packages/analyze/src/lib/files/analyze/dependencyResolver.js +0 -5
  479. package/packages/analyze/src/lib/files/analyze/dependencyResolver.js.map +1 -1
  480. package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js +9 -0
  481. package/packages/analyze/src/lib/files/analyze/findOrCreateEntity.js.map +1 -1
  482. package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js +54 -27
  483. package/packages/analyze/src/lib/files/scenarios/TransformationTracer.js.map +1 -1
  484. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +65 -0
  485. package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
  486. package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js +0 -40
  487. package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js.map +1 -1
  488. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +18 -4
  489. package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
  490. package/packages/database/index.js +1 -0
  491. package/packages/database/index.js.map +1 -1
  492. package/packages/database/src/lib/kysely/db.js +5 -0
  493. package/packages/database/src/lib/kysely/db.js.map +1 -1
  494. package/packages/database/src/lib/kysely/tables/editorScenariosTable.js +51 -0
  495. package/packages/database/src/lib/kysely/tables/editorScenariosTable.js.map +1 -0
  496. package/packages/database/src/lib/loadCommits.js +23 -13
  497. package/packages/database/src/lib/loadCommits.js.map +1 -1
  498. package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.js +1 -4
  499. package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.js.map +1 -1
  500. package/packages/database/src/lib/updateCommitMetadata.js +100 -89
  501. package/packages/database/src/lib/updateCommitMetadata.js.map +1 -1
  502. package/packages/database/src/lib/updateFreshAnalysisStatus.js +41 -30
  503. package/packages/database/src/lib/updateFreshAnalysisStatus.js.map +1 -1
  504. package/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.js +68 -57
  505. package/packages/database/src/lib/updateFreshAnalysisStatusWithScenarios.js.map +1 -1
  506. package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js +29 -1
  507. package/packages/generate/src/lib/componentScenarioPage/generateScenarioClientWrapper.js.map +1 -1
  508. package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js +33 -5
  509. package/packages/generate/src/lib/componentScenarioPage/getIFrameMessageListenerCode.js.map +1 -1
  510. package/packages/utils/src/lib/fs/rsyncCopy.js +6 -2
  511. package/packages/utils/src/lib/fs/rsyncCopy.js.map +1 -1
  512. package/scripts/npm-post-install.cjs +34 -0
  513. package/codeyam-cli/src/commands/detect-universal-mocks.js +0 -120
  514. package/codeyam-cli/src/commands/detect-universal-mocks.js.map +0 -1
  515. package/codeyam-cli/src/commands/list.js +0 -31
  516. package/codeyam-cli/src/commands/list.js.map +0 -1
  517. package/codeyam-cli/src/commands/webapp-info.js +0 -146
  518. package/codeyam-cli/src/commands/webapp-info.js.map +0 -1
  519. package/codeyam-cli/src/utils/universal-mocks.js +0 -152
  520. package/codeyam-cli/src/utils/universal-mocks.js.map +0 -1
  521. package/codeyam-cli/src/webserver/build/client/assets/InlineSpinner-EhOseatT.js +0 -34
  522. package/codeyam-cli/src/webserver/build/client/assets/agent-transcripts-DHKuQSmR.js +0 -17
  523. package/codeyam-cli/src/webserver/build/client/assets/dev.empty-JTAjQ54M.js +0 -1
  524. package/codeyam-cli/src/webserver/build/client/assets/entity._sha.scenarios._scenarioId.fullscreen-DjLxr2JB.js +0 -6
  525. package/codeyam-cli/src/webserver/build/client/assets/entity._sha_.create-scenario-CtYowLOt.js +0 -6
  526. package/codeyam-cli/src/webserver/build/client/assets/git-BdHOxVfg.js +0 -15
  527. package/codeyam-cli/src/webserver/build/client/assets/globals-CCgBKWy4.css +0 -1
  528. package/codeyam-cli/src/webserver/build/client/assets/labs-BK0C1H1T.js +0 -1
  529. package/codeyam-cli/src/webserver/build/client/assets/manifest-390cb8fa.js +0 -1
  530. package/codeyam-cli/src/webserver/build/client/assets/memory-CzZySbBE.js +0 -78
  531. package/codeyam-cli/src/webserver/build/client/assets/root-DnbDhvTU.js +0 -62
  532. package/codeyam-cli/src/webserver/build/client/assets/settings-CclxrcPK.js +0 -1
  533. package/codeyam-cli/src/webserver/build/client/assets/useCustomSizes-BqgrAzs3.js +0 -1
  534. package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-DAFqfEDH.js +0 -2
  535. package/codeyam-cli/src/webserver/build/server/assets/index-CXfuiwt3.js +0 -1
  536. package/codeyam-cli/src/webserver/build/server/assets/server-build-BSvme_Ao.js +0 -259
  537. package/codeyam-cli/templates/codeyam-stop-hook.sh +0 -284
  538. package/scripts/finalize-analyzer.cjs +0 -13
  539. /package/codeyam-cli/templates/{codeyam-diagnose.md → commands/codeyam-diagnose.md} +0 -0
  540. /package/codeyam-cli/templates/{codeyam-debug.md → skills/codeyam-debug/SKILL.md} +0 -0
  541. /package/codeyam-cli/templates/{codeyam-setup.md → skills/codeyam-setup/SKILL.md} +0 -0
  542. /package/codeyam-cli/templates/{codeyam-sim.md → skills/codeyam-sim/SKILL.md} +0 -0
  543. /package/codeyam-cli/templates/{codeyam-test.md → skills/codeyam-test/SKILL.md} +0 -0
  544. /package/codeyam-cli/templates/{codeyam-verify.md → skills/codeyam-verify/SKILL.md} +0 -0
@@ -0,0 +1,44 @@
1
+ ### What to look for
2
+
3
+ Read the full transcript for these signals:
4
+
5
+ **User corrections or redirections**
6
+ - "no", "actually", "that's not right", "you need to also...", "you missed..."
7
+ - User provides information Claude didn't know or couldn't infer from code
8
+ - User reminds Claude of a step, pattern, or relationship
9
+ - A correction about something other than current task requirements is ALWAYS rule-worthy
10
+
11
+ **Investigation and debugging**
12
+ - Claude tried multiple approaches, read logs, or tested hypotheses
13
+ - Investigation revealed non-obvious behavior or root causes
14
+ - Debugging strategies that worked (or didn't) for specific areas
15
+
16
+ **Architecture not evident in code**
17
+ - Files that must change together (templates + installation, routes + registration)
18
+ - Complex files, data flows, pipelines, or system interactions that would benefit from an overview
19
+
20
+ **Commands and workflows**
21
+ - Specific commands or flags needed for this area
22
+ - Order of operations that matters ("must run X before Y")
23
+
24
+ **Ignore:**
25
+ - Corrections to requirements for the current feature or bug
26
+ - Confusion isolated to the current work session (won't recur)
27
+
28
+ ### Before creating a rule
29
+
30
+ **Critical check:** Read the actual source files that were modified. If the code already contains comments, guard patterns, or tests that explain the insight, the code is the documentation — skip the rule unless the file is complex and you've made a mistake or the user had to interrupt and correct you.
31
+
32
+ Show your thinking before proceeding with creating or updating rules.
33
+
34
+ ### How to write rules
35
+
36
+ **Rules must be forward-looking, not historical.** You are reading a session transcript where bugs were found and fixed, but the rule should describe the *current* codebase, not tell the story of what went wrong, what was fixed, etc. The code has already been updated — past bugs are no longer relevant.
37
+
38
+ - **DO**: State constraints and requirements ("this script MUST copy directories recursively, not just files")
39
+ - **DO**: Explain *why* something matters ("errors in prompt copying are silently caught, so missing directories won't surface as errors")
40
+ - **DON'T**: Describe what old code did ("the old version only copied files, causing X to be missing")
41
+ - **DON'T**: Narrate the debugging journey ("we discovered that the catch block was swallowing errors")
42
+ - **DON'T**: Note issues or known gaps if they are actively being worked on!
43
+
44
+ Think of the reader as a developer about to modify these files. They need to know what constraints to preserve and what pitfalls to watch for — not what happened in the past if it is no longer relevant.
@@ -0,0 +1,28 @@
1
+ FIRST: Read `.codeyam/rules/instructions.md` — it contains the required format, rule placement via the rule-path API, and an example rule. You MUST follow this format exactly when creating or editing rules.
2
+
3
+ THEN: Read the file {{CONTEXT_FILE}} and follow the instructions inside.
4
+
5
+ Analyze the conversation transcript for rule-worthy learnings:
6
+ - User corrections, redirections, or information Claude didn't know
7
+ - Investigation results and debugging knowledge
8
+ - Architecture and relationships not obvious from code
9
+ - Commands, workflows, and processes
10
+
11
+ Access and read files in the repo or in the .claude folder as needed.
12
+
13
+ Create new rules only when the learnings meet the guidelines in the context file.
14
+
15
+ IMPORTANT: If you create ANY rule files, write a short summary to `{{NOTIFICATION_FILE}}`. The summary should list each rule change, e.g.:
16
+ ```
17
+ The background rule-reflection agent created the following rules:
18
+ - Created `.claude/rules/tooling/new-pattern.md` — documents X pattern
19
+ ```
20
+ Only write the notification file when rules are created.
21
+
22
+ The project root is {{PROJECT_DIR}}
23
+
24
+ CRITICAL: All rule files MUST be written to {{PROJECT_DIR}}/.claude/rules/ (the project directory). Always use the full absolute path when writing rule files.
25
+
26
+ CRITICAL: Before writing any rule file, you MUST run the rule-path command to determine the correct subdirectory:
27
+ codeyam memory rule-path path/one path/two
28
+ Pass all paths from your frontmatter. The command returns the correct .claude/rules/ subdirectory as JSON. Do NOT guess the placement from the first path — rules with paths spanning multiple directories belong at their common ancestor.
@@ -0,0 +1,31 @@
1
+ FIRST: Read `.codeyam/rules/instructions.md` — it contains the required format, rule placement via the rule-path API, and an example rule. You MUST follow this format exactly when creating or editing rules.
2
+
3
+ THEN: Read the file {{CONTEXT_FILE}} and follow the instructions inside.
4
+
5
+ The user interrupted Claude mid-response — a strong signal of confusion or misunderstanding.
6
+ Analyze both Claude's interrupted output and the user's follow-up to determine what went wrong.
7
+
8
+ Look for:
9
+ - Claude heading in a wrong direction that the user had to correct
10
+ - Misunderstanding of project conventions, architecture, or dependencies
11
+ - Missing context that caused Claude to make incorrect assumptions
12
+ - Patterns that would recur in future sessions without a rule
13
+
14
+ Access and read files in the repo or in the .claude folder as needed.
15
+
16
+ Create new rules only when the learnings meet the guidelines in the context file.
17
+
18
+ IMPORTANT: If you create ANY rule files, write a short summary to `{{NOTIFICATION_FILE}}`. The summary should list each rule change, e.g.:
19
+ ```
20
+ The background rule-reflection agent created the following rules:
21
+ - Created `.claude/rules/tooling/new-pattern.md` — documents X pattern
22
+ ```
23
+ Only write the notification file when rules are created.
24
+
25
+ The project root is {{PROJECT_DIR}}
26
+
27
+ CRITICAL: All rule files MUST be written to {{PROJECT_DIR}}/.claude/rules/ (the project directory). Always use the full absolute path when writing rule files.
28
+
29
+ CRITICAL: Before writing any rule file, you MUST run the rule-path command to determine the correct subdirectory:
30
+ codeyam memory rule-path path/one path/two
31
+ Pass all paths from your frontmatter. The command returns the correct .claude/rules/ subdirectory as JSON. Do NOT guess the placement from the first path — rules with paths spanning multiple directories belong at their common ancestor.
@@ -0,0 +1,24 @@
1
+ FIRST: Read `.codeyam/rules/instructions.md` — it contains the required format, rule placement via the rule-path API, and an example rule. You MUST follow this format exactly when creating or editing rules.
2
+
3
+ THEN: Read the file {{CONTEXT_FILE}} and follow the instructions inside.
4
+
5
+ For each stale rule:
6
+ 1. Review the inline rule content and the diff to determine if the rule needs updating
7
+ 2. If it needs updating, edit the rule file in .claude/rules/ — also trim prose and unnecessary headers (most rules should be a few bullets)
8
+ 3. Run `codeyam memory touch <rule-path1> <rule-path2> ...` with the SPECIFIC rule paths you reviewed to mark them as audited in .claude/codeyam-rule-state.json
9
+ Example: `codeyam memory touch tooling/cli-build.md packages/ai/execution-flow-prioritization.md`
10
+
11
+ Write a summary to `{{NOTIFICATION_FILE}}` listing each action taken, even if you only ran `codeyam memory touch` without content changes. Example:
12
+ ```
13
+ The background rule-reflection agent updated the following rules:
14
+ - Reviewed `.claude/rules/example.md` — no content changes, ran `codeyam memory touch`
15
+ - Created `.claude/rules/tooling/new-pattern.md` — documents X pattern
16
+ ```
17
+
18
+ The project root is {{PROJECT_DIR}}
19
+
20
+ CRITICAL: All rule files MUST be written to {{PROJECT_DIR}}/.claude/rules/ (the project directory), NOT ~/.claude/rules/ (the user home directory). Always use the full absolute path when writing rule files.
21
+
22
+ CRITICAL: Before writing any rule file, you MUST run the rule-path command to determine the correct subdirectory:
23
+ codeyam memory rule-path path/one path/two
24
+ Pass all paths from your frontmatter. The command returns the correct .claude/rules/ subdirectory as JSON. Do NOT guess the placement from the first path — rules with paths spanning multiple directories belong at their common ancestor.
@@ -14,6 +14,7 @@ Supports four notification files (legacy combined + split agents):
14
14
  - rule-notification-interruption.md (interruption review agent)
15
15
  """
16
16
 
17
+ import json
17
18
  import os
18
19
  import sys
19
20
 
@@ -26,27 +27,53 @@ NOTIFICATION_FILES = [
26
27
  ]
27
28
 
28
29
 
30
+ def get_project_slug():
31
+ """
32
+ Derive project slug from .codeyam/config.json (matching getProjectSlug() on the TS side).
33
+ Falls back to os.path.basename(project_dir) if config is absent or malformed.
34
+ """
35
+ project_dir = os.environ.get('CLAUDE_PROJECT_DIR', os.getcwd())
36
+ try:
37
+ config_path = os.path.join(project_dir, '.codeyam', 'config.json')
38
+ with open(config_path, 'r') as f:
39
+ config = json.load(f)
40
+ slug = config.get('projectSlug', '')
41
+ if slug:
42
+ return slug
43
+ except (IOError, json.JSONDecodeError, KeyError):
44
+ pass
45
+ return os.path.basename(project_dir)
46
+
47
+
29
48
  def main():
30
49
  collected = []
50
+ slug = get_project_slug()
51
+
52
+ # Check slug subdirectory first, then fall back to flat directory
53
+ dirs_to_check = [os.path.join(MARKER_DIR, slug), MARKER_DIR]
31
54
 
32
55
  for filename in NOTIFICATION_FILES:
33
- filepath = os.path.join(MARKER_DIR, filename)
34
- if not os.path.exists(filepath):
35
- continue
36
-
37
- try:
38
- with open(filepath, 'r') as f:
39
- content = f.read().strip()
40
- except IOError:
41
- continue
42
-
43
- if content:
44
- collected.append(content)
45
-
46
- try:
47
- os.remove(filepath)
48
- except OSError:
49
- pass
56
+ for check_dir in dirs_to_check:
57
+ filepath = os.path.join(check_dir, filename)
58
+ if not os.path.exists(filepath):
59
+ continue
60
+
61
+ try:
62
+ with open(filepath, 'r') as f:
63
+ content = f.read().strip()
64
+ except IOError:
65
+ continue
66
+
67
+ if content:
68
+ collected.append(content)
69
+
70
+ try:
71
+ os.remove(filepath)
72
+ except OSError:
73
+ pass
74
+
75
+ # Found in this directory — don't check the fallback
76
+ break
50
77
 
51
78
  if collected:
52
79
  print('\n\n'.join(collected))
@@ -120,6 +120,24 @@ def read_rule_content(rule_name):
120
120
  return text
121
121
 
122
122
 
123
+ def get_project_slug():
124
+ """
125
+ Derive project slug from .codeyam/config.json (matching getProjectSlug() on the TS side).
126
+ Falls back to os.path.basename(project_dir) if config is absent or malformed.
127
+ """
128
+ project_dir = os.environ.get('CLAUDE_PROJECT_DIR', os.getcwd())
129
+ try:
130
+ config_path = os.path.join(project_dir, '.codeyam', 'config.json')
131
+ with open(config_path, 'r') as f:
132
+ config = json.load(f)
133
+ slug = config.get('projectSlug', '')
134
+ if slug:
135
+ return slug
136
+ except (IOError, json.JSONDecodeError, KeyError):
137
+ pass
138
+ return os.path.basename(project_dir)
139
+
140
+
123
141
  def load_memory_settings():
124
142
  """
125
143
  Load memory settings from .codeyam/config.json.
@@ -463,8 +481,9 @@ def handle_stop(hook_input):
463
481
  if not session_id or not transcript_path:
464
482
  return
465
483
 
466
- marker_dir = Path('/tmp/claude-rule-markers')
467
- marker_dir.mkdir(exist_ok=True)
484
+ slug = get_project_slug()
485
+ marker_dir = Path('/tmp/claude-rule-markers') / slug
486
+ marker_dir.mkdir(parents=True, exist_ok=True)
468
487
  marker_file = marker_dir / f'{session_id}.marker'
469
488
 
470
489
  last_line, _ = read_marker(marker_file)
@@ -539,8 +558,9 @@ def handle_user_prompt_submit(hook_input):
539
558
  if not session_id or not transcript_path:
540
559
  return
541
560
 
542
- marker_dir = Path('/tmp/claude-rule-markers')
543
- marker_dir.mkdir(exist_ok=True)
561
+ slug = get_project_slug()
562
+ marker_dir = Path('/tmp/claude-rule-markers') / slug
563
+ marker_dir.mkdir(parents=True, exist_ok=True)
544
564
  marker_file = marker_dir / f'{session_id}.marker'
545
565
 
546
566
  last_line, was_stop = read_marker(marker_file)
@@ -4,13 +4,11 @@ Rules provide context-specific guidance when working in files matching their `pa
4
4
 
5
5
  ## Core Principles
6
6
 
7
- 1. **One concept per rule** - Each rule should cover a single topic. If you're documenting two unrelated things, create two rules.
8
- 2. **Paths must match content scope** - A rule about one specific file should have that file in `paths`, not a broad `**/*.ts` pattern.
9
- 3. **Keep rules SHORT** - Most rules should be **1-4 bullets**. Only complex multi-file architectural overviews should exceed ~10 lines. Every word costs context.
7
+ 1. **One concept per rule** If you're documenting two unrelated things, create two rules.
8
+ 2. **Paths must match content scope** A rule about one file should have that file in `paths`, not a broad `**/*.ts` pattern.
9
+ 3. **Keep rules SHORT** Most rules should be **1-4 bullets**. Only complex multi-file architectures should exceed ~10 lines.
10
10
 
11
- ### Good vs Bad Rule Length
12
-
13
- **Good** — a typical rule (4 bullets):
11
+ **Example** a typical rule:
14
12
 
15
13
  ```markdown
16
14
  ---
@@ -26,68 +24,21 @@ paths:
26
24
  - Test with exact ordering from database, not just same entries
27
25
  ```
28
26
 
29
- **Bad** same info bloated to 40+ lines with unnecessary headers, restating what the code says, and paragraphs instead of bullets.
30
-
31
- ## When to Create a New Rule
32
-
33
- Create a new rule when:
34
-
35
- - You learn something non-obvious about the codebase
36
- - You make a mistake and want to prevent it in the future
37
- - The user explains something that isn't clear from the code
38
- - An existing rule is covering multiple unrelated topics (split it)
39
-
40
- ## Before Creating: What Makes a Rule Valuable?
41
-
42
- A rule earns its place when it meets these criteria:
43
-
44
- 1. **Beyond the code** — It captures knowledge that reading the source alone wouldn't reveal (historical context, non-obvious interactions, gotchas).
45
- 2. **Explains "why" over "what"** — Gotchas, non-obvious behavior, architectural decisions. (Function signatures, bug fixes, and limitations are already visible in code.)
46
- 3. **Prevents real mistakes** — It would have saved someone from a past confusion or bug, not just a "nice to know."
27
+ ## When to Create a Rule
47
28
 
48
- ### Examples
29
+ Create a rule when you learn something that **reading the code alone wouldn't reveal**:
49
30
 
50
- **✅ Worth documenting:**
31
+ - Non-obvious gotchas or behavior that caused real confusion or bugs
32
+ - Architecture, file relationships, or data flows that take time to piece together
33
+ - Debugging strategies for a tricky area of the codebase
34
+ - Preferred commands or workflows when multiple options exist (e.g. "Use `pnpm test` to run tests")
35
+ - User corrections or explanations that aren't captured in the code itself
51
36
 
52
- - Where to add new functionality
53
- - An overview of all files, classes, functions, etc used in a particular part of the repo
54
- - Debugging strategies for a particular area of the repo
55
- - "Use `pnpm test` to run tests" (if there is more than one way to run tests and this way is preferred)
56
-
57
- Skip things like "The auth module handles authentication" or "This function takes X and returns Y" unless creating an overview of a complex area of the app — For individual files Claude can read the code and infer these insights.
58
-
59
- ## Path Specificity
60
-
61
- The `paths` field controls when the rule is shown. Match the scope of your content:
62
-
63
- | Content Scope | Path Pattern | Example |
64
- | ------------- | ----------------------- | ------------------------------------------------------ |
65
- | Single file | `'path/to/file.ts'` | Rule about `processExpression.ts` specifically |
66
- | Related files | `'path/to/feature*.ts'` | Rule about `generateExecutionFlows*.ts` files |
67
- | Directory | `'path/to/dir/**/*.ts'` | Rule about the queue system in `utils/queue/` |
68
- | Cross-cutting | Multiple specific paths | Testing rule with paths to test configs and test files |
69
-
70
- Match path specificity to content scope — use `'path/to/feature.ts'` for a single-feature rule, not `'**/*.ts'`.
71
-
72
- ## File Placement
37
+ **Skip** rules that restate what the code says — function signatures, type definitions, "this module handles X." Claude can read the code.
73
38
 
74
- Place each rule at the **deepest common directory** shared by all its `paths` entries:
39
+ ## Frontmatter & Paths
75
40
 
76
- 1. Take all paths from the rule's frontmatter
77
- 2. Strip filenames — keep only the directory portions
78
- 3. Find the longest shared directory prefix
79
- 4. Place the rule `.md` file in `.claude/rules/<that-prefix>/`
80
-
81
- | Paths in frontmatter | Deepest common dir | Rule location |
82
- | ---------------------------------------------------------- | ---------------------- | ---------------------------------------------- |
83
- | `packages/ai/src/lib/foo.ts`, `packages/ai/src/lib/bar.ts` | `packages/ai/src/lib/` | `.claude/rules/packages/ai/src/lib/foo-bar.md` |
84
- | `packages/ai/src/lib/a.ts`, `packages/ai/src/utils/b.ts` | `packages/ai/src/` | `.claude/rules/packages/ai/src/a-and-b.md` |
85
- | `packages/ai/**`, `packages/types/**` | `packages/` | `.claude/rules/packages/ai-types.md` |
86
- | `src/api/auth.ts` (single file) | `src/api/` | `.claude/rules/src/api/auth.md` |
87
-
88
- Reserve the top level of `.claude/rules/` for rules whose paths genuinely span the entire repo.
89
-
90
- ## Required Frontmatter
41
+ Every rule needs a `paths` frontmatter field. Be specific to avoid loading rules unnecessarily:
91
42
 
92
43
  ```yaml
93
44
  ---
@@ -97,36 +48,31 @@ paths:
97
48
  ---
98
49
  ```
99
50
 
100
- | Field | Purpose |
101
- | ------- | ---------------------------------------------------------------- |
102
- | `paths` | Glob patterns - be specific to avoid loading rules unnecessarily |
103
-
104
- **Note:** Audit dates live in `.claude/codeyam-rule-state.json` (managed by `codeyam memory touch`). Keep rule frontmatter limited to `paths`.
105
-
106
- ## Content Guidelines
107
-
108
- ### Be Actionable
51
+ | Content Scope | Path Pattern | Example |
52
+ | ------------- | ----------------------- | ---------------------------------------------- |
53
+ | Single file | `'path/to/file.ts'` | Rule about `processExpression.ts` specifically |
54
+ | Related files | `'path/to/feature*.ts'` | Rule about `generateExecutionFlows*.ts` files |
55
+ | Directory | `'path/to/dir/**/*.ts'` | Rule about the queue system in `utils/queue/` |
56
+ | Cross-cutting | Multiple specific paths | Testing rule spanning test configs and tests |
109
57
 
110
- - Good: "Run `pnpm test:api` for API tests"
111
- - Bad: "Make sure to run the appropriate tests"
58
+ Audit dates live in `.claude/codeyam-rule-state.json` (managed by `codeyam memory touch`). Keep frontmatter limited to `paths`.
112
59
 
113
- ### Focus on What to Do
114
-
115
- - "Auth tokens are stored in httpOnly cookies via `src/auth/cookies.ts`" tells the reader exactly where to look and what pattern to follow.
116
-
117
- ## Categories
60
+ ## File Placement
118
61
 
119
- **architecture** - Design decisions, file relationships, data flow
62
+ Rules must be written to `.claude/rules/`, NOT `.codeyam/rules/`. The instructions file lives in `.codeyam/` but actual rule files go in `.claude/rules/`.
120
63
 
121
- - "These three files must change together because..."
122
- - "Data flows from X → Y → Z"
64
+ Use `codeyam memory rule-path` to compute the correct directory from your frontmatter paths:
123
65
 
124
- **testing** - Test commands, mock patterns, fixtures
66
+ ```
67
+ $ codeyam memory rule-path packages/ai/src/lib/foo.ts packages/ai/src/utils/bar.ts
68
+ {"result":".claude/rules/packages/ai/src/"}
69
+ ```
125
70
 
126
- - "Run tests with: `pnpm test path/to/test.ts`"
127
- - "Must run `pnpm pretest` first because..."
71
+ The command computes the deepest common directory shared by all paths and returns the `.claude/rules/` subdirectory where the rule file should live. Reserve the top level of `.claude/rules/` for rules whose paths genuinely span the entire repo.
128
72
 
129
- **faq** - Gotchas, workarounds, common questions
73
+ ## Content Guidelines
130
74
 
131
- - "If you see error X, it means Y"
132
- - "This looks wrong but is intentional because..."
75
+ - **Be actionable** — "Run `pnpm test:api` for API tests" not "Make sure to run the appropriate tests"
76
+ - **Focus on why, not what** Gotchas, non-obvious behavior, architectural decisions. The code already shows "what."
77
+ - **Point to specifics** — "Auth tokens are stored in httpOnly cookies via `src/auth/cookies.ts`" beats a vague description.
78
+ - **Be short!** - Context window space is precious! Do not ramble, use bullets, focus on providing clear actionable information.
@@ -0,0 +1,237 @@
1
+ ---
2
+ name: codeyam-dev-mode
3
+ autoApprove: true
4
+ description: |
5
+ Use this skill when working in CodeYam Dev Mode — an interactive environment for iterating on
6
+ components and scenarios with a live preview panel alongside a Claude Code terminal.
7
+ Use when: The embedded terminal in Dev Mode auto-invokes this skill to provide entity/scenario context.
8
+ ---
9
+
10
+ # CodeYam Dev Mode
11
+
12
+ You are working inside CodeYam Dev Mode — a split-screen environment with this Claude Code terminal on the left and a live preview on the right.
13
+
14
+ ## Step 1: Read Session Context
15
+
16
+ Read the dev mode context file to understand the current entity and scenario:
17
+
18
+ ```
19
+ cat .codeyam/dev-mode-context.md
20
+ ```
21
+
22
+ The context file contains all the specific paths you need — source file, mock data, dev server project, and **server log**. All paths are fully resolved; no placeholders to fill in.
23
+
24
+ ## Step 2: Gather Context While Server Sets Up
25
+
26
+ The dev server needs time to set up the sandboxed project (copying files, installing deps, starting Vite). The mock data files in the tmp project **do not exist yet** when you first start. Use this time productively.
27
+
28
+ **Do these in parallel:**
29
+
30
+ 1. **Read the source file** from the real repo (exists immediately).
31
+
32
+ 2. **Query the database** for all scenarios belonging to this entity's analysis. Use the **Analysis ID** from the context file:
33
+
34
+ ```
35
+ sqlite3 .codeyam/db.sqlite3 "SELECT name, description FROM scenarios WHERE analysis_id = '<ANALYSIS_ID>'"
36
+ ```
37
+
38
+ Each scenario's `description` explains what data shape it tests — e.g. "empty list", "many items", "error state". This tells you what data attributes matter most for the component's visual states.
39
+
40
+ 3. **Monitor the server log** listed in the context file under **Server log**:
41
+
42
+ ```
43
+ tail -f <server log path from context file>
44
+ ```
45
+
46
+ Wait until you see a local URL like `http://localhost:...` indicating the Vite server has started. Do NOT try to read mock data or other files from the tmp project until the logs confirm setup is complete.
47
+
48
+ ## Step 3: Read Mock Data and Present Overview
49
+
50
+ Once the dev server is ready, read the **mock data file** from the tmp project path listed in the context file.
51
+
52
+ Then present a **concise** overview to the user:
53
+
54
+ 1. **Component Summary** — 2-3 sentences on what the component does and the current scenario being previewed.
55
+
56
+ 2. **Suggested Tests** — Compare the component's code paths (conditionals, edge cases, visual states) against the existing scenarios from the database. Recommend 2-4 specific ways to test the component that are **not yet covered** by saved scenarios. Focus on interesting visual states — e.g. "What does this look like with a very long title?", "What happens when the list is empty?", "How does the error state render?". Be specific to this component, not generic.
57
+
58
+ Keep it brief — no tables, no exhaustive attribute lists. The user can see the preview and wants actionable suggestions, not a data dump.
59
+
60
+ ## How Dev Mode Works
61
+
62
+ **Layout:**
63
+
64
+ - **Left panel** — This Claude Code terminal (you)
65
+ - **Right panel** — Live preview iframe showing the rendered component/scenario
66
+
67
+ **Architecture:**
68
+
69
+ - The preview runs from a sandboxed project at the tmp path listed in the context file
70
+ - Source code edits in the real repo auto-sync to the preview via HMR (hot module replacement)
71
+ - Mock data files live in the tmp project under `__codeyamMocks__/`
72
+
73
+ **What you can edit:**
74
+
75
+ - **Source code** (the entity's file in the real repo) — edits sync automatically to the preview
76
+ - **Mock data** (the `MockData_*.tsx` file in the tmp project) — edits also sync via HMR
77
+ - Both types of edits show up in the preview almost instantly
78
+
79
+ **CRITICAL — What you must NEVER edit for functional changes:**
80
+
81
+ - **Shimmed component files** (`*_Scenario.tsx` in the tmp project) — these are auto-generated files that wire up the component with mocked dependencies. **NEVER modify these to change what renders.** Any functional changes you make here:
82
+ - Will be lost when the scenario is recaptured or regenerated
83
+ - Cannot be saved as a scenario (only mock data is persisted to the database)
84
+ - Break the ability to reproduce the scenario in the future
85
+ - To change what the component displays, **always edit the `MockData_*.tsx` file**. The shimmed component reads mock data via `scenarios().data()` — that's the mechanism for controlling component behavior and visual state.
86
+ - The ONLY acceptable edit to a shimmed component file is adding temporary `console.log` statements for debugging (see Client-Side Logging below). Never change imports, state initialization, hooks, memos, or rendering logic.
87
+
88
+ ## Workflow
89
+
90
+ 1. Read the context file (`.codeyam/dev-mode-context.md`)
91
+ 2. While dev server sets up, do in parallel:
92
+ - Read the source file (from real repo — available immediately)
93
+ - Query database for scenario names/descriptions (available immediately)
94
+ - Monitor server log until dev server is ready
95
+ 3. Read the mock data file (from tmp project — only after setup completes)
96
+ 4. Present concise overview: component summary + suggested untested scenarios
97
+ 5. Ask the user what they want to change
98
+ 6. Make incremental edits to **source code or mock data only** — the preview updates live
99
+ 7. After making changes, refresh the preview (curl command from context file)
100
+ 8. Iterate based on user feedback
101
+
102
+ ## Client-Side Logging (Required)
103
+
104
+ **Always add `console.log` statements to trace the execution flow when making changes.** This is critical — you cannot see the preview, so logging is your only way to verify the component renders as expected.
105
+
106
+ Client-side `console.log` and `console.error` calls are automatically captured by the `/api/client-log` endpoint and written to the server log file. This means you can add logging in component code and read it from the server log.
107
+
108
+ **When to add logging:**
109
+
110
+ - Before and after every change you make to the shimmed component or mock data
111
+ - At key data flow checkpoints: after state initialization, after useMemo computations, before the render return
112
+ - In useEffect callbacks to confirm they fire
113
+ - Around conditional branches you're targeting (e.g. "this condition should now be true")
114
+
115
+ **How to log:**
116
+
117
+ Add `console.log` with a `[CY-DEBUG]` prefix in the shimmed component file (the `*_Default_Scenario.tsx` file in the tmp project). **This is the ONLY acceptable edit to shimmed component files — temporary debug logging. Never change the component's logic, imports, state, or rendering in these files.**
118
+
119
+ ```typescript
120
+ // After state declarations:
121
+ console.log(
122
+ '[CY-DEBUG] render: myState:',
123
+ myState?.length,
124
+ 'otherData:',
125
+ otherData,
126
+ );
127
+
128
+ // Inside useEffect:
129
+ useEffect(() => {
130
+ console.log('[CY-DEBUG] useEffect fired, setting data');
131
+ // ...
132
+ }, []);
133
+
134
+ // Before return:
135
+ console.log(
136
+ '[CY-DEBUG] PRE-RENDER: showThumbnails:',
137
+ items?.length > 0,
138
+ 'showLoader:',
139
+ !items,
140
+ );
141
+ ```
142
+
143
+ **After refreshing, always check the log** for your `[CY-DEBUG]` lines:
144
+
145
+ ```
146
+ tail -30 <server log path from context file>
147
+ ```
148
+
149
+ If you don't see your debug logs but see `[CLIENT CONSOLE.ERROR]` or `Application Error`, the component is crashing before your code runs. Read the error stack trace to find the failing component.
150
+
151
+ **Keep logging in place** as you iterate — it costs nothing and saves significant debugging time.
152
+
153
+ ## Refreshing the Preview
154
+
155
+ After making changes, refresh the live preview so it picks up your edits. The exact curl command is in the context file under **Server > Refresh preview** — copy and run it:
156
+
157
+ ```
158
+ curl -s -X POST http://localhost:<port>/api/dev-mode-preview
159
+ ```
160
+
161
+ **Always refresh after making changes.** This triggers the preview iframe to reload, **clears the server log file**, waits for the page to re-render, and then fetches the preview URL to check for SSR errors.
162
+
163
+ **The response includes preview health info.** Check the `preview` field in the JSON response:
164
+
165
+ ```json
166
+ {
167
+ "success": true,
168
+ "sessionsNotified": 1,
169
+ "logCleared": true,
170
+ "preview": {
171
+ "status": 200,
172
+ "healthy": true
173
+ }
174
+ }
175
+ ```
176
+
177
+ If the preview is unhealthy (e.g., SSR error caught by an error boundary), the response will include the error:
178
+
179
+ ```json
180
+ {
181
+ "preview": {
182
+ "status": 500,
183
+ "healthy": false,
184
+ "error": "ReferenceError: myVariable is not defined\n at Component (/path/to/file.tsx:42:5)"
185
+ }
186
+ }
187
+ ```
188
+
189
+ **After every refresh:**
190
+
191
+ 1. **Check `preview.healthy`** in the JSON response. If `false`, the `error` field contains the SSR error — fix it before proceeding.
192
+ 2. **Check the log** for your `[CY-DEBUG]` lines to confirm the execution path:
193
+
194
+ ```
195
+ tail -30 <server log path from context file>
196
+ ```
197
+
198
+ If the preview was unhealthy, the log will also contain `[DEV-MODE-CHECK]` lines with the error details.
199
+
200
+ Look for your `[CY-DEBUG]` lines to confirm the execution path. If you see errors instead, the component is crashing. If you see nothing, the page may still be loading — wait a moment and check again.
201
+
202
+ ## Debugging with Server Logs
203
+
204
+ The **Server log** path in the context file captures all output from the dev server process — Vite compilation errors, SSR errors, HMR updates, and runtime warnings. **Client-side errors** (React rendering errors, unhandled exceptions, console.error calls) are also automatically reported to this log via the `/api/client-log` endpoint. This means both server and client errors appear in the same log file.
205
+
206
+ Since the log is **cleared on every refresh**, you always see fresh output. No need to scroll past old errors.
207
+
208
+ **When to check the server log:**
209
+
210
+ - **After every refresh** — always verify your debug logs appear and no errors are present
211
+ - The preview shows a blank page, error boundary, or 500 error
212
+ - HMR updates aren't taking effect after edits
213
+ - The preview is stuck loading or shows unexpected content
214
+
215
+ **How to check:**
216
+
217
+ ```
218
+ tail -50 <server log path from context file>
219
+ ```
220
+
221
+ **What to look for:**
222
+
223
+ - `[CY-DEBUG]` — your trace logs confirming the execution path and data values
224
+ - `[CLIENT CONSOLE.ERROR]` — client-side React errors or unhandled exceptions
225
+ - `[vite]` error messages — TypeScript compilation failures
226
+ - `Application Error` — React error boundary activated (component crashed during render)
227
+ - No output at all — the page hasn't loaded yet, or the component never rendered
228
+
229
+ ## Tips
230
+
231
+ - **NEVER modify shimmed component files** (`*_Scenario.tsx`) to change rendering behavior — only edit `MockData_*.tsx` files to change what the component displays. Shimmed components are auto-generated; functional changes to them won't persist and can't be saved as scenarios.
232
+ - **Refresh the preview frequently** — the user is watching the preview panel as you work. Make small changes, then refresh so they see visual progress. Don't batch multiple edits into one big refresh at the end. Aim for a refresh after every meaningful edit (new data values, layout changes, style tweaks).
233
+ - **Always add `[CY-DEBUG]` logging before refreshing** — never refresh without a way to verify the result
234
+ - Mock data files are TypeScript (`.tsx`) — they export scenario-specific props/data
235
+ - The database at `.codeyam/db.sqlite3` has entity and scenario metadata if you need deeper investigation
236
+ - If the preview breaks, check the server log (path in context file) for compilation or runtime errors
237
+ - You can also modify other files in the repo that the entity imports — those changes sync too