1
0
Fork
You've already forked propsec
0
Fork of github.com/ccmdi/propsec
  • TypeScript 93.9%
  • SCSS 5.3%
  • JavaScript 0.8%
Find a file
2026年06月10日 22:33:58 -04:00
.github/workflows chore: more plugin lint 2026年05月13日 14:35:43 -04:00
images chore: README 2026年03月04日 16:08:25 -05:00
src itemPattern on ArrayConstraints 2026年06月10日 21:06:55 -04:00
.editorconfig init 2025年12月18日 14:02:19 -05:00
.gitignore chore: gitignore 2026年02月15日 12:58:07 -05:00
AGENTS.md itemPattern on ArrayConstraints 2026年06月10日 21:06:55 -04:00
esbuild.config.mjs feat: add validation cache 2025年12月21日 14:48:26 -05:00
eslint.config.mjs chore: plugin lint 2026年05月12日 12:09:05 -04:00
LICENSE docs: finalize readme and license 2025年12月18日 14:12:59 -05:00
manifest.json 0.6.3 2026年06月10日 22:33:58 -04:00
package-lock.json 0.6.3 2026年06月10日 22:33:58 -04:00
package.json 0.6.3 2026年06月10日 22:33:58 -04:00
README.md itemPattern on ArrayConstraints 2026年06月10日 21:06:55 -04:00
tsconfig.json chore: main to src 2025年12月18日 15:55:43 -05:00
version-bump.mjs init 2025年12月18日 14:02:19 -05:00
versions.json 0.6.3 2026年06月10日 22:33:58 -04:00

Propsec

Schema enforcement for Obsidian properties.

Define schemas based on templates or invariants in your vault, add custom reusable types, and more.

Usage

First, define a schema:

Once saved, violating notes such as this one...

...will be caught by the validation:

Why

Obsidian properties are freeform. Over time, things can break: you change the structure, use an old field, etc. This plugin validates notes against schemas you define. Your notes are untouched, but your vault's consistency becomes easier to manage.

Setup

  1. Open plugin settings
  2. Create a schema: click + Add Schema
  3. Set a query to target notes
  4. Add fields: name, type, required/optional
  5. Violations appear in the status bar/sidebar

Schema definition

The query field allows schema matching based on file paths and/or tags:

Query Matches
Journal Notes directly in Journal folder
Journal/* Notes in Journal and all subfolders
#book Notes with #book tag
Projects/* or #active Notes matching either condition

You can also narrow which notes a schema applies to with properties:

  • File name matches: Filter by file name (regex)
  • Modified after / Modified before: Filter by modification date
  • Created after / Created before: Filter by creation date
  • Has property / Missing property: Filter by property existence
  • Property conditions: Filter by property values (property-operator-value list)

Field types

Primitives

string, number, boolean, date, array, object, null, unknown

Custom types

Define reusable types in settings. A custom type is a named group of fields. Use them when multiple schemas share the same structure or you need nested validation.

Union types

Add multiple field entries with the same name but different types. For example, two entries for status with types string and null creates string | null.

Field flags

Fields can be flagged to be required (key is required) xor warn (soft requirement). There is also a unique constraint that prevents duplicate values on that field.

Finally, there are cross-field constraints (compare this field's value to another field) and conditional validation (only validate this field when another field matches a condition).

Constraints

Each field type supports optional constraints:

Type Constraints
string pattern (regex), minLength, maxLength
number min, max
array minItems, maxItems, contains (required values), itemPattern (regex each item must match)
date min, max

Installation

Copy to .obsidian/plugins/ or install via BRAT.