スキル一覧に戻る
leovigna

obsidian-bases

by leovigna

0🍴 0📅 2026年1月22日
GitHubで見るManusで実行

SKILL.md


name: obsidian-bases description: "Work with Obsidian Bases - a native database system for creating dynamic views of notes using properties, filters, formulas, and multiple view layouts (table, cards, list, map). Use when creating or editing .base files, writing Base queries in code blocks, working with Database/ folder schemas (Tasks, Projects, People, Companies, Meetings, Bookmarks), defining formulas or filters, setting up views and relationships, or answering questions about Bases syntax and features."

Obsidian Bases

Create and manage database-like views of notes using Obsidian Bases, including the standardized Database/ folder schemas.

Quick Start

Create a base file

Use Command Palette → "Bases: Create new base" or right-click folder → "New base".

Basic structure:

filters:
  and:
    - file.inFolder("Database/Tasks")
    - status == "active"
views:
  - type: table
    name: Active Tasks
    order:
      - priority
      - due

Embed a base

Use ![[File.base]] or ![[File.base#ViewName]] in any note.

Inline base queries

```base
filters:
  and:
    - file.hasTag("example")
views:
  - type: table
    name: Results
```

Core Concepts

Properties

Three types of properties:

  1. Note properties - Frontmatter YAML (access as property or note.property)
  2. File properties - Built-in fields (file.name, file.mtime, file.size, etc.)
  3. Formula properties - Calculated fields (formula.formula_name)

Filters

Apply to all views or specific views. Use boolean logic (and, or, not):

filters:
  and:
    - file.inFolder("Database/Tasks")
    - status == "active"
  or:
    - priority == "urgent"
    - due < today()
  not:
    - assignee == null

Formulas

Define calculated properties:

formulas:
  is_overdue: due && due < today() && status == "active"
  days_until: 'due ? (due - today()).format("days") : ""'
  price_total: "price * quantity"

Use in filters: formula.is_overdue

Views

Multiple views per base with different layouts:

  • table - Rows and columns (default)
  • cards - Gallery grid with optional images
  • list - Bulleted or numbered lists
  • map - Interactive map with pins (requires Maps plugin)

Database/ Folder Schemas

See references/database-schemas.md for complete property definitions and relationship patterns for:

  • Tasks - Task management (status, priority, assignee, project, due)
  • Projects - Project tracking (lead, team, target_date, completion metrics)
  • People - CRM contacts (company, role, email, contact tracking)
  • Companies - Organizations (industry, stage, relationship)
  • Meetings - Meeting notes (attendees, meeting_date, project, company)
  • Bookmarks - URL management (url, category, saved, rating)

Common Patterns

Filter by folder and type

filters:
  and:
    - file.inFolder("Database/Tasks")
    - type == "task"

Group by property

views:
  - type: table
    name: Tasks by Priority
    groupBy:
      property: priority
      direction: DESC

Reference current file with this

filters:
  and:
    - project == link(this.file)  # Tasks for current project
    - file.hasLink(this.file)     # Files linking here

Create relationships

# In task frontmatter
assignee: "[[Database/People/Team-Member]]"
project: "[[Database/Projects/AGI-Assistant]]"

Query related data:

filters:
  and:
    - file.inFolder("Database/Tasks")
    - project == link("Database/Projects/AGI-Assistant")

Date arithmetic

formulas:
  deadline: start_date + "2w"
  is_overdue: due_date < now() && status != "Done"
  days_ago: '(today() - file.ctime).format("days")'

Conditional display

formulas:
  status_indicator: 'if(completed, "✅", "⏳")'
  formatted_price: 'if(price, "$" + price.toFixed(2), "")'

List operations

formulas:
  tag_count: tags.length
  first_tag: tags[0]
  has_urgent: tags.contains("urgent")

View Configuration

Table view

views:
  - type: table
    name: My View
    limit: 50
    order:
      - priority
      - due
    groupBy:
      property: status
      direction: ASC
    summaries:
      file.name: Count
      price: Sum

Cards view

views:
  - type: cards
    name: Gallery
    cardSize: medium
    imageProperty: cover
    imageFit: cover
    imageAspectRatio: "16:9"

List view

views:
  - type: list
    name: Task List
    markers: bullets  # bullets, numbers, or none
    indentProperties: true
    separator: ", "

Common Formulas

See references/formula-examples.md for extensive examples.

Quick reference:

# Date calculations
due_in_days: '(due - today()).format("days")'
overdue: due < today() && status == "active"
age_in_days: '(today() - file.ctime).format("days")'

# Text formatting
full_name: first_name + " " + last_name
display_title: file.name.title()
domain: 'url.split("/")[2]'

# Number calculations
total: price * quantity
percent: '(part / whole * 100).toFixed(1) + "%"'

# Conditional logic
priority_score: '(impact * urgency) / effort'
status_emoji: 'status == "done" ? "✅" : "⏳"'

Functions Reference

See references/functions-reference.md for complete function list.

Common functions:

Global: if(), now(), today(), date(), link(), max(), min()

String: contains(), replace(), split(), lower(), title(), trim()

Number: round(), ceil(), floor(), abs(), toFixed()

Date: format(), relative(), date(), time()

List: filter(), map(), sort(), join(), unique(), contains()

File: hasTag(), hasLink(), inFolder(), hasProperty()

Best Practices

File organization

  • Keep .base files in the folder they query
  • Use Database/ folder for centralized data
  • Name files descriptively: Tasks.base, Active-Projects.base

Property naming

  • Use lowercase with underscores: due_date, last_contact
  • Reserve type for entity classification
  • Prefix formulas: formula.is_overdue

Filter optimization

  • Apply folder filters at global level (applies to all views)
  • Apply specific filters at view level
  • Use file properties before note properties (faster)

Formula design

  • Keep formulas simple and readable
  • Use meaningful names: days_until_due not calc1
  • Handle null values: if(price, price.toFixed(2), "")
  • Avoid circular references

View structure

  • First view is default when embedding
  • Name views descriptively: "Active Tasks by Priority"
  • Use grouping for categorical data
  • Add summaries for numeric columns

Syntax Reference

Operators

Arithmetic: +, -, *, /, %, ( )

Comparison: ==, !=, >, <, >=, <=

Boolean: !, &&, ||

Property access

property          # Note property (shorthand)
note.property     # Note property (explicit)
file.name         # File property
formula.calc      # Formula property
property.subprop  # Object property (dot notation)
property[0]       # List element
link("path")                    # Create link
link("path", "display")         # Link with display text
link("path", icon("plus"))      # Link with icon
assignee == link(this.file)     # Compare link to current file
authors.contains(this)          # Check if list contains link

Troubleshooting

Base not showing data

  • Check filter logic (use advanced editor to debug)
  • Verify folder paths are correct
  • Ensure property names match frontmatter

Formula not calculating

  • Check for circular references
  • Verify property types match operators
  • Use if() to handle null values

View not updating

  • File properties auto-refresh
  • Note properties require file save
  • Backlinks may need manual refresh

Performance issues

  • Avoid file.backlinks in formulas (expensive)
  • Use file.hasLink() instead of checking backlinks
  • Limit results with limit property
  • Filter at folder level first

Migration from Dataview

Dataview query:

TABLE status, priority, due
FROM "Tasks"
WHERE status = "active"
SORT priority DESC

Equivalent Base:

filters:
  and:
    - file.inFolder("Tasks")
    - status == "active"
views:
  - type: table
    name: Active Tasks
    order:
      - priority

Key differences:

  • No FROM - use file.inFolder() filter
  • No TABLE - properties selected in UI
  • WHEREfilters
  • SORTorder
  • ===
  • Function syntax: contains() not contains

Additional Resources

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です