jfl 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (381) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +313 -0
  3. package/clawdbot-skill/README.md +328 -0
  4. package/clawdbot-skill/SKILL.md +362 -0
  5. package/clawdbot-skill/index.ts +486 -0
  6. package/clawdbot-skill/package.json +28 -0
  7. package/clawdbot-skill/skill.json +28 -0
  8. package/dist/commands/agents.d.ts +5 -0
  9. package/dist/commands/agents.d.ts.map +1 -0
  10. package/dist/commands/agents.js +399 -0
  11. package/dist/commands/agents.js.map +1 -0
  12. package/dist/commands/context-hub.d.ts +12 -0
  13. package/dist/commands/context-hub.d.ts.map +1 -0
  14. package/dist/commands/context-hub.js +642 -0
  15. package/dist/commands/context-hub.js.map +1 -0
  16. package/dist/commands/deploy.d.ts +5 -0
  17. package/dist/commands/deploy.d.ts.map +1 -0
  18. package/dist/commands/deploy.js +370 -0
  19. package/dist/commands/deploy.js.map +1 -0
  20. package/dist/commands/feedback.d.ts +2 -0
  21. package/dist/commands/feedback.d.ts.map +1 -0
  22. package/dist/commands/feedback.js +178 -0
  23. package/dist/commands/feedback.js.map +1 -0
  24. package/dist/commands/hud.d.ts +4 -0
  25. package/dist/commands/hud.d.ts.map +1 -0
  26. package/dist/commands/hud.js +262 -0
  27. package/dist/commands/hud.js.map +1 -0
  28. package/dist/commands/init.d.ts +4 -0
  29. package/dist/commands/init.d.ts.map +1 -0
  30. package/dist/commands/init.js +553 -0
  31. package/dist/commands/init.js.map +1 -0
  32. package/dist/commands/login.d.ts +23 -0
  33. package/dist/commands/login.d.ts.map +1 -0
  34. package/dist/commands/login.js +818 -0
  35. package/dist/commands/login.js.map +1 -0
  36. package/dist/commands/ralph.d.ts +9 -0
  37. package/dist/commands/ralph.d.ts.map +1 -0
  38. package/dist/commands/ralph.js +67 -0
  39. package/dist/commands/ralph.js.map +1 -0
  40. package/dist/commands/repair.d.ts +7 -0
  41. package/dist/commands/repair.d.ts.map +1 -0
  42. package/dist/commands/repair.js +283 -0
  43. package/dist/commands/repair.js.map +1 -0
  44. package/dist/commands/session-mgmt.d.ts +33 -0
  45. package/dist/commands/session-mgmt.d.ts.map +1 -0
  46. package/dist/commands/session-mgmt.js +404 -0
  47. package/dist/commands/session-mgmt.js.map +1 -0
  48. package/dist/commands/session.d.ts +2 -0
  49. package/dist/commands/session.d.ts.map +1 -0
  50. package/dist/commands/session.js +639 -0
  51. package/dist/commands/session.js.map +1 -0
  52. package/dist/commands/skills.d.ts +31 -0
  53. package/dist/commands/skills.d.ts.map +1 -0
  54. package/dist/commands/skills.js +314 -0
  55. package/dist/commands/skills.js.map +1 -0
  56. package/dist/commands/status.d.ts +2 -0
  57. package/dist/commands/status.d.ts.map +1 -0
  58. package/dist/commands/status.js +127 -0
  59. package/dist/commands/status.js.map +1 -0
  60. package/dist/commands/synopsis.d.ts +10 -0
  61. package/dist/commands/synopsis.d.ts.map +1 -0
  62. package/dist/commands/synopsis.js +277 -0
  63. package/dist/commands/synopsis.js.map +1 -0
  64. package/dist/commands/update.d.ts +10 -0
  65. package/dist/commands/update.d.ts.map +1 -0
  66. package/dist/commands/update.js +165 -0
  67. package/dist/commands/update.js.map +1 -0
  68. package/dist/commands/voice.d.ts +410 -0
  69. package/dist/commands/voice.d.ts.map +1 -0
  70. package/dist/commands/voice.js +4763 -0
  71. package/dist/commands/voice.js.map +1 -0
  72. package/dist/index.d.ts +9 -0
  73. package/dist/index.d.ts.map +1 -0
  74. package/dist/index.js +512 -0
  75. package/dist/index.js.map +1 -0
  76. package/dist/mcp/context-hub-mcp.d.ts +11 -0
  77. package/dist/mcp/context-hub-mcp.d.ts.map +1 -0
  78. package/dist/mcp/context-hub-mcp.js +548 -0
  79. package/dist/mcp/context-hub-mcp.js.map +1 -0
  80. package/dist/telegram/voice.d.ts +146 -0
  81. package/dist/telegram/voice.d.ts.map +1 -0
  82. package/dist/telegram/voice.js +351 -0
  83. package/dist/telegram/voice.js.map +1 -0
  84. package/dist/types/skills.d.ts +44 -0
  85. package/dist/types/skills.d.ts.map +1 -0
  86. package/dist/types/skills.js +5 -0
  87. package/dist/types/skills.js.map +1 -0
  88. package/dist/ui/banner.d.ts +18 -0
  89. package/dist/ui/banner.d.ts.map +1 -0
  90. package/dist/ui/banner.js +323 -0
  91. package/dist/ui/banner.js.map +1 -0
  92. package/dist/ui/index.d.ts +8 -0
  93. package/dist/ui/index.d.ts.map +1 -0
  94. package/dist/ui/index.js +8 -0
  95. package/dist/ui/index.js.map +1 -0
  96. package/dist/ui/prompts.d.ts +52 -0
  97. package/dist/ui/prompts.d.ts.map +1 -0
  98. package/dist/ui/prompts.js +72 -0
  99. package/dist/ui/prompts.js.map +1 -0
  100. package/dist/ui/theme.d.ts +82 -0
  101. package/dist/ui/theme.d.ts.map +1 -0
  102. package/dist/ui/theme.js +142 -0
  103. package/dist/ui/theme.js.map +1 -0
  104. package/dist/utils/auth-guard.d.ts +66 -0
  105. package/dist/utils/auth-guard.d.ts.map +1 -0
  106. package/dist/utils/auth-guard.js +348 -0
  107. package/dist/utils/auth-guard.js.map +1 -0
  108. package/dist/utils/ensure-project.d.ts +11 -0
  109. package/dist/utils/ensure-project.d.ts.map +1 -0
  110. package/dist/utils/ensure-project.js +70 -0
  111. package/dist/utils/ensure-project.js.map +1 -0
  112. package/dist/utils/git.d.ts +73 -0
  113. package/dist/utils/git.d.ts.map +1 -0
  114. package/dist/utils/git.js +219 -0
  115. package/dist/utils/git.js.map +1 -0
  116. package/dist/utils/github-auth.d.ts +54 -0
  117. package/dist/utils/github-auth.d.ts.map +1 -0
  118. package/dist/utils/github-auth.js +375 -0
  119. package/dist/utils/github-auth.js.map +1 -0
  120. package/dist/utils/github-repo.d.ts +30 -0
  121. package/dist/utils/github-repo.d.ts.map +1 -0
  122. package/dist/utils/github-repo.js +219 -0
  123. package/dist/utils/github-repo.js.map +1 -0
  124. package/dist/utils/platform-auth.d.ts +81 -0
  125. package/dist/utils/platform-auth.d.ts.map +1 -0
  126. package/dist/utils/platform-auth.js +191 -0
  127. package/dist/utils/platform-auth.js.map +1 -0
  128. package/dist/utils/project-config.d.ts +43 -0
  129. package/dist/utils/project-config.d.ts.map +1 -0
  130. package/dist/utils/project-config.js +97 -0
  131. package/dist/utils/project-config.js.map +1 -0
  132. package/dist/utils/skill-registry.d.ts +49 -0
  133. package/dist/utils/skill-registry.d.ts.map +1 -0
  134. package/dist/utils/skill-registry.js +192 -0
  135. package/dist/utils/skill-registry.js.map +1 -0
  136. package/dist/utils/wallet.d.ts +62 -0
  137. package/dist/utils/wallet.d.ts.map +1 -0
  138. package/dist/utils/wallet.js +252 -0
  139. package/dist/utils/wallet.js.map +1 -0
  140. package/dist/utils/x402-client.d.ts +86 -0
  141. package/dist/utils/x402-client.d.ts.map +1 -0
  142. package/dist/utils/x402-client.js +265 -0
  143. package/dist/utils/x402-client.js.map +1 -0
  144. package/package.json +76 -0
  145. package/scripts/postinstall.js +116 -0
  146. package/scripts/test-onboarding.sh +121 -0
  147. package/scripts/voice-start.sh +128 -0
  148. package/scripts/voice-stop.sh +33 -0
  149. package/template/.claude/settings.json +92 -0
  150. package/template/.claude/skills/agent-browser/SKILL.md +116 -0
  151. package/template/.claude/skills/brand-architect/SKILL.md +240 -0
  152. package/template/.claude/skills/brand-architect/config.yaml +137 -0
  153. package/template/.claude/skills/campaign-hud/config.yaml +112 -0
  154. package/template/.claude/skills/content-creator/SKILL.md +294 -0
  155. package/template/.claude/skills/debug/MULTI_AGENT.md +360 -0
  156. package/template/.claude/skills/debug/SKILL.md +549 -0
  157. package/template/.claude/skills/fly-deploy/SKILL.md +676 -0
  158. package/template/.claude/skills/founder-video/SKILL.md +467 -0
  159. package/template/.claude/skills/hud/SKILL.md +157 -0
  160. package/template/.claude/skills/ralph-tui/SKILL.md +210 -0
  161. package/template/.claude/skills/react-best-practices/AGENTS.md +2249 -0
  162. package/template/.claude/skills/react-best-practices/README.md +123 -0
  163. package/template/.claude/skills/react-best-practices/SKILL.md +125 -0
  164. package/template/.claude/skills/react-best-practices/metadata.json +15 -0
  165. package/template/.claude/skills/react-best-practices/rules/_sections.md +46 -0
  166. package/template/.claude/skills/react-best-practices/rules/_template.md +28 -0
  167. package/template/.claude/skills/react-best-practices/rules/advanced-event-handler-refs.md +55 -0
  168. package/template/.claude/skills/react-best-practices/rules/advanced-use-latest.md +49 -0
  169. package/template/.claude/skills/react-best-practices/rules/async-api-routes.md +38 -0
  170. package/template/.claude/skills/react-best-practices/rules/async-defer-await.md +80 -0
  171. package/template/.claude/skills/react-best-practices/rules/async-dependencies.md +36 -0
  172. package/template/.claude/skills/react-best-practices/rules/async-parallel.md +28 -0
  173. package/template/.claude/skills/react-best-practices/rules/async-suspense-boundaries.md +99 -0
  174. package/template/.claude/skills/react-best-practices/rules/bundle-barrel-imports.md +59 -0
  175. package/template/.claude/skills/react-best-practices/rules/bundle-conditional.md +31 -0
  176. package/template/.claude/skills/react-best-practices/rules/bundle-defer-third-party.md +49 -0
  177. package/template/.claude/skills/react-best-practices/rules/bundle-dynamic-imports.md +35 -0
  178. package/template/.claude/skills/react-best-practices/rules/bundle-preload.md +50 -0
  179. package/template/.claude/skills/react-best-practices/rules/client-event-listeners.md +74 -0
  180. package/template/.claude/skills/react-best-practices/rules/client-swr-dedup.md +56 -0
  181. package/template/.claude/skills/react-best-practices/rules/js-batch-dom-css.md +82 -0
  182. package/template/.claude/skills/react-best-practices/rules/js-cache-function-results.md +80 -0
  183. package/template/.claude/skills/react-best-practices/rules/js-cache-property-access.md +28 -0
  184. package/template/.claude/skills/react-best-practices/rules/js-cache-storage.md +70 -0
  185. package/template/.claude/skills/react-best-practices/rules/js-combine-iterations.md +32 -0
  186. package/template/.claude/skills/react-best-practices/rules/js-early-exit.md +50 -0
  187. package/template/.claude/skills/react-best-practices/rules/js-hoist-regexp.md +45 -0
  188. package/template/.claude/skills/react-best-practices/rules/js-index-maps.md +37 -0
  189. package/template/.claude/skills/react-best-practices/rules/js-length-check-first.md +49 -0
  190. package/template/.claude/skills/react-best-practices/rules/js-min-max-loop.md +82 -0
  191. package/template/.claude/skills/react-best-practices/rules/js-set-map-lookups.md +24 -0
  192. package/template/.claude/skills/react-best-practices/rules/js-tosorted-immutable.md +57 -0
  193. package/template/.claude/skills/react-best-practices/rules/rendering-activity.md +26 -0
  194. package/template/.claude/skills/react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
  195. package/template/.claude/skills/react-best-practices/rules/rendering-conditional-render.md +40 -0
  196. package/template/.claude/skills/react-best-practices/rules/rendering-content-visibility.md +38 -0
  197. package/template/.claude/skills/react-best-practices/rules/rendering-hoist-jsx.md +46 -0
  198. package/template/.claude/skills/react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
  199. package/template/.claude/skills/react-best-practices/rules/rendering-svg-precision.md +28 -0
  200. package/template/.claude/skills/react-best-practices/rules/rerender-defer-reads.md +39 -0
  201. package/template/.claude/skills/react-best-practices/rules/rerender-dependencies.md +45 -0
  202. package/template/.claude/skills/react-best-practices/rules/rerender-derived-state.md +29 -0
  203. package/template/.claude/skills/react-best-practices/rules/rerender-functional-setstate.md +74 -0
  204. package/template/.claude/skills/react-best-practices/rules/rerender-lazy-state-init.md +58 -0
  205. package/template/.claude/skills/react-best-practices/rules/rerender-memo.md +44 -0
  206. package/template/.claude/skills/react-best-practices/rules/rerender-transitions.md +40 -0
  207. package/template/.claude/skills/react-best-practices/rules/server-after-nonblocking.md +73 -0
  208. package/template/.claude/skills/react-best-practices/rules/server-cache-lru.md +41 -0
  209. package/template/.claude/skills/react-best-practices/rules/server-cache-react.md +26 -0
  210. package/template/.claude/skills/react-best-practices/rules/server-parallel-fetching.md +79 -0
  211. package/template/.claude/skills/react-best-practices/rules/server-serialization.md +38 -0
  212. package/template/.claude/skills/remotion-best-practices/SKILL.md +43 -0
  213. package/template/.claude/skills/remotion-best-practices/rules/3d.md +86 -0
  214. package/template/.claude/skills/remotion-best-practices/rules/animations.md +29 -0
  215. package/template/.claude/skills/remotion-best-practices/rules/assets/charts-bar-chart.tsx +173 -0
  216. package/template/.claude/skills/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +100 -0
  217. package/template/.claude/skills/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +108 -0
  218. package/template/.claude/skills/remotion-best-practices/rules/assets.md +78 -0
  219. package/template/.claude/skills/remotion-best-practices/rules/audio.md +172 -0
  220. package/template/.claude/skills/remotion-best-practices/rules/calculate-metadata.md +104 -0
  221. package/template/.claude/skills/remotion-best-practices/rules/can-decode.md +75 -0
  222. package/template/.claude/skills/remotion-best-practices/rules/charts.md +58 -0
  223. package/template/.claude/skills/remotion-best-practices/rules/compositions.md +146 -0
  224. package/template/.claude/skills/remotion-best-practices/rules/display-captions.md +126 -0
  225. package/template/.claude/skills/remotion-best-practices/rules/extract-frames.md +229 -0
  226. package/template/.claude/skills/remotion-best-practices/rules/fonts.md +152 -0
  227. package/template/.claude/skills/remotion-best-practices/rules/get-audio-duration.md +58 -0
  228. package/template/.claude/skills/remotion-best-practices/rules/get-video-dimensions.md +68 -0
  229. package/template/.claude/skills/remotion-best-practices/rules/get-video-duration.md +58 -0
  230. package/template/.claude/skills/remotion-best-practices/rules/gifs.md +138 -0
  231. package/template/.claude/skills/remotion-best-practices/rules/images.md +130 -0
  232. package/template/.claude/skills/remotion-best-practices/rules/import-srt-captions.md +67 -0
  233. package/template/.claude/skills/remotion-best-practices/rules/lottie.md +68 -0
  234. package/template/.claude/skills/remotion-best-practices/rules/measuring-dom-nodes.md +35 -0
  235. package/template/.claude/skills/remotion-best-practices/rules/measuring-text.md +143 -0
  236. package/template/.claude/skills/remotion-best-practices/rules/sequencing.md +106 -0
  237. package/template/.claude/skills/remotion-best-practices/rules/tailwind.md +11 -0
  238. package/template/.claude/skills/remotion-best-practices/rules/text-animations.md +20 -0
  239. package/template/.claude/skills/remotion-best-practices/rules/timing.md +179 -0
  240. package/template/.claude/skills/remotion-best-practices/rules/transcribe-captions.md +19 -0
  241. package/template/.claude/skills/remotion-best-practices/rules/transitions.md +122 -0
  242. package/template/.claude/skills/remotion-best-practices/rules/trimming.md +53 -0
  243. package/template/.claude/skills/remotion-best-practices/rules/videos.md +171 -0
  244. package/template/.claude/skills/search/SKILL.md +220 -0
  245. package/template/.claude/skills/spec/SKILL.md +377 -0
  246. package/template/.claude/skills/startup/SKILL.md +310 -0
  247. package/template/.claude/skills/web-architect/SKILL.md +309 -0
  248. package/template/.claude/skills/x-algorithm/SKILL.md +305 -0
  249. package/template/.jfl/config.json +8 -0
  250. package/template/.mcp.json +11 -0
  251. package/template/CLAUDE.md +960 -0
  252. package/template/content/.gitkeep +0 -0
  253. package/template/context-hub +3 -0
  254. package/template/knowledge/BRAND_BRIEF.md +124 -0
  255. package/template/knowledge/BRAND_DECISIONS.md +168 -0
  256. package/template/knowledge/NARRATIVE.md +114 -0
  257. package/template/knowledge/ROADMAP.md +128 -0
  258. package/template/knowledge/THESIS.md +108 -0
  259. package/template/knowledge/VISION.md +74 -0
  260. package/template/knowledge/VOICE_AND_TONE.md +146 -0
  261. package/template/previews/.gitkeep +0 -0
  262. package/template/scripts/session/auto-commit.sh +245 -0
  263. package/template/scripts/session/auto-merge.sh +325 -0
  264. package/template/scripts/session/jfl-doctor.sh +587 -0
  265. package/template/scripts/session/session-end.sh +194 -0
  266. package/template/scripts/session/session-init.sh +163 -0
  267. package/template/scripts/session/session-sync.sh +167 -0
  268. package/template/scripts/session/test-context-preservation.sh +160 -0
  269. package/template/skills/agent-browser/SKILL.md +116 -0
  270. package/template/skills/brand-architect/SKILL.md +240 -0
  271. package/template/skills/brand-architect/config.yaml +137 -0
  272. package/template/skills/campaign-hud/config.yaml +112 -0
  273. package/template/skills/content-creator/SKILL.md +294 -0
  274. package/template/skills/debug/MULTI_AGENT.md +360 -0
  275. package/template/skills/debug/SKILL.md +549 -0
  276. package/template/skills/fly-deploy/SKILL.md +676 -0
  277. package/template/skills/founder-video/SKILL.md +467 -0
  278. package/template/skills/hud/SKILL.md +204 -0
  279. package/template/skills/ralph-tui/SKILL.md +210 -0
  280. package/template/skills/react-best-practices/AGENTS.md +2249 -0
  281. package/template/skills/react-best-practices/README.md +123 -0
  282. package/template/skills/react-best-practices/SKILL.md +125 -0
  283. package/template/skills/react-best-practices/metadata.json +15 -0
  284. package/template/skills/react-best-practices/rules/_sections.md +46 -0
  285. package/template/skills/react-best-practices/rules/_template.md +28 -0
  286. package/template/skills/react-best-practices/rules/advanced-event-handler-refs.md +55 -0
  287. package/template/skills/react-best-practices/rules/advanced-use-latest.md +49 -0
  288. package/template/skills/react-best-practices/rules/async-api-routes.md +38 -0
  289. package/template/skills/react-best-practices/rules/async-defer-await.md +80 -0
  290. package/template/skills/react-best-practices/rules/async-dependencies.md +36 -0
  291. package/template/skills/react-best-practices/rules/async-parallel.md +28 -0
  292. package/template/skills/react-best-practices/rules/async-suspense-boundaries.md +99 -0
  293. package/template/skills/react-best-practices/rules/bundle-barrel-imports.md +59 -0
  294. package/template/skills/react-best-practices/rules/bundle-conditional.md +31 -0
  295. package/template/skills/react-best-practices/rules/bundle-defer-third-party.md +49 -0
  296. package/template/skills/react-best-practices/rules/bundle-dynamic-imports.md +35 -0
  297. package/template/skills/react-best-practices/rules/bundle-preload.md +50 -0
  298. package/template/skills/react-best-practices/rules/client-event-listeners.md +74 -0
  299. package/template/skills/react-best-practices/rules/client-swr-dedup.md +56 -0
  300. package/template/skills/react-best-practices/rules/js-batch-dom-css.md +82 -0
  301. package/template/skills/react-best-practices/rules/js-cache-function-results.md +80 -0
  302. package/template/skills/react-best-practices/rules/js-cache-property-access.md +28 -0
  303. package/template/skills/react-best-practices/rules/js-cache-storage.md +70 -0
  304. package/template/skills/react-best-practices/rules/js-combine-iterations.md +32 -0
  305. package/template/skills/react-best-practices/rules/js-early-exit.md +50 -0
  306. package/template/skills/react-best-practices/rules/js-hoist-regexp.md +45 -0
  307. package/template/skills/react-best-practices/rules/js-index-maps.md +37 -0
  308. package/template/skills/react-best-practices/rules/js-length-check-first.md +49 -0
  309. package/template/skills/react-best-practices/rules/js-min-max-loop.md +82 -0
  310. package/template/skills/react-best-practices/rules/js-set-map-lookups.md +24 -0
  311. package/template/skills/react-best-practices/rules/js-tosorted-immutable.md +57 -0
  312. package/template/skills/react-best-practices/rules/rendering-activity.md +26 -0
  313. package/template/skills/react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
  314. package/template/skills/react-best-practices/rules/rendering-conditional-render.md +40 -0
  315. package/template/skills/react-best-practices/rules/rendering-content-visibility.md +38 -0
  316. package/template/skills/react-best-practices/rules/rendering-hoist-jsx.md +46 -0
  317. package/template/skills/react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
  318. package/template/skills/react-best-practices/rules/rendering-svg-precision.md +28 -0
  319. package/template/skills/react-best-practices/rules/rerender-defer-reads.md +39 -0
  320. package/template/skills/react-best-practices/rules/rerender-dependencies.md +45 -0
  321. package/template/skills/react-best-practices/rules/rerender-derived-state.md +29 -0
  322. package/template/skills/react-best-practices/rules/rerender-functional-setstate.md +74 -0
  323. package/template/skills/react-best-practices/rules/rerender-lazy-state-init.md +58 -0
  324. package/template/skills/react-best-practices/rules/rerender-memo.md +44 -0
  325. package/template/skills/react-best-practices/rules/rerender-transitions.md +40 -0
  326. package/template/skills/react-best-practices/rules/server-after-nonblocking.md +73 -0
  327. package/template/skills/react-best-practices/rules/server-cache-lru.md +41 -0
  328. package/template/skills/react-best-practices/rules/server-cache-react.md +26 -0
  329. package/template/skills/react-best-practices/rules/server-parallel-fetching.md +79 -0
  330. package/template/skills/react-best-practices/rules/server-serialization.md +38 -0
  331. package/template/skills/remotion-best-practices/SKILL.md +43 -0
  332. package/template/skills/remotion-best-practices/rules/3d.md +86 -0
  333. package/template/skills/remotion-best-practices/rules/animations.md +29 -0
  334. package/template/skills/remotion-best-practices/rules/assets/charts-bar-chart.tsx +173 -0
  335. package/template/skills/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +100 -0
  336. package/template/skills/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +108 -0
  337. package/template/skills/remotion-best-practices/rules/assets.md +78 -0
  338. package/template/skills/remotion-best-practices/rules/audio.md +172 -0
  339. package/template/skills/remotion-best-practices/rules/calculate-metadata.md +104 -0
  340. package/template/skills/remotion-best-practices/rules/can-decode.md +75 -0
  341. package/template/skills/remotion-best-practices/rules/charts.md +58 -0
  342. package/template/skills/remotion-best-practices/rules/compositions.md +146 -0
  343. package/template/skills/remotion-best-practices/rules/display-captions.md +126 -0
  344. package/template/skills/remotion-best-practices/rules/extract-frames.md +229 -0
  345. package/template/skills/remotion-best-practices/rules/fonts.md +152 -0
  346. package/template/skills/remotion-best-practices/rules/get-audio-duration.md +58 -0
  347. package/template/skills/remotion-best-practices/rules/get-video-dimensions.md +68 -0
  348. package/template/skills/remotion-best-practices/rules/get-video-duration.md +58 -0
  349. package/template/skills/remotion-best-practices/rules/gifs.md +138 -0
  350. package/template/skills/remotion-best-practices/rules/images.md +130 -0
  351. package/template/skills/remotion-best-practices/rules/import-srt-captions.md +67 -0
  352. package/template/skills/remotion-best-practices/rules/lottie.md +68 -0
  353. package/template/skills/remotion-best-practices/rules/measuring-dom-nodes.md +35 -0
  354. package/template/skills/remotion-best-practices/rules/measuring-text.md +143 -0
  355. package/template/skills/remotion-best-practices/rules/sequencing.md +106 -0
  356. package/template/skills/remotion-best-practices/rules/tailwind.md +11 -0
  357. package/template/skills/remotion-best-practices/rules/text-animations.md +20 -0
  358. package/template/skills/remotion-best-practices/rules/timing.md +179 -0
  359. package/template/skills/remotion-best-practices/rules/transcribe-captions.md +19 -0
  360. package/template/skills/remotion-best-practices/rules/transitions.md +122 -0
  361. package/template/skills/remotion-best-practices/rules/trimming.md +53 -0
  362. package/template/skills/remotion-best-practices/rules/videos.md +171 -0
  363. package/template/skills/search/SKILL.md +220 -0
  364. package/template/skills/spec/SKILL.md +377 -0
  365. package/template/skills/startup/SKILL.md +310 -0
  366. package/template/skills/web-architect/SKILL.md +309 -0
  367. package/template/skills/x-algorithm/SKILL.md +305 -0
  368. package/template/suggestions/.gitkeep +0 -0
  369. package/template/templates/QUICKSTART_SKILL_TO_PRODUCT.md +242 -0
  370. package/template/templates/brand/BRAND_BRIEF.md +124 -0
  371. package/template/templates/brand/BRAND_DECISIONS.md +168 -0
  372. package/template/templates/brand/BRAND_GUIDELINES.md +251 -0
  373. package/template/templates/brand/VOICE_AND_TONE.md +146 -0
  374. package/template/templates/brand/global.css +240 -0
  375. package/template/templates/collaboration/CONTRIBUTOR.md +74 -0
  376. package/template/templates/collaboration/CRM.md +97 -0
  377. package/template/templates/collaboration/TASKS.md +83 -0
  378. package/template/templates/strategic/NARRATIVE.md +114 -0
  379. package/template/templates/strategic/ROADMAP.md +128 -0
  380. package/template/templates/strategic/THESIS.md +108 -0
  381. package/template/templates/strategic/VISION.md +74 -0
