jfl 0.8.1 → 0.9.1

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 (296) hide show
  1. package/README.md +35 -4
  2. package/dist/commands/digest.d.ts +6 -0
  3. package/dist/commands/digest.d.ts.map +1 -1
  4. package/dist/commands/digest.js +70 -69
  5. package/dist/commands/digest.js.map +1 -1
  6. package/dist/commands/doctor.d.ts +1 -0
  7. package/dist/commands/doctor.d.ts.map +1 -1
  8. package/dist/commands/doctor.js +30 -1
  9. package/dist/commands/doctor.js.map +1 -1
  10. package/dist/commands/eval.d.ts +40 -0
  11. package/dist/commands/eval.d.ts.map +1 -1
  12. package/dist/commands/eval.js +8 -8
  13. package/dist/commands/eval.js.map +1 -1
  14. package/dist/commands/findings.d.ts +7 -0
  15. package/dist/commands/findings.d.ts.map +1 -1
  16. package/dist/commands/findings.js +4 -4
  17. package/dist/commands/findings.js.map +1 -1
  18. package/dist/commands/ide.d.ts +2 -1
  19. package/dist/commands/ide.d.ts.map +1 -1
  20. package/dist/commands/ide.js +61 -1
  21. package/dist/commands/ide.js.map +1 -1
  22. package/dist/commands/init-from-service.d.ts +15 -0
  23. package/dist/commands/init-from-service.d.ts.map +1 -0
  24. package/dist/commands/init-from-service.js +541 -0
  25. package/dist/commands/init-from-service.js.map +1 -0
  26. package/dist/commands/init.d.ts +1 -0
  27. package/dist/commands/init.d.ts.map +1 -1
  28. package/dist/commands/init.js +32 -1
  29. package/dist/commands/init.js.map +1 -1
  30. package/dist/commands/kanban.d.ts.map +1 -1
  31. package/dist/commands/kanban.js +13 -4
  32. package/dist/commands/kanban.js.map +1 -1
  33. package/dist/commands/linear.d.ts +41 -0
  34. package/dist/commands/linear.d.ts.map +1 -0
  35. package/dist/commands/linear.js +715 -0
  36. package/dist/commands/linear.js.map +1 -0
  37. package/dist/commands/peter.d.ts.map +1 -1
  38. package/dist/commands/peter.js +232 -25
  39. package/dist/commands/peter.js.map +1 -1
  40. package/dist/commands/portfolio.d.ts +5 -0
  41. package/dist/commands/portfolio.d.ts.map +1 -1
  42. package/dist/commands/portfolio.js +193 -203
  43. package/dist/commands/portfolio.js.map +1 -1
  44. package/dist/commands/predict.d.ts +19 -0
  45. package/dist/commands/predict.d.ts.map +1 -1
  46. package/dist/commands/predict.js +4 -4
  47. package/dist/commands/predict.js.map +1 -1
  48. package/dist/commands/services.d.ts.map +1 -1
  49. package/dist/commands/services.js +146 -0
  50. package/dist/commands/services.js.map +1 -1
  51. package/dist/commands/setup.d.ts.map +1 -1
  52. package/dist/commands/setup.js +279 -20
  53. package/dist/commands/setup.js.map +1 -1
  54. package/dist/commands/start.d.ts +25 -0
  55. package/dist/commands/start.d.ts.map +1 -0
  56. package/dist/commands/start.js +191 -0
  57. package/dist/commands/start.js.map +1 -0
  58. package/dist/commands/telemetry-monitor.d.ts +11 -0
  59. package/dist/commands/telemetry-monitor.d.ts.map +1 -0
  60. package/dist/commands/telemetry-monitor.js +224 -0
  61. package/dist/commands/telemetry-monitor.js.map +1 -0
  62. package/dist/commands/telemetry-test.d.ts +11 -0
  63. package/dist/commands/telemetry-test.d.ts.map +1 -0
  64. package/dist/commands/telemetry-test.js +67 -0
  65. package/dist/commands/telemetry-test.js.map +1 -0
  66. package/dist/commands/tenet-agents.d.ts +13 -0
  67. package/dist/commands/tenet-agents.d.ts.map +1 -0
  68. package/dist/commands/tenet-agents.js +191 -0
  69. package/dist/commands/tenet-agents.js.map +1 -0
  70. package/dist/commands/tenet-setup.d.ts +20 -0
  71. package/dist/commands/tenet-setup.d.ts.map +1 -0
  72. package/dist/commands/tenet-setup.js +135 -0
  73. package/dist/commands/tenet-setup.js.map +1 -0
  74. package/dist/commands/train.d.ts +18 -0
  75. package/dist/commands/train.d.ts.map +1 -1
  76. package/dist/commands/train.js +182 -0
  77. package/dist/commands/train.js.map +1 -1
  78. package/dist/commands/viz.d.ts +33 -0
  79. package/dist/commands/viz.d.ts.map +1 -1
  80. package/dist/commands/viz.js +9 -9
  81. package/dist/commands/viz.js.map +1 -1
  82. package/dist/commands/whoami.d.ts +2 -0
  83. package/dist/commands/whoami.d.ts.map +1 -0
  84. package/dist/commands/whoami.js +24 -0
  85. package/dist/commands/whoami.js.map +1 -0
  86. package/dist/index.js +230 -30
  87. package/dist/index.js.map +1 -1
  88. package/dist/lib/advanced-setup.d.ts +78 -0
  89. package/dist/lib/advanced-setup.d.ts.map +1 -0
  90. package/dist/lib/advanced-setup.js +433 -0
  91. package/dist/lib/advanced-setup.js.map +1 -0
  92. package/dist/lib/agent-config.d.ts +33 -0
  93. package/dist/lib/agent-config.d.ts.map +1 -1
  94. package/dist/lib/agent-config.js +26 -0
  95. package/dist/lib/agent-config.js.map +1 -1
  96. package/dist/lib/counterfactual-training-bridge.d.ts +114 -0
  97. package/dist/lib/counterfactual-training-bridge.d.ts.map +1 -0
  98. package/dist/lib/counterfactual-training-bridge.js +322 -0
  99. package/dist/lib/counterfactual-training-bridge.js.map +1 -0
  100. package/dist/lib/discovery-agent.d.ts +48 -0
  101. package/dist/lib/discovery-agent.d.ts.map +1 -0
  102. package/dist/lib/discovery-agent.js +111 -0
  103. package/dist/lib/discovery-agent.js.map +1 -0
  104. package/dist/lib/flow-engine.d.ts.map +1 -1
  105. package/dist/lib/flow-engine.js +46 -8
  106. package/dist/lib/flow-engine.js.map +1 -1
  107. package/dist/lib/gtm-generator.d.ts +29 -0
  108. package/dist/lib/gtm-generator.d.ts.map +1 -0
  109. package/dist/lib/gtm-generator.js +252 -0
  110. package/dist/lib/gtm-generator.js.map +1 -0
  111. package/dist/lib/hub-health.d.ts +40 -0
  112. package/dist/lib/hub-health.d.ts.map +1 -0
  113. package/dist/lib/hub-health.js +89 -0
  114. package/dist/lib/hub-health.js.map +1 -0
  115. package/dist/lib/invariant-monitor.d.ts +6 -2
  116. package/dist/lib/invariant-monitor.d.ts.map +1 -1
  117. package/dist/lib/invariant-monitor.js +89 -2
  118. package/dist/lib/invariant-monitor.js.map +1 -1
  119. package/dist/lib/journal-analyzer.d.ts +71 -0
  120. package/dist/lib/journal-analyzer.d.ts.map +1 -0
  121. package/dist/lib/journal-analyzer.js +306 -0
  122. package/dist/lib/journal-analyzer.js.map +1 -0
  123. package/dist/lib/linear-client.d.ts +73 -0
  124. package/dist/lib/linear-client.d.ts.map +1 -0
  125. package/dist/lib/linear-client.js +112 -0
  126. package/dist/lib/linear-client.js.map +1 -0
  127. package/dist/lib/linear-id-map.d.ts +20 -0
  128. package/dist/lib/linear-id-map.d.ts.map +1 -0
  129. package/dist/lib/linear-id-map.js +59 -0
  130. package/dist/lib/linear-id-map.js.map +1 -0
  131. package/dist/lib/linear-kanban.d.ts +66 -0
  132. package/dist/lib/linear-kanban.d.ts.map +1 -0
  133. package/dist/lib/linear-kanban.js +175 -0
  134. package/dist/lib/linear-kanban.js.map +1 -0
  135. package/dist/lib/onboarding.d.ts +40 -0
  136. package/dist/lib/onboarding.d.ts.map +1 -0
  137. package/dist/lib/onboarding.js +213 -0
  138. package/dist/lib/onboarding.js.map +1 -0
  139. package/dist/lib/physical-world-model.d.ts +50 -0
  140. package/dist/lib/physical-world-model.d.ts.map +1 -0
  141. package/dist/lib/physical-world-model.js +251 -0
  142. package/dist/lib/physical-world-model.js.map +1 -0
  143. package/dist/lib/planning-loop.d.ts +157 -0
  144. package/dist/lib/planning-loop.d.ts.map +1 -0
  145. package/dist/lib/planning-loop.js +537 -0
  146. package/dist/lib/planning-loop.js.map +1 -0
  147. package/dist/lib/policy-head.d.ts +13 -0
  148. package/dist/lib/policy-head.d.ts.map +1 -1
  149. package/dist/lib/policy-head.js +168 -2
  150. package/dist/lib/policy-head.js.map +1 -1
  151. package/dist/lib/resource-optimizer-middleware.d.ts +39 -0
  152. package/dist/lib/resource-optimizer-middleware.d.ts.map +1 -0
  153. package/dist/lib/resource-optimizer-middleware.js +222 -0
  154. package/dist/lib/resource-optimizer-middleware.js.map +1 -0
  155. package/dist/lib/resource-optimizer.d.ts +71 -0
  156. package/dist/lib/resource-optimizer.d.ts.map +1 -0
  157. package/dist/lib/resource-optimizer.js +228 -0
  158. package/dist/lib/resource-optimizer.js.map +1 -0
  159. package/dist/lib/rl-manager.d.ts +74 -0
  160. package/dist/lib/rl-manager.d.ts.map +1 -0
  161. package/dist/lib/rl-manager.js +245 -0
  162. package/dist/lib/rl-manager.js.map +1 -0
  163. package/dist/lib/service-analyzer.d.ts +76 -0
  164. package/dist/lib/service-analyzer.d.ts.map +1 -0
  165. package/dist/lib/service-analyzer.js +704 -0
  166. package/dist/lib/service-analyzer.js.map +1 -0
  167. package/dist/lib/service-gtm.js +2 -2
  168. package/dist/lib/service-gtm.js.map +1 -1
  169. package/dist/lib/service-questionnaire.d.ts +11 -0
  170. package/dist/lib/service-questionnaire.d.ts.map +1 -0
  171. package/dist/lib/service-questionnaire.js +89 -0
  172. package/dist/lib/service-questionnaire.js.map +1 -0
  173. package/dist/lib/setup/agent-generator.d.ts +2 -0
  174. package/dist/lib/setup/agent-generator.d.ts.map +1 -1
  175. package/dist/lib/setup/agent-generator.js +128 -4
  176. package/dist/lib/setup/agent-generator.js.map +1 -1
  177. package/dist/lib/setup/flow-generator.d.ts +10 -0
  178. package/dist/lib/setup/flow-generator.d.ts.map +1 -0
  179. package/dist/lib/setup/flow-generator.js +113 -0
  180. package/dist/lib/setup/flow-generator.js.map +1 -0
  181. package/dist/lib/setup/invariant-bridge.d.ts +91 -0
  182. package/dist/lib/setup/invariant-bridge.d.ts.map +1 -0
  183. package/dist/lib/setup/invariant-bridge.js +384 -0
  184. package/dist/lib/setup/invariant-bridge.js.map +1 -0
  185. package/dist/lib/setup/spec-generator.d.ts +41 -5
  186. package/dist/lib/setup/spec-generator.d.ts.map +1 -1
  187. package/dist/lib/setup/spec-generator.js +503 -29
  188. package/dist/lib/setup/spec-generator.js.map +1 -1
  189. package/dist/lib/setup/starter-intelligence.d.ts +25 -0
  190. package/dist/lib/setup/starter-intelligence.d.ts.map +1 -0
  191. package/dist/lib/setup/starter-intelligence.js +309 -0
  192. package/dist/lib/setup/starter-intelligence.js.map +1 -0
  193. package/dist/lib/stratus-client.js +1 -1
  194. package/dist/lib/stratus-client.js.map +1 -1
  195. package/dist/lib/surface-agent.d.ts +78 -0
  196. package/dist/lib/surface-agent.d.ts.map +1 -0
  197. package/dist/lib/surface-agent.js +105 -0
  198. package/dist/lib/surface-agent.js.map +1 -0
  199. package/dist/lib/surface-coordination-example.d.ts +30 -0
  200. package/dist/lib/surface-coordination-example.d.ts.map +1 -0
  201. package/dist/lib/surface-coordination-example.js +164 -0
  202. package/dist/lib/surface-coordination-example.js.map +1 -0
  203. package/dist/lib/telemetry/physical-world-collector.d.ts +15 -0
  204. package/dist/lib/telemetry/physical-world-collector.d.ts.map +1 -0
  205. package/dist/lib/telemetry/physical-world-collector.js +177 -0
  206. package/dist/lib/telemetry/physical-world-collector.js.map +1 -0
  207. package/dist/lib/telemetry/training-bridge.d.ts +51 -0
  208. package/dist/lib/telemetry/training-bridge.d.ts.map +1 -0
  209. package/dist/lib/telemetry/training-bridge.js +185 -0
  210. package/dist/lib/telemetry/training-bridge.js.map +1 -0
  211. package/dist/lib/telemetry.d.ts +2 -1
  212. package/dist/lib/telemetry.d.ts.map +1 -1
  213. package/dist/lib/telemetry.js +23 -2
  214. package/dist/lib/telemetry.js.map +1 -1
  215. package/dist/lib/tenet-board-agent.d.ts +52 -0
  216. package/dist/lib/tenet-board-agent.d.ts.map +1 -0
  217. package/dist/lib/tenet-board-agent.js +226 -0
  218. package/dist/lib/tenet-board-agent.js.map +1 -0
  219. package/dist/lib/tenet-ide-agent.d.ts +40 -0
  220. package/dist/lib/tenet-ide-agent.d.ts.map +1 -0
  221. package/dist/lib/tenet-ide-agent.js +199 -0
  222. package/dist/lib/tenet-ide-agent.js.map +1 -0
  223. package/dist/lib/workspace/data-pipeline.d.ts.map +1 -1
  224. package/dist/lib/workspace/data-pipeline.js +27 -5
  225. package/dist/lib/workspace/data-pipeline.js.map +1 -1
  226. package/dist/lib/workspace/sidebar-runner.d.ts +13 -0
  227. package/dist/lib/workspace/sidebar-runner.d.ts.map +1 -0
  228. package/dist/lib/workspace/sidebar-runner.js +419 -0
  229. package/dist/lib/workspace/sidebar-runner.js.map +1 -0
  230. package/dist/lib/workspace/surface-registry.d.ts.map +1 -1
  231. package/dist/lib/workspace/surface-registry.js +9 -1
  232. package/dist/lib/workspace/surface-registry.js.map +1 -1
  233. package/dist/lib/workspace/surfaces/agent-overview.d.ts +3 -3
  234. package/dist/lib/workspace/surfaces/agent-overview.d.ts.map +1 -1
  235. package/dist/lib/workspace/surfaces/agent-overview.js +3 -3
  236. package/dist/lib/workspace/surfaces/agent-overview.js.map +1 -1
  237. package/dist/lib/workspace/surfaces/index.d.ts +3 -0
  238. package/dist/lib/workspace/surfaces/index.d.ts.map +1 -1
  239. package/dist/lib/workspace/surfaces/index.js +3 -0
  240. package/dist/lib/workspace/surfaces/index.js.map +1 -1
  241. package/dist/lib/workspace/surfaces/kanban.d.ts +15 -0
  242. package/dist/lib/workspace/surfaces/kanban.d.ts.map +1 -0
  243. package/dist/lib/workspace/surfaces/kanban.js +43 -0
  244. package/dist/lib/workspace/surfaces/kanban.js.map +1 -0
  245. package/dist/lib/workspace/surfaces/physical-world.d.ts +15 -0
  246. package/dist/lib/workspace/surfaces/physical-world.d.ts.map +1 -0
  247. package/dist/lib/workspace/surfaces/physical-world.js +37 -0
  248. package/dist/lib/workspace/surfaces/physical-world.js.map +1 -0
  249. package/dist/lib/workspace/surfaces/sidebar.d.ts +22 -0
  250. package/dist/lib/workspace/surfaces/sidebar.d.ts.map +1 -0
  251. package/dist/lib/workspace/surfaces/sidebar.js +94 -0
  252. package/dist/lib/workspace/surfaces/sidebar.js.map +1 -0
  253. package/dist/lib/workspace/tmux-adapter.d.ts +8 -5
  254. package/dist/lib/workspace/tmux-adapter.d.ts.map +1 -1
  255. package/dist/lib/workspace/tmux-adapter.js +38 -7
  256. package/dist/lib/workspace/tmux-adapter.js.map +1 -1
  257. package/dist/lib/workspace/tmux-sidebar.d.ts +14 -0
  258. package/dist/lib/workspace/tmux-sidebar.d.ts.map +1 -0
  259. package/dist/lib/workspace/tmux-sidebar.js +230 -0
  260. package/dist/lib/workspace/tmux-sidebar.js.map +1 -0
  261. package/dist/types/flows.d.ts +2 -1
  262. package/dist/types/flows.d.ts.map +1 -1
  263. package/dist/types/physical-world-model.d.ts +65 -0
  264. package/dist/types/physical-world-model.d.ts.map +1 -0
  265. package/dist/types/physical-world-model.js +43 -0
  266. package/dist/types/physical-world-model.js.map +1 -0
  267. package/dist/types/telemetry.d.ts +37 -0
  268. package/dist/types/telemetry.d.ts.map +1 -1
  269. package/dist/types/world-model.d.ts.map +1 -1
  270. package/dist/types/world-model.js +14 -7
  271. package/dist/types/world-model.js.map +1 -1
  272. package/dist/utils/context-hub-port.d.ts.map +1 -1
  273. package/dist/utils/context-hub-port.js +6 -1
  274. package/dist/utils/context-hub-port.js.map +1 -1
  275. package/dist/utils/jfl-config.d.ts +7 -2
  276. package/dist/utils/jfl-config.d.ts.map +1 -1
  277. package/dist/utils/jfl-config.js +14 -4
  278. package/dist/utils/jfl-config.js.map +1 -1
  279. package/package.json +3 -2
  280. package/packages/pi/extensions/context.ts +51 -1
  281. package/packages/pi/extensions/hub-tools.ts +247 -0
  282. package/packages/pi/extensions/index.ts +38 -6
  283. package/packages/pi/extensions/memory-tool.ts +84 -4
  284. package/packages/pi/extensions/service-skills.ts +214 -0
  285. package/scripts/telemetry-dashboard.sh +44 -0
  286. package/scripts/test-planning-loop-e2e.ts +181 -0
  287. package/scripts/test-server-inference.ts +49 -0
  288. package/scripts/test-state-sensitivity.ts +32 -0
  289. package/scripts/train/v2/benchmark.py +661 -0
  290. package/scripts/train/v2/generate_balanced.py +439 -0
  291. package/scripts/train/v2/generate_hard_negatives.py +219 -0
  292. package/scripts/train/v2/infer.py +149 -36
  293. package/scripts/train/v2/infer_server.py +224 -0
  294. package/scripts/train/v2/online_train.py +576 -0
  295. package/scripts/train/v2/precompute.py +24 -6
  296. package/template/CLAUDE.md +74 -132
