Obsidian vault crud
Skill richfrem/agent-plugins-skills/plugins/obsidian-wiki-engine/skills/obsidian-vault-crud
repo for reusable plugins and skills
npx -y skills add richfrem/agent-plugins-skills --skill obsidian-vault-crudAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Safe Create/Read/Update/Delete operations for Obsidian Vault notes. Implements atomic writes, advisory locking, concurrent edit detection, and lossless YAML frontmatter handling. Use when reading, writing, updating, or appending to any vault note.
SKILL.md
2.6 KB, as published. Nobody here has run it
Dependencies
This skill requires Python 3.8+ and standard library only. No external packages needed.
To install this skill's dependencies:
pip-compile ./requirements.in
pip install -r ./requirements.txt
See ./requirements.txt for the dependency lockfile (currently empty — standard library only).
Obsidian Vault CRUD
Status: Active
Author: Richard Fremmerlid
Domain: Obsidian Integration
Depends On: obsidian-markdown-mastery (WP05)
Core Mandate
This skill provides the disk I/O layer for all agent interactions with the Obsidian Vault. It does NOT handle syntax parsing (that belongs to obsidian-markdown-mastery). Instead, it ensures that every file write is:
- Atomic — via POSIX
os.rename()from a.tmpstaging file - Locked — via an advisory
.agent-lockfile at the vault root - Conflict-aware — via
mtimecomparison before/after read - Lossless — via
ruamel.yamlfor frontmatter (never PyYAML)
Available Commands
Read a Note
python ./vault_ops.py read --file <path>
Create a Note
python ./vault_ops.py create --file <path> --content <text> [--frontmatter key=value ...]
Update a Note
python ./vault_ops.py update --file <path> --content <text>
Append to a Note
python ./vault_ops.py append --file <path> --content <text>
Safety Guarantees
Atomic Write Protocol
- Write content to
<target>.agent-tmp - Verify the
.agent-tmpfile was written completely os.rename('<target>.agent-tmp', '<target>')— atomic on POSIX- If any step fails, the
.agent-tmpis cleaned up
Advisory Lock Protocol
- Before any write batch: create
<vault_root>/.agent-lock - After write batch completes: remove
.agent-lock - Other agents check for
.agent-lockbefore writing - This is advisory (does not block Obsidian UI)
Concurrent Edit Detection
- Capture
os.stat(file).st_mtimebefore reading - Before writing, check
st_mtimeagain - If mtime changed → another process edited the file → ABORT
Frontmatter Handling
- Uses
ruamel.yaml(NOTPyYAML) to preserve comments, indentation, and array styles - Ensures Dataview and Obsidian Properties remain intact