Install
$ agentstack add skill-jame581-logseqbrain-brain-save ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
Brain Save
Persist session context — decisions, progress, plans, implementation details — to the Claude Brain Logseq graph for cross-session and cross-device continuity.
Prerequisites
Resolve the graph path per 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:
- Session Log Entry (always)
- Decisions (when made — see
references/decisions.mdfor conflict + cross-project rules) - Plan Updates (when plans changed — replace, don't append)
- Implementation Details (when significant)
- Jira Task Context (when tasks were worked on — store pointers, not full plans)
- User Preferences & Meta (when newly discovered — update
pages/Meta.md)
Save Process
- 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___.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.
Task pages: a save may also target a task page (pages/Tasks___.md) when the session was about that task. Task pages have no fixed template, but their page-top property block must contain status:: with one of active | blocked | done. If the page exists without status::, seed status:: active as part of this save. If the session content signals completion ("merged", "deployed", "closed", "released", "hotovo"), suggest status:: done — never write a status change the user didn't confirm (same rule as auto-save). If no task page exists for a worked task, keep the Current Plan pointer entry only — don't create Tasks___.md uninvited; offer to create one and only do so if the user wants it.
- 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 Editold_stringto be unique.
- Prepare the updates for each applicable category from
references/categories.md. When composing the text, follow the content-generation invariants inskills/_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. Also run the decision-detection scan on your composed session summary per the "Decision detection (forward-only)" section ofreferences/decisions.md.
- Self-check the composed text against
skills/_shared/hygiene-rules.mdbefore writing — the rules withenforced-at: composeandauto-fixableofyes/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. Formalformed-propertyspecifically, only auto-correctkey:→key::when the composed block is a page-top property block (e.g. updatinglast-updated::); in a section append such as Session Log or Decisions akey: valueline may be prose, so leave it forbrain-doctorto report. Do not run thereportrules (broken-link,duplicate-entry,structural-integrity,description-link); those need whole-graph context and belong tobrain-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 — see skills/_shared/logseq-format.md.
- 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 - Seed/update the task page's page-top
status::when the save targets a task page (per step 2 — seedactiveif missing; writedone/blockedonly with the user's confirmation) - After appending to Session Log, check the rotation trigger per
references/rotation.md(64 KB / 40 entries) and suggest rotation if exceeded — suggestion only.
- Update the journal —
## Sessions. Append a rich cross-reference to today'sjournals/yyyy_MM_dd.md:
```markdown
- ## Sessions
- [[Projects/ProjectName]]: Brief summary of session
```
- Update
pages/Meta.mdif new user preferences emerged (seereferences/categories.mdcategory 6).
- Refresh
pages/Index.md. Every save rewrites the saved project's one-liner: keep the stable descriptor before the parenthetical untouched; replace the parenthetical with( — ), e.g.(v0.8.0 shipped 2026-06-23 — v0.9.0 in design). One surgical single-line Edit. This is unconditional — Index rot comes precisely from "only when status changed" judgment calls. If the project's one-liner has no parenthetical yet, append one after the stable descriptor. If the project is missing frompages/Index.mdentirely, add a one-liner under## Projects— descriptor taken from the project page's first Overview bullet, then the parenthetical.
- Post-write verify. Run the "Post-write verify (scoped)" procedure in
skills/_shared/hygiene-rules.mdover exactly the files written in steps 6–9. Fix any hit per the catalog remediation and re-verify. This is mandatory — the compose self-check (step 5) is necessary but not sufficient.
- Write a journey-log entry per
skills/_shared/journey-log.mdwith activity line:saved [[Projects/]].
- Confirm to the user in plain language what was saved. List each thing written.
Auto-Suggest Save
See references/auto-suggest.md. Suggestion only — never auto-save.
Important Notes
- Edit tool for surgical updates only. Never rewrite a whole page (sync conflicts).
- All content in bullet-point format. See
CLAUDE.mdfor Logseq invariants. - When appending, place new entries at the end of the section, before the next
##heading. - If
journals/doesn't exist, create it (Bashmkdir -p) before writing the journal entry.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: jame581
- Source: jame581/LogseqBrain
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.