@@ -19,79 +19,51 @@ Don't make users fill out forms before they can build. Let them start immediatel
19
19
 
20
20
  ---
21
21
 
22
- ## CRITICAL: Session Sync (MUST READ)
22
+ ## Session Startup
23
23
 
24
- **Context loss is unacceptable.** Before starting ANY work, verify repos are synced.
24
+ **Two runtimes, two paths.** JFL works in both Pi (with the JFL extension) and Claude Code (without it). The startup behavior depends on which runtime you're in.
25
25
 
26
- ### At Session Start - ALWAYS Do (BEFORE RESPONDING TO USER):
26
+ ### Path A: Pi with JFL Extension (you receive a `jfl-session-init` message)
27
27
 
28
- **Complete ALL steps before saying anything to the user.**
28
+ **The extension already handled everything.** When you see a message with `customType: "jfl-session-init"`, it means:
29
+ - Session sync, doctor check, and Context Hub are done
30
+ - Auto-commit daemon is running
31
+ - Full project context (journals, knowledge docs, code headers) is injected into your system prompt
32
+ - The user already saw a boot animation while all this loaded
33
+
34
+ **DO NOT run any startup commands:**
35
+ - ❌ `./scripts/session/session-sync.sh`
36
+ - ❌ `./scripts/session/jfl-doctor.sh`
37
+ - ❌ `jfl_context` or `context_get`
38
+ - ❌ `cat .jfl/journal/*.jsonl`
39
+ - ❌ `/hud`
40
+
41
+ **Just greet the user naturally (3-5 lines):**
42
+ - What was worked on recently (from context already in your system prompt)
43
+ - Current phase and any blockers
44
+ - A suggested next action
45
+
46
+ No tool calls. No setup noise. Just talk.
47
+
48
+ ### Path B: Claude Code / No Extension (you do NOT receive a `jfl-session-init` message)
49
+
50
+ **You need to initialize manually.** Complete these steps before responding:
29
51
 
