agentleFS
tboome33tboome33/obsidian-mcp-router/skills/write-frontmatter-merge/SKILL.md

write-frontmatter-merge

Skill1 starsChanged 7 months agoApache-2.0View on GitHub

Apply multiple frontmatter updates at once (sequential, NOT atomic — partial failures are reported per-key). Use when you want to update 2+ properties on the same file in one call.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Call the obsidian-router merge_frontmatter MCP tool with arguments parsed from $ARGUMENTS.

    line 16
  2. Very specific:

    If the call fails entirely (not a per-key partial failure), do NOT silently redo it with direct-filesystem tools (Read/Edit/Write on the …

    line 65

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

write-frontmatter-merge

Call the obsidian-router merge_frontmatter MCP tool with arguments parsed from $ARGUMENTS.

Arguments

Required:

  • path — file path relative to vault root.
  • values — object map of keys/values to set.

Optional:

  • vault — omit for default.
  • createIfMissing — create absent keys. Default true.
  • ifMatch — a contentSha256 from a prior get_file. Checked ONCE before any key is written; a mismatch throws a 409 before the first mutation. Guards against merging into a file that changed since you read it (it does not make the multi-key update atomic — see the warning below).

Argument parsing from $ARGUMENTS

  • path=X k1=v1 k2=v2 k3=v3 — most natural form
  • path=X values={"k1":"v1","k2":"v2"} — JSON-explicit form
  • the user might phrase it conversationally: "marque le trade comme closed avec outcome=stopped" → infer values

Type inference per value

  • numeric → number
  • true/false → boolean
  • null → null
  • [...] → JSON array
  • {...} → JSON object
  • otherwise → string

⚠️ Not atomic on its own

Called directly, this is NOT atomic. If applying 5 updates and the 3rd fails, the first two are already applied. The tool returns a per-key status — surface that result honestly:

  • N succeeded, M failed
  • list the failed keys with their error

To make it all-or-nothing (v0.66.0+, borrowing C2): run it as a write_bundle step. The bundle captures the file's content before the first key is written, and treats a partial merge (failed > 0) as a failed step — so the file goes back to exactly what it was:

write_bundle({
  vault, steps: [
    { op: "merge_frontmatter", path: "wiki/<page>.md", values: { status: "closed", outcome: "tp1" } }
  ]
})

Then read outcome: applied or rolled-back, never a half-updated file. This is the intended remedy — see the write-bundle skill. The older workaround (read the frontmatter, modify it client-side, write-create-or-replace the whole file) still works but rewrites the body too.

On failure — remediate, NEVER fall back to filesystem writes

If the call fails entirely (not a per-key partial failure), do NOT silently redo it with direct-filesystem tools (Read/Edit/Write on the vault's real path):

  • Connection error (ECONNREFUSED, timeout) → vault closed; list_vaults, then ask the user to open it via the openUri link and wait.
  • Validation / API error (HTTP 4xx) → fix the arguments — still through the router.

Rationale + message template: the default-vault-health-check convention (canonical source).

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.