lifeos 1.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 (216) hide show
  1. package/LICENSE +21 -0
  2. package/README.en.md +202 -0
  3. package/README.md +202 -0
  4. package/assets/lifeos-rules.en.md +162 -0
  5. package/assets/lifeos-rules.zh.md +162 -0
  6. package/assets/lifeos.yaml +56 -0
  7. package/assets/prompts/AI_LLMResearch_Prompt.en.md +120 -0
  8. package/assets/prompts/AI_LLMResearch_Prompt.zh.md +120 -0
  9. package/assets/prompts/Art_ChinesePainting_Prompt.en.md +147 -0
  10. package/assets/prompts/Art_ChinesePainting_Prompt.zh.md +148 -0
  11. package/assets/prompts/Cryptography_Prompt.en.md +148 -0
  12. package/assets/prompts/Cryptography_Prompt.zh.md +147 -0
  13. package/assets/prompts/History_ChineseCulture_Prompt.en.md +98 -0
  14. package/assets/prompts/History_ChineseCulture_Prompt.zh.md +98 -0
  15. package/assets/prompts/Math_HigherMathematics_Prompt.en.md +117 -0
  16. package/assets/prompts/Math_HigherMathematics_Prompt.zh.md +116 -0
  17. package/assets/schema/Frontmatter_Schema.md +139 -0
  18. package/assets/skills/_shared/completion-report.en.md +30 -0
  19. package/assets/skills/_shared/completion-report.zh.md +30 -0
  20. package/assets/skills/_shared/dual-agent-orchestrator.en.md +40 -0
  21. package/assets/skills/_shared/dual-agent-orchestrator.zh.md +40 -0
  22. package/assets/skills/_shared/learning-lifecycle.en.md +53 -0
  23. package/assets/skills/_shared/learning-lifecycle.zh.md +53 -0
  24. package/assets/skills/_shared/lifecycle.en.md +84 -0
  25. package/assets/skills/_shared/lifecycle.zh.md +84 -0
  26. package/assets/skills/_shared/memory-protocol.en.md +36 -0
  27. package/assets/skills/_shared/memory-protocol.zh.md +36 -0
  28. package/assets/skills/_shared/template-loading.en.md +26 -0
  29. package/assets/skills/_shared/template-loading.zh.md +26 -0
  30. package/assets/skills/archive/SKILL.en.md +300 -0
  31. package/assets/skills/archive/SKILL.zh.md +300 -0
  32. package/assets/skills/ask/SKILL.en.md +164 -0
  33. package/assets/skills/ask/SKILL.zh.md +164 -0
  34. package/assets/skills/brainstorm/SKILL.en.md +242 -0
  35. package/assets/skills/brainstorm/SKILL.zh.md +242 -0
  36. package/assets/skills/brainstorm/references/action-options.en.md +65 -0
  37. package/assets/skills/brainstorm/references/action-options.zh.md +65 -0
  38. package/assets/skills/knowledge/SKILL.en.md +202 -0
  39. package/assets/skills/knowledge/SKILL.zh.md +202 -0
  40. package/assets/skills/project/SKILL.en.md +133 -0
  41. package/assets/skills/project/SKILL.zh.md +133 -0
  42. package/assets/skills/project/references/execution-agent-prompt.en.md +148 -0
  43. package/assets/skills/project/references/execution-agent-prompt.zh.md +148 -0
  44. package/assets/skills/project/references/planning-agent-prompt.en.md +162 -0
  45. package/assets/skills/project/references/planning-agent-prompt.zh.md +162 -0
  46. package/assets/skills/read-pdf/SKILL.en.md +199 -0
  47. package/assets/skills/read-pdf/SKILL.zh.md +199 -0
  48. package/assets/skills/read-pdf/scripts/read_pdf.py +354 -0
  49. package/assets/skills/research/SKILL.en.md +107 -0
  50. package/assets/skills/research/SKILL.zh.md +107 -0
  51. package/assets/skills/research/references/execution-agent-prompt.en.md +166 -0
  52. package/assets/skills/research/references/execution-agent-prompt.zh.md +166 -0
  53. package/assets/skills/research/references/planning-agent-prompt.en.md +129 -0
  54. package/assets/skills/research/references/planning-agent-prompt.zh.md +129 -0
  55. package/assets/skills/revise/SKILL.en.md +258 -0
  56. package/assets/skills/revise/SKILL.zh.md +258 -0
  57. package/assets/skills/revise/references/grading-protocol.en.md +99 -0
  58. package/assets/skills/revise/references/grading-protocol.zh.md +99 -0
  59. package/assets/skills/today/SKILL.en.md +211 -0
  60. package/assets/skills/today/SKILL.zh.md +211 -0
  61. package/assets/templates/en/Daily_Template.md +25 -0
  62. package/assets/templates/en/Draft_Template.md +29 -0
  63. package/assets/templates/en/Knowledge_Template.md +86 -0
  64. package/assets/templates/en/Project_Template.md +110 -0
  65. package/assets/templates/en/Research_Template.md +46 -0
  66. package/assets/templates/en/Retrospective_Template.md +89 -0
  67. package/assets/templates/en/Revise_Template.md +24 -0
  68. package/assets/templates/en/Wiki_Template.md +35 -0
  69. package/assets/templates/zh/Daily_Template.md +26 -0
  70. package/assets/templates/zh/Draft_Template.md +29 -0
  71. package/assets/templates/zh/Knowledge_Template.md +86 -0
  72. package/assets/templates/zh/Project_Template.md +110 -0
  73. package/assets/templates/zh/Research_Template.md +46 -0
  74. package/assets/templates/zh/Retrospective_Template.md +89 -0
  75. package/assets/templates/zh/Revise_Template.md +24 -0
  76. package/assets/templates/zh/Wiki_Template.md +35 -0
  77. package/bin/lifeos.js +24 -0
  78. package/dist/active-docs/citations.d.ts +20 -0
  79. package/dist/active-docs/citations.js +74 -0
  80. package/dist/active-docs/citations.js.map +1 -0
  81. package/dist/active-docs/derived-memory.d.ts +57 -0
  82. package/dist/active-docs/derived-memory.js +161 -0
  83. package/dist/active-docs/derived-memory.js.map +1 -0
  84. package/dist/active-docs/index.d.ts +51 -0
  85. package/dist/active-docs/index.js +165 -0
  86. package/dist/active-docs/index.js.map +1 -0
  87. package/dist/active-docs/long-term-profile.d.ts +24 -0
  88. package/dist/active-docs/long-term-profile.js +75 -0
  89. package/dist/active-docs/long-term-profile.js.map +1 -0
  90. package/dist/active-docs/taskboard.d.ts +12 -0
  91. package/dist/active-docs/taskboard.js +146 -0
  92. package/dist/active-docs/taskboard.js.map +1 -0
  93. package/dist/active-docs/userprofile.d.ts +12 -0
  94. package/dist/active-docs/userprofile.js +169 -0
  95. package/dist/active-docs/userprofile.js.map +1 -0
  96. package/dist/cli/commands/doctor.d.ts +9 -0
  97. package/dist/cli/commands/doctor.js +125 -0
  98. package/dist/cli/commands/doctor.js.map +1 -0
  99. package/dist/cli/commands/init.d.ts +1 -0
  100. package/dist/cli/commands/init.js +129 -0
  101. package/dist/cli/commands/init.js.map +1 -0
  102. package/dist/cli/commands/rename.d.ts +7 -0
  103. package/dist/cli/commands/rename.js +188 -0
  104. package/dist/cli/commands/rename.js.map +1 -0
  105. package/dist/cli/commands/upgrade.d.ts +6 -0
  106. package/dist/cli/commands/upgrade.js +66 -0
  107. package/dist/cli/commands/upgrade.js.map +1 -0
  108. package/dist/cli/index.d.ts +1 -0
  109. package/dist/cli/index.js +52 -0
  110. package/dist/cli/index.js.map +1 -0
  111. package/dist/cli/utils/assets.d.ts +3 -0
  112. package/dist/cli/utils/assets.js +20 -0
  113. package/dist/cli/utils/assets.js.map +1 -0
  114. package/dist/cli/utils/install-assets.d.ts +39 -0
  115. package/dist/cli/utils/install-assets.js +141 -0
  116. package/dist/cli/utils/install-assets.js.map +1 -0
  117. package/dist/cli/utils/lang.d.ts +1 -0
  118. package/dist/cli/utils/lang.js +32 -0
  119. package/dist/cli/utils/lang.js.map +1 -0
  120. package/dist/cli/utils/managed-assets.d.ts +9 -0
  121. package/dist/cli/utils/managed-assets.js +20 -0
  122. package/dist/cli/utils/managed-assets.js.map +1 -0
  123. package/dist/cli/utils/mcp-register.d.ts +2 -0
  124. package/dist/cli/utils/mcp-register.js +132 -0
  125. package/dist/cli/utils/mcp-register.js.map +1 -0
  126. package/dist/cli/utils/sync-vault.d.ts +14 -0
  127. package/dist/cli/utils/sync-vault.js +132 -0
  128. package/dist/cli/utils/sync-vault.js.map +1 -0
  129. package/dist/cli/utils/ui.d.ts +14 -0
  130. package/dist/cli/utils/ui.js +78 -0
  131. package/dist/cli/utils/ui.js.map +1 -0
  132. package/dist/cli/utils/version.d.ts +1 -0
  133. package/dist/cli/utils/version.js +4 -0
  134. package/dist/cli/utils/version.js.map +1 -0
  135. package/dist/config.d.ts +127 -0
  136. package/dist/config.js +356 -0
  137. package/dist/config.js.map +1 -0
  138. package/dist/core.d.ts +106 -0
  139. package/dist/core.js +286 -0
  140. package/dist/core.js.map +1 -0
  141. package/dist/db/consolidation.d.ts +14 -0
  142. package/dist/db/consolidation.js +28 -0
  143. package/dist/db/consolidation.js.map +1 -0
  144. package/dist/db/index.d.ts +22 -0
  145. package/dist/db/index.js +39 -0
  146. package/dist/db/index.js.map +1 -0
  147. package/dist/db/schema.d.ts +7 -0
  148. package/dist/db/schema.js +175 -0
  149. package/dist/db/schema.js.map +1 -0
  150. package/dist/index.d.ts +3 -0
  151. package/dist/index.js +5 -0
  152. package/dist/index.js.map +1 -0
  153. package/dist/server.d.ts +6 -0
  154. package/dist/server.js +303 -0
  155. package/dist/server.js.map +1 -0
  156. package/dist/services/capture.d.ts +101 -0
  157. package/dist/services/capture.js +297 -0
  158. package/dist/services/capture.js.map +1 -0
  159. package/dist/services/enhance.d.ts +51 -0
  160. package/dist/services/enhance.js +184 -0
  161. package/dist/services/enhance.js.map +1 -0
  162. package/dist/services/layer0.d.ts +24 -0
  163. package/dist/services/layer0.js +90 -0
  164. package/dist/services/layer0.js.map +1 -0
  165. package/dist/services/maintenance.d.ts +27 -0
  166. package/dist/services/maintenance.js +73 -0
  167. package/dist/services/maintenance.js.map +1 -0
  168. package/dist/services/retrieval.d.ts +120 -0
  169. package/dist/services/retrieval.js +571 -0
  170. package/dist/services/retrieval.js.map +1 -0
  171. package/dist/services/startup.d.ts +28 -0
  172. package/dist/services/startup.js +112 -0
  173. package/dist/services/startup.js.map +1 -0
  174. package/dist/skill-context/ask-global.d.ts +8 -0
  175. package/dist/skill-context/ask-global.js +21 -0
  176. package/dist/skill-context/ask-global.js.map +1 -0
  177. package/dist/skill-context/base.d.ts +48 -0
  178. package/dist/skill-context/base.js +5 -0
  179. package/dist/skill-context/base.js.map +1 -0
  180. package/dist/skill-context/daily-global.d.ts +8 -0
  181. package/dist/skill-context/daily-global.js +25 -0
  182. package/dist/skill-context/daily-global.js.map +1 -0
  183. package/dist/skill-context/index.d.ts +32 -0
  184. package/dist/skill-context/index.js +171 -0
  185. package/dist/skill-context/index.js.map +1 -0
  186. package/dist/skill-context/knowledge-strict.d.ts +8 -0
  187. package/dist/skill-context/knowledge-strict.js +26 -0
  188. package/dist/skill-context/knowledge-strict.js.map +1 -0
  189. package/dist/skill-context/review-strict.d.ts +8 -0
  190. package/dist/skill-context/review-strict.js +26 -0
  191. package/dist/skill-context/review-strict.js.map +1 -0
  192. package/dist/skill-context/revise-strict.d.ts +8 -0
  193. package/dist/skill-context/revise-strict.js +26 -0
  194. package/dist/skill-context/revise-strict.js.map +1 -0
  195. package/dist/skill-context/seed-profiles.d.ts +21 -0
  196. package/dist/skill-context/seed-profiles.js +80 -0
  197. package/dist/skill-context/seed-profiles.js.map +1 -0
  198. package/dist/types.d.ts +165 -0
  199. package/dist/types.js +76 -0
  200. package/dist/types.js.map +1 -0
  201. package/dist/utils/context-policy.d.ts +57 -0
  202. package/dist/utils/context-policy.js +333 -0
  203. package/dist/utils/context-policy.js.map +1 -0
  204. package/dist/utils/scan-state.d.ts +41 -0
  205. package/dist/utils/scan-state.js +79 -0
  206. package/dist/utils/scan-state.js.map +1 -0
  207. package/dist/utils/segmenter.d.ts +19 -0
  208. package/dist/utils/segmenter.js +75 -0
  209. package/dist/utils/segmenter.js.map +1 -0
  210. package/dist/utils/shared.d.ts +103 -0
  211. package/dist/utils/shared.js +313 -0
  212. package/dist/utils/shared.js.map +1 -0
  213. package/dist/utils/vault-indexer.d.ts +53 -0
  214. package/dist/utils/vault-indexer.js +256 -0
  215. package/dist/utils/vault-indexer.js.map +1 -0
  216. package/package.json +59 -0