30
52
  **1. Run session sync:**
31
53
  ```bash
32
54
  ./scripts/session/session-sync.sh
33
55
  ```
34
56
 
35
- **2. Run doctor check (ONLY for existing projects):**
36
-
37
- **IMPORTANT: Skip doctor for fresh projects.** Detect fresh project:
57
+ **2. Run doctor check:**
38
58
  ```bash
39
- # Fresh project indicators:
40
- # - No git commits yet: git rev-list --count HEAD returns 0 or error
41
- # - Empty knowledge docs: VISION.md has template text
42
- # - No journal entries: .jfl/journal/ is empty
43
-
44
- # Check if fresh
45
- COMMIT_COUNT=$(git rev-list --count HEAD 2>/dev/null || echo "0")
46
- if [[ "$COMMIT_COUNT" -gt "5" ]]; then
47
- # Existing project - run doctor
48
- ./scripts/session/jfl-doctor.sh
49
- # Ask user before continuing
50
- # If warnings: "Doctor found issues: [list]. Want me to fix these?"
51
- # If clean: "Doctor check passed. Ready to continue?"
52
- # STOP AND WAIT for user response
53
- # If approved: ./scripts/session/jfl-doctor.sh --fix
54
- else
55
- # Fresh project - skip doctor
56
- echo "Fresh project detected, skipping doctor check."
57
- fi
59
+ ./scripts/session/jfl-doctor.sh
58
60
  ```
