skills/obsidian-dataview/SKILL.md
Write Obsidian Dataview queries (DQL, inline DQL, and DataviewJS) from natural language descriptions. Use this skill whenever the user wants to query, filter, list, table, or summarize their Obsidian notes using Dataview — even if they just describe what data they want to see without mentioning "dataview" explicitly. Trigger on phrases like "show me all notes tagged...", "list my tasks due...", "table of books by rating", "query my vault for...", "create a dataview query", "dataview", "DQL", or any request to dynamically display, filter, sort, or aggregate note metadata in Obsidian.
npx skillsauth add alahmadiq8/skills obsidian-dataviewInstall 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.
You are an expert at writing Obsidian Dataview queries. Dataview is a plugin that provides a live index and query engine over an Obsidian vault. It lets users query their notes using the Dataview Query Language (DQL), inline DQL, or DataviewJS (JavaScript).
Your job is to translate natural language descriptions into correct, working Dataview queries. Always output queries ready to paste into an Obsidian note.
A DQL query lives inside a dataview code block and follows this structure:
```dataview
<QUERY-TYPE> <fields>
FROM <source>
<DATA-COMMAND> <expression>
<DATA-COMMAND> <expression>
```
Only the Query Type is mandatory. Everything else is optional.
| Type | Purpose | Notes |
|------|---------|-------|
| LIST | Bullet point list of pages | Can show one additional field per page |
| TABLE | Tabular view with columns | Comma-separated field list, supports AS "Header" |
| TASK | Interactive task list | Operates at task level, not page level |
| CALENDAR | Monthly calendar with dots | Requires a date field |
All types support WITHOUT ID to hide the file link / group key column.
| Command | Purpose | Can repeat? |
|---------|---------|-------------|
| FROM | Select sources (tags, folders, links) | No (0 or 1, right after query type) |
| WHERE | Filter by field conditions | Yes |
| SORT | Sort results by field(s) | Yes |
| GROUP BY | Group results; creates rows array | Yes |
| FLATTEN | Expand arrays into separate rows | Yes |
| LIMIT | Cap result count | Yes |
DQL executes line-by-line, top to bottom — each command transforms the result set and passes it to the next line. This is different from SQL.
#tag (includes subtags)"folder/path" (includes subfolders, no trailing slash)"folder/File" or "folder/File.md"[[note]] — pages that link TO this noteoutgoing([[note]]) — pages linked FROM this note[[]] or [[#]]#tag AND "folder", #a OR #b, negate with -#tagList with additional info:
```dataview
LIST rating
FROM #books
SORT rating DESC
```
Table with custom headers:
```dataview
TABLE author AS "Author", published AS "Year", file.inlinks AS "Mentions"
FROM #poems
SORT published ASC
```
Filtered tasks:
```dataview
TASK
WHERE !completed AND contains(tags, "#work")
GROUP BY file.link
```
Calendar view:
```dataview
CALENDAR due
WHERE typeof(due) = "date"
```
Inline DQL (single value, embedded in text):
`= this.file.name`
`= date(today)`
`= [[other note]].someField`
DataviewJS (full JavaScript):
```dataviewjs
dv.table(["Name", "Rating"],
dv.pages("#books")
.sort(b => b.rating, "desc")
.map(b => [b.file.link, b.rating]))
```
key: value between --- fences at file topKey:: Value (own line) or [Key:: Value] (in sentence)(Key:: Value)My Field → my-fieldobj.key1Pages have many automatic fields under file.*:
file.name, file.path, file.folder, file.ext, file.linkfile.ctime/file.cday, file.mtime/file.mday (created/modified dates)file.size, file.tags, file.etags, file.aliasesfile.inlinks, file.outlinks (links to/from this file)file.tasks, file.lists (all tasks/list items in the file)file.frontmatter (raw frontmatter key-value pairs)file.day (date from filename if in yyyy-mm-dd format)file.starred (bookmarked status)Tasks have implicit fields too: status, completed, checked, fullyCompleted, text, line, path, section, tags, outlinks, link, children, parent, task, annotated.
Task emoji shorthands map to fields: 🗓️ → due, ✅ → completion, ➕ → created, 🛫 → start, ⏳ → scheduled.
6, 3.6, -80true, falseYYYY-MM[-DDTHH:mm:ss] — access parts via .year, .month, .day, etc.6 hours, 4min, 6hr 4min[[Page]] or [[Page|Display]]"a", "b")obj.keydate(today), date(now), date(tomorrow), date(yesterday), date(sow) (start of week), date(eow), date(som), date(eom), date(soy), date(eoy)
dur(1 day), dur(3 hours), dur(2 weeks), dur(6hr 4min) — can combine with dates: date(today) - dur(7 days)
+, -, *, /, %=, !=, <, >, <=, >="text" + fieldlist[0], object["key"], object.key(x) => x.field[[Page]].field gets field from that pageWhen you use GROUP BY field, each result row has:
key: the grouped field valuerows: a DataArray of all matching pagesUse "swizzling" to access fields: rows.file.link gets all links in the group. Use length(rows) to count.
For complex queries, consult these reference files which contain the full documentation:
references/query-language.md — Complete DQL structure, all query types with examples, all data commands, differences from SQL
references/metadata-and-types.md — How to add metadata (frontmatter, inline fields), all implicit fields for pages and tasks, field types, emoji shorthands
references/expressions-and-literals.md — All expression types, comparison operators, lambdas, date/duration literals, link indexing
references/functions.md — All DQL functions: constructors, numeric ops, string ops, array/object ops, date formatting, utility functions
contains(), dateformat(), filter(), map(), choice(), default(), or any data manipulationreferences/javascript-api.md — DataviewJS codeblock API (dv.*), rendering, querying, Data Arrays, utility functions
dataviewjs blocks| Function | Purpose | Example |
|----------|---------|---------|
| contains(str, sub) | Check substring/list membership | WHERE contains(file.name, "WIP") |
| icontains(str, sub) | Case-insensitive contains | WHERE icontains(tags, "project") |
| length(array) | Count elements | TABLE length(file.inlinks) AS "Refs" |
| date(today) | Today's date | WHERE due <= date(today) |
| dur(X) | Duration literal | WHERE file.mtime >= date(today) - dur(7 days) |
| dateformat(d, fmt) | Format date as string | dateformat(file.ctime, "yyyy-MM-dd") |
| default(f, val) | Fallback for null | default(status, "unknown") |
| choice(b, l, r) | If/else | choice(done, "✅", "❌") |
| filter(arr, fn) | Filter array | filter(file.tasks, (t) => !t.completed) |
| map(arr, fn) | Transform array | map(file.tags, (t) => upper(t)) |
| flat(arr) | Flatten nested arrays | flat(rows.file.tags) |
| any(arr, fn) | Any element matches? | WHERE any(file.tasks, (t) => !t.completed) |
| all(arr, fn) | All elements match? | WHERE all(file.tasks, (t) => t.completed) |
| sum(arr) / average(arr) | Aggregate numbers | TABLE sum(hours) AS "Total" |
| round(n, d) | Round number | round(rating, 1) |
| replace(s, p, r) | String replace | replace(file.name, "_", " ") |
| regextest(pat, s) | Regex test | WHERE regextest("^2024", string(date)) |
| split(s, delim) | Split string | split(file.name, " - ") |
| join(arr, sep) | Join array to string | join(file.tags, ", ") |
| typeof(v) | Get type name | WHERE typeof(due) = "date" |
| number(s) | Extract number from string | number("18 years") = 18 |
| link(path) | Create link object | link("My Note") |
| meta(link) | Get link metadata | meta(section).subpath |
| striptime(date) | Remove time from date | striptime(file.ctime) = file.cday |
| nonnull(arr) | Remove nulls | sum(nonnull(list_of_values)) |
| sort(list) | Sort a list | sort(file.tags) |
| reverse(list) | Reverse a list | reverse(sort(file.tags)) |
| unique(arr) | Deduplicate | unique(flat(rows.file.tags)) |
| min/max(a,b,..) | Min/max of values | min(due, date(eom)) |
| extract(obj, keys..) | Pull fields from object | extract(file, "ctime", "mtime") |
typeof() for safety. When comparing dates, check typeof(due) = "date" to avoid null comparisons returning unexpected results.WHERE field checks existence. WHERE due filters out pages where due is null/undefined.completed, text, tags) are directly available. For other query types, access tasks via file.tasks.key and rows — use rows.field to access original page fields.`= expression` for embedding one value in text. No query types or data commands available.dataviewjs blocks with the dv.* API.```dataview ```, JS in ```dataviewjs ```, inline DQL in `= ...`.The Dataview documentation that powers this skill is sourced from: https://github.com/blacksmithgu/obsidian-dataview/tree/master/docs/docs
Each reference file includes source links. To update when the docs change, re-fetch the relevant files from GitHub and update the corresponding reference documents.
development
Generate reveal.js HTML slide presentations from topics, outlines, or content. Use when the user asks to create slides, presentations, decks, or talks. Triggers on: "create a presentation", "make slides about", "build a deck", "generate a talk", "slide deck for", or any request involving presentation creation. Supports code highlighting, fragments, speaker notes, math, markdown, and Mermaid.js diagrams (flowcharts, sequence, class, ER, mindmap, timeline, etc.).
tools
Edit and manage Obsidian vaults — create, read, update, and delete notes, manage properties/frontmatter, handle links and backlinks, work with tags, tasks, daily notes, templates, bases, and more. Uses the Obsidian CLI for safe vault operations when available, with direct file editing as fallback. Use this skill whenever the user mentions Obsidian, vault, knowledge base notes with wikilinks, frontmatter/properties on markdown files, daily notes, or any task involving an Obsidian vault — even if they just say "my notes" or reference a folder that looks like a vault (has .obsidian/ directory).
development
Creates and runs Grafana k6 load testing scripts for traffic simulation, performance testing, and stress testing. Use this skill whenever the user wants to load test an API, simulate traffic against a service, write a k6 script, do performance testing, stress testing, spike testing, soak testing, smoke testing, breakpoint testing, or any kind of traffic simulation. Also use when the user mentions k6, VUs (virtual users), ramping load, arrival rate, or wants to benchmark an endpoint's response time under load. Even if the user just says "test my API under load" or "how many requests can my server handle" — this skill is the right choice.
development
Build, configure, and develop Hugo static sites and themes. Use when the user wants to create a new Hugo site, develop or customize a Hugo theme, write Hugo templates (layouts, partials, shortcodes), configure hugo.toml/yaml/json, work with Hugo's asset pipeline (images, CSS/Sass, JS bundling), manage content (pages, sections, taxonomies, menus), or deploy a Hugo site. Triggers on mentions of "Hugo", "hugo.toml", "static site generator", Hugo-related template syntax (Go templates, baseof, partials), or Hugo content workflows.