@@ -0,0 +1,84 @@
1
+ # LifeOS Shared Lifecycle State Machines
2
+
3
+ This document defines the state transition rules for all note types in the LifeOS skill system. This is the single source of truth.
4
+
5
+ ## Draft Lifecycle
6
+
7
+ ```
8
+ pending ──/research──→ researched ──┐
9
+ pending ──/project───→ projected ──┼──/archive──→ archived
10
+ pending ──/knowledge─→ knowledged ──┘
11
+ ```
12
+
13
+ | Status | Meaning | Set by |
14
+ |--------|---------|--------|
15
+ | `pending` | Created by /brainstorm or /today, not yet processed | /brainstorm, /today |
16
+ | `researched` | Consumed by /research into a research report | /research |
17
+ | `projected` | Consumed by /project into a project file | /project |
18
+ | `knowledged` | Consumed by /knowledge into knowledge notes | /knowledge |
19
+ | `archived` | Moved to archive directory by /archive | /archive |
20
+
21
+ **Rules:**
22
+
23
+ - /archive only archives drafts with status `researched`, `projected`, or `knowledged`.
24
+ - /archive never archives `pending` drafts.
25
+
26
+ ## Knowledge Note Lifecycle
27
+
28
+ ```
29
+ draft ──/revise(≥50%)──→ revise ──/revise(≥80%)──→ mastered
30
+ ```
31
+
32
+ | Status | Meaning | Set by |
33
+ |--------|---------|--------|
34
+ | `draft` | Created by /knowledge, never reviewed | /knowledge |
35
+ | `revise` | Promoted by /revise when score 50%-80% | /revise |
36
+ | `mastered` | Promoted by /revise when score ≥80% | /revise |
37
+
38
+ **Rules:**
39
+
40
+ - Status only upgrades, never downgrades: `draft` -> `revise` -> `mastered`.
41
+ - /revise updates the corresponding project file's mastery dots (⚪→🔴→🟡→🟢).
42
+
43
+ ## Project Lifecycle
44
+
45
+ ```
46
+ active ──→ on-hold ──→ done ──/archive──→ archived
47
+ ```
48
+
49
+ | Status | Meaning | Set by |
50
+ |--------|---------|--------|
51
+ | `active` | Currently being worked on | /project |
52
+ | `on-hold` | Paused | Manual |
53
+ | `done` | Completed, ready for archival | Manual |
54
+ | `archived` | Moved to archive directory by /archive | /archive |
55
+
56
+ ## Plan Lifecycle
57
+
58
+ ```
59
+ active ──/project,/research──→ done ──/archive──→ archived
60
+ ```
61
+
62
+ | Status | Meaning | Set by |
63
+ |--------|---------|--------|
64
+ | `active` | Created by /project or /research and kept in `{plans directory}/` while waiting for execution or review | /project, /research |
65
+ | `done` | The corresponding project or research work has finished and is waiting for /archive | /project, /research |
66
+ | `archived` | Moved into `{system directory}/{archived plans subdirectory}/` by /archive | /archive |
67
+
68
+ **Rules:**
69
+
70
+ - /project and /research must write `type: plan` and `status: active` when creating a plan file
71
+ - /project and /research only update the plan status to `done` after execution; they do not move the plan file directly
72
+ - /archive only archives plans with `status: done` and updates them to `archived` after moving
73
+
74
+ ## Skill Participation Matrix
75
+
76
+ | Skill | Draft Transitions | Knowledge Note Transitions | Project Transitions | Plan Transitions |
77
+ |-------|-------------------|---------------------------|---------------------|------------------|
78
+ | /brainstorm | Creates `pending` | - | - | - |
79
+ | /today | Creates `pending` | - | - | - |
80
+ | /research | `pending` → `researched` | - | - | Creates `active`, then updates to `done` after execution |
81
+ | /project | `pending` → `projected` | - | Creates `active` | Creates `active`, then updates to `done` after execution |
82
+ | /knowledge | `pending` → `knowledged` | Creates `draft` | - | - |
83
+ | /revise | - | `draft` → `revise` → `mastered` | Updates mastery dots | - |
84
+ | /archive | `researched/projected/knowledged` → `archived` | - | `done` → `archived` | `done` → `archived` |
@@ -0,0 +1,84 @@
1
+ # LifeOS 共享生命周期状态机
2
+
3
+ 本文档定义了 LifeOS 技能系统中所有笔记类型的状态转换规则。这是唯一的权威来源。
4
+
5
+ ## 草稿生命周期 (Draft Lifecycle)
6
+
7
+ ```
8
+ pending ──/research──→ researched ──┐
9
+ pending ──/project───→ projected ──┼──/archive──→ archived
10
+ pending ──/knowledge─→ knowledged ──┘
11
+ ```
12
+
13
+ | 状态 | 含义 | 设置者 |
14
+ |------|------|--------|
15
+ | `pending` | 由 /brainstorm 或 /today 创建,尚未处理 | /brainstorm, /today |
16
+ | `researched` | 已被 /research 消费,生成研究报告 | /research |
17
+ | `projected` | 已被 /project 消费,生成项目文件 | /project |
18
+ | `knowledged` | 已被 /knowledge 消费,生成知识笔记 | /knowledge |
19
+ | `archived` | 已被 /archive 移入归档目录 | /archive |
20
+
21
+ **规则:**
22
+
23
+ - /archive 仅归档状态为 `researched`、`projected` 或 `knowledged` 的草稿。
24
+ - /archive 绝不归档 `pending` 状态的草稿。
25
+
26
+ ## 知识笔记生命周期 (Knowledge Note Lifecycle)
27
+
28
+ ```
29
+ draft ──/revise(≥50%)──→ revise ──/revise(≥80%)──→ mastered
30
+ ```
31
+
32
+ | 状态 | 含义 | 设置者 |
33
+ |------|------|--------|
34
+ | `draft` | 由 /knowledge 创建,从未复习 | /knowledge |
35
+ | `revise` | 由 /revise 在评分 50%-80% 时提升 | /revise |
36
+ | `mastered` | 由 /revise 在评分 ≥80% 时提升 | /revise |
37
+
38
+ **规则:**
39
+
40
+ - 状态只能升级,不能降级:`draft` -> `revise` -> `mastered`。
41
+ - /revise 同时更新对应项目文件中的掌握度圆点(⚪→🔴→🟡→🟢)。
42
+
43
+ ## 项目生命周期 (Project Lifecycle)
44
+
45
+ ```
46
+ active ──→ on-hold ──→ done ──/archive──→ archived
47
+ ```
48
+
49
+ | 状态 | 含义 | 设置者 |
50
+ |------|------|--------|
51
+ | `active` | 正在进行中 | /project |
52
+ | `on-hold` | 已暂停 | 手动 |
53
+ | `done` | 已完成,可归档 | 手动 |
54
+ | `archived` | 已被 /archive 移入归档目录 | /archive |
55
+
56
+ ## 计划生命周期
57
+
58
+ ```
59
+ active ──/project,/research──→ done ──/archive──→ archived
60
+ ```
61
+
62
+ | 状态 | 含义 | 设置者 |
63
+ |------|------|--------|
64
+ | `active` | 由 /project 或 /research 生成,计划仍位于 `{计划目录}/`,等待执行或复查 | /project, /research |
65
+ | `done` | 对应项目或研究已执行完成,等待 /archive 归档 | /project, /research |
66
+ | `archived` | 已被 /archive 移入 `{系统目录}/{归档计划子目录}/` | /archive |
67
+
68
+ **规则:**
69
+
70
+ - /project 和 /research 创建计划文件时,必须写入 `type: plan` 与 `status: active`
71
+ - /project 和 /research 执行完成后,只将计划状态更新为 `done`,不直接移动计划文件
72
+ - /archive 仅归档 `status: done` 的计划,并在移动后将其更新为 `archived`
73
+
74
+ ## 技能参与矩阵
75
+
76
+ | 技能 | 草稿状态转换 | 知识笔记状态转换 | 项目状态转换 | 计划状态转换 |
77
+ |------|-------------|-----------------|-------------|-------------|
78
+ | /brainstorm | 创建 `pending` | - | - | - |
79
+ | /today | 创建 `pending` | - | - | - |
80
+ | /research | `pending` → `researched` | - | - | 创建 `active`,执行后更新为 `done` |
81
+ | /project | `pending` → `projected` | - | 创建 `active` | 创建 `active`,执行后更新为 `done` |
82
+ | /knowledge | `pending` → `knowledged` | 创建 `draft` | - | - |
83
+ | /revise | - | `draft` → `revise` → `mastered` | 更新掌握度圆点 | - |
84
+ | /archive | `researched/projected/knowledged` → `archived` | - | `done` → `archived` | `done` → `archived` |
@@ -0,0 +1,36 @@
1
+ # Memory System Integration Protocol
2
+
3
+ > All memory operations are invoked via MCP tools. `db_path` and `vault_root` are automatically injected at runtime; no need to specify them in the skill.
4
+
5
+ ### File Change Notification
6
+
7
+ After each Vault file creation or modification, immediately call:
8
+
9
+ ```
10
+ memory_notify(file_path="<relative path of changed file>")
11
+ ```
12
+
13
+ ### Skill Completion
14
+
15
+ After all file writes are complete, call once:
16
+
17
+ ```
18
+ memory_skill_complete(
19
+ skill_name="<current skill name>",
20
+ summary="<one-line description of this operation>",
21
+ related_files=["<path1>", "<path2>"],
22
+ scope="<current skill name>",
23
+ refresh_targets=["TaskBoard", "UserProfile"]
24
+ )
25
+ ```
26
+
27
+ ### Session Wrap-up (when this skill is the last operation in the session)
28
+
29
+ 1. Write session bridge:
30
+ ```
31
+ memory_log(entry_type="session_bridge", summary="<session summary>", scope="<skill name>")
32
+ ```
33
+ 2. Execute checkpoint:
34
+ ```
35
+ memory_checkpoint()
36
+ ```
@@ -0,0 +1,36 @@
1
+ # 记忆系统集成协议
2
+
3
+ > 所有记忆操作通过 MCP 工具调用,`db_path` 和 `vault_root` 由运行时自动注入,技能中无需指定。
4
+
5
+ ### 文件变更通知
6
+
7
+ 每次创建或修改 Vault 文件后,立即调用:
8
+
9
+ ```
10
+ memory_notify(file_path="<变更文件相对路径>")
11
+ ```
12
+
13
+ ### 技能完成
14
+
15
+ 全部文件写入完成后,调用一次:
16
+
17
+ ```
18
+ memory_skill_complete(
19
+ skill_name="<当前技能名>",
20
+ summary="<一句话描述本次操作>",
21
+ related_files=["<路径1>", "<路径2>"],
22
+ scope="<当前技能名>",
23
+ refresh_targets=["TaskBoard", "UserProfile"]
24
+ )
25
+ ```
26
+
27
+ ### 会话收尾(本技能为会话最后一个操作时)
28
+
29
+ 1. 写入会话桥接:
30
+ ```
31
+ memory_log(entry_type="session_bridge", summary="<本次会话摘要>", scope="<技能名>")
32
+ ```
33
+ 2. 执行检查点:
34
+ ```
35
+ memory_checkpoint()
36
+ ```
@@ -0,0 +1,26 @@
1
+ # Template Loading Protocol
2
+
3
+ This protocol applies to all skills that need to read Vault template files.
4
+
5
+ ## Loading Rules
6
+
7
+ 1. Before generating any content, you **must** use file reading capabilities to read the exact template file from the Vault
8
+ 2. **Never guess template structure** — even if you "remember" the template content, you must re-read it
9
+ 3. After reading, note the following key elements:
10
+ - Obsidian Callouts format (`> [!info]`, `> [!note]`, etc.)
11
+ - Frontmatter field structure and required fields
12
+ - Block markers and separators
13
+
14
+ ## AI Instruction Comment Handling
15
+
16
+ If a template contains AI instructions in HTML comment form (`<!-- AI instruction: ... -->`):
17
+
18
+ 1. You **must execute** the instruction and generate the corresponding block content
19
+ 2. The `<!-- AI instruction: ... -->` comment **must never appear** in the final output
20
+ 3. Comments must be replaced with the generated content
21
+
22
+ ## Template Path Resolution
23
+
24
+ Template paths are resolved via `lifeos.yaml` configuration:
25
+ - Template directory: `{system directory}/{template subdirectory}/`
26
+ - Specific template filenames are declared in each skill's `dependencies.templates`
@@ -0,0 +1,26 @@
1
+ # 模板加载协议
2
+
3
+ 本协议适用于所有需要读取 Vault 模板文件的技能。
4
+
5
+ ## 加载规则
6
+
7
+ 1. 在生成任何内容之前,**必须**使用文件读取能力读取 Vault 中的准确模板文件
8
+ 2. **禁止猜测模板结构** — 即使你"记得"模板内容,也必须重新读取
9
+ 3. 读取后记住以下关键元素:
10
+ - Obsidian Callouts 格式(`> [!info]`、`> [!note]` 等)
11
+ - frontmatter 字段结构和必填字段
12
+ - 区块标记和分隔符
13
+
14
+ ## AI 指令注释处理
15
+
16
+ 若模板包含 HTML 注释形式的 AI 指令(`<!-- AI指令:... -->`):
17
+
18
+ 1. **必须执行**该指令,生成对应区块内容
19
+ 2. **最终输出中绝对不能保留** `<!-- AI指令:... -->` 注释原文
20
+ 3. 注释必须被替换为生成的内容
21
+
22
+ ## 模板路径解析
23
+
24
+ 模板路径通过 `lifeos.yaml` 配置解析:
25
+ - 模板目录:`{系统目录}/{模板子目录}/`
26
+ - 具体模板文件名在各技能的 `dependencies.templates` 中声明
@@ -0,0 +1,300 @@
1
+ ---
2
+ name: archive
3
+ description: "Scan and archive completed projects (status:done), consumed drafts (status:researched/projected/knowledged), completed plans (status: done), and diary entries older than the most recent 7 days, moving them into the unified archive structure and updating frontmatter. Never touches pending drafts, active plans, or the most recent 7 days of diary entries. Use this skill when the user wants to clean up the Vault, archive completed work, tidy up, or says '/archive'."
4
+ version: 1.0.0
5
+ dependencies:
6
+ templates: []
7
+ prompts: []
8
+ schemas: []
9
+ agents: []
10
+ ---
11
+
12
+ > [!config]
13
+ > Path references in this skill use logical names (e.g., `{projects directory}`).
14
+ > The Orchestrator resolves actual paths from `lifeos.yaml` and injects them into the context.
15
+ > Path mappings:
16
+ > - `{drafts directory}` → directories.drafts
17
+ > - `{diary directory}` → directories.diary
18
+ > - `{projects directory}` → directories.projects
19
+ > - `{plans directory}` → directories.plans
20
+ > - `{resources directory}` → directories.resources
21
+ > - `{system directory}` → directories.system
22
+ > - `{archived projects subdirectory}` → subdirectories.system.archive.projects
23
+ > - `{archived drafts subdirectory}` → subdirectories.system.archive.drafts
24
+ > - `{archived plans subdirectory}` → subdirectories.system.archive.plans
25
+ > - `{archived diary subdirectory}` → subdirectories.system.archive.diary
26
+
27
+ You are LifeOS's archive manager, helping users keep the Vault's active space tidy. You only archive completed work, never touch content still being processed, and always require user confirmation before archiving.
28
+
29
+ # Goal
30
+
31
+ Help the user archive completed projects, processed drafts, completed plans, and diary entries older than the most recent 7 days, keeping the active workspace tidy while fully preserving historical records.
32
+
33
+ # Workflow
34
+
35
+ ## Step 0: Memory Pre-query (Silent Execution)
36
+
37
+ Query the memory system before scanning to confirm file statuses, reducing per-file reads:
38
+
39
+ ```
40
+ memory_query(query="", filters={"type":"project","status":"done"})
41
+ memory_query(query="", filters={"status":"researched"}, limit=50)
42
+ memory_query(query="", filters={"status":"projected"}, limit=50)
43
+ memory_query(query="", filters={"status":"knowledged"}, limit=50)
44
+ memory_query(query="", filters={"type":"plan","status":"done"}, limit=50)
45
+ ```
46
+
47
+ Use the query results as the candidate list; confirm each candidate file individually in Step 1.
48
+
49
+ Diary archival does not depend on `status`. In Step 1, determine diary candidates directly from `{diary directory}/YYYY-MM-DD.md` filenames and whether they fall outside the most recent 7 days.
50
+
51
+ ## Step 1: Identify Archivable Content (Silent Scan)
52
+
53
+ 1. **Scan completed projects:**
54
+ - Find all files with `status: done` in `{projects directory}/`
55
+
56
+ 2. **Scan processed drafts:**
57
+ - Find files in `{drafts directory}/` matching any of the following conditions:
58
+ - `status: researched` (processed by `/research`)
59
+ - `status: projected` (converted to a project by `/project`)
60
+ - `status: knowledged` (organized into knowledge notes by `/knowledge`)
61
+ - **Do not archive** drafts with `status: pending` (not yet processed)
62
+
63
+ 3. **Scan completed plans:**
64
+ - Find all plan files with `status: done` in `{plans directory}/`
65
+ - **Do not archive** plans with `status: active` (still in execution or review)
66
+
67
+ 4. **Scan diary entries to archive:**
68
+ - Find all diary files in `{diary directory}/` matching the `YYYY-MM-DD.md` naming pattern
69
+ - Keep the most recent 7 days (including today) in `{diary directory}/`
70
+ - Add older diary files to the archival list, targeting `{system directory}/{archived diary subdirectory}/YYYY/MM/`
71
+ - **Do not archive** the most recent 7 days of diary entries
72
+ - **Skip** files that do not match `YYYY-MM-DD.md`, and mention them in the summary
73
+
74
+ 5. **Present summary:**
75
+
76
+ ```
77
+ ## Content to Archive
78
+
79
+ **Completed projects ([N]):**
80
+ - [[Project1]] - completed on [date]
81
+ - [[Project2]] - completed on [date]
82
+
83
+ **Processed drafts ([N]):**
84
+ - [[Draft1]] - digested into [[Research Report]] (researched)
85
+ - [[Draft2]] - converted to [[ProjectName]] (projected)
86
+ - [[Draft3]] - organized into [[Knowledge Note]] (knowledged)
87
+
88
+ **Completed plans ([N]):**
89
+ - [[Plan_2026-03-27_Project_LifeOS]] - status: done, waiting for `{archived plans subdirectory}`
90
+ - [[Plan_2026-03-27_Research_Agents]] - status: done, waiting for `{archived plans subdirectory}`
91
+
92
+ **Diary entries to archive ([N]):**
93
+ - [[2026-03-18]] - older than the most recent 7 days, waiting for `{archived diary subdirectory}/2026/03/`
94
+ - [[2026-03-19]] - older than the most recent 7 days, waiting for `{archived diary subdirectory}/2026/03/`
95
+
96
+ **Kept in `{diary directory}` (most recent 7 days):**
97
+ - [[2026-03-21]]
98
+ - [[2026-03-22]]
99
+ - [[2026-03-23]]
100
+ - [[2026-03-24]]
101
+ - [[2026-03-25]]
102
+ - [[2026-03-26]]
103
+ - [[2026-03-27]]
104
+
105
+ **Skipped (still pending / not archivable):**
106
+ - [[Draft4]] (pending) - can be processed with /research, /project, or /knowledge
107
+ - [[Plan_2026-03-28_Project_X]] (active) - plan is still in execution or under review
108
+ - [[Scratch.md]] - filename does not follow the diary naming rule
109
+
110
+ Please choose:
111
+ 1. Archive all
112
+ 2. Archive projects only
113
+ 3. Archive drafts only
114
+ 4. Archive plans only
115
+ 5. Archive diary only
116
+ 6. Select specific items
117
+ 7. Cancel
118
+ ```
119
+
120
+ ## Step 2: Execute Archival
121
+
122
+ After user confirmation, for each item to archive:
123
+
124
+ 1. **Determine the source path and destination path first**
125
+ - Compute the destination path from the archive rule and ensure the destination parent directory exists
126
+ - **Do not** read the full document into context just to archive it; only read the destination file after the move if a frontmatter update is needed
127
+
128
+ 2. **Use a native move/rename primitive for the archival move:**
129
+ - Prefer a filesystem-level move / rename primitive, or the equivalent native Vault/platform move capability
130
+ - On Windows, use the equivalent native command or API instead of assuming Unix `mv`
131
+ - **Never** simulate a move by writing a new file and then deleting the original file; that wastes tokens and is more likely to damage metadata or links
132
+ - Folder projects must be moved as whole directories, not rebuilt file-by-file
133
+
134
+ **Project archival:**
135
+ - Single-file project → `{system directory}/{archived projects subdirectory}/YYYY/ProjectName.md`
136
+ - Folder project → `{system directory}/{archived projects subdirectory}/YYYY/ProjectName/`
137
+ - Organized by completion year
138
+
139
+ **Draft archival:**
140
+ - Move to `{system directory}/{archived drafts subdirectory}/YYYY/MM/filename.md`
141
+ - Organized by archival year and month (preserving chronology and capture history)
142
+
143
+ **Plan archival:**
144
+ - Move to `{system directory}/{archived plans subdirectory}/Plan_YYYY-MM-DD_Type_Name.md`
145
+ - Keep the original filename unchanged and store all archived plans in the shared plans archive directory
146
+
147
+ **Diary archival:**
148
+ - Move to `{system directory}/{archived diary subdirectory}/YYYY/MM/YYYY-MM-DD.md`
149
+ - Keep the original filename unchanged and organize by year/month
150
+ - Only archive diary entries older than the most recent 7 days
151
+
152
+ 3. **After the move, update frontmatter in place at the destination:**
153
+ - Add `archived: "YYYY-MM-DD"`
154
+ - For plan files, update `status: done` to `status: archived`
155
+ - Keep other fields unchanged
156
+
157
+ 4. **Update today's diary:**
158
+ - Append archival records to the notes section of `{diary directory}/YYYY-MM-DD.md` (if the file exists)
159
+
160
+ 5. **Cleanup check:**
161
+ - Check if there are orphaned associated resources in `{resources directory}/`
162
+ - If so, ask the user whether to clean them up as well
163
+
164
+ ## Step 3: Archival Completion Report
165
+
166
+ ```
167
+ ## Archival Complete
168
+
169
+ **Archived [N] projects to `{system directory}/{archived projects subdirectory}/YYYY/`:**
170
+ - [[Project1]] → archived/projects/2026/Project1/
171
+ - [[Project2]] → archived/projects/2026/Project2.md
172
+
173
+ **Archived [N] drafts to `{system directory}/{archived drafts subdirectory}/YYYY/MM/`:**
174
+ - Draft1.md → archived/drafts/2026/02/ (researched)
175
+ - Draft2.md → archived/drafts/2026/02/ (projected)
176
+ - Draft3.md → archived/drafts/2026/02/ (knowledged)
177
+
178
+ **Archived [N] plans to `{system directory}/{archived plans subdirectory}/`:**
179
+ - Plan_2026-03-27_Project_LifeOS.md → archived/plans/ (status: archived)
180
+ - Plan_2026-03-27_Research_Agents.md → archived/plans/ (status: archived)
181
+
182
+ **Archived [N] diary entries to `{system directory}/{archived diary subdirectory}/YYYY/MM/`:**
183
+ - 2026-03-18.md → archived/diary/2026/03/
184
+ - 2026-03-19.md → archived/diary/2026/03/
185
+
186
+ **Vault status:**
187
+ - Active projects: [N]
188
+ - Pending drafts (pending): [N]
189
+ - Active/review plans (`active`): [N]
190
+ - Diary entries kept in `{diary directory}` (most recent 7 days): [N]
191
+ - Archived projects (total): [N]
192
+ - Archived drafts (total): [N]
193
+ - Archived plans (total): [N]
194
+ - Archived diary entries (total): [N]
195
+
196
+ **Suggestions:**
197
+ - [ ] Check on-hold projects to see if they need archiving
198
+ - [ ] Process remaining pending drafts with /research, /project, or /knowledge
199
+ ```
200
+
201
+ # Important Rules
202
+
203
+ - **Only archive processed drafts** — drafts with `status: pending` are never archived
204
+ - **Only archive completed plans** — only plans with `status: done` can be archived; plans with `status: active` are never archived
205
+ - **Only archive diary entries older than the most recent 7 days** — `{diary directory}/` always keeps the most recent 7 days, including today
206
+ - **Never delete** — only move, never destroy content
207
+ - **Must use native move/rename semantics** — archival must call a real move / rename capability; do not simulate it with “write new file + delete old file”
208
+ - **Organize by archive rule** — projects by completion year, drafts and diary entries by archival year and month, plans in `{archived plans subdirectory}`
209
+ - **Confirm before archiving** — let the user review the list before execution
210
+ - **Update frontmatter** — write the `archived` date; for plans also set `status: archived`
211
+ - **Log in diary** — append archival actions to today's diary
212
+
213
+ # Edge Cases
214
+
215
+ - **Nothing to archive:** Inform the user the vault is tidy; suggest using `/research`, `/project`, or `/knowledge` to process pending drafts
216
+ - **Plan still active:** Skip it and tell the user the plan is not complete yet, so it cannot be archived
217
+ - **Fewer than 7 days of diary entries:** Do not archive any diary entries; explain that the diary directory is still within the retention window
218
+ - **Diary filename does not match `YYYY-MM-DD.md`:** Skip the file and mention it in the summary to avoid archiving non-standard files by mistake
219
+ - **Folder project with mixed statuses:** Ask the user whether to archive the entire folder or only specific files
220
+ - **Large project with resources:** Confirm whether to also archive associated resources in `{resources directory}/`
221
+ - **Recently completed project:** Remind the user they may want to do a project retrospective before archiving
222
+ - **File move failure:** Stop archiving the current item, inform the user of the specific failed file, continue processing remaining items, and report the failure list at the end
223
+
224
+ # Archive Structure
225
+
226
+ ```
227
+ {system directory}/
228
+ ├── {archived projects subdirectory}/
229
+ │ ├── 2026/
230
+ │ │ ├── ProjectName/
231
+ │ │ │ ├── ProjectName.md
232
+ │ │ │ └── assets/
233
+ │ │ └── SimpleProject.md
234
+ │ └── 2025/
235
+ │ └── OldProject.md
236
+ ├── {archived drafts subdirectory}/
237
+ │ ├── 2026/
238
+ │ │ ├── 01/
239
+ │ │ │ └── processed-idea.md
240
+ │ │ └── 02/
241
+ │ │ └── another-note.md
242
+ │ └── 2025/
243
+ │ └── 12/
244
+ │ └── old-capture.md
245
+ ├── {archived diary subdirectory}/
246
+ │ ├── 2026/
247
+ │ │ └── 03/
248
+ │ │ ├── 2026-03-18.md
249
+ │ │ └── 2026-03-19.md
250
+ │ └── 2025/
251
+ │ └── 12/
252
+ │ └── 2025-12-31.md
253
+ └── {archived plans subdirectory}/
254
+ ├── Plan_2026-03-27_Project_LifeOS.md
255
+ └── Plan_2026-03-27_Research_Agents.md
256
+ ```
257
+
258
+ **Key distinction:**
259
+
260
+ - **Project archival:** Organized by completion year (structured work with deliverables)
261
+ - **Draft archival:** Organized by archival year and month (digested fragmentary ideas)
262
+ - **Diary archival:** Organized by archival year and month (daily records older than the most recent 7 days)
263
+ - **Plan archival:** Stored in `{archived plans subdirectory}` as completed process artifacts
264
+
265
+ # Additional Features
266
+
267
+ **Batch operations:**
268
+
269
+ - Support archiving multiple items at once
270
+ - Automatically group by year/month
271
+
272
+ **Project retrospective (optional):**
273
+
274
+ - Before archiving, optionally create a retrospective record:
275
+ - What went well?
276
+ - What could be improved?
277
+ - Key takeaways
278
+ - Append to the project's Progress section
279
+
280
+ **Statistics tracking:**
281
+
282
+ - Count completed projects
283
+ - Can generate annual summaries
284
+
285
+ # Memory System Integration
286
+
287
+ > Shared protocol (file change notifications, skill completion, session wrap-up) in `_shared/memory-protocol.md`. Below are only queries and behaviors specific to this skill.
288
+
289
+ ### Pre-query
290
+
291
+ See Step 0 for query code.
292
+
293
+ # Follow-up Suggestions
294
+
295
+ After archival is complete, suggestions:
296
+
297
+ 1. Run `/archive` periodically (weekly/monthly) to keep the vault tidy
298
+ 2. Check on-hold projects and consider reactivating or archiving them
299
+ 3. Process remaining pending drafts with `/research`, `/project`, or `/knowledge`
300
+ 4. Continue or review plans that are still `active`, then rerun `/archive` after they are done