59
61
 
60
- **For existing projects:** After running doctor, you MUST ask the user before continuing.
61
- **For fresh projects:** Skip directly to step 3.
62
-
63
- **3. Get unified context via MCP (REQUIRED):**
62
+ **3. Get unified context:**
64
63
  ```
65
64
  Call: mcp__jfl-context__context_get
66
65
  ```
67
-
68
- This single call returns:
69
- - Recent journal entries (what happened across sessions)
70
- - Knowledge docs (vision, roadmap, narrative, thesis)
71
- - Code file headers (@purpose tags)
72
-
73
- **CRITICAL: Filter cross-project context pollution.**
74
-
75
- Context Hub may return results from OTHER projects on the machine. ALWAYS verify context matches the current project:
76
-
77
- 1. Check the project path in journal entries
78
- 2. If journal paths don't match current directory, IGNORE them
79
- 3. If knowledge docs look like templates, this is a FRESH project
80
- 4. For fresh projects: Skip context_get entirely, start foundation questions
81
-
82
- **Example of cross-project pollution (IGNORE THIS):**
83
- ```
84
- Journal from: /Users/alectaggart/gatcha-toilet/.jfl/journal/...
85
- Current project: /Users/alectaggart/case
86
- → THESE DON'T MATCH. Ignore the journal entry.
87
- ```
88
-
89
- **For fresh projects (no commits, empty docs):**
90
- - Skip context_get
91
- - Skip doctor check
92
- - Go straight to foundation questions (VISION, ROADMAP, etc.)
93
-
94
- **DO NOT read individual markdown files.** The context MCP tool aggregates everything. This is why we built Context Hub.
66
+ This returns recent journal entries, knowledge docs, and code headers.
95
67
 