@@ -0,0 +1,194 @@
1
+ #!/bin/bash
2
+ # session-end.sh - Gracefully end a JFL session
3
+ # Handles both worktree sessions (merge + cleanup) and main branch sessions
4
+ #
5
+ # Usage:
6
+ # ./scripts/session/session-end.sh # Standard end
7
+ # ./scripts/session/session-end.sh --force # Force end (even with uncommitted changes)
8
+
9
+ set -e
10
+
11
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
12
+ PROJECT_ROOT="$(pwd)"
13
+ LOG_DIR="$PROJECT_ROOT/.jfl/logs"
14
+ SESSION_FILE="$PROJECT_ROOT/.jfl/current-session.json"
15
+
16
+ # Colors
17
+ RED='\033[0;31m'
18
+ GREEN='\033[0;32m'
19
+ YELLOW='\033[1;33m'
20
+ BLUE='\033[0;34m'
21
+ NC='\033[0m'
22
+
23
+ FORCE=false
24
+ while [[ $# -gt 0 ]]; do
25
+ case $1 in
26
+ --force|-f)
27
+ FORCE=true
28
+ shift
29
+ ;;
30
+ *)
31
+ shift
32
+ ;;
33
+ esac
34
+ done
35
+
36
+ echo ""
37
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
38
+ echo " JFL Session End"
39
+ echo " $(date '+%Y-%m-%d %H:%M:%S')"
40
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
41
+ echo ""
42
+
43
+ cd "$PROJECT_ROOT"
44
+
45
+ # Check if this is a worktree session
46
+ IS_WORKTREE=false
47
+ SESSION_NAME=""
48
+ WORKTREE_PATH=""
49
+
50
+ if [ -f "$SESSION_FILE" ]; then
51
+ # Parse session info
52
+ if grep -q '"worktree": true' "$SESSION_FILE" 2>/dev/null; then
53
+ IS_WORKTREE=true
54
+ SESSION_NAME=$(grep -o '"session_name"[^,}]*' "$SESSION_FILE" | cut -d'"' -f4)
55
+ WORKTREE_PATH=$(grep -o '"worktree_path"[^,}]*' "$SESSION_FILE" | cut -d'"' -f4)
56
+ fi
57
+ fi
58
+
59
+ if $IS_WORKTREE && [ -n "$SESSION_NAME" ] && [ "$SESSION_NAME" != "main" ] && [ "$SESSION_NAME" != "null" ]; then
60
+ echo -e "${BLUE}→${NC} Ending worktree session: $SESSION_NAME"
61
+ echo ""
62
+
63
+ # Use worktree-session.sh to properly end (merge + cleanup)
64
+ if [ -f "$SCRIPT_DIR/worktree-session.sh" ]; then
65
+ "$SCRIPT_DIR/worktree-session.sh" end "$SESSION_NAME"
66
+ else
67
+ echo -e "${RED}✗${NC} worktree-session.sh not found!"
68
+ echo " Manual cleanup needed:"
69
+ echo " 1. cd $WORKTREE_PATH && git add -A && git commit"
70
+ echo " 2. Merge branch $SESSION_NAME to main"
71
+ echo " 3. Remove worktree: git worktree remove $WORKTREE_PATH"
72
+ exit 1
73
+ fi
74
+
75
+ # Clean up session file
76
+ rm -f "$SESSION_FILE"
77
+
78
+ else
79
+ # Main branch session - just commit and push
80
+ echo -e "${BLUE}→${NC} Ending main branch session..."
81
+
82
+ # Step 1: Stop auto-commit
83
+ echo -e "${BLUE}→${NC} Stopping auto-commit..."
84
+ "$SCRIPT_DIR/auto-commit.sh" stop 2>/dev/null || true
85
+
86
+ # Step 2: Take final snapshot (fast - skip large files)
87
+ echo -e "${BLUE}→${NC} Taking final snapshot..."
88
+ mkdir -p "$LOG_DIR"
89
+ SNAPSHOT_END="$LOG_DIR/snapshot-end-$(date +%Y%m%d-%H%M%S).txt"
90
+ CRITICAL_PATHS=("knowledge/" "previews/" "content/" "suggestions/" "CLAUDE.md")
91
+
92
+ # Skip .jfl/ for snapshots (contains large memory.db)
93
+ # Use stat instead of md5 for speed (size + mtime is enough for change detection)
94
+ for p in "${CRITICAL_PATHS[@]}"; do
95
+ if [ -e "$PROJECT_ROOT/$p" ]; then
96
+ find "$PROJECT_ROOT/$p" -type f -exec stat -f "%z %m %N" {} \; 2>/dev/null
97
+ fi
98
+ done | sort > "$SNAPSHOT_END"
99
+
100
+ # Step 3: Check for uncommitted changes
101
+ echo -e "${BLUE}→${NC} Checking for uncommitted changes..."
102
+ CHANGES=$(git status --porcelain 2>/dev/null | wc -l | tr -d ' ')
103
+
104
+ if [ "$CHANGES" -gt 0 ]; then
105
+ echo -e "${YELLOW}⚠${NC} Found $CHANGES uncommitted changes"
106
+ git status --short
107
+
108
+ echo ""
109
+ echo -e "${BLUE}→${NC} Committing all changes..."
110
+ git add -A
111
+
112
+ COMMIT_MSG="session: end $(date '+%Y-%m-%d %H:%M')"
113
+
114
+ if git commit -m "$COMMIT_MSG"; then
115
+ echo -e "${GREEN}✓${NC} Changes committed"
116
+ else
117
+ echo -e "${YELLOW}⚠${NC} Nothing to commit"
118
+ fi
119
+ else
120
+ echo -e "${GREEN}✓${NC} No uncommitted changes"
121
+ fi
122
+
123
+ # Step 4: Push to remote
124
+ echo -e "${BLUE}→${NC} Pushing to remote..."
125
+ CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
126
+ if git push origin "$CURRENT_BRANCH" 2>/dev/null; then
127
+ echo -e "${GREEN}✓${NC} Pushed to origin/$CURRENT_BRANCH"
128
+ else
129
+ echo -e "${YELLOW}⚠${NC} Push failed (will retry on next session)"
130
+ fi
131
+
132
+ # Step 5: Sync product repo if symlink/submodule
133
+ PRODUCT_PATH="$PROJECT_ROOT/product"
134
+ if [ -L "$PRODUCT_PATH" ] || [ -d "$PRODUCT_PATH/.git" ]; then
135
+ echo ""
136
+ echo -e "${BLUE}→${NC} Syncing product repo..."
137
+
138
+ if [ -L "$PRODUCT_PATH" ]; then
139
+ TARGET=$(readlink "$PRODUCT_PATH")
140
+ if [[ "$TARGET" == ../* ]]; then
141
+ TARGET="$PROJECT_ROOT/$TARGET"
142
+ fi
143
+ TARGET=$(cd "$TARGET" 2>/dev/null && pwd)
144
+ else
145
+ TARGET="$PRODUCT_PATH"
146
+ fi
147
+
148
+ if [ -d "$TARGET/.git" ]; then
149
+ cd "$TARGET"
150
+ PRODUCT_CHANGES=$(git status --porcelain 2>/dev/null | wc -l | tr -d ' ')
151
+ if [ "$PRODUCT_CHANGES" -gt 0 ]; then
152
+ git add -A
153
+ git commit -m "session: end $(date '+%Y-%m-%d %H:%M')" || true
154
+ git push 2>/dev/null || echo -e "${YELLOW}⚠${NC} Product push failed"
155
+ echo -e "${GREEN}✓${NC} Product repo synced"
156
+ else
157
+ echo -e "${GREEN}✓${NC} Product repo clean"
158
+ fi
159
+ cd "$PROJECT_ROOT"
160
+ fi
161
+ fi
162
+
163
+ # Step 6: Compare snapshots
164
+ if [ -f "$SESSION_FILE" ]; then
165
+ SNAPSHOT_BEFORE=$(grep -o '"snapshot_before"[^,}]*' "$SESSION_FILE" | cut -d'"' -f4)
166
+
167
+ if [ -f "$SNAPSHOT_BEFORE" ]; then
168
+ echo ""
169
+ echo -e "${BLUE}→${NC} Session file changes:"
170
+ DIFF_OUTPUT=$(diff "$SNAPSHOT_BEFORE" "$SNAPSHOT_END" 2>/dev/null || true)
171
+
172
+ if [ -n "$DIFF_OUTPUT" ]; then
173
+ ADDED=$(echo "$DIFF_OUTPUT" | grep "^>" | wc -l | tr -d ' ')
174
+ REMOVED=$(echo "$DIFF_OUTPUT" | grep "^<" | wc -l | tr -d ' ')
175
+ echo " Files added/modified: $ADDED"
176
+ echo " Files removed: $REMOVED"
177
+ echo "$DIFF_OUTPUT" > "$LOG_DIR/session-diff-$(date +%Y%m%d-%H%M%S).txt"
178
+ else
179
+ echo " No file changes this session"
180
+ fi
181
+ fi
182
+ fi
183
+
184
+ # Clean up session file
185
+ rm -f "$SESSION_FILE"
186
+
187
+ echo ""
188
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
189
+ echo -e " ${GREEN}Session ended successfully!${NC}"
190
+ echo ""
191
+ echo " All changes committed and pushed."
192
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
193
+ echo ""
194
+ fi
@@ -0,0 +1,163 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # session-init.sh - Initialize a JFL session properly
4
+ #
5
+ # Called by SessionStart hook. Does:
6
+ # 1. Quick doctor check (warn only, don't block)
7
+ # 2. Clean up stale sessions if > 5
8
+ # 3. Create new worktree for this session
9
+ # 4. Output path for Claude to cd into
10
+ #
11
+ # @purpose Session initialization with worktree creation
12
+
13
+ set -e
14
+
15
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
16
+ REPO_DIR="${JFL_REPO_DIR:-$(pwd)}"
17
+ WORKTREES_DIR="$REPO_DIR/worktrees"
18
+
19
+ cd "$REPO_DIR" || exit 1
20
+
21
+ # Colors
22
+ RED='\033[0;31m'
23
+ GREEN='\033[0;32m'
24
+ YELLOW='\033[1;33m'
25
+ CYAN='\033[0;36m'
26
+ NC='\033[0m'
27
+
28
+ # ==============================================================================
29
+ # Step 1: Quick health check (warn only)
30
+ # ==============================================================================
31
+
32
+ echo ""
33
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
34
+ echo " JFL Session Init"
35
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
36
+
37
+ # Count stale sessions (no PID or PID not running)
38
+ stale_count=0
39
+ active_count=0
40
+
41
+ if [[ -d "$WORKTREES_DIR" ]]; then
42
+ for worktree in "$WORKTREES_DIR"/session-*; do
43
+ if [[ -d "$worktree" ]]; then
44
+ pid_file="$worktree/.jfl/auto-commit.pid"
45
+ if [[ -f "$pid_file" ]]; then
46
+ pid=$(cat "$pid_file" 2>/dev/null)
47
+ if [[ -n "$pid" ]] && kill -0 "$pid" 2>/dev/null; then
48
+ active_count=$((active_count + 1))
49
+ continue
50
+ fi
51
+ fi
52
+ stale_count=$((stale_count + 1))
53
+ fi
54
+ done
55
+ fi
56
+
57
+ # Report status
58
+ if [[ $stale_count -gt 0 ]]; then
59
+ echo -e "${YELLOW}⚠${NC} $stale_count stale sessions, $active_count active"
60
+ else
61
+ echo -e "${GREEN}✓${NC} $active_count active sessions"
62
+ fi
63
+
64
+ # ==============================================================================
65
+ # Step 2: Auto-cleanup if too many stale sessions
66
+ # ==============================================================================
67
+
68
+ if [[ $stale_count -gt 5 ]]; then
69
+ echo -e "${YELLOW}→${NC} Cleaning up stale sessions (> 5)..."
70
+ "$SCRIPT_DIR/jfl-doctor.sh" --fix 2>/dev/null | grep -E "^ (Cleaning|✓)" || true
71
+ fi
72
+
73
+ # ==============================================================================
74
+ # Step 3: Create new worktree
75
+ # ==============================================================================
76
+
77
+ # Generate session name with collision protection
78
+ user=$(git config user.name 2>/dev/null | tr ' ' '-' | tr '[:upper:]' '[:lower:]' | tr -cd 'a-z0-9-' || echo "user")
79
+ # Truncate long usernames to prevent path issues
80
+ user="${user:0:30}"
81
+ date_str=$(date +%Y%m%d)
82
+ time_str=$(date +%H%M)
83
+
84
+ # Generate unique session name, retry if collision detected
85
+ max_attempts=5
86
+ attempt=0
87
+ while [[ $attempt -lt $max_attempts ]]; do
88
+ random_id=$(openssl rand -hex 3 2>/dev/null || printf "%06x" $RANDOM$RANDOM)
89
+ session_name="session-${user}-${date_str}-${time_str}-${random_id}"
90
+
91
+ # Check for collision: journal file or worktree already exists
92
+ if [[ -f "$REPO_DIR/.jfl/journal/${session_name}.jsonl" ]] || [[ -d "$WORKTREES_DIR/$session_name" ]]; then
93
+ echo -e "${YELLOW}⚠${NC} Session name collision, regenerating..."
94
+ attempt=$((attempt + 1))
95
+ sleep 0.1 # Brief pause before retry
96
+ else
97
+ break
98
+ fi
99
+ done
100
+
101
+ if [[ $attempt -ge $max_attempts ]]; then
102
+ echo -e "${RED}✗${NC} Failed to generate unique session name after $max_attempts attempts"
103
+ exit 1
104
+ fi
105
+
106
+ worktree_path="$WORKTREES_DIR/$session_name"
107
+
108
+ echo ""
109
+ echo "Creating session: $session_name"
110
+
111
+ # Create worktree
112
+ if git worktree add "$worktree_path" -b "$session_name" 2>&1 | head -3; then
113
+ echo -e "${GREEN}✓${NC} Worktree created"
114
+ else
115
+ echo -e "${RED}✗${NC} Failed to create worktree"
116
+ # Fall back to main branch
117
+ echo "main" > "$REPO_DIR/.jfl/current-worktree.txt"
118
+ echo "main" > "$REPO_DIR/.jfl/current-session-branch.txt"
119
+ exit 0
120
+ fi
121
+
122
+ # Initialize submodules in worktree (quick, no network)
123
+ cd "$worktree_path"
124
+ if [[ -f ".gitmodules" ]]; then
125
+ if [[ ! -d "product/.git" ]] && [[ ! -f "product/.git" ]]; then
126
+ echo "→ Initializing submodules..."
127
+ git submodule update --init --depth 1 product 2>/dev/null || true
128
+ fi
129
+ fi
130
+
131
+ # Create session directories
132
+ mkdir -p .jfl/logs
133
+
134
+ # CRITICAL: Symlink journal to main repo so entries persist after worktree cleanup
135
+ # Without this, journal entries written in worktree are lost when worktree is removed!
136
+ rm -rf .jfl/journal 2>/dev/null || true
137
+ ln -sf "$REPO_DIR/.jfl/journal" .jfl/journal
138
+ echo -e "${GREEN}✓${NC} Journal symlinked to main repo"
139
+
140
+ # Start auto-commit in background
141
+ if [[ -x "$SCRIPT_DIR/auto-commit.sh" ]]; then
142
+ "$SCRIPT_DIR/auto-commit.sh" start >> .jfl/logs/auto-commit.log 2>&1 &
143
+ echo -e "${GREEN}✓${NC} Auto-commit started"
144
+ fi
145
+
146
+ cd "$REPO_DIR"
147
+
148
+ # ==============================================================================
149
+ # Step 4: Save state and output instructions
150
+ # ==============================================================================
151
+
152
+ # Save paths
153
+ echo "$worktree_path" > "$REPO_DIR/.jfl/current-worktree.txt"
154
+ echo "$session_name" > "$REPO_DIR/.jfl/current-session-branch.txt"
155
+
156
+ # Also save in worktree
157
+ echo "$session_name" > "$worktree_path/.jfl/current-session-branch.txt"
158
+
159
+ echo ""
160
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
161
+ echo -e " ${CYAN}CLAUDE: You MUST run:${NC} cd $worktree_path"
162
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
163
+ echo ""
@@ -0,0 +1,167 @@
1
+ #!/bin/bash
2
+ # session-sync.sh - Run at session start to ensure all repos are synced
3
+ # This prevents the "where did my files go" problem
4
+
5
+ set -e
6
+
7
+ RED='\033[0;31m'
8
+ GREEN='\033[0;32m'
9
+ YELLOW='\033[1;33m'
10
+ NC='\033[0m' # No Color
11
+
12
+ echo "========================================"
13
+ echo "JFL Session Sync"
14
+ echo "========================================"
15
+
16
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
17
+ GTM_ROOT="$(pwd)"
18
+
19
+ # Track failures
20
+ FAILURES=0
21
+
22
+ # Function to sync a repo
23
+ sync_repo() {
24
+ local repo_path="$1"
25
+ local repo_name="$2"
26
+
27
+ if [ ! -d "$repo_path" ]; then
28
+ echo -e "${RED}ERROR: $repo_name not found at $repo_path${NC}"
29
+ FAILURES=$((FAILURES + 1))
30
+ return 1
31
+ fi
32
+
33
+ echo ""
34
+ echo "--- Syncing $repo_name ---"
35
+ cd "$repo_path"
36
+
37
+ # Check if it's a git repo
38
+ if [ ! -d ".git" ]; then
39
+ echo -e "${YELLOW}WARNING: $repo_name is not a git repo${NC}"
40
+ return 0
41
+ fi
42
+
43
+ # Get current branch
44
+ CURRENT_BRANCH=$(git branch --show-current 2>/dev/null || echo "detached")
45
+
46
+ # Fetch latest
47
+ echo "Fetching from origin..."
48
+ git fetch origin 2>/dev/null || {
49
+ echo -e "${YELLOW}WARNING: Could not fetch $repo_name (no network?)${NC}"
50
+ return 0
51
+ }
52
+
53
+ # Check if behind
54
+ if [ "$CURRENT_BRANCH" != "detached" ] && [ "$CURRENT_BRANCH" != "" ]; then
55
+ LOCAL=$(git rev-parse HEAD)
56
+ REMOTE=$(git rev-parse "origin/$CURRENT_BRANCH" 2>/dev/null || echo "")
57
+
58
+ if [ -n "$REMOTE" ] && [ "$LOCAL" != "$REMOTE" ]; then
59
+ BEHIND=$(git rev-list --count HEAD.."origin/$CURRENT_BRANCH" 2>/dev/null || echo "0")
60
+ AHEAD=$(git rev-list --count "origin/$CURRENT_BRANCH"..HEAD 2>/dev/null || echo "0")
61
+
62
+ if [ "$BEHIND" -gt 0 ]; then
63
+ echo -e "${YELLOW}$repo_name is $BEHIND commits behind origin/$CURRENT_BRANCH${NC}"
64
+
65
+ # Check for uncommitted changes
66
+ if [ -n "$(git status --porcelain)" ]; then
67
+ echo -e "${RED}ERROR: $repo_name has uncommitted changes AND is behind${NC}"
68
+ echo "Please commit or stash changes, then pull"
69
+ FAILURES=$((FAILURES + 1))
70
+ else
71
+ echo "Pulling latest..."
72
+ git pull origin "$CURRENT_BRANCH" || {
73
+ echo -e "${RED}ERROR: Failed to pull $repo_name${NC}"
74
+ FAILURES=$((FAILURES + 1))
75
+ }
76
+ fi
77
+ fi
78
+
79
+ if [ "$AHEAD" -gt 0 ]; then
80
+ echo -e "${YELLOW}$repo_name is $AHEAD commits ahead (unpushed)${NC}"
81
+ fi
82
+ else
83
+ echo -e "${GREEN}$repo_name is up to date${NC}"
84
+ fi
85
+ else
86
+ echo -e "${YELLOW}$repo_name is in detached HEAD state${NC}"
87
+ # Try to checkout main and pull
88
+ echo "Attempting to checkout main and pull..."
89
+ git checkout main 2>/dev/null && git pull origin main 2>/dev/null || {
90
+ echo -e "${YELLOW}Could not auto-fix detached HEAD${NC}"
91
+ }
92
+ fi
93
+
94
+ # Show current state
95
+ echo "Current: $(git log --oneline -1)"
96
+ }
97
+
98
+ # Sync main GTM repo
99
+ sync_repo "$GTM_ROOT" "jfl-gtm"
100
+
101
+ # Check for product - submodule or symlink
102
+ PRODUCT_PATH="$GTM_ROOT/product"
103
+ if [ -d "$PRODUCT_PATH" ] && [ -f "$PRODUCT_PATH/.git" ]; then
104
+ # It's a submodule (submodules have .git as a FILE, not directory)
105
+ echo ""
106
+ echo "--- Updating product submodule ---"
107
+ cd "$GTM_ROOT"
108
+
109
+ # First, init if needed
110
+ git submodule init product 2>/dev/null || true
111
+
112
+ # Update to latest from remote
113
+ git submodule update --remote product || {
114
+ echo -e "${YELLOW}WARNING: Could not update product submodule${NC}"
115
+ }
116
+
117
+ # Show what commit we're on
118
+ cd "$PRODUCT_PATH"
119
+ echo -e "${GREEN}product submodule at: $(git log --oneline -1)${NC}"
120
+ cd "$GTM_ROOT"
121
+
122
+ elif [ -L "$PRODUCT_PATH" ]; then
123
+ # It's a symlink - resolve and sync the target (legacy support)
124
+ echo -e "${YELLOW}WARNING: product/ is a symlink, not a submodule${NC}"
125
+ echo "Consider converting to submodule for better reliability"
126
+
127
+ TARGET=$(readlink "$PRODUCT_PATH")
128
+ if [[ "$TARGET" == ../* ]]; then
129
+ RESOLVED_TARGET="$GTM_ROOT/$TARGET"
130
+ else
131
+ RESOLVED_TARGET="$TARGET"
132
+ fi
133
+ RESOLVED_TARGET=$(cd "$RESOLVED_TARGET" 2>/dev/null && pwd)
134
+
135
+ if [ -n "$RESOLVED_TARGET" ]; then
136
+ sync_repo "$RESOLVED_TARGET" "jfl-platform (product symlink target)"
137
+ else
138
+ echo -e "${RED}ERROR: Could not resolve product symlink target${NC}"
139
+ FAILURES=$((FAILURES + 1))
140
+ fi
141
+ elif [ ! -e "$PRODUCT_PATH" ]; then
142
+ # Product doesn't exist - try to init submodule
143
+ echo ""
144
+ echo "--- Initializing product submodule ---"
145
+ cd "$GTM_ROOT"
146
+ git submodule init product 2>/dev/null && git submodule update product || {
147
+ echo -e "${YELLOW}WARNING: Could not initialize product submodule${NC}"
148
+ }
149
+ fi
150
+
151
+ # Sync other submodules
152
+ echo ""
153
+ echo "--- Syncing submodules ---"
154
+ cd "$GTM_ROOT"
155
+ git submodule update --init --recursive 2>/dev/null || true
156
+
157
+ # Final status
158
+ echo ""
159
+ echo "========================================"
160
+ if [ $FAILURES -gt 0 ]; then
161
+ echo -e "${RED}Session sync completed with $FAILURES errors${NC}"
162
+ echo "Please fix the above issues before continuing"
163
+ exit 1
164
+ else
165
+ echo -e "${GREEN}Session sync completed successfully${NC}"
166
+ fi
167
+ echo "========================================"
@@ -0,0 +1,160 @@
1
+ #!/bin/bash
2
+ # test-context-preservation.sh - Verify that context files exist and are in sync
3
+ # Run this to catch "missing files" issues before they become problems
4
+
5
+ set -e
6
+
7
+ RED='\033[0;31m'
8
+ GREEN='\033[0;32m'
9
+ YELLOW='\033[1;33m'
10
+ NC='\033[0m'
11
+
12
+ echo "========================================"
13
+ echo "Context Preservation Test"
14
+ echo "========================================"
15
+
16
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
17
+ GTM_ROOT="$(pwd)"
18
+
19
+ FAILURES=0
20
+ WARNINGS=0
21
+
22
+ # Test 1: Critical GTM knowledge files exist
23
+ echo ""
24
+ echo "Test 1: Critical knowledge files"
25
+ CRITICAL_FILES=(
26
+ "knowledge/VISION.md"
27
+ "knowledge/NARRATIVE.md"
28
+ "knowledge/ROADMAP.md"
29
+ "knowledge/BRAND_DECISIONS.md"
30
+ "knowledge/DESIGN_SYSTEM.md"
31
+ "knowledge/NAMING.md"
32
+ "knowledge/PRODUCT_SPEC_V2.md"
33
+ )
34
+
35
+ for file in "${CRITICAL_FILES[@]}"; do
36
+ if [ -f "$GTM_ROOT/$file" ]; then
37
+ SIZE=$(wc -c < "$GTM_ROOT/$file")
38
+ if [ "$SIZE" -lt 100 ]; then
39
+ echo -e "${YELLOW} WARNING: $file exists but is very small ($SIZE bytes)${NC}"
40
+ WARNINGS=$((WARNINGS + 1))
41
+ else
42
+ echo -e "${GREEN} ✓ $file ($SIZE bytes)${NC}"
43
+ fi
44
+ else
45
+ echo -e "${RED} ✗ $file MISSING${NC}"
46
+ FAILURES=$((FAILURES + 1))
47
+ fi
48
+ done
49
+
50
+ # Test 2: Product platform specs exist
51
+ echo ""
52
+ echo "Test 2: Product platform specs"
53
+ PRODUCT_PATH="$GTM_ROOT/product"
54
+ if [ -L "$PRODUCT_PATH" ]; then
55
+ PRODUCT_PATH=$(cd "$PRODUCT_PATH" 2>/dev/null && pwd)
56
+ fi
57
+
58
+ PLATFORM_FILES=(
59
+ "PLATFORM_SPEC.md"
60
+ "TEMPLATE_SPEC.md"
61
+ "CONTEXT_GRAPH_SPEC.md"
62
+ )
63
+
64
+ for file in "${PLATFORM_FILES[@]}"; do
65
+ if [ -f "$PRODUCT_PATH/$file" ]; then
66
+ SIZE=$(wc -c < "$PRODUCT_PATH/$file")
67
+ echo -e "${GREEN} ✓ product/$file ($SIZE bytes)${NC}"
68
+ else
69
+ echo -e "${RED} ✗ product/$file MISSING${NC}"
70
+ FAILURES=$((FAILURES + 1))
71
+ fi
72
+ done
73
+
74
+ # Test 3: Git repos are in sync with remotes
75
+ echo ""
76
+ echo "Test 3: Git sync status"
77
+
78
+ check_git_sync() {
79
+ local repo_path="$1"
80
+ local repo_name="$2"
81
+
82
+ cd "$repo_path" 2>/dev/null || return 1
83
+
84
+ git fetch origin 2>/dev/null || {
85
+ echo -e "${YELLOW} WARNING: Could not fetch $repo_name${NC}"
86
+ WARNINGS=$((WARNINGS + 1))
87
+ return 0
88
+ }
89
+
90
+ BRANCH=$(git branch --show-current 2>/dev/null || echo "")
91
+ if [ -z "$BRANCH" ]; then
92
+ echo -e "${YELLOW} WARNING: $repo_name is in detached HEAD${NC}"
93
+ WARNINGS=$((WARNINGS + 1))
94
+ return 0
95
+ fi
96
+
97
+ LOCAL=$(git rev-parse HEAD)
98
+ REMOTE=$(git rev-parse "origin/$BRANCH" 2>/dev/null || echo "")
99
+
100
+ if [ -z "$REMOTE" ]; then
101
+ echo -e "${YELLOW} WARNING: $repo_name has no remote tracking${NC}"
102
+ WARNINGS=$((WARNINGS + 1))
103
+ return 0
104
+ fi
105
+
106
+ BEHIND=$(git rev-list --count HEAD.."origin/$BRANCH" 2>/dev/null || echo "0")
107
+
108
+ if [ "$BEHIND" -gt 0 ]; then
109
+ echo -e "${RED} ✗ $repo_name is $BEHIND commits BEHIND origin${NC}"
110
+ FAILURES=$((FAILURES + 1))
111
+ else
112
+ echo -e "${GREEN} ✓ $repo_name is in sync${NC}"
113
+ fi
114
+ }
115
+
116
+ check_git_sync "$GTM_ROOT" "jfl-gtm"
117
+
118
+ # Check product target
119
+ PRODUCT_LINK="$GTM_ROOT/product"
120
+ if [ -L "$PRODUCT_LINK" ]; then
121
+ TARGET=$(readlink "$PRODUCT_LINK")
122
+ if [[ "$TARGET" == ../* ]]; then
123
+ RESOLVED="$GTM_ROOT/$TARGET"
124
+ else
125
+ RESOLVED="$TARGET"
126
+ fi
127
+ RESOLVED=$(cd "$RESOLVED" 2>/dev/null && pwd)
128
+ if [ -n "$RESOLVED" ]; then
129
+ check_git_sync "$RESOLVED" "jfl-platform"
130
+ fi
131
+ fi
132
+
133
+ # Test 4: No uncommitted critical changes
134
+ echo ""
135
+ echo "Test 4: Uncommitted changes check"
136
+ cd "$GTM_ROOT"
137
+ UNCOMMITTED=$(git status --porcelain knowledge/ 2>/dev/null | wc -l)
138
+ if [ "$UNCOMMITTED" -gt 0 ]; then
139
+ echo -e "${YELLOW} WARNING: $UNCOMMITTED uncommitted changes in knowledge/${NC}"
140
+ git status --porcelain knowledge/ | head -5
141
+ WARNINGS=$((WARNINGS + 1))
142
+ else
143
+ echo -e "${GREEN} ✓ No uncommitted knowledge changes${NC}"
144
+ fi
145
+
146
+ # Summary
147
+ echo ""
148
+ echo "========================================"
149
+ if [ $FAILURES -gt 0 ]; then
150
+ echo -e "${RED}FAILED: $FAILURES critical issues found${NC}"
151
+ echo "Run: ./scripts/session-sync.sh to fix sync issues"
152
+ exit 1
153
+ elif [ $WARNINGS -gt 0 ]; then
154
+ echo -e "${YELLOW}PASSED with $WARNINGS warnings${NC}"
155
+ exit 0
156
+ else
157
+ echo -e "${GREEN}PASSED: All context preservation checks passed${NC}"
158
+ exit 0
159
+ fi
160
+ echo "========================================"