agentleFS
tejask0tejask0/agent-skills/obsidian-update-agentmd/SKILL.md

obsidian-update-agentmd

Skill0 starsChanged 4 months agoMITView on GitHub

Scan the Obsidian vault's current folder/file structure and regenerate CLAUDE.md to reflect it accurately. Use when the user says "update CLAUDE.md", "sync the vault structure", "I've added new notes/folders", "update the agent context", or "run obsidian-update-agentmd". Also run after any bulk note reorganisation.

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 8 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

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

    Look up "obsidian_vault_path" in ~/.claude/skills-user-config.json.

    line 18
  2. Very specific:

    Run a recursive directory listing (max depth 4, exclude .obsidian/, .git/, .stfolder, plugin dirs).

    line 31
  3. Very specific:

    Use Bash with find (if your agent exposes Bash under a different tool name, use that):

    line 38
  4. Distinctive:

    Read these files to extract the current "active projects" snapshot (adapt the names to the vault's own):

    line 52
  5. Distinctive:

    Do NOT read every project file.

    line 59
  6. Distinctive:

    Read CLAUDE.md (same vault root).

    line 65
  7. Distinctive:

    New folders/files: not listed → add to the structure diagram.

    line 67
  8. Very specific:

    Use ← annotation comments for important files/folders.

    line 114
  9. Distinctive:

    Keep the tree at max 3 levels deep unless a subfolder is particularly rich.

    line 116
  10. Very specific:

    Don't enumerate every file in Reference/, Clippings/, or Templates/ — just note the folder.

    line 117
  11. Distinctive:

    After editing, output a short summary (under 10 lines):

    line 123
  12. Distinctive:

    Don't narrate the process.

    line 133
  13. Distinctive:

    If CLAUDE.md doesn't exist yet, create it from scratch using the structure above.

    line 142

≈ “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

Obsidian Update CLAUDE.md

Scan the live vault, diff against the current CLAUDE.md, and rewrite it to be accurate. The goal is a tight, agent-useful document — not a changelog. Be surgical.

Vault root path

Look up "obsidian_vault_path" in ~/.claude/skills-user-config.json.

  • If present, use it directly.
  • If missing, ask the user for their vault root path once (it may be a local folder, a Google Drive / cloud-synced folder, or — under OpenClaw / Claude Code on a remote host — the current working directory of a synced checkout), then write it to ~/.claude/skills-user-config.json under that key so future runs don't need to ask.

Step 1 — Map the vault structure

Run a recursive directory listing (max depth 4, exclude .obsidian/, .git/, .stfolder, plugin dirs). Collect:

  1. All folders — note new ones not in current CLAUDE.md.
  2. All top-level .md files in each folder — note additions and deletions.
  3. Total file count per top-level section (whatever top-level folders the vault uses).

Use Bash with find (if your agent exposes Bash under a different tool name, use that):

find <vault_root> -maxdepth 4 \
  -not -path "*/.obsidian/*" \
  -not -path "*/.git/*" \
  -not -path "*/.stfolder/*" \
  | sort

Step 2 — Read key state files

Read these files to extract the current "active projects" snapshot (adapt the names to the vault's own):

  • a status note (e.g. Now.md) — active/paused projects table
  • a priorities note (e.g. Priorities.md) — current focus areas
  • a project index note (e.g. a top-level project list) — project index

Do NOT read every project file. Extract project names and statuses from Now.md only.


Step 3 — Diff against current CLAUDE.md

Read CLAUDE.md (same vault root). Compare:

  • New folders/files not listed → add to the structure diagram.
  • Removed folders/files still listed → remove them.
  • Renamed sections — update names.
  • Active projects table — replace entirely from Now.md data.
  • Last updated date — always update to today's date.

Things to NOT change unless clearly wrong:

  • The "What this is" intro paragraph.
  • The "Note on Play" callout.
  • Conventions section (unless a new convention is observed).
  • Agent key file descriptions (unless a file was renamed/removed).

Step 4 — Rewrite CLAUDE.md

Edit CLAUDE.md in place using the Edit tool. Maintain this structure:

# CLAUDE.md

This file provides guidance to AI agents (Claude, etc.) working in this vault.

> **Last updated:** YYYY-MM-DD

## What this is
...

## Vault Structure
\`\`\`
obsidian/
├── <accurate tree>
\`\`\`

## Active Projects (as of last sync)
| Project | Status | Notes |
|---|---|---|
| <from Now.md> | ... | ... |

## Key Files for Agents
- <list of critical files with one-line descriptions>

## Conventions
...

Rules for the structure tree:

  • Use ← annotation comments for important files/folders.
  • List files inside folders only when individually notable (e.g. specific project files in a projects folder).
  • Keep the tree at max 3 levels deep unless a subfolder is particularly rich.
  • Don't enumerate every file in Reference/, Clippings/, or Templates/ — just note the folder.

Step 5 — Report what changed

After editing, output a short summary (under 10 lines):

CLAUDE.md updated (YYYY-MM-DD)

Added:    <new folders/files>
Removed:  <stale entries>
Updated:  Active projects table from Now.md; Last updated date

Don't narrate the process. Just the delta.


Guardrails

  • Never delete ## Conventions or ## Key Files for Agents unless explicitly told to.
  • Never commit to Git as part of this skill — that's a separate step.
  • Never expose secrets — if you spot API keys, passwords, or tokens while reading files, do not include them in CLAUDE.md. Flag them in the summary.
  • If CLAUDE.md doesn't exist yet, create it from scratch using the structure above.

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.