obsidian-bases
Obsidian Bases Skill
This skill enables Claude Code to create and edit valid Obsidian Bases (.base files) including views, filters, formulas, and all related configurations.
Overview
Obsidian Bases are YAML-based files that define dynamic views of notes in an Obsidian vault. A Base file can contain multiple views, global filters, formulas, property configurations, and custom summaries.
Core Schema
# Global filters apply to ALL views
filters:
and: [] # or: [], not: []
# Define formula properties
formulas:
formula_name: 'expression'
# Configure display names
properties:
property_name:
displayName: "Display Name"
# Define summary formulas
summaries:
custom_summary: 'values.mean().round(3)'
# Define views
views:
- type: table | cards | list | map
name: "View Name"
limit: 10
filters: { and: [] }
order: [file.name, property_name]
summaries: { property_name: Average }
Quick Examples
Example 1: Task Tracker
filters:
and:
- file.hasTag("task")
formulas:
priority_label: 'if(priority == 1, "🔴", if(priority == 2, "🟡", "🟢"))'
properties:
formula.priority_label:
displayName: Priority
views:
- type: table
name: "Tasks"
order: [file.name, status, formula.priority_label]
Example 2: Reading List
filters:
or:
- file.hasTag("book")
- file.hasTag("article")
views:
- type: cards
name: "Library"
order: [file.name, author, status]
Example 3: Daily Notes
filters:
and:
- file.inFolder("Daily Notes")
views:
- type: table
name: "Recent"
order: [file.name, file.mtime]
Validation Rules
Required Structure
- File extension:
.base - Valid YAML syntax
- At least one view defined
Filters
- Can be string:
filters: 'status == "done"' - Can be object:
filters: { and: [...] } - Supported operators:
==,!=,>,<,>=,<=,&&,||,!
View Types
table: Spreadsheet-like viewcards: Visual card gridlist: Simple list viewmap: Requires Maps plugin + lat/lng properties
Property Types
- Note properties:
note.authororauthor - File properties:
file.name,file.path,file.mtime,file.tags, etc. - Formula properties:
formula.my_formula
Summary Functions
| Name | Type | Description |
|---|---|---|
| Average | Number | Mathematical mean |
| Sum | Number | Sum of all numbers |
| Min/Max | Number | Smallest/Largest number |
| Count | Any | Count of values |
| Earliest/Latest | Date | Earliest/Latest date |
Common Formulas
# Conditional
status_icon: 'if(done, "✅", "⏳")'
# Date formatting
created: 'file.ctime.format("YYYY-MM-DD")'
# Arithmetic
total: 'price * quantity'
# String
display_name: 'author + " - " + title'
YAML Quoting Rules
- Single quotes for formulas with double quotes:
'if(done, "Yes")' - Double quotes for simple strings:
"View Name" - Escape nested quotes in complex expressions
Important Notes
- Filter scoping: Use
sourcesto limit search scope - Markdown only: Bases only work with
.mdfiles - Property references: Use
file.,note., orformula.prefix - Date arithmetic: Use duration strings like
"1d","1M","1h"
Detailed Documentation
For complete API documentation, see REFERENCE.md:
- Filter syntax and patterns
- All formula functions (100+ functions)
- View type configurations
- Complete examples
- Troubleshooting guide
More from lingengyuan/my-skills
wechat-archiver
Archives WeChat Official Account articles to knowledge base with auto-generated structured notes. Use when users provide WeChat article URLs (mp.weixin.qq.com) or mention archiving/saving WeChat articles. Combines wechat2md scraper and note-creator for complete workflow.
21md2wechat
Converts Markdown to WeChat Official Account HTML using AI-themed layouts and optionally one-click publishes to the draft box. Use when formatting Markdown for WeChat or uploading drafts with WECHAT_APPID/WECHAT_SECRET set in an env file.
9note-creator
Orchestrates creation of structured Obsidian notes with markdown, canvas diagrams, and table bases. Use when users ask to create notes, save knowledge, or document concepts in their Obsidian vault. Delegates to specialized format skills.
9sync_to_github
Automate git commit and push. Use when user says "sync to github", "commit and push", "push my changes", "save to git", "submit my work", or invokes /sync_to_github. Stages all changes, generates a commit message, commits, and pushes to remote.
7obsidian-markdown
Create and edit Obsidian Flavored Markdown with wikilinks, embeds, callouts, properties, and other Obsidian-specific syntax. Use when working with .md files in Obsidian, or when the user mentions wikilinks, callouts, frontmatter, tags, embeds, or Obsidian notes.
7json-canvas
Create and edit JSON Canvas files (.canvas) with nodes, edges, groups, and connections. Use when working with .canvas files, creating visual canvases, mind maps, flowcharts, or when the user mentions Canvas files in Obsidian.
6