obsidian-guide
Skill706 starsChanged 38 days agoApache-2.0View on GitHub
Gates and multi-call workflows for the obsidian_* tools: pin active and periodic targets to a path, round-trip heading sections without editing the wrong one or dropping its sub-sections, page a search to the end before editing its hits, match tags exactly, and repeat writes after a timeout or a dropped connection. Use before editing several notes, restructuring headings, writing to a periodic note, retagging, moving a note, or retrying a failed obsidian_* write.
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 2 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
Tag: no leading #. A note's own tags (obsidian_get_note full, the JSONLogic tags field) hold its tags as written, letter case included.
- Very specific: line 39
Call obsidian_get_note document-map for every full heading path.
- Very specific: line 40
Read each section you'll change by its full path, edit it, and write it back through obsidian_write_note section (gates 3–4).
- Very specific: line 47
Search and page to the end (gate 5).
- Very specific: line 48
When instructions gives a narrower Writable scope than Readable, drop hits outside the Writable scope before writing.
- Distinctive: line 57
Move or rename a note: No tool does this, and nothing updates links that point at the old name.
- Very specific: line 59
Read the note with obsidian_get_note content and write it with obsidian_write_note at the new path.
- Distinctive: line 61
Delete the old note once the user agrees (gate 10).
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Scope
One Obsidian vault, reached through the Local REST API plugin while Obsidian runs. Each note tool reads or edits one note per call. No tool moves or renames a note, and none rewrites links in other notes. The multi-note jobs are the workflows below.
Identifiers
- Note path:
hits[].filenamefrom obsidian_search_notes,entries[].pathfrom obsidian_list_notes, and thepathevery note tool returns. Writes and deletes match it exactly, letter case included. - Heading locator: the full
Parent::Childpaths in obsidian_get_note'sdocument-mapheadings, and thesectionTargeta section read or write returns. - Tag: no leading
#. A note's owntags(obsidian_get_notefull, the JSONLogictagsfield) hold its tags as written, letter case included. Parent tags show up only in tag counts.
Gates
- Pin
activeandperiodictargets after the first call. Each call resolves them again.activeis whichever file has focus in Obsidian at that moment, and aperiodictarget with nodateis the current period. For the rest of the task, address the note by thepaththe first call returned. - A missing periodic note can't be created through a
periodictarget. Every tool reads the target before acting, so a write to a period with no note also failsperiodic_not_found. Ask the user to create it in Obsidian. Or, if they agree, write it by path: read an earlier period's note (passdate) to learn the folder and filename pattern. A note written this way holds only what you send, without the user's periodic-note template. On Local REST API 5.0.2 and later without the periodic-notes extension, everyperiodictarget failsperiodic_unsupported, whether or not the note exists; find the note with obsidian_search_notes or obsidian_list_notes and address it by path. - Write a heading back with the
sectionTargetthe read returned, never the bare name you sent. A bare name resolves differently on each side. A read takes the first heading with that text in document order. A write takes the top-level heading with that text when there is one. ReadingNotesand then writingNotescan touch two different sections. - A heading section is its whole subtree. obsidian_get_note
format: "section"returns the heading line, its body, and every sub-section under it. A replace rewrites all of that, so send the sub-sections back or target the child heading instead. An append lands below the last sub-section. A prepend lands right under the heading line. Round-trip a read through obsidian_write_note withsection, which drops the leading heading line. obsidian_patch_notereplacekeeps a leading#heading line, and plugin v5.0 and later refuse that withheading_outside_section. - Page a search to the end before editing its hits. Without OBSIDIAN_READ_PATHS or OBSIDIAN_DENY_PATHS, every page re-runs the search. The cursor is an offset into the new result, so edits that remove matches shift later pages and skip notes. Under a read scope, later pages come from the first page's hits for at most 5 minutes past the last page read. Collect every
filenamefirst, then edit. - A text hit doesn't promise a replace match. Text mode needs each token somewhere in the filename or body, in any case. obsidian_replace_in_note needs the exact string, case-sensitive by default, and searches the body only by default. Read each note's
perReplacement[].count:0is a success that wrote nothing.useRegexpatterns run without themflag, so^and$match the ends of the scoped text, not of a line. To anchor a line, use(?<=^|\n)and(?=\n|$). - Tags match exactly.
{"in": ["work", {"var": "tags"}]}misses notes tagged onlyWork, or onlywork/tasks, which obsidian_list_tags still counts underwork. To catch nested tags, use{"some": [{"var": "tags"}, {"regexp": ["^work(/|$)", {"var": ""}]}]}. obsidian_manage_tagsremoveis exact the same way, and its defaultlocation: "frontmatter"leaves inline#tags in the body. Passlocation: "both"and check the returnedtags. - A JSONLogic hit is a note whose tree returns something truthy, and that value is the hit's
result. A note whose tree returnsfalse,null,0,"",[], or{}is left out. Return the field you need and one search reads it from every match:{"if": [<test>, {"var": "tags"}, null]}gives each match's tags. An empty value still drops the note. - After
obsidian_timeoutorobsidian_unreachableon a write, assume it may have landed. One write call makes several requests under one shared budget (45 s at the default timeout): a read before the write, the write, and a read after. The error can arrive after the write applied, and the server never re-sends a whole-file append or a section write. Repeating is safe for obsidian_write_note, obsidian_patch_notereplace, obsidian_manage_frontmatter, and obsidian_manage_tags. On a retry,file_exists(a create),note_missing(a delete), andcontent_preexists(a section append or prepend sent withoutapplyIfContentPreexists) each mean the first attempt landed. Don't force acontent_preexiststhrough withapplyIfContentPreexists. Read the note before repeating a whole-file obsidian_append_to_note, or an obsidian_replace_in_note whosereplacestill contains itssearch. - Confirm before deleting. obsidian_delete_note deletes on the first call unless its description says it asks. Get the user's go-ahead on the exact path first.
Workflows
Capture into a periodic note. Call obsidian_append_to_note with the periodic target. Add section to land under one of the note's headings, and createTargetIfMissing: true if that heading may not exist yet. On periodic_not_found or periodic_unsupported, follow gate 2. Follow-up edits use the returned path (gate 1).
Restructure headings.
- Call obsidian_get_note
document-mapfor every full heading path. - Read each section you'll change by its full path, edit it, and write it back through obsidian_write_note
section(gates 3–4). - Rename or remove a heading line with obsidian_replace_in_note. No section write changes a heading line.
- To reorder or move whole sections, rewrite the note: obsidian_get_note
content, edit, then obsidian_write_noteoverwrite: true. ComparepreviousSizeInByteswithcurrentSizeInBytes. - A renamed heading breaks
[[Note#Old heading]]links in other notes. Fix them as in Move or rename a note.
Find, then edit across notes.
- Search and page to the end (gate 5). To find notes by filename anywhere in the vault, test
pathwithregexpin jsonlogic mode, e.g.{"regexp": ["(^|/)Meeting[^/]*\\.md$", {"var": "path"}]}. Don't walk obsidian_list_notes for this: itsnameRegexnever enters a folder whose own name fails the pattern. - When
instructionsgives a narrower Writable scope than Readable, drop hits outside the Writable scope before writing. - Edit each hit and read its counts (gate 6).
Retag notes.
- Find the notes with a tree that returns their tags (gates 7–8).
- For each note, call obsidian_manage_tags
addwith the new tag andremovewith the old one, both withlocation: "both". - Confirm with obsidian_list_tags
nameRegex. A parent tag's count includes its nested tags.
Move or rename a note. No tool does this, and nothing updates links that point at the old name.
- Read the note with obsidian_get_note
contentand write it with obsidian_write_note at the new path. That write fails withfile_existsrather than overwrite a note already there. - Find the notes that wikilink the old name with the backlink
regexpin obsidian_search_notes'logicdescription. Rewrite each link with obsidian_replace_in_note (gate 6). - Delete the old note once the user agrees (gate 10).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

