Obsidian Bases Skill
This package owns the .base file format: the YAML schema, filters, formulas, properties, functions, summaries, view types, row selection and ordering, examples, and validation. It works on its own. Nothing here requires discovering, dispatching to, or loading another skill, and nothing requires fetching a remote page -- the complete function catalog ships in references/FUNCTIONS_REFERENCE.md.
Being able to write a valid base is not authorization to change a vault, and a base that parses is not a base that renders what you intended. Resolve the exact target and the authorized effect before any write, and keep the work read-only when either is missing. See references/operations.md for safe edits, error conditions, empty-result triage, readback, and rendering.
Scope
Owned here:
- The
.baseschema and every construct inside it:filters,formulas,properties,summaries, andviewswith theirtype,name,filters,groupBy,sort,order,limit, andsummarieskeys. - Expression syntax for filters and formulas, the property namespaces (
note.,file.,formula.),this, and the function and duration rules that make those expressions valid. - Static validation of a base document, and the boundary between a document that parses, a file that was written where you meant, and a view that renders the rows you expected.
Not owned here:
- Which notes deserve a base, where the
.basefile belongs, which template frames it, and what provenance it carries. Respect the target vault's applicable policy and the user's exact task. If no policy file exists, use explicit task-bound choices; clarify only missing decisions rather than inventing conventions. - Markdown note syntax,
.canvasgraph structure, and vault CLI operations. Name the matching package by identity --obsidian-visualize,obsidian-cli-- only when the task actually reaches that artifact and that package is loaded. When it is not, report the gap rather than improvising.
This package is standalone. Authoring the format needs no vault plugin, mutation server, environment variable, or personal configuration; rendering requires the target app's Bases capability. Applicable live vault policy always governs the task. Optional personal-policy tools and a vault-aware CLI compose only when selected; their absence is normal and unselected tools stay unused.
Workflow
- Resolve the target: the vault-relative path of the
.basefile (or the note holding an embeddedbaseblock), the effect (create, add a view, change a filter), and the authority for it. Stay read-only until all three are known. Read the file first when it already exists. - Create or open the file: a
.basefile in the vault containing valid YAML. - Define scope: add
filtersto select which notes appear (by tag, folder, property, or date). A base with no filters includes every file in the vault. - Add formulas (optional): define computed properties in the
formulassection. - Configure views: add one or more views (
table,cards,list,kanban, ormap) withorderspecifying which properties to display, plussort,groupBy, andlimitwhen the rows need an order, grouping, or a cap. - Validate: verify the file is valid YAML with no syntax errors. Check that all referenced properties and formulas exist. Common issues: unquoted strings containing special YAML characters, mismatched quotes in formula expressions, referencing
formula.Xwithout definingXinformulas. - Read back, then check the render: re-read the file from its path and confirm the document you intended is what landed. Then open the base in Obsidian and confirm the view renders the expected rows. These are two separate claims; neither follows from valid YAML. When no app is available, report the render leg as unverified.
Schema
Base files use the .base extension and contain valid YAML.
# Global filters apply to ALL views in the base
filters:
# Can be a single filter string
# OR a recursive filter object with exactly ONE key: and, or, or not
and:
- 'status == "active"'
- not:
- 'file.hasTag("archived")'
# Define formula properties that can be used across all views
formulas:
formula_name: 'expression'
# Configure display names and settings for properties
properties:
property_name:
displayName: "Display Name"
formula.formula_name:
displayName: "Formula Display Name"
file.ext:
displayName: "Extension"
# Define custom summary formulas
summaries:
custom_summary_name: 'values.mean().round(3)'
# Define one or more views
views:
- type: table | cards | list | kanban | map
name: "View Name"
limit: 10 # Optional: cap how many rows the view shows
groupBy: # Optional: one property only
property: property_name
direction: ASC | DESC
sort: # Optional: row order, first entry wins ties
- property: property_name
direction: ASC | DESC
filters: # View-specific filters follow the same rules
and:
- 'status == "active"'
order: # Columns to display, left to right
- file.name
- property_name
- formula.formula_name
summaries: # Map properties to summary formulas
property_name: Averageorder is the display order of columns, not the order of rows -- row order is sort. Mixing the two up is the most common reason a base "ignores" a requested ordering.
A view may also carry keys this schema does not list: the app writes view state (for example the layout's own display settings) into the same object. Carry unknown keys through unchanged when editing; deleting them silently resets someone's view.
Filter Syntax
Filters narrow down results. They can be applied globally or per-view. Global and view filters are both applied to a view, combined with AND.
Filter Structure
# Single filter
filters: 'status == "done"'
# AND - all conditions must be true
filters:
and:
- 'status == "done"'
- 'priority > 3'
# OR - any condition can be true
filters:
or:
- 'file.hasTag("book")'
- 'file.hasTag("article")'
# NOT - exclude matching items
filters:
not:
- 'file.hasTag("archived")'
# Nested filters
filters:
or:
- file.hasTag("tag")
- and:
- file.hasTag("book")
- file.hasLink("Textbook")
- not:
- file.hasTag("book")
- file.inFolder("Required Reading")A filter object holds exactly one of and, or, or not, and its value is a list whose entries are either filter strings or further filter objects. A filter string is any expression that evaluates truthy or falsey for a note, so filters and formulas share one syntax and one function set.
Filter Operators
| Operator | Description |
|---|---|
== |
equals |
!= |
not equal |
> |
greater than |
< |
less than |
>= |
greater than or equal |
<= |
less than or equal |
&& |
logical and |
|| |
logical or |
| <code>!</code> | logical not |
Arithmetic Operators
| Operator | Description |
|---|---|
+ |
plus |
- |
minus |
* |
multiply |
/ |
divide |
% |
modulo |
( ) |
parenthesis |
Properties
Three Types of Properties
- Note properties - From frontmatter:
note.authoror justauthor. Available for Markdown files only. - File properties - File metadata:
file.name,file.mtime, etc. Available for every file type, including attachments. - Formula properties - Computed values defined in this base:
formula.my_formula.
File Properties Reference
| Property | Type | Description |
|---|---|---|
file.name |
String | File name |
file.basename |
String | File name without extension |
file.path |
String | Full path to file |
file.folder |
String | Parent folder path |
file.ext |
String | File extension |
file.size |
Number | File size in bytes |
file.ctime |
Date | Created time |
file.mtime |
Date | Modified time |
file.tags |
List | All tags in file |
file.links |
List | Internal links in file |
file.backlinks |
List | Files linking to this file |
file.embeds |
List | Embeds in the note |
file.properties |
Object | All frontmatter properties |
file.file |
File | The file object itself, for functions that take one |
file.backlinks is a reverse lookup and is performance heavy; prefer file.links from the other side when the query allows it. file.backlinks and file.properties are not guaranteed to refresh as the vault changes, so a stale row is an index question, not a schema defect.
The this Keyword
- In main content area: refers to the base file itself (
this.file.folderis the base's own folder) - When embedded: refers to the embedding file (
this.file.nameis the note or canvas holding the embed, not the base) - In sidebar: refers to the active file in main content, which is what makes
file.hasLink(this.file)behave like a backlinks pane
Formula Syntax
Formulas compute values from properties. Defined in the formulas section.
formulas:
# Simple arithmetic
total: "price * quantity"
# Conditional logic
status_icon: 'if(done, "✅", "⏳")'
# String formatting
formatted_price: 'if(price, price.toFixed(2) + " dollars")'
# Date formatting
created: 'file.ctime.format("YYYY-MM-DD")'
# Calculate days since created (use .days for Duration)
days_old: '(now() - file.ctime).days'
# Calculate days until due date
days_until_due: 'if(due_date, (date(due_date) - today()).days, "")'A formula may reference another formula as long as the references do not form a cycle. Formula values are written as YAML strings, but the value a formula produces is typed by the data and the functions it uses, so a formula can feed a numeric summary or a date comparison.
Key Functions
Most commonly used functions. For the complete reference of all types (Date, String, Number, List, File, Link, Object, RegExp), see FUNCTIONS_REFERENCE.md. That file is the whole catalog; no remote lookup is part of this workflow.
| Function | Signature | Description |
|---|---|---|
date() |
date(string): date |
Parse string to date (YYYY-MM-DD HH:mm:ss) |
now() |
now(): date |
Current date and time |
today() |
today(): date |
Current date (time = 00:00:00) |
if() |
if(condition, trueResult, falseResult?) |
Conditional |
duration() |
duration(string): duration |
Parse duration string |
file() |
file(path): file |
Get file object |
link() |
link(path, display?): Link |
Create a link |
Duration Type
When subtracting two dates, the result is a Duration type (not a number).
Duration Fields: duration.days, duration.hours, duration.minutes, duration.seconds, duration.milliseconds
IMPORTANT: Duration does NOT support .round(), .floor(), .ceil() directly. Access a numeric field first (like .days), then apply number functions.
# CORRECT: Calculate days between dates
"(date(due_date) - today()).days" # Returns number of days
"(now() - file.ctime).days" # Days since created
"(date(due_date) - today()).days.round(0)" # Rounded days
# WRONG - will cause error:
# "((date(due) - today()) / 86400000).round(0)" # Duration doesn't support division then roundDate Arithmetic
# Duration units: y/year/years, M/month/months, d/day/days,
# w/week/weeks, h/hour/hours, m/minute/minutes, s/second/seconds
"now() + \"1 day\"" # Tomorrow
"today() + \"7d\"" # A week from today
"now() - file.ctime" # Returns Duration
"(now() - file.ctime).days" # Get days as numberRows: Filter, Group, Sort, Limit
Four different keys decide what a view shows. Keep them straight before blaming the data.
| Key | Scope | What it decides |
|---|---|---|
filters (top level) |
Every view in the base | Which notes are candidates at all |
filters (inside a view) |
That view only | Further narrowing, combined with the global filters using AND |
groupBy |
That view | Which property splits rows into sections; direction orders the sections |
sort |
That view | Row order within the result; a list of {property, direction} entries, first entry primary |
limit |
That view | How many rows the view shows |
order |
That view | Which columns appear, left to right -- not row order |
views:
- type: table
name: "Active studies"
groupBy:
property: status
direction: ASC
sort:
- property: priority
direction: ASC
- property: file.name
direction: ASC
limit: 25
order:
- file.name
- priorityASCis the ascending direction for the property's type: A to Z for text, smallest first for numbers, oldest first for dates.DESCreverses it.- Later
sortentries break ties left by earlier ones. A single entry leaves ties in an order you should not promise. - Grouping is limited to one property. A second grouping level is not expressible in this schema; use
sortto order within the group instead. - Rows whose grouping property is empty are grouped under the empty value rather than dropped.
limitcaps the rows the view shows. Which rows survive a cap is a rendered outcome -- read the view before claiming a specific row was excluded by the limit rather than by a filter.
View Types
Table View
views:
- type: table
name: "My Table"
order:
- file.name
- status
- due_date
summaries:
price: Sum
count: AverageCards View
views:
- type: cards
name: "Gallery"
order:
- file.name
- cover_image
- descriptionList View
views:
- type: list
name: "Simple List"
order:
- file.name
- statusKanban View
Columns come from the grouped property, so a kanban view needs a groupBy.
views:
- type: kanban
name: "Board"
groupBy:
property: status
direction: ASC
order:
- file.name
- dueMap View
Requires latitude/longitude properties and the Maps plugin.
views:
- type: map
name: "Locations"
# Map-specific settings for lat/lng propertiesLayout availability
| Layout | Introduced in app version | Extra requirement |
|---|---|---|
table |
1.9 | -- |
cards |
1.9 | -- |
list |
1.10 | -- |
kanban |
1.14 | Needs a groupBy property |
map |
1.10 | Maps plugin |
Community plugins can add further layouts. Availability is a runtime fact of the installed app, not something the YAML can assert: a type the installed build does not know does not render, and no amount of valid syntax changes that. Check the installed version and the enabled plugins, or report the layout as unverified.
Default Summary Formulas
| Name | Input Type | Description |
|---|---|---|
Average |
Number | Mathematical mean |
Min |
Number | Smallest number |
Max |
Number | Largest number |
Sum |
Number | Sum of all numbers |
Range |
Number | Max - Min |
Median |
Number | Mathematical median |
Stddev |
Number | Standard deviation |
Earliest |
Date | Earliest date |
Latest |
Date | Latest date |
Range |
Date | Latest - Earliest |
Checked |
Boolean | Count of true values |
Unchecked |
Boolean | Count of false values |
Empty |
Any | Count of empty values |
Filled |
Any | Count of non-empty values |
Unique |
Any | Count of unique values |
A custom entry in the top-level summaries section defines a new named summary; inside it, values is the list of that property's values across the result set, and the expression must return a single value. The per-view summaries map is a different thing: it assigns a summary name (default or custom) to a property.
summaries:
customAverage: 'values.mean().round(3)'
views:
- type: table
name: "Prices"
order:
- file.name
- price
summaries:
price: customAverageComplete Examples
references/examples.md covers complete bases and expected rendered results; read it when building from a worked example or defining expected rows and order.
Embedding Bases
Embed in Markdown files:
![[MyBase.base]]
<!-- Specific view -->
![[MyBase.base#View Name]]Without a selector the first view in the views list is used, so reordering views changes every plain embed. With a selector, the view name is the key: renaming a view breaks every embed that pointed at the old name, and nothing in the base file records the dangling reference. Rename a view only after checking which notes embed it.
Base syntax can also live in a fenced base code block inside a note. The schema is identical; only the container differs -- do not fork a second schema for blocks.
YAML Quoting Rules
- Use single quotes for formulas containing double quotes:
'if(done, "Yes", "No")' - Use double quotes for simple strings:
"My View Name" - Escape nested quotes properly in complex expressions
- Text literals inside an expression must themselves be quoted, which is why the nesting exists in the first place
Troubleshooting
references/troubleshooting.md covers YAML syntax errors, formula errors, and unexpected views; read it when diagnosing a base that fails or shows unexpected results.
Operations
references/operations.md covers the authorization boundary and vault policy, safe edits that preserve unrelated views and keys, the error conditions worth reporting, empty-result triage, exact readback versus rendered verification, embedded blocks, and optional composition with neighboring packages.
Validation Checklist
Static checks on the document you hold, before it goes anywhere:
- The file parses as YAML.
- Every filter object has exactly one of
and,or,not, and its value is a list. - Every
formula.Xreferenced inorder,properties,summaries, or another formula is defined informulas, with no cycles. - Every view has a
typeand aname, andgroupBy/sortentries name a real property. - Summary names used in a view's
summariesare default names or entries in the top-levelsummaries. - Formulas that subtract dates access a Duration field (
.days,.hours, ...) before applying number functions. - Formulas that read optional properties guard with
if().
Passing this list proves the document is well formed. It does not prove the file was written where you meant, that any note matches the filters, or that the view renders. Those are separate claims; see references/operations.md.
References
- Bases Syntax
- Functions
- Views
- Formulas
- Complete Functions Reference
- Operations Reference
- Complete Examples
- Troubleshooting
Attribution
The format documentation and examples in this package are derived from the obsidian-bases skill in kepano/obsidian-skills at commit 3ccff5338ea700537839b21900aa5358a0402c98, MIT License, Copyright (c) 2026 Steph Ango (@kepano). That material has been modified here. See Git history for the recorded revision, the modifications, and the evidence behind the additions.