96
68
  **4. Show recent journal entries:**
97
69
  ```bash
@@ -103,105 +75,75 @@ cat .jfl/journal/*.jsonl 2>/dev/null | tail -10
103
75
  Invoke: /hud skill
104
76
  ```
105
77
 
106
- This displays the full status, pipeline, tasks, and guides next action.
107
-
108
78
  **ONLY AFTER completing all 5 steps**, respond to the user with the HUD output.
109
79
 
110
- If you need to search for something specific later:
111
- ```
112
- Call: mcp__jfl-context__context_search with query="your search"
113
- ```
80
+ ### How to Tell Which Path You're On
114
81
 
115
- ## Session Management
82
+ - **Got a `jfl-session-init` message?** → Path A (extension handled it, just greet)
83
+ - **No such message?** → Path B (manual startup required)
116
84
 
117
- JFL automatically manages session isolation. You don't need to worry about worktrees or CD commands - it's handled for you.
85
+ ### Automatic Tool Invocation (DURING the session, not at startup)
118
86
 
119
- ### How It Works
87
+ **When the user asks questions, AUTOMATICALLY use the right tool:**
120
88
 
121
- - **Single session**: You work directly on your branch (simple, fast)
122
- - **Multiple sessions**: JFL creates isolated worktrees automatically (prevents conflicts)
123
- - **Auto-commit**: Work is saved every 2 minutes (prevents data loss)
124
- - **Auto-merge**: When you finish, work merges to your working branch automatically
89
+ | User Question | Auto-Invoke | Don't Ask |
90
+ |---------------|-------------|-----------|
91
+ | "What did we decide about X?" | `memory_search: X` | Just do it |
92
+ | "When did we implement Y?" | `memory_search: Y` | Just do it |
93
+ | "Why did we choose Z?" | `memory_search: Z decision` | Just do it |
94
+ | "Search for pricing" | `memory_search: pricing` | Just do it |
95
+ | "Show me database features" | `memory_search: database + type=feature` | Just do it |
96
+ | "What files have X?" | `context_search: X` | Just do it |
97
+ | "Find code about Y" | `context_search: Y` | Just do it |
125
98
 
