Logo: Obsidian Vault Discipline

Obsidian Vault Discipline

Communautéit
bacnh85
obsidian-vault-discipline

Vergewëssert Iech, datt fir all Dateibedreiwungen am Vault den Obsidian-Tool benotzt gëtt (net bash). Ausléiser, wann de Benotzer Obsidian, Vault, Notizen, Dateien am Vault verréckelen, Notizen archivéieren oder eng Dateibedreiwung an engem Obsidian-Vault-Pfad ernimmt. Och ausléisen, wann de Agent bash mv/cp/rm/rename fir Weeër benotze wëllt, déi „obsidian“, „hermes“, „vault“, „.obsidian“ oder änlech Hiweiser op e Vault enthalen. Agenten benotzen dacks automatesch bash fir Dateibedreiwungen — dës Skill verhënnert dee Feeler. Benotzt se VIRUN all Dateibedreiwung, wann Vault-Weeër betraff sinn.

Iwwersiicht

Editeurbacnh85
Repositorypi-extensions
Skill-Nummobsidian-vault-discipline
Stären
42
Forks
15
Matgeliwwert Dateien
1
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 1 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    bacnh85 huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Obsidian Vault Discipline an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/bacnh85/pi-extensions/tree/main/pi-obsidian/skills/obsidian-vault-discipline
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/bacnh85/pi-extensions.git /tmp/pi-extensions
mkdir -p .claude/skills
cp -r /tmp/pi-extensions/pi-obsidian/skills/obsidian-vault-discipline .claude/skills/obsidian-vault-discipline
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Obsidian Vault Discipline an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Obsidian Vault Discipline automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Obsidian Vault Discipline net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Obsidian Vault Discipline

Why this exists

The Obsidian CLI maintains its own file index separate from the filesystem. Using bash mv, bash cp, or bash rm on vault files bypasses this index: the file moves on disk but Obsidian can't find it. Search, backlinks, graph view, and all vault-aware operations break silently.

This skill ensures every vault file operation goes through Obsidian's API.

Rules

ALWAYS use the obsidian tool for vault file operations

OperationCommand
Readread file="Note Name"
Createcreate path="folder/note.md" content="..."
Write/overwritewrite file="note.md" content="..." overwrite=true
Move/renamemove file="Note" to="New Path"
Rename in placerename file="Note" name="New Name"
Deletedelete path="old.md" permanent=true
Appendappend file="Note.md" content="\nMore text"
Prependprepend file="Note.md" content="# Header\n"

For bulk operations, use eval with Obsidian's JS API

The eval command runs JavaScript inside the Obsidian app with full access to app.vault API. This is the right tool for batch operations.

Quoting rules for eval

code= follows shell quoting rules — get these wrong and the JS fails with a confusing Unexpected token / Unexpected identifier error.

  • Outer wrapper: single quotes code='...' — literal, no escape decoding. Multi-line is fine; single quotes don't stop at whitespace or newlines.
  • Inner JS strings: always double quotes "...". A single quote inside single-quoted code closes the value early (e.g. code='x = 'hi'' breaks).
  • Avoid code="..." (double) for JS — \n / \t decode to real control chars before the JS engine sees them. Use single-quote mode instead.
  • Escape hatch: if code needs both quote types, use eval file=NoteName — it reads the note body as code, so quoting is a non-issue: eval file="Scripts/bulk-move".

Move files matching a pattern:

eval code='
const files = app.vault.getFiles().filter(f =>
  f.path.startsWith("source/folder/") && f.name.includes("keyword")
);
let n = 0;
for (const f of files) {
  const dest = "dest/folder/" + f.name;
  const folder = dest.split("/").slice(0, -1).join("/");
  if (!app.vault.getAbstractFileByPath(folder))
    await app.vault.createFolder(folder, true);
  await app.vault.rename(f, dest);
  n++;
}
return "Moved " + n + " files.";
'

Delete test/temp files:

eval code='
const files = app.vault.getFiles().filter(f =>
  f.name.startsWith("__test") || f.name.startsWith("Untitled")
);
let n = 0;
for (const f of files) { await app.vault.delete(f, true); n++; }
return "Deleted " + n + " files.";
'

Rename a property in frontmatter (scoped to one file):

eval code='
const f = app.vault.getAbstractFileByPath("path/to/note.md");
let c = await app.vault.read(f);
c = c.replace(/^old_property:/m, "new_property:");
await app.vault.modify(f, c);
return "Renamed.";
'

List files by criteria:

eval code='
return app.vault.getFiles()
  .filter(f => f.stat.size > 100000)
  .map(f => f.path + " (" + f.stat.size + " bytes)")
  .join("\n");
'

Batch update frontmatter across many files:

