@rune-kit/rune 2.8.0 → 2.11.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 (287) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +68 -34
  3. package/agents/adversary.md +27 -0
  4. package/agents/architect.md +19 -29
  5. package/agents/asset-creator.md +18 -4
  6. package/agents/audit.md +25 -4
  7. package/agents/autopsy.md +19 -4
  8. package/agents/ba.md +35 -0
  9. package/agents/brainstorm.md +31 -4
  10. package/agents/browser-pilot.md +21 -4
  11. package/agents/coder.md +21 -29
  12. package/agents/completion-gate.md +20 -4
  13. package/agents/constraint-check.md +18 -4
  14. package/agents/context-engine.md +22 -4
  15. package/agents/context-pack.md +32 -0
  16. package/agents/cook.md +41 -4
  17. package/agents/db.md +19 -4
  18. package/agents/debug.md +33 -4
  19. package/agents/dependency-doctor.md +20 -4
  20. package/agents/deploy.md +27 -4
  21. package/agents/design.md +22 -4
  22. package/agents/doc-processor.md +27 -0
  23. package/agents/docs-seeker.md +19 -4
  24. package/agents/docs.md +31 -0
  25. package/agents/fix.md +37 -4
  26. package/agents/git.md +29 -0
  27. package/agents/hallucination-guard.md +20 -4
  28. package/agents/incident.md +21 -4
  29. package/agents/integrity-check.md +18 -4
  30. package/agents/journal.md +19 -4
  31. package/agents/launch.md +32 -4
  32. package/agents/logic-guardian.md +26 -11
  33. package/agents/marketing.md +23 -4
  34. package/agents/mcp-builder.md +26 -0
  35. package/agents/neural-memory.md +30 -0
  36. package/agents/onboard.md +22 -4
  37. package/agents/perf.md +21 -4
  38. package/agents/plan.md +29 -4
  39. package/agents/preflight.md +22 -4
  40. package/agents/problem-solver.md +20 -4
  41. package/agents/rescue.md +23 -4
  42. package/agents/research.md +19 -4
  43. package/agents/researcher.md +19 -29
  44. package/agents/retro.md +32 -0
  45. package/agents/review-intake.md +20 -4
  46. package/agents/review.md +32 -4
  47. package/agents/reviewer.md +20 -28
  48. package/agents/safeguard.md +19 -4
  49. package/agents/sast.md +18 -4
  50. package/agents/scaffold.md +41 -0
  51. package/agents/scanner.md +19 -28
  52. package/agents/scope-guard.md +18 -4
  53. package/agents/scout.md +23 -4
  54. package/agents/sentinel-env.md +26 -0
  55. package/agents/sentinel.md +33 -4
  56. package/agents/sequential-thinking.md +20 -4
  57. package/agents/session-bridge.md +24 -4
  58. package/agents/skill-forge.md +22 -4
  59. package/agents/skill-router.md +26 -4
  60. package/agents/slides.md +24 -0
  61. package/agents/surgeon.md +19 -4
  62. package/agents/team.md +30 -4
  63. package/agents/test.md +36 -4
  64. package/agents/trend-scout.md +17 -4
  65. package/agents/verification.md +20 -4
  66. package/agents/video-creator.md +20 -4
  67. package/agents/watchdog.md +19 -4
  68. package/agents/worktree.md +17 -4
  69. package/commands/rune.md +168 -168
  70. package/compiler/__tests__/analytics.test.js +370 -0
  71. package/compiler/adapters/openclaw.js +2 -2
  72. package/compiler/analytics.js +385 -0
  73. package/compiler/bin/rune.js +68 -2
  74. package/compiler/dashboard.js +883 -0
  75. package/compiler/transforms/branding.js +1 -1
  76. package/contexts/dev.md +34 -34
  77. package/contexts/research.md +43 -43
  78. package/contexts/review.md +55 -55
  79. package/extensions/ai-ml/PACK.md +88 -88
  80. package/extensions/ai-ml/skills/ai-agents.md +172 -172
  81. package/extensions/ai-ml/skills/code-sandbox.md +187 -187
  82. package/extensions/ai-ml/skills/deep-research.md +146 -146
  83. package/extensions/ai-ml/skills/embedding-search.md +66 -66
  84. package/extensions/ai-ml/skills/fine-tuning-guide.md +74 -74
  85. package/extensions/ai-ml/skills/llm-architect.md +125 -125
  86. package/extensions/ai-ml/skills/llm-integration.md +64 -64
  87. package/extensions/ai-ml/skills/prompt-patterns.md +72 -72
  88. package/extensions/ai-ml/skills/rag-patterns.md +66 -66
  89. package/extensions/ai-ml/skills/web-extraction.md +114 -114
  90. package/extensions/analytics/PACK.md +92 -92
  91. package/extensions/analytics/skills/ab-testing.md +72 -72
  92. package/extensions/analytics/skills/dashboard-patterns.md +83 -83
  93. package/extensions/analytics/skills/data-validation.md +68 -68
  94. package/extensions/analytics/skills/funnel-analysis.md +81 -81
  95. package/extensions/analytics/skills/sql-patterns.md +57 -57
  96. package/extensions/analytics/skills/statistical-analysis.md +79 -79
  97. package/extensions/analytics/skills/tracking-setup.md +71 -71
  98. package/extensions/backend/PACK.md +104 -104
  99. package/extensions/backend/skills/api-patterns.md +84 -84
  100. package/extensions/backend/skills/async-pipeline.md +193 -193
  101. package/extensions/backend/skills/auth-patterns.md +97 -97
  102. package/extensions/backend/skills/background-jobs.md +133 -133
  103. package/extensions/backend/skills/caching-patterns.md +108 -108
  104. package/extensions/backend/skills/cli-generation.md +133 -133
  105. package/extensions/backend/skills/database-patterns.md +87 -87
  106. package/extensions/backend/skills/middleware-patterns.md +104 -104
  107. package/extensions/chrome-ext/PACK.md +93 -93
  108. package/extensions/chrome-ext/skills/cws-preflight.md +143 -143
  109. package/extensions/chrome-ext/skills/cws-publish.md +104 -104
  110. package/extensions/chrome-ext/skills/ext-ai-integration.md +251 -251
  111. package/extensions/chrome-ext/skills/ext-messaging.md +139 -139
  112. package/extensions/chrome-ext/skills/ext-storage.md +133 -133
  113. package/extensions/chrome-ext/skills/mv3-scaffold.md +164 -164
  114. package/extensions/content/PACK.md +96 -96
  115. package/extensions/content/skills/blog-patterns.md +88 -88
  116. package/extensions/content/skills/cms-integration.md +131 -131
  117. package/extensions/content/skills/content-scoring.md +107 -107
  118. package/extensions/content/skills/i18n.md +83 -83
  119. package/extensions/content/skills/mdx-authoring.md +137 -137
  120. package/extensions/content/skills/reference.md +1014 -1014
  121. package/extensions/content/skills/seo-patterns.md +67 -67
  122. package/extensions/content/skills/video-repurpose.md +153 -153
  123. package/extensions/devops/PACK.md +101 -101
  124. package/extensions/devops/skills/chaos-testing.md +67 -67
  125. package/extensions/devops/skills/ci-cd.md +75 -75
  126. package/extensions/devops/skills/docker.md +58 -58
  127. package/extensions/devops/skills/edge-serverless.md +163 -163
  128. package/extensions/devops/skills/infra-as-code.md +158 -158
  129. package/extensions/devops/skills/kubernetes.md +110 -110
  130. package/extensions/devops/skills/monitoring.md +57 -57
  131. package/extensions/devops/skills/server-setup.md +64 -64
  132. package/extensions/devops/skills/ssl-domain.md +42 -42
  133. package/extensions/ecommerce/PACK.md +116 -116
  134. package/extensions/ecommerce/skills/cart-system.md +79 -79
  135. package/extensions/ecommerce/skills/inventory-mgmt.md +102 -102
  136. package/extensions/ecommerce/skills/order-management.md +126 -126
  137. package/extensions/ecommerce/skills/payment-integration.md +472 -472
  138. package/extensions/ecommerce/skills/shopify-dev.md +69 -69
  139. package/extensions/ecommerce/skills/subscription-billing.md +93 -93
  140. package/extensions/ecommerce/skills/tax-compliance.md +117 -117
  141. package/extensions/gamedev/PACK.md +142 -142
  142. package/extensions/gamedev/skills/asset-pipeline.md +74 -74
  143. package/extensions/gamedev/skills/audio-system.md +129 -129
  144. package/extensions/gamedev/skills/camera-system.md +87 -87
  145. package/extensions/gamedev/skills/ecs.md +98 -98
  146. package/extensions/gamedev/skills/game-loops.md +72 -72
  147. package/extensions/gamedev/skills/input-system.md +199 -199
  148. package/extensions/gamedev/skills/multiplayer.md +180 -180
  149. package/extensions/gamedev/skills/particles.md +105 -105
  150. package/extensions/gamedev/skills/physics-engine.md +89 -89
  151. package/extensions/gamedev/skills/scene-management.md +146 -146
  152. package/extensions/gamedev/skills/threejs-patterns.md +90 -90
  153. package/extensions/gamedev/skills/webgl.md +71 -71
  154. package/extensions/mobile/PACK.md +106 -106
  155. package/extensions/mobile/skills/app-store-connect.md +152 -152
  156. package/extensions/mobile/skills/app-store-prep.md +66 -66
  157. package/extensions/mobile/skills/deep-linking.md +109 -109
  158. package/extensions/mobile/skills/flutter.md +60 -60
  159. package/extensions/mobile/skills/ios-build-pipeline.md +142 -142
  160. package/extensions/mobile/skills/native-bridge.md +66 -66
  161. package/extensions/mobile/skills/ota-updates.md +97 -97
  162. package/extensions/mobile/skills/push-notifications.md +111 -111
  163. package/extensions/mobile/skills/react-native.md +82 -82
  164. package/extensions/saas/PACK.md +116 -116
  165. package/extensions/saas/skills/billing-integration.md +200 -200
  166. package/extensions/saas/skills/feature-flags.md +130 -130
  167. package/extensions/saas/skills/multi-tenant.md +103 -103
  168. package/extensions/saas/skills/onboarding-flow.md +139 -139
  169. package/extensions/saas/skills/subscription-flow.md +95 -95
  170. package/extensions/saas/skills/team-management.md +144 -144
  171. package/extensions/security/PACK.md +99 -99
  172. package/extensions/security/skills/api-security.md +140 -140
  173. package/extensions/security/skills/compliance.md +68 -68
  174. package/extensions/security/skills/owasp-audit.md +64 -64
  175. package/extensions/security/skills/pentest-patterns.md +77 -77
  176. package/extensions/security/skills/secret-mgmt.md +65 -65
  177. package/extensions/security/skills/supply-chain.md +65 -65
  178. package/extensions/trading/PACK.md +80 -80
  179. package/extensions/trading/skills/chart-components.md +55 -55
  180. package/extensions/trading/skills/experiment-loop.md +125 -125
  181. package/extensions/trading/skills/fintech-patterns.md +47 -47
  182. package/extensions/trading/skills/indicator-library.md +58 -58
  183. package/extensions/trading/skills/quant-analysis.md +111 -111
  184. package/extensions/trading/skills/realtime-data.md +58 -58
  185. package/extensions/trading/skills/trade-logic.md +104 -104
  186. package/extensions/ui/PACK.md +130 -130
  187. package/extensions/ui/skills/a11y-audit.md +91 -91
  188. package/extensions/ui/skills/animation-patterns.md +127 -106
  189. package/extensions/ui/skills/component-patterns.md +100 -75
  190. package/extensions/ui/skills/design-decision.md +108 -108
  191. package/extensions/ui/skills/design-system.md +68 -68
  192. package/extensions/ui/skills/landing-patterns.md +155 -155
  193. package/extensions/ui/skills/palette-picker.md +173 -173
  194. package/extensions/ui/skills/react-health.md +90 -90
  195. package/extensions/ui/skills/type-system.md +125 -125
  196. package/extensions/ui/skills/web-vitals.md +153 -153
  197. package/extensions/zalo/PACK.md +145 -145
  198. package/extensions/zalo/skills/zalo-oa-mcp.md +317 -317
  199. package/extensions/zalo/skills/zalo-oa-messaging.md +429 -429
  200. package/extensions/zalo/skills/zalo-oa-setup.md +236 -236
  201. package/extensions/zalo/skills/zalo-oa-webhook.md +189 -189
  202. package/extensions/zalo/skills/zalo-personal-messaging.md +194 -194
  203. package/extensions/zalo/skills/zalo-personal-setup.md +153 -153
  204. package/extensions/zalo/skills/zalo-rate-guard.md +219 -219
  205. package/hooks/auto-format/index.cjs +48 -48
  206. package/hooks/context-watch/index.cjs +95 -68
  207. package/hooks/hooks.json +111 -111
  208. package/hooks/metrics-collector/index.cjs +86 -42
  209. package/hooks/post-session-reflect/index.cjs +189 -153
  210. package/hooks/pre-compact/index.cjs +95 -95
  211. package/hooks/run-hook.cmd +1 -1
  212. package/hooks/secrets-scan/index.cjs +100 -100
  213. package/hooks/session-start/index.cjs +71 -65
  214. package/hooks/typecheck/index.cjs +65 -65
  215. package/package.json +63 -63
  216. package/references/ui-pro-max-data/LICENSE-UI-PRO-MAX +21 -21
  217. package/references/ui-pro-max-data/charts.csv +26 -26
  218. package/references/ui-pro-max-data/colors.csv +161 -161
  219. package/references/ui-pro-max-data/styles.csv +68 -68
  220. package/references/ui-pro-max-data/typography.csv +74 -74
  221. package/references/ui-pro-max-data/ui-reasoning.csv +162 -162
  222. package/references/ui-pro-max-data/ux-guidelines.csv +99 -99
  223. package/skills/adversary/SKILL.md +283 -283
  224. package/skills/asset-creator/SKILL.md +157 -157
  225. package/skills/audit/SKILL.md +148 -2
  226. package/skills/autopsy/SKILL.md +335 -259
  227. package/skills/autopsy/references/repo-analysis-patterns.md +113 -0
  228. package/skills/ba/SKILL.md +72 -2
  229. package/skills/brainstorm/SKILL.md +342 -341
  230. package/skills/browser-pilot/SKILL.md +168 -168
  231. package/skills/constraint-check/SKILL.md +165 -165
  232. package/skills/context-engine/SKILL.md +404 -404
  233. package/skills/cook/SKILL.md +917 -834
  234. package/skills/cook/references/output-format.md +33 -0
  235. package/skills/db/SKILL.md +273 -272
  236. package/skills/debug/SKILL.md +465 -443
  237. package/skills/dependency-doctor/SKILL.md +265 -235
  238. package/skills/deploy/SKILL.md +274 -231
  239. package/skills/design/DESIGN-REFERENCE.md +365 -365
  240. package/skills/design/SKILL.md +589 -482
  241. package/skills/doc-processor/SKILL.md +254 -254
  242. package/skills/docs/SKILL.md +374 -373
  243. package/skills/docs-seeker/SKILL.md +177 -177
  244. package/skills/fix/SKILL.md +330 -308
  245. package/skills/git/SKILL.md +339 -339
  246. package/skills/graft/SKILL.md +352 -0
  247. package/skills/graft/references/challenge-framework.md +98 -0
  248. package/skills/graft/references/mode-decision.md +44 -0
  249. package/skills/hallucination-guard/SKILL.md +219 -219
  250. package/skills/incident/SKILL.md +254 -251
  251. package/skills/integrity-check/SKILL.md +169 -169
  252. package/skills/journal/SKILL.md +240 -238
  253. package/skills/launch/SKILL.md +344 -342
  254. package/skills/logic-guardian/SKILL.md +251 -251
  255. package/skills/marketing/SKILL.md +290 -245
  256. package/skills/mcp-builder/SKILL.md +425 -423
  257. package/skills/mcp-builder/references/auto-discovery-pattern.md +169 -0
  258. package/skills/neural-memory/SKILL.md +362 -362
  259. package/skills/onboard/SKILL.md +404 -403
  260. package/skills/perf/SKILL.md +346 -346
  261. package/skills/plan/SKILL.md +433 -370
  262. package/skills/plan/references/feature-map.md +84 -0
  263. package/skills/preflight/SKILL.md +415 -396
  264. package/skills/problem-solver/SKILL.md +380 -284
  265. package/skills/rescue/SKILL.md +474 -450
  266. package/skills/retro/SKILL.md +5 -1
  267. package/skills/review/SKILL.md +612 -535
  268. package/skills/review-intake/SKILL.md +249 -249
  269. package/skills/safeguard/SKILL.md +200 -200
  270. package/skills/sast/SKILL.md +190 -190
  271. package/skills/scaffold/SKILL.md +328 -286
  272. package/skills/scope-guard/SKILL.md +180 -162
  273. package/skills/scout/SKILL.md +263 -263
  274. package/skills/sentinel/SKILL.md +382 -353
  275. package/skills/sentinel-env/SKILL.md +254 -254
  276. package/skills/sequential-thinking/SKILL.md +234 -234
  277. package/skills/session-bridge/SKILL.md +543 -397
  278. package/skills/skill-forge/SKILL.md +581 -539
  279. package/skills/skill-router/{skill.md → SKILL.md} +30 -2
  280. package/skills/surgeon/SKILL.md +215 -215
  281. package/skills/team/SKILL.md +556 -514
  282. package/skills/test/SKILL.md +614 -587
  283. package/skills/trend-scout/SKILL.md +145 -145
  284. package/skills/verification/SKILL.md +326 -325
  285. package/skills/video-creator/SKILL.md +201 -201
  286. package/skills/watchdog/SKILL.md +168 -168
  287. package/skills/worktree/SKILL.md +140 -140
