From logseq-brain
Saves session context, decisions, progress, and plans to a Logseq graph for cross-session continuity. Use at session end or when you want to persist key information.
How this skill is triggered — by the user, by Claude, or both
Slash command
/logseq-brain:brain-saveThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Persist session context — decisions, progress, plans, implementation details — to the Claude Brain Logseq graph for cross-session and cross-device continuity.
Persist session context — decisions, progress, plans, implementation details — to the Claude Brain Logseq graph for cross-session and cross-device continuity.
Resolve the graph path per skills/_shared/path-resolution.md.
Six categories — see references/categories.md for each one's format and rules. The orchestrator decides which apply based on what the session covered:
references/decisions.md for conflict + cross-project rules)pages/Meta.md)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?"
Verify project page exists. Glob for pages/Projects___<ProjectName>.md. If missing:
brain-init "Adding a New Project" flow, then continue.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.
Prepare the updates for each applicable category from references/categories.md. When composing the text, follow the content-generation invariants in skills/_shared/logseq-format.md — backticks for code (never {{ }}), escape # before numbers/hex, namespace every [[Tasks/…]] / [[Projects/…]] link, and use markdown links (not [[file://]]) for file paths. Violating these silently spawns phantom pages and broken macros.
Self-check the composed text against skills/_shared/hygiene-rules.md before writing — the rules with enforced-at: compose and auto-fixable of yes/safe-only: code-in-braces, bare-hash-tag, unnamespaced-link, file-link, malformed-property. Scan only the block(s) you just composed (pure in-memory; no extra file reads), and silently correct any violation to the invariant form — it's your own output, so no prompt. For malformed-property specifically, only auto-correct key: → key:: when the composed block is a page-top property block (e.g. updating last-updated::); in a section append such as Session Log or Decisions a key: value line may be prose, so leave it for brain-doctor to report. Do not run the report rules (broken-link, duplicate-entry, structural-integrity, description-link); those need whole-graph context and belong to brain-doctor. Contract: never emit a mechanical violation.
Write the updates using the Edit tool — surgical updates per section, never rewrite the whole page:
Before any Edit, account for Logseq's parse-time normalization (dropped
-on headings, space→tab indents, stripped empty headings). Confirm the region's current normalized form before editing and anchor on heading text — seeskills/_shared/logseq-format.md.
references/decisions.md)last-updated:: to today's dateUpdate the journal — ## Sessions. Append a rich cross-reference to today's journals/yyyy_MM_dd.md:
- ## Sessions
- [[Projects/ProjectName]]: Brief summary of session
Update pages/Meta.md if new user preferences emerged (see references/categories.md category 6).
Update pages/Index.md if a project status changed or new cross-project info emerged.
Write a journey-log entry per skills/_shared/journey-log.md with activity line: saved [[Projects/<ProjectName>]].
Confirm to the user in plain language what was saved. List each thing written.
See references/auto-suggest.md. Suggestion only — never auto-save.
CLAUDE.md for Logseq invariants.## heading.journals/ doesn't exist, create it (Bash mkdir -p) before writing the journal entry.npx claudepluginhub jame581/skillsmith --plugin logseq-brainProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.