joplin-brain-config

joplin-brain-config is a cursor rule for Codex, Cursor from gcake119/joplin-llm-wiki. It costs 1,684 tokens per session, scanned A, original, MIT.

Project rules for keeping a Joplin knowledge base, exported notes, and compilation workflows consistent.

In plain words
What is it for?
Use them when configuring Joplin exports, synchronizing SQLite data, maintaining raw and wiki folders, setting schedules, or checking change-detection results.
Why use it?
They prevent exported notes from being deleted incorrectly and clarify when changes should trigger wiki or agent compilation. Joplin is a note-taking application, and compilation turns source notes into generated knowledge outputs.

Cursor rule for CodexCursor

Written for Codex and Cursor: runs codex exec, but also installed under .cursor/. Also seen: mentions Codex.

Good fit Use them when configuring Joplin exports, synchronizing SQLite data, maintaining raw and wiki folders, setting schedules, or checking change-detection results.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/gcake119/joplin-llm-wiki/joplin-brain-config
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/gcake119/joplin-llm-wiki

Made for: Codex, Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for joplin-brain-config

README.md
[![agentmods](https://agentmods.dev/badge/rules/gcake119/joplin-llm-wiki/joplin-brain-config/github.svg)](https://agentmods.dev/rules/gcake119/joplin-llm-wiki/joplin-brain-config)
Your own site
<a href="https://agentmods.dev/rules/gcake119/joplin-llm-wiki/joplin-brain-config"><img src="https://agentmods.dev/badge/rules/gcake119/joplin-llm-wiki/joplin-brain-config/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for joplin-brain-config

Your own site · 80×15
<a href="https://agentmods.dev/rules/gcake119/joplin-llm-wiki/joplin-brain-config"><img src="https://agentmods.dev/badge/rules/gcake119/joplin-llm-wiki/joplin-brain-config.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,684 This file is loaded in full into every session.
When invoked 1,684 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.01684 $0.01684
Opus 5 $0.00842 $0.00842
Sonnet 5 $0.00337 $0.00337
Haiku 4.5 $0.00168 $0.00168

Measured 11d ago against content hash f997dc265f1a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

joplin-brain-config scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/joplin-brain-config.mdc · 29 lines

What it actually says

joplin-llm-wiki 設定與測試

  • 知識流對齊:本 repo 部分採用 gatelynch/llm-knowledge-base 四層概念。raw/ 對應 raw/wiki/ 對應 wiki/brainstorming/artifacts/ 保持為探索與成品區;上游專案不是 runtime dependency。
  • 語言:人可讀的知識管理輸出使用繁體中文;技術名詞、source path、filename 可保留原文。
  • Joplin notebook 匯出sqlite-sync --select-notebooks 寫入 joplin_sqlite_sync.notebook_filter。來源路徑使用 raw/<joined-notebook-slug>/<safe-title>.md;巢狀筆記本以 - 串接,例如 工作/專案A/會議工作-專案A-會議reconcile_mode: mirror 僅應清理匯出產生的 stale .md,不得刪非 .md
  • SQLite sync 變更閘門sqlite-sync 正常模式匯出後會比對 snapshot,只有 raw 變更才依 joplin_sqlite_sync.pipeline.compile_mode 觸發編譯。local 觸發 wiki-compileagent 觸發 agent-compileoff 不編譯。首次非 dry-run 只建立 baseline;--export-only 匯出並更新 state 但不編譯;--snapshot-only 只掃現有 raw/ 建立 baseline,不開 SQLite、不刪檔、不編譯。舊 run_wiki_compile 僅作為未設定 compile_mode 時的相容 fallback。
  • 定時語意sqlite-sync 不是檔案系統 watcher。只有在 sqlite-sync 被執行時才會匯出 SQLite、比對 raw snapshot、依 compile_mode 觸發編譯。常駐輪詢需設定 joplin_sqlite_sync.schedule.every_seconds 或 CLI --every <seconds>;若用 launchd/cron 重複啟動單輪命令,保持 every_seconds: null,避免外部排程與內部輪詢重疊。
  • 觀測欄位sqlite-sync summary 應維持 raw_changedchange_detectionchanged_filescompile_modecompile_triggered,供 CLI、排程與 Health GUI 日誌判讀。
  • Wiki 分層wiki-compileagent-compile 只能輸出到 wiki/summaries/*.mdwiki/concepts/*.mdwiki/indexes/All-Sources.mdwiki/indexes/All-Concepts.mdsummariesconceptsindexes 底下不得建立子資料夾。summaries 是每個來源一份摘要,concepts 是概念條目並交叉引用 summaries/concepts,indexes 只放固定索引入口。source_refs 使用 raw 下的相對路徑,例如 工作-專案A-會議/my-note.md
  • Query / Capturequery 預設用 --source-scope=knowledge,優先讀 wiki/,必要時補 raw/--source-scope=wiki|raw 可明確限制來源。成功回答不直接寫正式筆記,而是先建立 pending capture;確認後才寫 brainstorming/chat/artifacts/projects/<project>/askindexwatch、RAG/Chroma/embedding vector 管線已移除。
  • 模型選擇:本地預設是 wiki-compile + Ollama。Codex 月訂閱路線是 agent-compile + 本機已登入的 codex exec,不使用 OpenAI API key,也不等同 API 額度。兩條管路預設都掃完整個 raw/ 筆記庫;--batch=true 才是 10-15 頁單批次 fallback。OpenAI API provider 目前未實作。
  • joplin_wiki_writeback.enabled 預設為 true(YAML 省略該鍵時等同開啟)。當寫回視為開啟時,load-config 要求 joplin_data_api.token 非空、joplin_data_api.base_url 為合法 http(s) 且 hostname 僅允許 127.0.0.1localhost::1,否則拋 CONFIG_INVALID
  • 單元/整合測試裡若只驗證 wiki-compilequerysqlite-sync 等、不需要真的呼叫 Joplin Data API,請在迷你設定中加入:
joplin_wiki_writeback:
  enabled: false

若需測試 wiki 寫回路徑則設定 joplin_data_api.token(任意非空字串即可),並對 runWikiWriteback 傳入 fetch mock(見 test/joplin-wiki-writeback.test.js)。artifacts_project_notebook_title 只在 artifacts 按需寫回時必填。

  • wiki-compile --dry-run:不會對 Joplin 發送會變更資料的 HTTP;仍可能輸出 writeback_would_write 等乾跑統計(對 planner 路徑若檔案尚未存在,僅依路徑推估 topic)。corpus_auto_sweep.advance_state_on_dry_run: false(預設)時,dry-run 只跑 1 個 sweep 視窗且不推進 corpus-sweep-state.json
  • 小模型範例(見 config.yaml.example/README):chat_model: gemma4:e4bcorpus_digest_max_files: 40max_pages_per_run: 8min_pages_per_run: 2min_topic_pages_per_run: 3wiki-compile 預設單次掃完整輪,--batch=true 才只跑一個本地批次;Ollama num_ctx 由 Modelfile 設定。
  • 參考實作:src/config/load-config.jssrc/joplin/sqlite/exporter.jssrc/joplin/sqlite/notebooks.jssrc/joplin/sqlite/paths.jssrc/joplin/sqlite/sync-state.jssrc/commands/cmd-sqlite-sync.jssrc/joplin/wiki-writeback.jssrc/joplin/data-api-client.jssrc/wiki/wiki-compiler.jssrc/wiki/wiki-planner.jssrc/commands/cmd-agent-compile.js
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 29 lines · 1,684 tokens per session scan A f997dc265f1a

Subscribe to this mod's changes

joplin-brain-config is a cursor rule published in the GitHub repository gcake119/joplin-llm-wiki (2 stars, last pushed 3mo ago), licensed MIT. It adds 1,684 tokens to every session, about $0.0084 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.