126
- ### Session Branch
99
+ **The user should NEVER have to type tool names.** You detect the intent and invoke automatically.
127
100
 
128
- Sessions branch from your working branch (default: `main`, configurable in `.jfl/config.json`):
101
+ **Tool Selection Logic:**
129
102
 
130
- ```json
131
- {
132
- "working_branch": "develop"
133
- }
134
103
  ```
104
+ if question contains ("decide", "decided", "choice", "why we"):
105
+ → memory_search with type="decision"
135
106
 
136
- Session branches are named: `session-<user>-<date>-<time>-<random>`
107
+ if question contains ("when did we", "implemented", "built", "added"):
108
+ → memory_search with type="feature"
137
109
 
138
- ### Ending a Session
139
-
140
- When user says "done", "that's it", or "/end":
141
- - Run the `/end` skill to clean up properly
142
- - This commits, merges, and pushes your work
110
+ if question contains ("bug", "fix", "error"):
111
+ → memory_search with type="fix"
143
112
 
144
- If session crashes, uncommitted work is auto-saved via background auto-commit.
113
+ if question contains ("learn", "insight", "discovery"):
114
+ → memory_search (check learned field)
145
115
 
146
- ---
116
+ if question about "files" or "code":
117
+ → context_search
147
118
 
148
- This syncs:
149
- - jfl-gtm (this repo)
150
- - jfl-platform (product symlink target)
151
- - All submodules
119
+ if question about "current" or "now":
120
+ context_get
152
121
 
