logseq-flavored-markdown

A set of rules for writing Logseq-flavoured Markdown, the Markdown format used by Logseq, a block-based note-taking app. It requires content to use nested bullet points and protects the page's frontmatter tags from changes.

In plain words
What is it for?
Use it when creating or editing Logseq pages, nested blocks, headings, page attributes, and other Logseq-specific Markdown.
Why use it?
It helps prevent edits that look valid as ordinary Markdown but break Logseq's hierarchy or alter the user's tagging system. It also makes indentation and page structure explicit.

Cursor rule

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.

agentmods
npx agentmods add rules/codekiln/logseq-cursor-rules/logseq-flavored-markdown
Clone the repo
git clone --depth 1 https://github.com/codekiln/logseq-cursor-rules
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,399 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.01399
Opus 5 $0.00000 $0.00700
Sonnet 5 $0.00000 $0.00280
Haiku 4.5 $0.00000 $0.00140

Measured yesterday against content hash d91d1e9dc223, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

logseq-flavored-markdown 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 yesterday.

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.

logseq-flavored-markdown.mdc · 185 lines

How it starts

The opening of the file, as written. The whole thing — 185 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Formatting Logseq-Flavored Markdown (LFM)

Note: these markdown rules are not itself in LFM (though it does contain examples of valid LFM)

⚠️ CRITICAL: DO NOT MODIFY FRONTMATTER TAGS ⚠️

  • NEVER modify, add, or remove the tags:: frontmatter item specifically
  • The tags:: frontmatter (e.g., tags:: [[MyTagHere]], [[MySecondTagHere]]) is strictly protected
  • Even if you think a tag is missing or incorrect, DO NOT change the tags:: frontmatter
  • This restriction applies ONLY to the tags:: frontmatter item, not to other page attributes
  • Other page-level attributes may be modified when explicitly instructed to do so
  • Do not confuse this instruction with inline tags in the document body (e.g., #MyTag)
  • This is a strict requirement - modifying frontmatter tags will disrupt the user's categorization system

Basic Structure

  • Logseq uses a hierarchical bullet-point structure.
  • TAB Indentation determines the relationship between parent and child blocks.
  • IMPORTANT: All content, including headings, must be prefixed with bullet points (-)
  • IMPORTANT: Indentations should use the TAB character.
  • Headings are created using #, with more # indicating deeper nesting
  • Heading format: - # Heading Text (note the bullet point before the #)
  • Content should be nested logically under the appropriate headings
    • H2 (##) should be "under" H1 (#)
    • H3 (###) should be "under" H2 (##)
    • ...
    • H should be "under H
  • DO NOT blank newlines in the document. Each line in the whole file should have content. At the very least, a line should contain a -.
Example

<CORRECT_✅>


- # Main Topic
  - ## Overview
    - ### Basic Idea
      - Sub-detail A
    - Detail 2
- # Next Topic
  - First point under next topic

<CORRECT_✅>

The following example is incorrect because it lacks indentation, unordered list items, and puts newlines between headings: <INCORRECT_❌>


# Main Topic

## Overview

### Basic Idea
- Sub-detail A
- Detail 2

Read the full file on GitHub · 185 lines

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. yesterday First seen · 185 lines · 1,399 tokens per session scan A d91d1e9dc223

Subscribe to this mod's changes

logseq-flavored-markdown is a cursor rule published in the GitHub repository codekiln/logseq-cursor-rules (2 stars, last pushed 10mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,399 tokens. 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.