eval code='
const files = app.vault.getFiles().filter(f =>
  f.path.startsWith("folder/")
);
let n = 0;
for (const f of files) {
  let c = await app.vault.read(f);
  let m = c.match(/^---\s*\n([\s\S]*?)\n---/);
  if (!m || m[1].includes("status: archived")) continue;
  c = c.replace(/^status: active/m, "status: archived");
  await app.vault.modify(f, c);
  n++;
}
return "Updated " + n + " files.";
'

(See references/api-examples.md for more patterns.)

NEVER use bash for vault operations

These commands bypass Obsidian's index and must not be used on vault paths:

❌ Wrong✅ Right
bash mv file.md Archive/move file="file" to="Archive/file.md"
bash rm *.mddelete path="file.md" permanent=true
bash cp note.md backup/eval code="..." with app.vault.copy()
bash find vault -exec mv {} dest/ \;eval code="..." with app.vault.rename()
bash cat > file.md <<EOFcreate path="file.md" content="..."
bash sed -i 's/old/new/' file.mdeval code="..." with app.vault.modify()

Detecting vault paths

A path belongs to an Obsidian vault if any of these are true:

  • Running vault shows a vault whose path is a prefix of the target path
  • The path or any parent directory contains .obsidian/
  • The user explicitly says "vault", "obsidian", "my notes", "my vault"
  • The target directory is known from a previous vault operation in the session

When in doubt, check first: run vault to confirm the vault root, then check if your target path falls under it.

Frontmatter tag validation

The YAML # comment gotcha

In YAML, # starts a comment. An unquoted tag value like:

yaml
tags:
  - #type/research     # ← YAML sees this as a COMMENT, not a value

is silently discarded — Obsidian's tag pane shows nothing. Always quote:

yaml
tags:
  - "#type/research"   # ← YAML sees this as a string value

To detect this, never use bash grep '#type/' — that matches raw text and can't tell the difference. Use the validate-tags subcommand which uses Obsidian's own YAML parser:

obsidian run="files validate-tags" vault="My Vault"

This reports any file where the raw text has #type/ or #domain/ but Obsidian's parser sees zero tags (the unquoted-# bug). By default it checks for type/ and domain/ dimensions. Check custom dimensions:

obsidian run="files validate-tags=type/,domain/,status/" vault="My Vault"

Set list properties correctly

When setting array properties (tags, aliases), use type=list:

obsidian run="property:set name=tags type=list value=#type/research,#domain/ai-agents file=Note"
  • name= (not key=)
  • type=list for array values
  • Values are comma-separated, no brackets, no extra quotes

Verification checklist

Before submitting any change involving vault files, confirm:

  • No bash commands (mv, cp, rm, rename, sed, cat, find) were used on vault paths
  • All file operations used the obsidian tool or eval with Obsidian JS API
  • For bulk ops, the eval script handles folders that don't exist yet
  • Test files created during the session were cleaned up via the obsidian tool

Common pitfalls

  • bash mv is fast, but wrong. One mv command saves 2 seconds but breaks the vault. If you need to move many files, use one eval call with a loop instead of 26 move calls.
  • "But I already used bash and it looks fine." The file is on disk but Obsidian's index is stale. Run obsidian search query="filename" — if it returns nothing, the index is broken. Fix by using eval with app.vault.rename() to move it back through Obsidian's API, then move it properly.
  • cat > file.md in bash. This creates a file on disk that Obsidian doesn't know about. Use create path="..." content="..." instead.

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Obsidian Vault Discipline?

Vergewëssert Iech, datt fir all Dateibedreiwungen am Vault den Obsidian-Tool benotzt gëtt (net bash). Ausléiser, wann de Benotzer Obsidian, Vault, Notizen, Dateien am Vault verréckelen, Notizen archivéieren oder eng Dateibedreiwung an engem Obsidian-Vault-Pfad ernimmt. Och ausléisen, wann de Agent bash mv/cp/rm/rename fir Weeër benotze wëllt, déi „obsidian“, „hermes“, „vault“, „.obsidian“ oder änlech Hiweiser op e Vault enthalen. Agenten benotzen dacks automatesch bash fir Dateibedreiwungen — dës Skill verhënnert dee Feeler. Benotzt se VIRUN all Dateibedreiwung, wann Vault-Weeër betraff sinn.

Firwat Obsidian Vault Discipline op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Obsidian Vault Discipline besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Obsidian Vault Discipline an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/bacnh85/pi-extensions/tree/main/pi-obsidian/skills/obsidian-vault-discipline an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Obsidian Vault Discipline benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Obsidian Vault Discipline benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Obsidian Vault Discipline domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Obsidian Vault Discipline gratis?

bacnh85 huet de Skill op GitHub publizéiert. Kuckt am Repository no de Lizenzbedéngungen. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