153
- ### Why This Matters
122
+ if question about "status" or "dashboard":
123
+ → /hud
154
124
 
155
- The `product/` directory is a **symlink** to `../jfl-platform`. If jfl-platform gets out of sync with GitHub:
156
- - Files appear "deleted" when they exist on GitHub
157
- - Work done in previous sessions is invisible
158
- - User loses trust in the system
159
-
160
- **This has happened multiple times. Do not skip the sync.**
161
-
162
- ### Verify Context is Intact
163
-
164
- ```bash
165
- ./scripts/session/test-context-preservation.sh
125
+ else:
126
+ memory_search (general - hybrid search finds relevant)
166
127
  ```
167
128
 
168
- This checks:
169
- - Critical knowledge files exist (VISION.md, BRAND_DECISIONS.md, etc.)
170
- - Product specs exist (PLATFORM_SPEC.md, TEMPLATE_SPEC.md, CONTEXT_GRAPH_SPEC.md)
171
- - Git repos are in sync with remotes
172
- - No uncommitted changes in knowledge/
173
-
174
- **If tests fail, do not proceed until fixed.**
175
-
176
- ### Auto-Push on Session End
177
-
178
- Hooks in `.claude/settings.json` automatically:
179
- - Commit changes on Stop/PreCompact
180
- - Push to origin
181
-
182
- ### Continuous Auto-Commit (RECOMMENDED)
129
+ ## Session Management
183
130
 
