claude/skills/logseq/SKILL.md
Logseq HTTP-API CLI (`logseq` on PATH) for querying and mutating a running Logseq graph from the shell. Use when the user asks about their Logseq graph, pages, blocks, journals, tags, backlinks, or wants to run Datalog over their notes. Mutations supported (create/update/delete pages and blocks, set properties) behind confirmations. Requires Logseq running with the HTTP APIs server enabled. Triggers on phrases "my logseq graph", "logseq search", "logseq pages", "logseq journals", "logseq tags", "logseq backlinks", "logseq today", "logseq block", "logseq stats", "logseq datalog", "logseq q", "logseq raw", "search my notes", "find in logseq", "blocks tagged with", "pages linking to".
npx skillsauth add kendreaditya/.config logseqInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
logseq is a single-binary shell wrapper over Logseq's HTTP API server (0.10.15+). Stdlib Python, no deps. All state lives in this skill folder.
Do NOT use this skill for:
logseq-plugin skill (separate concern).logseq doctor # verify server + auth + graph
logseq today # today's journal (page metadata)
logseq today --tree # today's journal with block tree
logseq search "keyword" # full-text search
logseq page "Reading List" --tree
logseq stats # block/page/tag/journal counts
logseq backlinks "Page X" --with-dates # linked refs w/ journal day on each block
logseq timeline "Page X" --text # all text mentions, grouped by date
First-time setup if doctor complains:
logseq init # interactive: prompts for token, host, port
The user's Logseq must be running with the HTTP APIs server enabled:
127.0.0.1, port 12315.If the server is disabled or not running, logseq doctor emits:
Logseq HTTP API server is not running on 127.0.0.1:12315. Start it from the toolbar icon in Logseq.
Run logseq <command> --help for full option details on any command.
Setup / meta
init — interactive: token, host, port → state/config.jsondoctor — diagnose server + auth + graph; --fix symlinks CLI into PATH; --wait-for-server auto-spawns open -a Logseq if the port is closed and polls up to 30s until the API answers (requires Auto-start in Logseq's server config for the HTTP server to come up)version — CLI + server versionsgraph / graphs — current graph / all configured graphsuse <name> — soft-pin default graph (Logseq itself must be switched manually)config-get [key] — print config (token redacted)config-set <key> <value> — write config keyReads
today [--tree], yesterday [--tree], tomorrow [--tree]journals --last N [--tree] / --since DATE [--until DATE] / --on DATEpage <name> [--tree] [--resolve-embeds] — --resolve-embeds inlines ((uuid)) placeholders with target content (recursive, cycle-safe)pages [--filter REGEX] [--namespace NS] [--namespace-tree NS]block <uuid> [--children] [--resolve-embeds]props <uuid> / prop <uuid> <key>backlinks <page> [--with-dates] [--fields k1,k2,...] — linked references; --with-dates injects journal_day (ISO) + page_name; --fields projects each block to only the listed keys (matches both k and block/k)tag <name> [--with-dates] — blocks referencing a tag/pagetimeline <page> [--text] [--order asc|desc] [--fields k1,k2,...] — refs grouped by journal date; --order controls date sort (default desc); --text = case-insensitive content match; --fields only applies to JSON outputsearch <query> [--limit N] [--with-dates] [--fields k1,k2,...] — full-text (PFTS markers stripped); --with-dates enriches blocks only (not pages-content); --fields projects result listsrecent / favorites / templatesStats, tags, properties
stats — graph summary (blocks, pages, tags, journals)stats --broken-refs — pages referenced but never opened (raw form)stats --orphans — name-only pseudopages with no contentstats --largest-pages [N] — top pages by block counttags [--sort freq|name] [--limit N]tag-freq <name>prop-keys / prop-values <key> / prop-search <key> [<value>]Writes (gated on --yes or interactive confirm; --dry-run prints without sending)
write page-create <name> [--content ...] [--properties JSON]write page-delete <name> / page-rename <old> <new>write block-insert <parent> <content> [--before UUID|--after UUID]write block-append <page> <content> / block-prepend <page> <content>write block-update <uuid> <content> / block-remove <uuid>write block-move <uuid> <new-parent> / block-batch <parent> <json-array>write prop-set <uuid> <key> <value> / prop-remove <uuid> <key>write template-apply|create|remove ...Raw / escape hatches
datalog '<query>' — full Datalog via datascript_queryq '<expr>' — Logseq simplified syntax: (page "X"), (tag "X"), (task TODO)custom-query '<edn>'raw <method> [--args JSON] — generic POST /apiraw --list [--grep PATTERN] — enumerate all 123 known methods--token X # overrides env + config
--host X # default 127.0.0.1
--port N # default 12315
--graph X # soft-pin a graph name
--format FMT # json|pretty|tree|md|table|plain|uuids
--pretty # shortcut for --format pretty
--uuids-only # shortcut for --format uuids (one per line)
--limit N / --offset N
--quiet / --verbose
--yes, -y # auto-confirm writes
--dry-run # print request without sending (writes only)
Default format: pretty when stdout is a TTY, json when piped. Override with --format.
Resolution precedence: CLI flag → env → config file → default.
LOGSEQ_API_TOKEN — tokenLOGSEQ_HOST — default 127.0.0.1LOGSEQ_PORT — default 12315LOGSEQ_GRAPH — soft-pinConfig file: ~/.config/claude/skills/logseq/state/config.json (chmod 600). Written by init and config-set.
# Dump today's journal as markdown
logseq today --tree --format md
# Page tree as plain indented bullets (content only, no JSON)
logseq page "Reading List" --tree --format plain
# All blocks matching a search term, resolved one at a time
logseq search "keyword" --uuids-only | xargs -n1 logseq block --children
# Chronological story for a topic (catches un-indexed refs via text match)
logseq timeline "Person X" --text
# Backlinks enriched + field-projected to keep JSON small
logseq backlinks "Person X" --with-dates --fields content,journal_day --format json
# Page tree with embed blocks resolved inline (no more stray ((uuid)) placeholders)
logseq page "Person X" --tree --resolve-embeds --format plain
# Timeline in chronological (oldest-first) order
logseq timeline "Person X" --text --order asc
# Graph stats for cron
logseq stats --format json | jq '{blocks, pages, journals}'
# Pages I linked to but never opened
logseq stats --broken-refs --format table
More in references/recipes.md.
getCurrentPage returns null on fresh journal mounts. The CLI doesn't hit this directly (uses today's date + getPage instead), but if you add a handler that needs the current page, read from the DOM title, not this endpoint.journalDay, createdAt), pull-query results are kebab-case (block/uuid, block/created-at, path-refs). The module handles this internally via defensive readers. See references/shapes.md.search snippets have PFTS markers ($pfts_2lqh>...<pfts_2lqh$). The CLI strips them via strip_pfts before output.
3a. search returns two kinds of UUIDs. blocks[].uuid are block UUIDs — pass to logseq block. pages-content[].uuid are page UUIDs — passing them to logseq block fails (the CLI now reports "That UUID is the page 'X', not a block" and suggests logseq page). Use pages list for page titles.deletePage purges the :block/name entry, so [[Deleted Page]] references in other blocks become untracked text. The "broken refs" query can't find them anymore. Consequence: "broken ref" truly means "page referenced + pseudopage only", not "deleted page referenced".insertBlock don't always populate :block/refs. Top-level blocks created via appendBlockInPage do. Use top-level blocks for seeds/tests that need reliable backlinks.:server/tokens list, it accepts any bearer token. The CLI doesn't detect this.list_files_of_current_graph is declared but unwired in 0.10.15 — raw call returns MethodNotExist. Documented in references/api.md.logseq use X only writes a soft-pin to config. The user must switch graphs inside Logseq.# Seed a fresh logseq-test graph (safety-checks current graph == 'logseq-test')
python3 ~/.config/claude/skills/logseq/scripts/tests/seed.py --reset
# Run the full test harness (73 assertions)
bash ~/.config/claude/skills/logseq/scripts/tests/run_tests.sh
SKILL.md — this file.scripts/logseq.py — entry point; symlinked from ~/.config/scripts/logseq.scripts/_logseq_common.py — HTTP client, config, formatters, datalog constants, error classifier.scripts/commands/ — per-group handlers (reads, stats, writes, raw, meta).scripts/tests/seed.py — populates logseq-test with 15 pages / ~30 blocks.scripts/tests/run_tests.sh — 73 assertions against the seeded graph.references/api.md — full enumerated HTTP API surface.references/datalog.md — Datalog query cookbook.references/shapes.md — JSON response shapes.references/recipes.md — copy-pasteable pipelines.state/config.json — token + host + port + preferred date format.development
Search and read content from leetcode.com — problem catalog, daily challenge, full problem statements with hints and starter code, the Discuss forum (interview experiences, comp posts, layoff threads), and company question-list metadata. Read-only, no auth, no API key. Use when the user wants to look up a LeetCode problem by name/number/slug, see today's daily challenge, search Discuss for interview write-ups at a specific company (Google, Waymo, Meta, Amazon, etc.), browse a tag-filtered discuss feed, read a Discuss post + comments, or check what a LeetCode company list covers. Triggers — "lcsearch", "leetcode search", "search leetcode", "leetcode discuss", "leetcode problem", "daily leetcode", "interview discuss", "what's the leetcode for X", URLs containing leetcode.com/problems/, leetcode.com/discuss/, or leetcode.com/company/. Pair with the `interviewcoder` skill (structured leetcode-style writeups from 1point3acres) and `blind` (anonymous workplace chatter) for the same companies.
development
Terminal Spotify playback/search via spogo (preferred) or spotify_player.
development
Search and read posts from interviewcoder.co — a Next.js-fronted aggregator of technical-interview writeups (largely sourced from 1point3acres) tagged by company, position, stage (Phone Screen / OA / Onsite / etc.), period, job type, and structured leetcode-style questions. Use when the user wants real interview questions for a specific company, recent writeups from a hiring loop, leetcode-style problems with tags and difficulty, or to look up a specific interviewcoder.co URL. Read-only, no auth, no API key. Triggers — "interviewcoder", "interviewcoder.co", "interview questions at [company]", "what's been asked at [company] recently", "interview writeup", and URLs containing interviewcoder.co.
tools
Small Yahoo Finance CLI for ticker info + N-year stock returns. Use when the user asks about: stock price, market cap, sector/industry classification, dividend yield, P/E ratio, beta, 52-week range, N-year stock return, company description for a public company. Triggers: 'yfinance', 'yfin', 'stock price', 'market cap of', 'how much has X stock returned', 'sector for ticker', 'industry classification'. Pairs with the levels-fyi skill for cross-checking public/private status (levels gives ticker, yfin returns live data).