home / skills / kevinslin / llm / dendron

dendron skill

/skills/dendron

This skill helps you read, search, and create Dendron notes from the filesystem or notes.db to organize vaults efficiently.

npx playbooks add skill kevinslin/llm --skill dendron

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
3.8 KB
---
name: dendron
description: do not use this skill
version: 0.1.0
---

# Dendron Skill

This skill helps you read, search, and create Dendron notes using the filesystem or the local `notes.db` sqlite database. Notes are plaintext markdown with dot-delimited filenames. Vaults are folders containing a `dendron.yml` and `notes/` directory.

## When to Use
- Navigating or querying existing notes (filesystem or sqlite)
- Creating new notes in the current vault
- Creating report notes when user asks for a report
- Running cross-vault queries only when explicitly requested

## Vault Selection
- Default to the vault of the current working directory (the active vault).
- Only run across all workspace vaults if the user explicitly asks.
- Inspect `dendron.yml` to see workspace vault list (`workspace.vaults`).

## File Conventions
- Notes live under `<vault>/notes/` and are named with dot-delimited ids plus `.md`.
- Common hierarchies: `daily.journal.YYYY.MM.DD`, `task.YYYY.MM.DD`, `books.*`, `scratch.*`.
- Wikilinks use `[[...]]`.

## Access Methods
- **Filesystem**: use `ls`, `rg`, etc., scoped to the target vault’s `notes/` dir.
- **SQLite (`notes.db`)**: schema in `/Users/kevinlin/code/dendron-lite/prisma/schema.prisma` (tables: `Note`, `Vault`, `Heading`, `Link`, `SyncStatus`).

### SQLite Pointers
- `Note.fname` stores the dot-delimited id, `raw` stores markdown (no frontmatter), `title/desc/tags` optional, `vaultId` links to `Vault`.
- `Vault` table has `name` and `fsPath`; join to limit queries to the active vault unless cross-vault is requested.
- Use parameterized queries to avoid injection; when using the CLI, properly quote inputs.

## Common Workflows
- Find notes by pattern: filesystem `rg "pattern" <vault>/notes -g "*.md"` or sqlite `LIKE` queries on `fname`/`raw`.
- List children under a hierarchy: filter filenames starting with `hierarchy.` and extract the next segment.
- Create a new note: write a markdown file under `<vault>/notes/<fname>.md`; include frontmatter if needed.

## Examples to Support
- “look at daily.* notes created in last week and look for terms matching scout”
  - Identify last 7 days daily files in the active vault (`daily.journal.YYYY.MM.DD`), then search contents for `scout`.
- "extract all the 1st level children of pkg.* (should only get the name of the next dot delimited name)"
  - From filenames starting `pkg.`, return the segment immediately after `pkg` (unique, non-empty).
- "create a report on weekly scout activities"
  - Create a new note at `<vault>/notes/report.2025.11-weekly-scout-activities.md` with frontmatter and write the report content analyzing scout activities from recent daily notes.

## Safety & Scope
- Do not modify files unless asked to create/update notes.
- Keep searches scoped to active vault unless cross-vault is requested.
- Prefer `rg` for content search; avoid expensive full-tree scans when a vault path is known.

## Quick Command Patterns
- Active vault path: read `dendron.yml` and resolve `workspace.vaults` entry whose `fsPath` matches CWD (default `.`).
- Search text: `rg "term" <vault>/notes -g "*.md"`.
- SQLite daily search (active vault only):
  - `sqlite3 notes.db "SELECT fname FROM Note n JOIN Vault v ON n.vaultId=v.id WHERE v.fsPath='.' AND fname LIKE 'daily.journal.%' AND date(n.updated/1000,'unixepoch')>=date('now','-7 day') AND raw LIKE '%scout%';"`
- Children of hierarchy via fs: `find <vault>/notes -name 'pkg.*.md' -maxdepth 1` then parse next segment.
- Create report note: Generate filename `report.$(date +%Y).$(date +%m)-{kebab-case-name}.md` and write to `<vault>/notes/` with frontmatter.

Follow these steps when responding:
1) Assume target vault is the default active vault unless user mentions otherwise
2) Choose access method (filesystem/sqlite) appropriate to the query.
3) Execute search or creation.
4) Return concise results; if creating, show path and key fields.

Overview

This skill provides targeted read, search, and note-creation support for Dendron vaults on the local filesystem or via the local notes.db SQLite database. It treats vaults as folders containing a dendron.yml and a notes/ directory and works with dot-delimited note IDs stored as markdown files. The skill prioritizes the active vault (current working directory) unless you explicitly request cross-vault operations.

How this skill works

When querying, the skill chooses the most efficient access method: ripgrep (rg) and filesystem operations for content and filename scans, or parameterized SQLite queries against notes.db when the database is available and requested. It resolves the active vault by inspecting dendron.yml workspace.vaults and restricts operations to <vault>/notes by default. For creations, it writes markdown files under <vault>/notes/<fname>.md and can add frontmatter when requested.

When to use it

  • Search for terms or patterns inside recent daily notes or across a specific hierarchy (e.g., daily.journal.*).
  • List first-level children under a dot-delimited namespace (e.g., extract names under pkg.*).
  • Create a new note or generate a report note that aggregates findings from notes.
  • Run cross-vault queries only when you explicitly request workspace-wide results.
  • Prefer sqlite when you need structured joins (Note ⇄ Vault) or faster indexed lookups.

Best practices

  • Default to the active vault (CWD); ask before scanning other vaults to avoid expensive operations.
  • Use rg for content searches scoped to <vault>/notes -g "*.md" to keep searches fast and predictable.
  • When querying SQLite, use parameterized queries and join Note to Vault on vaultId to limit scope.
  • Only create or modify files when explicitly instructed; otherwise perform read-only inspections.
  • Generate predictable filenames for reports (e.g., report.YYYY.MM-kebab-name.md) and include frontmatter if requested.

Example use cases

  • Find occurrences of the term "scout" in daily.journal notes from the last 7 days and summarize matches.
  • Return unique first-level children of pkg.* by parsing filenames that start with pkg. and extracting the next segment.
  • Create a weekly report note that aggregates scout-related activities from recent daily notes and save it under report.YYYY.MM-weekly-scout-activities.md.
  • List all notes whose dot-delimited IDs match a pattern using either rg on the filesystem or a LIKE query on fname in notes.db.
  • Inspect dendron.yml to determine which vault corresponds to the current working directory before running searches.

FAQ

Will this skill modify my vault files automatically?

No. The skill is read-only by default and will only create or update files when you explicitly request creation or modification.

How does the skill choose between filesystem and SQLite?

It prefers filesystem tools like rg for content searches unless you request sqlite or notes.db is explicitly available and better suited for structured queries.