184
- **Problem:** Stop/PreCompact hooks only run if session ends cleanly. If session crashes, terminal closes, or you switch away files can be lost.
131
+ JFL automatically manages session isolation. You don't need to worry about worktrees or CD commands it's handled for you.
185
132
 
186
- **Solution:** Run continuous auto-commit in background:
133
+ ### How It Works
187
134
 
188
- ```bash
189
- # In a separate terminal, run:
190
- ./scripts/session/auto-commit.sh start
135
+ - **Single session**: You work directly on your branch (simple, fast)
136
+ - **Multiple sessions**: JFL creates isolated worktrees automatically (prevents conflicts)
137
+ - **Auto-commit**: Work is saved every 2 minutes (prevents data loss)
138
+ - **Auto-merge**: When you finish, work merges to your working branch automatically
191
139
 
192
- # Or with custom interval (default 120s):
193
- ./scripts/session/auto-commit.sh start 60
194
- ```
140
+ ### Ending a Session
195
141
 
196
- This commits every 2 minutes to:
197
- - knowledge/
198
- - previews/
199
- - content/
200
- - suggestions/
201
- - CLAUDE.md
202
- - .jfl/
142
+ When user says "done", "that's it", or "/end":
143
+ - Run the `/end` skill to clean up properly
144
+ - This commits, merges, and pushes your work
203
145
 
204
- **Start this at every session.** It's the only way to guarantee no work is lost.
146
+ If session crashes, uncommitted work is auto-saved via background auto-commit.
205
147
 
206
148
  ---
207
149