$npx -y skills add KevRojo/Dulus --skill obsidian-basesCreate and edit Obsidian Bases (.base files) with views, filters, formulas, and summaries. Use when working with .base files, creating database-like views of notes, or when the user mentions Bases, table views, card views, filters, or formulas in Obsidian.
| 1 | # Obsidian Bases Skill |
| 2 | |
| 3 | ## Workflow |
| 4 | |
| 5 | 1. **Create the file**: Create a `.base` file in the vault with valid YAML content |
| 6 | 2. **Define scope**: Add `filters` to select which notes appear (by tag, folder, property, or date) |
| 7 | 3. **Add formulas** (optional): Define computed properties in the `formulas` section |
| 8 | 4. **Configure views**: Add one or more views (`table`, `cards`, `list`, or `map`) with `order` specifying which properties to display |
| 9 | 5. **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.X` without defining `X` in `formulas` |
| 10 | 6. **Test in Obsidian**: Open the `.base` file in Obsidian to confirm the view renders correctly. If it shows a YAML error, check quoting rules below |
| 11 | |
| 12 | ## Schema |
| 13 | |
| 14 | Base files use the `.base` extension and contain valid YAML. |
| 15 | |
| 16 | ```yaml |
| 17 | # Global filters apply to ALL views in the base |
| 18 | filters: |
| 19 | # Can be a single filter string |
| 20 | # OR a recursive filter object with and/or/not |
| 21 | and: [] |
| 22 | or: [] |
| 23 | not: [] |
| 24 | |
| 25 | # Define formula properties that can be used across all views |
| 26 | formulas: |
| 27 | formula_name: 'expression' |
| 28 | |
| 29 | # Configure display names and settings for properties |
| 30 | properties: |
| 31 | property_name: |
| 32 | displayName: "Display Name" |
| 33 | formula.formula_name: |
| 34 | displayName: "Formula Display Name" |
| 35 | file.ext: |
| 36 | displayName: "Extension" |
| 37 | |
| 38 | # Define custom summary formulas |
| 39 | summaries: |
| 40 | custom_summary_name: 'values.mean().round(3)' |
| 41 | |
| 42 | # Define one or more views |
| 43 | views: |
| 44 | - type: table | cards | list | map |
| 45 | name: "View Name" |
| 46 | limit: 10 # Optional: limit results |
| 47 | groupBy: # Optional: group results |
| 48 | property: property_name |
| 49 | direction: ASC | DESC |
| 50 | filters: # View-specific filters |
| 51 | and: [] |
| 52 | order: # Properties to display in order |
| 53 | - file.name |
| 54 | - property_name |
| 55 | - formula.formula_name |
| 56 | summaries: # Map properties to summary formulas |
| 57 | property_name: Average |
| 58 | ``` |
| 59 | |
| 60 | ## Filter Syntax |
| 61 | |
| 62 | Filters narrow down results. They can be applied globally or per-view. |
| 63 | |
| 64 | ### Filter Structure |
| 65 | |
| 66 | ```yaml |
| 67 | # Single filter |
| 68 | filters: 'status == "done"' |
| 69 | |
| 70 | # AND - all conditions must be true |
| 71 | filters: |
| 72 | and: |
| 73 | - 'status == "done"' |
| 74 | - 'priority > 3' |
| 75 | |
| 76 | # OR - any condition can be true |
| 77 | filters: |
| 78 | or: |
| 79 | - 'file.hasTag("book")' |
| 80 | - 'file.hasTag("article")' |
| 81 | |
| 82 | # NOT - exclude matching items |
| 83 | filters: |
| 84 | not: |
| 85 | - 'file.hasTag("archived")' |
| 86 | |
| 87 | # Nested filters |
| 88 | filters: |
| 89 | or: |
| 90 | - file.hasTag("tag") |
| 91 | - and: |
| 92 | - file.hasTag("book") |
| 93 | - file.hasLink("Textbook") |
| 94 | - not: |
| 95 | - file.hasTag("book") |
| 96 | - file.inFolder("Required Reading") |
| 97 | ``` |
| 98 | |
| 99 | ### Filter Operators |
| 100 | |
| 101 | | Operator | Description | |
| 102 | |----------|-------------| |
| 103 | | `==` | equals | |
| 104 | | `!=` | not equal | |
| 105 | | `>` | greater than | |
| 106 | | `<` | less than | |
| 107 | | `>=` | greater than or equal | |
| 108 | | `<=` | less than or equal | |
| 109 | | `&&` | logical and | |
| 110 | | `\|\|` | logical or | |
| 111 | | <code>!</code> | logical not | |
| 112 | |
| 113 | ## Properties |
| 114 | |
| 115 | ### Three Types of Properties |
| 116 | |
| 117 | 1. **Note properties** - From frontmatter: `note.author` or just `author` |
| 118 | 2. **File properties** - File metadata: `file.name`, `file.mtime`, etc. |
| 119 | 3. **Formula properties** - Computed values: `formula.my_formula` |
| 120 | |
| 121 | ### File Properties Reference |
| 122 | |
| 123 | | Property | Type | Description | |
| 124 | |----------|------|-------------| |
| 125 | | `file.name` | String | File name | |
| 126 | | `file.basename` | String | File name without extension | |
| 127 | | `file.path` | String | Full path to file | |
| 128 | | `file.folder` | String | Parent folder path | |
| 129 | | `file.ext` | String | File extension | |
| 130 | | `file.size` | Number | File size in bytes | |
| 131 | | `file.ctime` | Date | Created time | |
| 132 | | `file.mtime` | Date | Modified time | |
| 133 | | `file.tags` | List | All tags in file | |
| 134 | | `file.links` | List | Internal links in file | |
| 135 | | `file.backlinks` | List | Files linking to this file | |
| 136 | | `file.embeds` | List | Embeds in the note | |
| 137 | | `file.properties` | Object | All frontmatter properties | |
| 138 | |
| 139 | ### The `this` Keyword |
| 140 | |
| 141 | - In main content area: refers to the base file itself |
| 142 | - When embedded: refers to the embedding file |
| 143 | - In sidebar: refers to the active file in main content |
| 144 | |
| 145 | ## Formula Syntax |
| 146 | |
| 147 | Formulas compute values from properties. Defined in the `formulas` section. |
| 148 | |
| 149 | ```yaml |
| 150 | formulas: |
| 151 | # Simple arithmetic |
| 152 | total: "price * quantity" |
| 153 | |
| 154 | # Conditional logic |
| 155 | status_icon: 'if(done, "✅", "⏳")' |
| 156 | |
| 157 | # String formatting |
| 158 | formatted_price: 'if(price, price.toFixed(2) + " dollars")' |
| 159 | |
| 160 | # Date formatting |
| 161 | created: 'file.ctime.format("YYYY-MM-DD")' |
| 162 | |
| 163 | # Calculate days since created (use .days for Duration) |
| 164 | days_ |