@@ -1,397 +1,543 @@
1
- ---
2
- name: session-bridge
3
- description: Universal context persistence across sessions. Auto-saves decisions, conventions, and progress to .rune/ files. Loads state at session start. Use when any skill makes architectural decisions or establishes patterns that must survive session boundaries.
4
- metadata:
5
- author: runedev
6
- version: "0.5.0"
7
- layer: L3
8
- model: haiku
9
- group: state
10
- tools: "Read, Write, Edit, Glob, Grep"
11
- listen: phase.complete
12
- ---
13
-
14
- # session-bridge
15
-
16
- ## Purpose
17
-
18
- Solve the #1 developer complaint: context loss across sessions. Session-bridge auto-saves critical context to `.rune/` files in the project directory, and loads them at session start. Every new session knows exactly where the last one left off.
19
-
20
- ## Triggers
21
-
22
- - Auto-trigger: when an architectural decision is made
23
- - Auto-trigger: when a convention/pattern is established
24
- - Auto-trigger: before context compaction
25
- - Auto-trigger: at session end (stop hook)
26
- - `/rune status` — manual state check
27
-
28
- ## Calls (outbound)
29
-
30
- # Exception: L3→L3 coordination (same pattern as hallucination-guard → research)
31
- - `integrity-check` (L3): verify .rune/ file integrity before loading state
32
-
33
- ## Called By (inbound)
34
-
35
- - `cook` (L1): auto-save decisions during feature implementation
36
- - `rescue` (L1): state management throughout refactoring
37
- - `context-engine` (L3): save state before compaction
38
-
39
- ## State Files Managed
40
-
41
- ```
42
- .rune/
43
- ├── decisions.md — Architectural decisions log
44
- ├── conventions.md — Established patterns & style
45
- ├── progress.md Task progress tracker
46
- ├── session-log.md Brief log of each session
47
- ├── instincts.md Learned project-specific patterns (trigger→action)
48
- └── cumulative-notes.md Living project understanding (profile, themes, relationships)
49
- ```
50
-
51
- ## Execution
52
-
53
- ### Save Mode (end of session or pre-compaction)
54
-
55
- #### Step 1 — Gather state
56
-
57
- Collect from the current session:
58
- - All architectural or technology choices made (language, library, approach)
59
- - Conventions established (naming patterns, file structure, coding style)
60
- - Tasks completed, in-progress, and blocked
61
- - A one-paragraph summary of what this session accomplished
62
-
63
- **Python project context** (if `pyproject.toml` or `setup.py` detected):
64
- - Python version (from `.python-version`, `pyproject.toml` `requires-python`, or `python --version`)
65
- - Virtual environment path and type (venv, poetry, uv, conda)
66
- - Installed optional dependency groups (e.g., `[dev]`, `[test]`, `[embeddings]`)
67
- - Last mypy error count (from most recent verification run, if available)
68
- - Last test coverage percentage (from most recent test run, if available)
69
- - DB migration version (if alembic, django migrations, or similar detected)
70
-
71
- #### Step 2 Update .rune/decisions.md
72
-
73
- Use `Glob` to check if `.rune/decisions.md` exists. If not, use `Write` to create it with a `# Decisions Log` header.
74
-
75
- For each architectural decision from this session, use `Edit` to append to `.rune/decisions.md`:
76
-
77
- ```markdown
78
- ## [YYYY-MM-DD HH:MM] Decision: <title>
79
-
80
- **Context:** Why this decision was needed
81
- **Decision:** What was decided
82
- **Rationale:** Why this approach over alternatives
83
- **Impact:** What files/modules are affected
84
- ```
85
-
86
- #### Step 3 Update .rune/conventions.md
87
-
88
- Use `Glob` to check if `.rune/conventions.md` exists. If not, use `Write` to create it with a `# Conventions` header.
89
-
90
- For each pattern or convention established, use `Edit` to append to `.rune/conventions.md`:
91
-
92
- ```markdown
93
- ## [YYYY-MM-DD] Convention: <title>
94
-
95
- **Pattern:** Description of the convention
96
- **Example:** Code example showing the pattern
97
- **Applies to:** Where this convention should be followed
98
- ```
99
-
100
- Python example:
101
- ```markdown
102
- ## [YYYY-MM-DD] Convention: Async-First I/O
103
-
104
- **Pattern:** All I/O functions use `async def`; blocking calls (`requests`, `open`, `time.sleep`) are forbidden in async modules
105
- **Example:** `async def fetch_data(): async with httpx.AsyncClient() as client: ...`
106
- **Applies to:** All modules in `src/` — sync wrappers only in CLI entry points
107
- ```
108
-
109
- #### Step 4 Update .rune/progress.md
110
-
111
- Use `Glob` to check if `.rune/progress.md` exists. If not, use `Write` to create it with a `# Progress` header.
112
-
113
- Use `Edit` to append the current task status to `.rune/progress.md`:
114
-
115
- ```markdown
116
- ## [YYYY-MM-DD HH:MM] Session Summary
117
-
118
- **Completed:**
119
- - [x] Task description
120
-
121
- **In Progress:**
122
- - [ ] Task description (step X/Y)
123
-
124
- **Blocked:**
125
- - [ ] Task description — reason
126
-
127
- **Next Session Should:**
128
- - Start with X
129
- - Continue Y from step Z
130
-
131
- **Python Context** (if Python project):
132
- - Python: [version] ([venv type])
133
- - Installed extras: [list of optional dependency groups]
134
- - mypy: [error count] ([strict/normal])
135
- - Coverage: [percentage]%
136
- - Migration: [version or N/A]
137
- ```
138
-
139
- #### Step 5 — Update .rune/session-log.md
140
-
141
- Use `Glob` to check if `.rune/session-log.md` exists. If not, use `Write` to create it with a `# Session Log` header.
142
-
143
- Use `Edit` to append a one-line entry to `.rune/session-log.md`:
144
-
145
- ```
146
- [YYYY-MM-DD HH:MM] — [brief description of session accomplishments]
147
- ```
148
-
149
- #### Step 5.5 — Autonomous Loop Notes (when inside team or headless)
150
-
151
- When session-bridge is invoked by `cook` running inside `team` or in autonomous mode (`claude -p`), persist iteration state to `.rune/task-notes.md`:
152
-
153
- ```markdown
154
- # Task Notes: [task name]
155
- ## What Worked (with evidence)
156
- - [approach]: [outcome, test output, or file path as proof]
157
-
158
- ## What Failed
159
- - [approach]: [why it failed, error message]
160
-
161
- ## What's Left
162
- - [ ] [remaining task with specific next step]
163
-
164
- ## Key Context for Next Iteration
165
- - [critical info that would be lost on context reset]
166
- ```
167
-
168
- **Why**: In autonomous loops, each `claude -p` invocation starts with zero context. Without this file, the next iteration repeats failed approaches and loses progress. The notes bridge the gap between independent invocations.
169
-
170
- **Rules**: Agent reads `.rune/task-notes.md` at start (Step 1 of Load Mode), updates at end. Keep concise — max 50 lines. Prune completed items.
171
-
172
- #### Step 5.7 Instinct Extraction (Project-Scoped Learning)
173
-
174
- Extract atomic "instincts" learned trigger→action patterns from this session and persist to `.rune/instincts.md`. Instincts are project-scoped by default to prevent cross-project contamination.
175
-
176
- **Instinct format:**
177
-
178
- ```markdown
179
- ## [YYYY-MM-DD] Instinct: <short name>
180
-
181
- **Trigger:** <when this pattern applies — specific condition>
182
- **Action:** <what to do — specific behavior>
183
- **Confidence:** <0.3–0.9>
184
- **Evidence:** <what happened that taught this — file, error, outcome>
185
- ```
186
-
187
- **Extraction rules:**
188
-
189
- | Signal | Example | Confidence |
190
- |--------|---------|------------|
191
- | Repeated manual correction by user | "Don't use X, use Y here" (2+ times) | 0.7–0.9 |
192
- | Failed approach → successful pivot | Tried approach A, failed, approach B worked | 0.5–0.7 |
193
- | Project-specific convention discovered | "This codebase uses X pattern for Y" | 0.4–0.6 |
194
- | One-off preference (may not generalize) | User chose a specific library once | 0.3–0.4 |
195
-
196
- **Promotion to global**: When the same instinct (matching trigger+action) appears in `.rune/instincts.md` across 2+ projects at confidence ≥0.8, promote it to Neural Memory via Step 6 with tag `[cross-project, instinct]`. Until then, it stays project-local.
197
-
198
- **Pruning**: At session start (Load Mode Step 1), review instincts older than 30 days with confidence <0.5 — remove them. Instincts that conflict with current conventions should be removed immediately.
199
-
200
- **Max instincts**: Keep `.rune/instincts.md` under 20 entries. When full, evict the lowest-confidence entry.
201
-
202
- #### Step 5.9Cumulative Project Notes (Structured Memory)
203
-
204
- Maintain a running **cumulative notes** file at `.rune/cumulative-notes.md` that evolves across sessions. Unlike `progress.md` (which tracks tasks) or `decisions.md` (which logs choices), cumulative notes capture the **living understanding** of the project — patterns learned, relationships discovered, recurring themes, and open threads.
205
-
206
- **Format** use these fixed sections (add content, never remove prior entries):
207
-
208
- ```markdown
209
- # Cumulative Project Notes
210
-
211
- ## Project Profile
212
- - [Core purpose of the project — 1 sentence]
213
- - [Primary users/audience]
214
- - [Key technical constraints — e.g., "must run offline", "latency-critical", "multi-tenant"]
215
-
216
- ## Architecture Map
217
- - [Key modules and their responsibilities — discovered over sessions]
218
- - [Critical data flows e.g., "user input validation API → DB → cache invalidation"]
219
- - [Integration points external APIs, services, databases]
220
-
221
- ## Recurring Themes
222
- - [Patterns that keep coming up across sessions e.g., "auth edge cases", "migration complexity"]
223
- - [Common failure modes what breaks and why]
224
- - [Technical debt hotspotsareas that repeatedly cause issues]
225
-
226
- ## Active Topics
227
- - [What's currently being worked on updated each session]
228
- - [Open questions that haven't been resolved yet]
229
- - [Experiments in progress]
230
-
231
- ## Relationship Map
232
- - [Key files and their dependencies — "changing X requires updating Y"]
233
- - [People and their areas "Alice owns auth, Bob owns payments"]
234
- - [External service dependencies "Stripe webhook order.complete handler"]
235
-
236
- ## Follow-Up Items
237
- - [ ] [Things noted but not yet addressed — carry forward until done]
238
- - [ ] [Ideas that came up during work but were out of scope]
239
-
240
- ## Attention Points
241
- - [Things the next session should be aware of — fragile areas, pending PRs, deadlines]
242
- - [Temporary workarounds that need proper fixes]
243
- ```
244
-
245
- **Update rules:**
246
- - **Create** the file on first session-bridge save if it doesn't exist
247
- - **Append** to existing sections — never overwrite prior entries (they represent accumulated knowledge)
248
- - **Prune** entries older than 60 days in Recurring Themes and Relationship Map — these may be stale
249
- - **Move** completed Follow-Up Items to a `## Resolved` section at the bottom (keep last 10)
250
- - **Keep under 200 lines** — if approaching limit, summarize older entries in each section
251
-
252
- **Why**: Individual state files (decisions.md, progress.md) capture discrete events. Cumulative notes capture the **emergent understanding** that develops over many sessions the kind of knowledge that's lost when context resets. This is the project's "institutional memory."
253
-
254
- #### Step 6 — Cross-Project Knowledge Extraction (Neural Memory Bridge)
255
-
256
- Before committing, extract generalizable patterns from this session for cross-project reuse:
257
-
258
- 1. Review the session's decisions, conventions, and completed tasks
259
- 2. Identify 1-3 patterns that are NOT project-specific but would help in OTHER projects:
260
- - Technology choices with reasoning ("Chose Redis over Memcached because X")
261
- - Architecture patterns ("Fan-out queue pattern solved Y")
262
- - Failure modes discovered ("React 19 useEffect cleanup breaks when Z")
263
- - Performance insights ("N+1 query pattern in Prisma solved by include")
264
- 3. For each generalizable pattern, save to Neural Memory:
265
- - Use `nmem_remember` with rich cognitive language (causal, comparative, decisional)
266
- - Tags: `[cross-project, <technology>, <pattern-type>]`
267
- - Priority: 6-7 (important enough to surface in other projects)
268
- 4. Skip if session was purely project-specific (config changes, bug fixes with no transferable insight)
269
-
270
- **Why**: This turns every project session into learning that compounds across ALL projects. A pattern discovered in Project A auto-surfaces when Project B faces a similar problem.
271
-
272
- #### Step 7 — Commit
273
-
274
- Stage and commit all updated state files:
275
-
276
- ```bash
277
- git add .rune/ && git commit -m "chore: update rune session state"
278
- ```
279
-
280
- If git is not available or the directory is not a repo, skip the commit and emit a warning.
281
-
282
- ---
283
-
284
- ### Load Mode (start of session)
285
-
286
- #### Step 1 — Check existence
287
-
288
- Use `Glob` to check for `.rune/` directory:
289
-
290
- ```
291
- Glob pattern: .rune/*.md
292
- ```
293
-
294
- If no files found: suggest running `/rune onboard` to initialize the project. Exit load mode.
295
-
296
- #### Step 1.5Integrity verification
297
-
298
- Before loading state files, invoke `integrity-check` (L3) to verify `.rune/` files haven't been tampered:
299
-
300
- ```
301
- REQUIRED SUB-SKILL: rune:integrity-check
302
- Invoke integrity-check on all .rune/*.md files found in Step 1.
303
- → Capture: status (CLEAN | SUSPICIOUS | TAINTED), findings list.
304
- ```
305
-
306
- Handle results:
307
- - `CLEAN` proceed to Step 2 (load files)
308
- - `SUSPICIOUS` present warning to user with specific findings. Ask: "Suspicious patterns detected in .rune/ files. Load anyway?" If user approves → proceed. If not → exit load mode.
309
- - `TAINTED` **BLOCK load**. Report: ".rune/ integrity check FAILED possible poisoning detected. Run `/rune integrity` for details."
310
-
311
- #### Step 2 Load files
312
-
313
- Use `Read` on all four state files in parallel:
314
-
315
- ```
316
- Read: .rune/decisions.md
317
- Read: .rune/conventions.md
318
- Read: .rune/progress.md
319
- Read: .rune/session-log.md
320
- Read: .rune/cumulative-notes.md
321
- ```
322
-
323
- #### Step 3 Summarize
324
-
325
- Present the loaded context to the agent in a structured summary:
326
-
327
- > "Here's what happened in previous sessions:"
328
- > - Last session: [last line from session-log.md]
329
- > - Key decisions: [last 3 entries from decisions.md]
330
- > - Active conventions: [count from conventions.md]
331
- > - Current progress: [in-progress and blocked items from progress.md]
332
- > - Project understanding: [Active Topics + Attention Points from cumulative-notes.md]
333
- > - Next task: [first item under "Next Session Should" from progress.md]
334
-
335
- #### Step 4 — Resume
336
-
337
- Identify the next concrete task from `progress.md` → "Next Session Should" section. Present it as the recommended starting point to the calling orchestrator.
338
-
339
- ## Output Format
340
-
341
- ### Save Mode
342
- ```
343
- ## Session Bridge — Saved
344
- - **decisions.md**: [N] decisions appended
345
- - **conventions.md**: [N] conventions appended
346
- - **progress.md**: updated (completed/in-progress/blocked counts)
347
- - **session-log.md**: 1 entry appended
348
- - **Git commit**: [hash] | skipped (no git)
349
- ```
350
-
351
- ### Load Mode
352
- ```
353
- ## Session Bridge Loaded
354
- - **Last session**: [date and summary]
355
- - **Decisions on file**: [count]
356
- - **Conventions on file**: [count]
357
- - **Next task**: [task description]
358
- ```
359
-
360
- ## Constraints
361
-
362
- 1. MUST save decisions, conventions, and progress — not just a status line
363
- 2. MUST verify saved context can be loaded in a fresh session — test the round-trip
364
- 3. MUST NOT overwrite existing bridge data without merging
365
-
366
- ## Sharp Edges
367
-
368
- Known failure modes for this skill. Check these before declaring done.
369
-
370
- | Failure Mode | Severity | Mitigation |
371
- |---|---|---|
372
- | Overwriting existing .rune/ files instead of appending | HIGH | Constraint 3: use Edit to append entries — never Write to overwrite existing state |
373
- | Saving only a status line, missing decisions/conventions | HIGH | Constraint 1: all three files (decisions, conventions, progress) must be updated |
374
- | Load mode presenting stale context without age marker | MEDIUM | Mark each loaded entry with its session date — caller knows how fresh it is |
375
- | Silent failure when git unavailable | MEDIUM | Note "no git available" in report — do not fail silently or skip without logging |
376
- | Loading poisoned .rune/ files without verification | CRITICAL | Step 1.5 integrity-check MUST run before loading — TAINTED = block load |
377
-
378
- ## Done When (Save Mode)
379
-
380
- - decisions.md updated with all architectural decisions made this session
381
- - conventions.md updated with all new patterns established
382
- - progress.md updated with completed/in-progress/blocked task status
383
- - session-log.md appended with one-line session summary
384
- - Git commit made (or "no git" noted in report)
385
- - Session Bridge Saved report emitted
386
-
387
- ## Done When (Load Mode)
388
-
389
- - .rune/*.md files found and read
390
- - Last session summary presented
391
- - Current in-progress and blocked tasks identified
392
- - Next task recommendation from progress.md
393
- - Session Bridge Loaded report emitted
394
-
395
- ## Cost Profile
396
-
397
- ~100-300 tokens per save. ~500-1000 tokens per load. Always haiku. Negligible cost.
1
+ ---
2
+ name: session-bridge
3
+ description: Universal context persistence across sessions. Auto-saves decisions, conventions, and progress to .rune/ files. Loads state at session start. Use when any skill makes architectural decisions or establishes patterns that must survive session boundaries.
4
+ metadata:
5
+ author: runedev
6
+ version: "0.6.0"
7
+ layer: L3
8
+ model: haiku
9
+ group: state
10
+ tools: "Read, Write, Edit, Glob, Grep"
11
+ listen: phase.complete, checkpoint.request
12
+ ---
13
+
14
+ # session-bridge
15
+
16
+ ## Purpose
17
+
18
+ Solve the #1 developer complaint: context loss across sessions. Session-bridge auto-saves critical context to `.rune/` files in the project directory, and loads them at session start. Every new session knows exactly where the last one left off.
19
+
20
+ ## Triggers
21
+
22
+ - Auto-trigger: when an architectural decision is made
23
+ - Auto-trigger: when a convention/pattern is established
24
+ - Auto-trigger: before context compaction
25
+ - Auto-trigger: at session end (stop hook)
26
+ - Signal: `checkpoint.request`explicit checkpoint from cook/team mid-phase
27
+ - `/checkpoint` — manual checkpoint (save exact resume point)
28
+ - `/rune status` — manual state check
29
+
30
+ ## Calls (outbound)
31
+
32
+ # Exception: L3→L3 coordination (same pattern as hallucination-guard → research)
33
+ - `integrity-check` (L3): verify .rune/ file integrity before loading state
34
+
35
+ ## Called By (inbound)
36
+
37
+ - `cook` (L1): auto-save decisions during feature implementation
38
+ - `rescue` (L1): state management throughout refactoring
39
+ - `context-engine` (L3): save state before compaction
40
+
41
+ ## State Files Managed
42
+
43
+ ```
44
+ .rune/
45
+ ├── decisions.md Architectural decisions log
46
+ ├── conventions.md Established patterns & style
47
+ ├── progress.md Task progress tracker
48
+ ├── session-log.md Brief log of each session
49
+ ├── instincts.md — Learned project-specific patterns (trigger→action)
50
+ ├── cumulative-notes.md — Living project understanding (profile, themes, relationships)
51
+ ├── learnings.jsonl — Structured learning log (append-only, queryable)
52
+ └── checkpoint.md — Exact resume point for cross-session continuity
53
+ ```
54
+
55
+ ## Execution
56
+
57
+ ### Save Mode (end of session or pre-compaction)
58
+
59
+ #### Step 1 Gather state
60
+
61
+ Collect from the current session:
62
+ - All architectural or technology choices made (language, library, approach)
63
+ - Conventions established (naming patterns, file structure, coding style)
64
+ - Tasks completed, in-progress, and blocked
65
+ - A one-paragraph summary of what this session accomplished
66
+
67
+ **Python project context** (if `pyproject.toml` or `setup.py` detected):
68
+ - Python version (from `.python-version`, `pyproject.toml` `requires-python`, or `python --version`)
69
+ - Virtual environment path and type (venv, poetry, uv, conda)
70
+ - Installed optional dependency groups (e.g., `[dev]`, `[test]`, `[embeddings]`)
71
+ - Last mypy error count (from most recent verification run, if available)
72
+ - Last test coverage percentage (from most recent test run, if available)
73
+ - DB migration version (if alembic, django migrations, or similar detected)
74
+
75
+ #### Step 2 Update .rune/decisions.md
76
+
77
+ Use `Glob` to check if `.rune/decisions.md` exists. If not, use `Write` to create it with a `# Decisions Log` header.
78
+
79
+ For each architectural decision from this session, use `Edit` to append to `.rune/decisions.md`:
80
+
81
+ ```markdown
82
+ ## [YYYY-MM-DD HH:MM] Decision: <title>
83
+
84
+ **Context:** Why this decision was needed
85
+ **Decision:** What was decided
86
+ **Rationale:** Why this approach over alternatives
87
+ **Impact:** What files/modules are affected
88
+ ```
89
+
90
+ #### Step 3 Update .rune/conventions.md
91
+
92
+ Use `Glob` to check if `.rune/conventions.md` exists. If not, use `Write` to create it with a `# Conventions` header.
93
+
94
+ For each pattern or convention established, use `Edit` to append to `.rune/conventions.md`:
95
+
96
+ ```markdown
97
+ ## [YYYY-MM-DD] Convention: <title>
98
+
99
+ **Pattern:** Description of the convention
100
+ **Example:** Code example showing the pattern
101
+ **Applies to:** Where this convention should be followed
102
+ ```
103
+
104
+ Python example:
105
+ ```markdown
106
+ ## [YYYY-MM-DD] Convention: Async-First I/O
107
+
108
+ **Pattern:** All I/O functions use `async def`; blocking calls (`requests`, `open`, `time.sleep`) are forbidden in async modules
109
+ **Example:** `async def fetch_data(): async with httpx.AsyncClient() as client: ...`
110
+ **Applies to:** All modules in `src/` — sync wrappers only in CLI entry points
111
+ ```
112
+
113
+ #### Step 4 Update .rune/progress.md
114
+
115
+ Use `Glob` to check if `.rune/progress.md` exists. If not, use `Write` to create it with a `# Progress` header.
116
+
117
+ Use `Edit` to append the current task status to `.rune/progress.md`:
118
+
119
+ ```markdown
120
+ ## [YYYY-MM-DD HH:MM] Session Summary
121
+
122
+ **Completed:**
123
+ - [x] Task description
124
+
125
+ **In Progress:**
126
+ - [ ] Task description (step X/Y)
127
+
128
+ **Blocked:**
129
+ - [ ] Task description — reason
130
+
131
+ **Next Session Should:**
132
+ - Start with X
133
+ - Continue Y from step Z
134
+
135
+ **Python Context** (if Python project):
136
+ - Python: [version] ([venv type])
137
+ - Installed extras: [list of optional dependency groups]
138
+ - mypy: [error count] ([strict/normal])
139
+ - Coverage: [percentage]%
140
+ - Migration: [version or N/A]
141
+ ```
142
+
143
+ #### Step 5 Update .rune/session-log.md
144
+
145
+ Use `Glob` to check if `.rune/session-log.md` exists. If not, use `Write` to create it with a `# Session Log` header.
146
+
147
+ Use `Edit` to append a one-line entry to `.rune/session-log.md`:
148
+
149
+ ```
150
+ [YYYY-MM-DD HH:MM] — [brief description of session accomplishments]
151
+ ```
152
+
153
+ #### Step 5.5 — Autonomous Loop Notes (when inside team or headless)
154
+
155
+ When session-bridge is invoked by `cook` running inside `team` or in autonomous mode (`claude -p`), persist iteration state to `.rune/task-notes.md`:
156
+
157
+ ```markdown
158
+ # Task Notes: [task name]
159
+ ## What Worked (with evidence)
160
+ - [approach]: [outcome, test output, or file path as proof]
161
+
162
+ ## What Failed
163
+ - [approach]: [why it failed, error message]
164
+
165
+ ## What's Left
166
+ - [ ] [remaining task with specific next step]
167
+
168
+ ## Key Context for Next Iteration
169
+ - [critical info that would be lost on context reset]
170
+ ```
171
+
172
+ **Why**: In autonomous loops, each `claude -p` invocation starts with zero context. Without this file, the next iteration repeats failed approaches and loses progress. The notes bridge the gap between independent invocations.
173
+
174
+ **Rules**: Agent reads `.rune/task-notes.md` at start (Step 1 of Load Mode), updates at end. Keep concise max 50 lines. Prune completed items.
175
+
176
+ #### Step 5.7 — Instinct Extraction (Project-Scoped Learning)
177
+
178
+ Extract atomic "instincts" — learned trigger→action patterns — from this session and persist to `.rune/instincts.md`. Instincts are project-scoped by default to prevent cross-project contamination.
179
+
180
+ **Instinct format:**
181
+
182
+ ```markdown
183
+ ## [YYYY-MM-DD] Instinct: <short name>
184
+
185
+ **Trigger:** <when this pattern applies — specific condition>
186
+ **Action:** <what to do — specific behavior>
187
+ **Confidence:** <0.3–0.9>
188
+ **Evidence:** <what happened that taught this — file, error, outcome>
189
+ ```
190
+
191
+ **Extraction rules:**
192
+
193
+ | Signal | Example | Confidence |
194
+ |--------|---------|------------|
195
+ | Repeated manual correction by user | "Don't use X, use Y here" (2+ times) | 0.7–0.9 |
196
+ | Failed approach successful pivot | Tried approach A, failed, approach B worked | 0.5–0.7 |
197
+ | Project-specific convention discovered | "This codebase uses X pattern for Y" | 0.4–0.6 |
198
+ | One-off preference (may not generalize) | User chose a specific library once | 0.3–0.4 |
199
+
200
+ **Promotion to global**: When the same instinct (matching trigger+action) appears in `.rune/instincts.md` across 2+ projects at confidence ≥0.8, promote it to Neural Memory via Step 6 with tag `[cross-project, instinct]`. Until then, it stays project-local.
201
+
202
+ **Pruning**: At session start (Load Mode Step 1), review instincts older than 30 days with confidence <0.5 — remove them. Instincts that conflict with current conventions should be removed immediately.
203
+
204
+ **Max instincts**: Keep `.rune/instincts.md` under 20 entries. When full, evict the lowest-confidence entry.
205
+
206
+ #### Step 5.8 Learnings Log (Structured JSONL)
207
+
208
+ Append structured learning entries to `.rune/learnings.jsonl` — an append-only log that captures decisions, insights, and error resolutions in a machine-queryable format. Unlike markdown state files (which are for human reading), JSONL enables fast filtering and "latest winner" lookups.
209
+
210
+ **Entry schema** — one JSON object per line:
211
+
212
+ ```json
213
+ {"ts":"2026-04-04T14:30:00Z","skill":"cook","type":"decision","key":"state-lib","insight":"Chose Zustand over Redux — fewer re-renders in dashboard with 50+ real-time widgets","confidence":0.8,"files":["src/store/index.ts"]}
214
+ ```
215
+
216
+ | Field | Type | Description |
217
+ |-------|------|-------------|
218
+ | `ts` | ISO 8601 | When the learning was captured |
219
+ | `skill` | string | Which skill produced this learning |
220
+ | `type` | enum | `decision` · `error` · `insight` · `convention` · `performance` |
221
+ | `key` | string | Dedup key — latest entry per key+type wins on read |
222
+ | `insight` | string | 1-2 sentences, causal language ("Chose X because Y", "Root cause was X") |
223
+ | `confidence` | 0.1–1.0 | How certain this learning is (0.3=hunch, 0.7=validated, 0.9=battle-tested) |
224
+ | `files` | string[] | Optionalaffected file paths |
225
+
226
+ **Write rules:**
227
+ - Append only never edit or delete lines in the JSONL file
228
+ - Max 1-3 entries per session (only genuinely transferable learnings)
229
+ - Use causal/comparative language, not flat facts
230
+ - Key must be kebab-case, descriptive (e.g., `auth-lib`, `db-migration-strategy`, `react-hook-pitfall`)
231
+
232
+ **Read rules (latest-winner):**
233
+ - When loading learnings, group by `key+type` and take the entry with the latest `ts`
234
+ - This means updating a learning = just append a new entry with the same key+type
235
+ - No dedup needed on write — dedup happens on read
236
+
237
+ **Query patterns** (for other skills or session-start):
238
+ - All learnings: read `.rune/learnings.jsonl`, parse line-by-line
239
+ - By type: filter `type === "error"` to surface past mistakes before coding
240
+ - By skill: filter `skill === "cook"` to see cook-specific learnings
241
+ - By recency: sort by `ts` descending, take top N
242
+ - Surface top 5 learnings at session start if file has 10+ entries
243
+
244
+ **Pruning**: When file exceeds 100 entries, compact by keeping only the latest-winner per key+type. Write compacted entries to a new file, replace original.
245
+
246
+ **Why**: Markdown state files (decisions.md, conventions.md) are great for human reading but hard to query programmatically. JSONL enables structured recall — "show me all errors from last week" or "what did we decide about auth?" — without parsing markdown headers.
247
+
248
+ #### Step 5.9 Cumulative Project Notes (Structured Memory)
249
+
250
+ Maintain a running **cumulative notes** file at `.rune/cumulative-notes.md` that evolves across sessions. Unlike `progress.md` (which tracks tasks) or `decisions.md` (which logs choices), cumulative notes capture the **living understanding** of the project patterns learned, relationships discovered, recurring themes, and open threads.
251
+
252
+ **Format** — use these fixed sections (add content, never remove prior entries):
253
+
254
+ ```markdown
255
+ # Cumulative Project Notes
256
+
257
+ ## Project Profile
258
+ - [Core purpose of the project 1 sentence]
259
+ - [Primary users/audience]
260
+ - [Key technical constraints e.g., "must run offline", "latency-critical", "multi-tenant"]
261
+
262
+ ## Architecture Map
263
+ - [Key modules and their responsibilities discovered over sessions]
264
+ - [Critical data flows — e.g., "user input validation API DB → cache invalidation"]
265
+ - [Integration points external APIs, services, databases]
266
+
267
+ ## Recurring Themes
268
+ - [Patterns that keep coming up across sessions e.g., "auth edge cases", "migration complexity"]
269
+ - [Common failure modes — what breaks and why]
270
+ - [Technical debt hotspots areas that repeatedly cause issues]
271
+
272
+ ## Active Topics
273
+ - [What's currently being worked on — updated each session]
274
+ - [Open questions that haven't been resolved yet]
275
+ - [Experiments in progress]
276
+
277
+ ## Relationship Map
278
+ - [Key files and their dependencies — "changing X requires updating Y"]
279
+ - [People and their areas — "Alice owns auth, Bob owns payments"]
280
+ - [External service dependencies "Stripe webhook order.complete handler"]
281
+
282
+ ## Follow-Up Items
283
+ - [ ] [Things noted but not yet addressed — carry forward until done]
284
+ - [ ] [Ideas that came up during work but were out of scope]
285
+
286
+ ## Attention Points
287
+ - [Things the next session should be aware of — fragile areas, pending PRs, deadlines]
288
+ - [Temporary workarounds that need proper fixes]
289
+ ```
290
+
291
+ **Update rules:**
292
+ - **Create** the file on first session-bridge save if it doesn't exist
293
+ - **Append** to existing sections — never overwrite prior entries (they represent accumulated knowledge)
294
+ - **Prune** entries older than 60 days in Recurring Themes and Relationship Map these may be stale
295
+ - **Move** completed Follow-Up Items to a `## Resolved` section at the bottom (keep last 10)
296
+ - **Keep under 200 lines** if approaching limit, summarize older entries in each section
297
+
298
+ **Why**: Individual state files (decisions.md, progress.md) capture discrete events. Cumulative notes capture the **emergent understanding** that develops over many sessions — the kind of knowledge that's lost when context resets. This is the project's "institutional memory."
299
+
300
+ #### Step 6 — Cross-Project Knowledge Extraction (Neural Memory Bridge)
301
+
302
+ Before committing, extract generalizable patterns from this session for cross-project reuse:
303
+
304
+ 1. Review the session's decisions, conventions, and completed tasks
305
+ 2. Identify 1-3 patterns that are NOT project-specific but would help in OTHER projects:
306
+ - Technology choices with reasoning ("Chose Redis over Memcached because X")
307
+ - Architecture patterns ("Fan-out queue pattern solved Y")
308
+ - Failure modes discovered ("React 19 useEffect cleanup breaks when Z")
309
+ - Performance insights ("N+1 query pattern in Prisma solved by include")
310
+ 3. For each generalizable pattern, save to Neural Memory:
311
+ - Use `nmem_remember` with rich cognitive language (causal, comparative, decisional)
312
+ - Tags: `[cross-project, <technology>, <pattern-type>]`
313
+ - Priority: 6-7 (important enough to surface in other projects)
314
+ 4. Skip if session was purely project-specific (config changes, bug fixes with no transferable insight)
315
+
316
+ **Why**: This turns every project session into learning that compounds across ALL projects. A pattern discovered in Project A auto-surfaces when Project B faces a similar problem.
317
+
318
+ #### Step 7 — Commit
319
+
320
+ Stage and commit all updated state files:
321
+
322
+ ```bash
323
+ git add .rune/ && git commit -m "chore: update rune session state"
324
+ ```
325
+
326
+ If git is not available or the directory is not a repo, skip the commit and emit a warning.
327
+
328
+ ---
329
+
330
+ ### Load Mode (start of session)
331
+
332
+ #### Step 1 Check existence
333
+
334
+ Use `Glob` to check for `.rune/` directory:
335
+
336
+ ```
337
+ Glob pattern: .rune/*.md
338
+ ```
339
+
340
+ If no files found: suggest running `/rune onboard` to initialize the project. Exit load mode.
341
+
342
+ #### Step 1.5 — Integrity verification
343
+
344
+ Before loading state files, invoke `integrity-check` (L3) to verify `.rune/` files haven't been tampered:
345
+
346
+ ```
347
+ REQUIRED SUB-SKILL: rune:integrity-check
348
+ → Invoke integrity-check on all .rune/*.md files found in Step 1.
349
+ → Capture: status (CLEAN | SUSPICIOUS | TAINTED), findings list.
350
+ ```
351
+
352
+ Handle results:
353
+ - `CLEAN` proceed to Step 2 (load files)
354
+ - `SUSPICIOUS` present warning to user with specific findings. Ask: "Suspicious patterns detected in .rune/ files. Load anyway?" If user approves → proceed. If not → exit load mode.
355
+ - `TAINTED` → **BLOCK load**. Report: ".rune/ integrity check FAILED — possible poisoning detected. Run `/rune integrity` for details."
356
+
357
+ #### Step 2 Load files
358
+
359
+ Use `Read` on all four state files in parallel:
360
+
361
+ ```
362
+ Read: .rune/decisions.md
363
+ Read: .rune/conventions.md
364
+ Read: .rune/progress.md
365
+ Read: .rune/session-log.md
366
+ Read: .rune/cumulative-notes.md
367
+ ```
368
+
369
+ #### Step 3 — Summarize
370
+
371
+ Present the loaded context to the agent in a structured summary:
372
+
373
+ > "Here's what happened in previous sessions:"
374
+ > - Last session: [last line from session-log.md]
375
+ > - Key decisions: [last 3 entries from decisions.md]
376
+ > - Active conventions: [count from conventions.md]
377
+ > - Current progress: [in-progress and blocked items from progress.md]
378
+ > - Project understanding: [Active Topics + Attention Points from cumulative-notes.md]
379
+ > - Next task: [first item under "Next Session Should" from progress.md]
380
+
381
+ #### Step 4 Resume
382
+
383
+ Identify the next concrete task from `progress.md` "Next Session Should" section. Present it as the recommended starting point to the calling orchestrator.
384
+
385
+ ### Checkpoint Mode (explicit save-and-resume point)
386
+
387
+ Unlike Save Mode (which captures session state broadly), Checkpoint Mode creates an **exact resume point** — a single file that tells the next session precisely where to pick up, what's in-flight, and what decisions are load-bearing.
388
+
389
+ **Trigger**: User says `/checkpoint`, or `cook`/`team` emits `checkpoint.request` signal when pausing mid-phase.
390
+
391
+ #### Step 1 Capture resume state
392
+
393
+ Collect into a structured checkpoint:
394
+
395
+ ```markdown
396
+ # Checkpoint — [YYYY-MM-DD HH:MM]
397
+
398
+ ## What I Was Doing
399
+ [1-2 sentences: the exact task and sub-step in progress]
400
+
401
+ ## Current Git State
402
+ - Branch: [branch name]
403
+ - Last commit: [short hash + message]
404
+ - Uncommitted changes: [list of modified/untracked files, or "clean"]
405
+ - Stashed: [yes/no — if yes, stash message]
406
+
407
+ ## Decisions Made This Session (Load-Bearing)
408
+ [Only decisions that affect the remaining work — not all decisions]
409
+ - [Decision 1]: [choice + why]
410
+ - [Decision 2]: [choice + why]
411
+
412
+ ## What's Left (Ordered)
413
+ 1. [Next immediate step — be specific: file, function, what to change]
414
+ 2. [Step after that]
415
+ 3. [Remaining steps...]
416
+
417
+ ## Context the Next Session Needs
418
+ [Critical info that's NOT in the code or git history — mental model, gotchas discovered, things tried and failed]
419
+ - [Item 1]
420
+ - [Item 2]
421
+
422
+ ## Resume Command
423
+ [Exact instruction for the next session to pick up — e.g., "Continue Phase 2 Task 3: implement the retry logic in src/api/client.ts, the happy path is done, need error handling"]
424
+ ```
425
+
426
+ #### Step 2 — Write checkpoint file
427
+
428
+ Write to `.rune/checkpoint.md` (overwrite — only one active checkpoint at a time).
429
+
430
+ #### Step 3 — Confirm to user
431
+
432
+ ```
433
+ ## Checkpoint Saved
434
+ - **Resume point**: [1-line summary of what to continue]
435
+ - **Git state**: [branch] @ [commit hash] — [clean/N uncommitted files]
436
+ - **Remaining tasks**: [count]
437
+ - Next session will auto-detect this checkpoint and offer to resume.
438
+ ```
439
+
440
+ #### Checkpoint Resume (in Load Mode)
441
+
442
+ At Load Mode Step 1, after checking `.rune/*.md` existence, also check for `.rune/checkpoint.md`:
443
+
444
+ - If checkpoint exists, read it FIRST (before other state files)
445
+ - Present the resume point prominently:
446
+ ```
447
+ ## Checkpoint Detected — [date]
448
+ **Resume**: [Resume Command from checkpoint]
449
+ **Git state**: [branch] @ [commit] — [clean/dirty]
450
+ **Tasks remaining**: [count]
451
+ ```
452
+ - After successful resume (user confirms they've picked up where they left off), rename checkpoint:
453
+ ```bash
454
+ mv .rune/checkpoint.md .rune/checkpoint-[date].resolved.md
455
+ ```
456
+ - Keep last 3 resolved checkpoints for history, delete older ones
457
+
458
+ **Why**: Save Mode captures everything broadly. Checkpoint captures the **exact needle position** — like a bookmark in a book vs. a summary of chapters read. The next session doesn't need to scan all state files to figure out what to do; the checkpoint tells it directly.
459
+
460
+ ## Output Format
461
+
462
+ ### Save Mode
463
+ ```
464
+ ## Session Bridge — Saved
465
+ - **decisions.md**: [N] decisions appended
466
+ - **conventions.md**: [N] conventions appended
467
+ - **progress.md**: updated (completed/in-progress/blocked counts)
468
+ - **session-log.md**: 1 entry appended
469
+ - **Git commit**: [hash] | skipped (no git)
470
+ ```
471
+
472
+ ### Load Mode
473
+ ```
474
+ ## Session Bridge — Loaded
475
+ - **Last session**: [date and summary]
476
+ - **Checkpoint**: [detected — resume point] | [none]
477
+ - **Decisions on file**: [count]
478
+ - **Conventions on file**: [count]
479
+ - **Learnings on file**: [count] (top 5 surfaced if 10+)
480
+ - **Next task**: [task description]
481
+ ```
482
+
483
+ ### Checkpoint Mode
484
+ ```
485
+ ## Checkpoint Saved
486
+ - **Resume point**: [1-line summary]
487
+ - **Git state**: [branch] @ [hash] — [clean/N files]
488
+ - **Remaining tasks**: [count]
489
+ ```
490
+
491
+ ## Constraints
492
+
493
+ 1. MUST save decisions, conventions, and progress — not just a status line
494
+ 2. MUST verify saved context can be loaded in a fresh session — test the round-trip
495
+ 3. MUST NOT overwrite existing bridge data without merging
496
+
497
+ ## Sharp Edges
498
+
499
+ Known failure modes for this skill. Check these before declaring done.
500
+
501
+ | Failure Mode | Severity | Mitigation |
502
+ |---|---|---|
503
+ | Overwriting existing .rune/ files instead of appending | HIGH | Constraint 3: use Edit to append entries — never Write to overwrite existing state |
504
+ | Saving only a status line, missing decisions/conventions | HIGH | Constraint 1: all three files (decisions, conventions, progress) must be updated |
505
+ | Load mode presenting stale context without age marker | MEDIUM | Mark each loaded entry with its session date — caller knows how fresh it is |
506
+ | Silent failure when git unavailable | MEDIUM | Note "no git available" in report — do not fail silently or skip without logging |
507
+ | Loading poisoned .rune/ files without verification | CRITICAL | Step 1.5 integrity-check MUST run before loading — TAINTED = block load |
508
+ | Learnings JSONL grows unbounded | MEDIUM | Auto-compact at 100 entries — keep only latest-winner per key+type |
509
+ | Checkpoint stale after code changes | MEDIUM | Checkpoint includes git state — if branch/commit differ at resume, warn user that checkpoint may be outdated |
510
+ | Multiple checkpoints overwrite each other | LOW | By design — only one active checkpoint. Resolved ones archived with date suffix |
511
+
512
+ ## Done When (Save Mode)
513
+
514
+ - decisions.md updated with all architectural decisions made this session
515
+ - conventions.md updated with all new patterns established
516
+ - progress.md updated with completed/in-progress/blocked task status
517
+ - session-log.md appended with one-line session summary
518
+ - learnings.jsonl appended with 1-3 structured entries (if transferable learnings exist)
519
+ - Git commit made (or "no git" noted in report)
520
+ - Session Bridge Saved report emitted
521
+
522
+ ## Done When (Load Mode)
523
+
524
+ - .rune/*.md files found and read
525
+ - Checkpoint detected and presented (if exists)
526
+ - Learnings surfaced (top 5 if 10+ entries)
527
+ - Last session summary presented
528
+ - Current in-progress and blocked tasks identified
529
+ - Next task recommendation from progress.md (or checkpoint resume command)
530
+ - Session Bridge Loaded report emitted
531
+
532
+ ## Done When (Checkpoint Mode)
533
+
534
+ - Git state captured (branch, commit, uncommitted files)
535
+ - Load-bearing decisions documented
536
+ - Remaining tasks listed in execution order
537
+ - Resume command written (specific enough for a fresh session to act on)
538
+ - checkpoint.md written to .rune/
539
+ - Checkpoint Saved report emitted
540
+
541
+ ## Cost Profile
542
+
543
+ ~100-300 tokens per save. ~500-1000 tokens per load. Always haiku. Negligible cost.