brain-save

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Brain Save

Brain 保存

Persist session context — decisions, progress, plans, implementation details — to the Claude Brain Logseq graph for cross-session and cross-device continuity.
将会话上下文——包括决策、进展、计划、实现细节——持久化到Claude Brain Logseq图谱中,以实现跨会话和跨设备的连续性。

Prerequisites

前置条件

Resolve the graph path per
skills/_shared/path-resolution.md
.
按照
skills/_shared/path-resolution.md
中的规则解析图谱路径。

What to Save

保存内容分类

Six categories — see
references/categories.md
for each one's format and rules. The orchestrator decides which apply based on what the session covered:
  1. Session Log Entry (always)
  2. Decisions (when made — see
    references/decisions.md
    for conflict + cross-project rules)
  3. Plan Updates (when plans changed — replace, don't append)
  4. Implementation Details (when significant)
  5. Jira Task Context (when tasks were worked on — store pointers, not full plans)
  6. User Preferences & Meta (when newly discovered — update
    pages/Meta.md
    )
共六大类——每个类别的格式和规则请参考
references/categories.md
。编排器会根据会话涉及的内容决定适用哪些类别:
  1. 会话日志条目(必选)
  2. 决策内容(当做出决策时——冲突处理及跨项目规则请参考
    references/decisions.md
  3. 计划更新(当计划变更时——替换而非追加)
  4. 实现细节(当内容较为重要时)
  5. Jira任务上下文(当处理任务时——仅存储指针,不保存完整计划)
  6. 用户偏好与元数据(当发现新内容时——更新
    pages/Meta.md

Save Process

保存流程

  1. Identify target project(s). Look for project names mentioned, files/repos discussed, or explicit user statements ("we're working on X"). If multiple projects, save to each. If unclear, ask: "This touched [X] and [Y] — save to both?"
  2. Verify project page exists. Glob for
    pages/Projects___<ProjectName>.md
    . If missing:
    • Tell user: "No project page found for [name]. Want me to create one first?"
    • If yes, hand off to
      brain-init
      "Adding a New Project" flow, then continue.
    • If no, list available projects and let the user pick.
    • Never write session data to a non-existent project page.
  3. Read the current project page selectively using the section-targeted-read pattern in
    skills/_shared/section-locator.md
    . Read only the sections you'll touch (Session Log, Decisions, Current Plan, Implementation) — never the whole file. The read serves two purposes: detect duplicates before appending, and provide enough surrounding lines for the Edit
    old_string
    to be unique.
  4. Prepare the updates for each applicable category from
    references/categories.md
    .
  5. Write the updates using the Edit tool — surgical updates per section, never rewrite the whole page:
    • Append to Session Log
    • Append to Decisions (with conflict check per
      references/decisions.md
      )
    • Replace Current Plan if changed
    • Update Implementation if needed
    • Update
      last-updated::
      to today's date
  6. Update the journal —
    ## Sessions
    .
    Append a rich cross-reference to today's
    journals/yyyy_MM_dd.md
    :
    markdown
    - ## Sessions
      - [[Projects/ProjectName]]: Brief summary of session
  7. Update
    pages/Meta.md
    if new user preferences emerged (see
    references/categories.md
    category 6).
  8. Update
    pages/Index.md
    if a project status changed or new cross-project info emerged.
  9. Write a journey-log entry per
    skills/_shared/journey-log.md
    with activity line:
    saved [[Projects/<ProjectName>]]
    .
  10. Confirm to the user in plain language what was saved. List each thing written.
  1. 确定目标项目。查找提及的项目名称、讨论的文件/仓库,或用户明确说明的内容(如"我们正在处理X项目")。如果涉及多个项目,需分别保存。若不明确,询问用户:"本次会话涉及[X]和[Y]——是否要保存到两个项目中?"
  2. 验证项目页面是否存在。全局查找
    pages/Projects___<ProjectName>.md
    文件。若不存在:
    • 告知用户:"未找到[name]项目的页面。是否需要先创建该页面?"
    • 若用户同意,移交至
      brain-init
      的"添加新项目"流程,之后继续保存操作。
    • 若用户不同意,列出可用项目供用户选择。
    • 禁止将会话数据写入不存在的项目页面。
  3. 选择性读取当前项目页面,使用
    skills/_shared/section-locator.md
    中的分段读取模式。仅读取需要修改的章节(会话日志、决策、当前计划、实现细节)——切勿读取整个文件。读取操作有两个目的:追加前检测重复内容,以及为编辑工具提供足够的上下文行以确保
    old_string
    的唯一性。
  4. 根据
    references/categories.md
    中的适用类别准备更新内容
  5. 使用编辑工具写入更新内容——仅对各章节进行精准更新,切勿重写整个页面:
    • 追加至会话日志章节
    • 追加至决策章节(需按照
      references/decisions.md
      进行冲突检查)
    • 若计划变更则替换当前计划章节
    • 必要时更新实现细节章节
    • last-updated::
      更新为当前日期
  6. 更新日志——
    ## Sessions
    章节
    。在当日的
    journals/yyyy_MM_dd.md
    文件中追加一个带交叉引用的条目:
    markdown
    - ## Sessions
      - [[Projects/ProjectName]]: 会话简要总结
  7. 若发现新的用户偏好,更新
    pages/Meta.md
    (参考
    references/categories.md
    第6类)。
  8. 若项目状态变更或出现新的跨项目信息,更新
    pages/Index.md
  9. 按照
    skills/_shared/journey-log.md
    的要求写入操作日志条目
    ,活动行内容为:
    saved [[Projects/<ProjectName>]]
  10. 用简洁语言向用户确认保存内容,列出所有已写入的内容。

Auto-Suggest Save

自动建议保存

See
references/auto-suggest.md
. Suggestion only — never auto-save.
参考
references/auto-suggest.md
。仅提供建议——切勿自动保存。

Important Notes

重要注意事项

  • Edit tool for surgical updates only. Never rewrite a whole page (sync conflicts).
  • All content in bullet-point format. See
    CLAUDE.md
    for Logseq invariants.
  • When appending, place new entries at the end of the section, before the next
    ##
    heading.
  • If
    journals/
    doesn't exist, create it (Bash
    mkdir -p
    ) before writing the journal entry.
  • 编辑工具仅用于精准更新。切勿重写整个页面(避免同步冲突)。
  • 所有内容均采用项目符号格式。Logseq的固定规则请参考
    CLAUDE.md
  • 追加内容时,将新条目放在章节末尾、下一个
    ##
    标题之前。
  • journals/
    目录不存在,写入日志条目前需先创建该目录(使用Bash命令
    mkdir -p
    )。