Logseq Review Workflow Eval
logseq/logseq
Compare two revisions of the Logseq logseq-review-workflow skill by running the same review prompt against isolated before and after skill snapshots, collecting both outputs, and producing a…
A skill your agent uses when measuring or optimising Trilium's backend search — "why is autocomplete slow on a big database?", "where does a search spend its time?", "did this change actually make…
$ npx skills add TriliumNext/Trilium --skill benchmarking-search -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install TriliumNext/Trilium benchmarking-search --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/TriliumNext/Trilium.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/benchmarking-search .claude/skills/benchmarking-search && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "benchmarking-search" agent skill from https://github.com/TriliumNext/Trilium/tree/main/.claude/skills/benchmarking-search into .claude/skills/benchmarking-search/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "benchmarking-search", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/TriliumNext/Trilium/tree/main/.claude/skills/benchmarking-searchType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add TriliumNext/Trilium --skill benchmarking-search -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install TriliumNext/Trilium benchmarking-search --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/TriliumNext/Trilium.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.claude/skills/benchmarking-search .agents/skills/benchmarking-search && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "benchmarking-search" agent skill from https://github.com/TriliumNext/Trilium/tree/main/.claude/skills/benchmarking-search into .agents/skills/benchmarking-search/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "benchmarking-search", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add TriliumNext/Trilium --skill benchmarking-search -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install TriliumNext/Trilium benchmarking-search --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/TriliumNext/Trilium.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.claude/skills/benchmarking-search .cursor/skills/benchmarking-search && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "benchmarking-search" agent skill from https://github.com/TriliumNext/Trilium/tree/main/.claude/skills/benchmarking-search into .cursor/skills/benchmarking-search/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "benchmarking-search", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/TriliumNext/Trilium.git --path .claude/skills/benchmarking-search--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add TriliumNext/Trilium --skill benchmarking-search -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install TriliumNext/Trilium benchmarking-search --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/TriliumNext/Trilium.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.claude/skills/benchmarking-search .gemini/skills/benchmarking-search && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "benchmarking-search" agent skill from https://github.com/TriliumNext/Trilium/tree/main/.claude/skills/benchmarking-search into .gemini/skills/benchmarking-search/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "benchmarking-search", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install TriliumNext/Trilium benchmarking-searchInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add TriliumNext/Trilium --skill benchmarking-search -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/TriliumNext/Trilium.git skills-src && mkdir -p .github/skills && cp -r skills-src/.claude/skills/benchmarking-search .github/skills/benchmarking-search && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "benchmarking-search" agent skill from https://github.com/TriliumNext/Trilium/tree/main/.claude/skills/benchmarking-search into .github/skills/benchmarking-search/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "benchmarking-search", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add TriliumNext/Trilium --skill benchmarking-search -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install TriliumNext/Trilium benchmarking-search --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/TriliumNext/Trilium.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.claude/skills/benchmarking-search .opencode/skills/benchmarking-search && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "benchmarking-search" agent skill from https://github.com/TriliumNext/Trilium/tree/main/.claude/skills/benchmarking-search into .opencode/skills/benchmarking-search/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "benchmarking-search", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
benchmarking-searchA skill your agent uses when measuring or optimising Trilium's backend search — "why is autocomplete slow on a big database?", "where does a search spend its time?", "did this change actually make…
Benchmarking Search is an agent skill from TriliumNext/Trilium. Use when measuring or optimising Trilium's backend search — "why is autocomplete slow on a big database?", "where does a search spend its time?", "did this change actually make search faster?", or any before/after on packages/trilium-core/src/services/search. Boots core against a read-only snapshot of a real database, times a query, and attributes a CPU profile by caller or by callee. Includes the measurement discipline that separates a real win from machine noise — several plausible "wins" in this area have…
Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files.
It sits in Knowledge Management. The repository describes itself as: Build your personal knowledge base with Trilium Notes. The licence is AGPL-3.0.
6 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 80be026. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships script files (TypeScript), which the agent can run.
Shell commands in SKILL.md call:
nodesqlite3From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Benchmarking Search loads about 2.3k tokens when it runs. Until then it costs about 157 tokens; SKILL.md has 991 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from TriliumNext/Trilium at commit 80be026, republished under its AGPL-3.0 licence (© TriliumNext). 991 words, ~2,283 tokens.
.claude/skills/benchmarking-search/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.Search performance only reproduces on a real database. A synthetic fixture has uniform titles, no clones, no inherited attributes and a shallow tree, and none of the costs that dominate in practice show up. Always measure against a snapshot of a real document.
| reads | answers | |
|---|---|---|
bench-search.mts | a database snapshot | how long does this query take, and how does that change |
bench-profile.mts | a .cpuprofile it writes | which function, called by whom, and what does it contain |
Never benchmark against a live document — and never let the harness write to one.
# macOS: ~/Library/Application Support/trilium-data ; Linux: ~/.local/share/trilium-data
cd ~/Library/Application\ Support/trilium-data
sqlite3 "file:document.db?mode=ro" ".backup '/path/to/bench/document.db'".backup uses SQLite's backup API, so it is safe while the app is running and handles the WAL. The source is opened mode=ro and never written. A 1.9 GB document copies in about seven seconds.
The snapshot must be named document.db and sit in a directory of its own — that directory becomes TRILIUM_DATA_DIR.
bench-search.mts has to live under apps/server/ to run: @triliumnext/core is a workspace package that pnpm links only into apps/server/node_modules, and ESM resolves bare specifiers from the importing file's own location.
cp .claude/skills/benchmarking-search/bench-search.mts apps/server/
TRILIUM_RESOURCE_DIR=$PWD/apps/server/src \
TRILIUM_DATA_DIR=/path/to/bench \
TRILIUM_GENERAL_READONLY=true \
TRILIUM_GENERAL_NOBACKUP=true \
BENCH_ITERATIONS=40 \
node --import tsx apps/server/bench-search.mts a t 'the quick brown fox'
rm apps/server/bench-search.mts # when finished| variable | why |
|---|---|
TRILIUM_RESOURCE_DIR | assets live under src/assets in dev; without it resource_dir.ts calls process.exit(1) at import time |
TRILIUM_GENERAL_READONLY | the harness refuses to start without it, so a snapshot is never written to |
TRILIUM_GENERAL_NOBACKUP | stops the backup service touching the snapshot directory |
BENCH_ITERATIONS | default 5. Use 40 for anything you intend to act on |
BENCH_PROFILE | write a .cpuprofile covering only the search calls |
BENCH_AUTOCOMPLETE | =1 sets autocomplete: true, taking NoteFlatTextExp's single-token path |
BENCH_ONE_PASS | =1 disables two-pass ranking, i.e. the pre-ab6dc34c15 behaviour |
It boots core exactly as apps/server/src/main.ts does, minus the HTTP server, so the code under test is the real thing.
BENCH_PROFILE=/tmp/a.cpuprofile ... node --import tsx apps/server/bench-search.mts a
# top functions by self time
node --import tsx .claude/skills/benchmarking-search/bench-profile.mts /tmp/a.cpuprofile 15
# who calls removeDiacritic, walking past thin wrappers
node --import tsx .claude/skills/benchmarking-search/bench-profile.mts /tmp/a.cpuprofile 8 \
removeDiacritic "normalize,normalizeSearchText,tokenizeIntoWords"
# what NoteFlatTextExp.execute spends its time on, by callee
node --import tsx .claude/skills/benchmarking-search/bench-profile.mts /tmp/a.cpuprofile 10 \
"children:execute@note_flat_text"The skip list matters. removeDiacritic is called ~100% from normalize, which is called ~100% from normalizeSearchText — attributing one level up tells you nothing. Skipping those names lands the blame on code that chose to normalize.
The @file suffix on children: narrows to one implementation; execute is a method on every expression type.
This is the most important section. Search work in this repo has repeatedly produced plausible numbers that were wrong.
Calibrate before trusting anything. Run the same code three times. Observed on a developer machine running Trilium alongside: ±10% at 12 iterations, ±4-5% at 40. Anything smaller than the floor is unresolvable, and reporting it as a win is a mistake.
Never compare measurements taken minutes apart. The machine drifts. One change here was recorded at 189 ms, and the identical code measured 210 ms later in the same session. Always measure both arms back to back, ideally in one command.
Prefer phase timers to wall clock. They are in-process, unsampled, and immune to profiler overhead. They are not in the codebase — add them temporarily around the stages of performSearch:
const t0 = performance.now();
const noteSet = expression.execute(allNoteSet, executionContext, searchContext);
const executeMs = performance.now() - t0;
// ... same around result construction, the computeScore loop, and the sort
getLog().info(`phases: execute=${executeMs.toFixed(1)} build=${buildMs.toFixed(1)} ...`);Then take the minimum of each phase independently across iterations — the least-contended estimate of each — rather than the phases of the best single iteration.
Phase timers catch what wall clock hides. A per-search cache keyed on `${noteId}-${parentNoteId}` showed a consistent 4-8% wall-clock improvement across every query, and the phase it targeted had gone 58.4 ms → 62.1 ms, i.e. slower. The tell: executeMs had also "improved", and the change could not possibly touch executeMs. If a phase your change cannot reach appears to move, you are reading noise.
Self time undercounts. Ranking leads by self time led to sizing one at ~23 ms when its subtree was 42.9 ms. Use children: for anything whose cost is in its callees.
Strings are the usual culprit. Almost every real win here was an allocation removed, not an algorithm improved: a template literal built per call, a Map key concatenated per lookup, String.normalize("NFD") re-run over a constant. Prefer nested maps over combined string keys — Map<parent, Map<child, V>> allocates nothing per lookup.
For a query matching most of the database (a single letter matches ~84% of a 22k-note document, since flat text includes noteId, type and mime):
| phase | what happens | typical share |
|---|---|---|
execute | getCandidateNotes scans every flat text; searchPathTowardsRoot resolves a note path per candidate | ~50% |
build | a SearchResult per match, each resolving its path segment titles | ~19% |
score | computeScore per match: title, path and content contributions | ~27% |
sort | full sort; the comparator's notePathTitle tiebreak fires constantly on equal scores | ~6% |
Every phase is O(matches). That is the ceiling: no micro-optimisation halves a query that matches 18,000 notes. Reaching a large win means processing fewer results — which is what two-pass ranking does — or matching fewer notes, which is a product decision.
The slowest shape is not the biggest result set but zero matches with several tokens: a 5-token query with no matches costs ~650 ms, because fewer than five good results triggers the progressive search's second pass and the whole scan runs twice, with cost linear in token count. That is the shape behind issue #10712.
Eight commits on perf/autocomplete-debounce (PR #11542), each with its measurements in the commit body. Read those before re-treading:
notesCount / 20 ms capped at a second, measured from the last search rather than the last keystroke.Tried and rejected, with numbers, so they are not retried blindly:
| why | |
|---|---|
| Reordering the archived filter after the fulltext match | broke 3 parse.spec assertions; execute +6 ms |
Per-search getAllNotePaths cache | copy-on-extend allocation exactly cancelled the sharing |
Lazy notePathTitle alone | build −16%, sort +68% — the sort tiebreak reads it |
Lazy notePathArray | broke 5 tests for ~2% |
autocomplete: true (the single-token fast path) | faster on 1 char, slower on 2+, and it changes results — it keeps candidates matching only via inherited attributes |
© TriliumNext, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 2 other files in .claude/skills/benchmarking-search of TriliumNext/Trilium.
Open the folder on GitHubat commit 80be026
Benchmarking Search next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Benchmarking Search this skillTriliumNext/Trilium | 38k | — | ~2.3k | Automated safety check: Pass | AGPL-3.0 | |
| Logseq Review Workflow Evallogseq/logseq | 45k | — | ~1k | Automated safety check: Pass | AGPL-3.0 | |
| Baoyu URL To Markdownsdyckjq-lab/llm-wiki-skill | 2.5k | 2 repos | ~3.2k | Automated safety check: Pass | None | |
| Obsidian CLIAtmosphere/atmosphere | 3.8k | 13 repos | ~795 | Automated safety check: Pass | Apache-2.0 | |
| Esm Cjs Risk Scanlogseq/logseq | 45k | — | ~3.3k | Automated safety check: Pass | AGPL-3.0 | |
| Knowledge Searchdataelement/bisheng | 12k | — | ~1.1k | Automated safety check: Pass | Apache-2.0 |
logseq/logseq
Compare two revisions of the Logseq logseq-review-workflow skill by running the same review prompt against isolated before and after skill snapshots, collecting both outputs, and producing a…
sdyckjq-lab/llm-wiki-skill
Fetch any URL and convert to markdown using Chrome CDP. An agent skill from sdyckjq-lab/llm-wiki-skill.
Atmosphere/atmosphere
Interact with Obsidian vaults using the Obsidian CLI to read, create, search, and manage notes, tasks, properties, and more.
logseq/logseq
Scan Logseq ClojureScript Node/Electron targets for npm module loading risks, especially ESM-only packages that may fail when loaded through js/require or shadow-cljs require-based shims.
dataelement/bisheng
Search the user's knowledge bases and knowledge spaces (企业知识库检索).
outline/outline
Save the current conversation, a decision, or a set of notes as a document in an Outline collection; use when the user wants to keep what was discussed in their knowledge base.
TriliumNext/Trilium
A skill your agent uses when cutting, preparing, or debugging a Trilium release — bumping the monorepo version, tagging, or diagnosing a failed "Release" workflow run.
TriliumNext/Trilium
A skill your agent uses when working on the Trilium Electron desktop app (apps/desktop) — adding or changing an electronApi method / IPC channel, touching preload.ts, main.ts, services/window.ts or…
TriliumNext/Trilium
A skill your agent uses when adding a DB migration or a new column/field to a Becca entity in Trilium ("add a migration", "new column on notes/attributes", "ALTER TABLE", "add a field to…
TriliumNext/Trilium
A skill your agent uses when adding, moving, or wiring an internal REST endpoint in Trilium (a new /api/ route) — choosing between a core-shared handler (packages/trilium-core/src/routes/index.ts…
TriliumNext/Trilium
A skill your agent uses when adding, changing, or reviewing an LLM/MCP tool in Trilium (the defineTools definitions under packages/trilium-core/src/services/llm/tools/ —…
TriliumNext/Trilium
Write, extend, and review CKEditor 5 plugins in the Trilium (TriliumNext Notes) monorepo — the rich-text-note editor under packages/ckeditor5, whose plugins live in src/plugins/.
Categories
A skill your agent uses when measuring or optimising Trilium's backend search — "why is autocomplete slow on a big database?", "where does a search spend its time?", "did this change actually make…. Benchmarking Search is an agent skill from TriliumNext/Trilium.", or any before/after on packages/trilium-core/src/services/search.
Benchmarking Search fits situations like: optimising Triliums backend search — why is autocomplete slow on a big database?; where does a search spend its time?; did this change actually make search faster?; any before/after on packages/trilium-core/src/services/search.
Run `npx skills add TriliumNext/Trilium --skill benchmarking-search -a claude-code`. Or copy the skill folder (.claude/skills/benchmarking-search in TriliumNext/Trilium) into .claude/skills/benchmarking-search in your project. Claude Code loads it when a task matches its description.
Run `npx skills add TriliumNext/Trilium --skill benchmarking-search -a codex`. Or copy the skill folder (.claude/skills/benchmarking-search in TriliumNext/Trilium) into .agents/skills/benchmarking-search in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add TriliumNext/Trilium --skill benchmarking-search -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/benchmarking-search, .gemini/skills/benchmarking-search, .github/skills/benchmarking-search and .opencode/skills/benchmarking-search in your project.
Going by SKILL.md and its folder, Benchmarking Search needs TypeScript for the scripts in its folder and the command-line tools its instructions call (node and sqlite3).
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Benchmarking Search is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.3k tokens (SKILL.md is roughly 9.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Benchmarking Search: Logseq Review Workflow Eval (logseq/logseq, 45k stars), Baoyu URL To Markdown (sdyckjq-lab/llm-wiki-skill, 2.5k stars), Obsidian CLI (Atmosphere/atmosphere, 3.8k stars) and Esm Cjs Risk Scan (logseq/logseq, 45k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
TriliumNext (a GitHub organization) maintains it in TriliumNext/Trilium, which has 38,265 GitHub stars. The repository holds 23 skills in this directory. The repository was last updated on October 10, 2026.
Source: TriliumNext/Trilium on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.