PluginWorks in Claude CodeCurrent
Desktop commander
MCP server for terminal commands, process management, and file operations across text, code, PDF, DOCX, Excel, images, and structured data.
0
Try it
See what this would do for you. No sign-up needed.
Install in Claude Code
Run these in Claude Code, in order. The first adds the marketplace, the second installs the plugin.
Step 1
/plugin marketplace add anthropics/claude-plugins-official
Step 2
/plugin install desktop-commander@claude-plugins-official
Review commands before running them. Promptu never runs code on your machine or pushes changes to your repo.
What's inside
6 skills
- ai-tools-setup
- computer-health-check
- desktop-commander-overview
- knowledge-base
- obsidian-vault
- terminal
1 MCP server
Security scan
Flagged
Promptu's text scan flagged something in this plugin. Read its files before you install it.
sudo in skills/computer-health-check/SKILL.md:16; pipe-to-shell in skills/terminal/SKILL.md:112
Details
# Desktop Commander Claude Code Plugin
Desktop Commander gives Claude Code access to a local MCP server for terminal sessions, filesystem work, structured documents, search, process management, and SSH workflows — plus a set of skills that steer the agent toward those capabilities for common tasks.
## Components
- MCP server: `desktop-commander`, installed with `npx -y @wonderwhy-er/desktop-commander@latest`.
- Skill: `desktop-commander-overview` — explains when to use Desktop Commander MCP tools and how common workflows compose.
- Skill: `terminal` — persistent shells/REPLs, SSH, Windows PowerShell, process/port inspection, and saving recurring workflows as scripts.
- Skill: `computer-health-check` — read-only system health check (CPU, memory, disk, battery, startup) with safe, opt-in cleanups.
- Skill: `ai-tools-setup` — install, configure, and repair Claude Desktop, MCP servers, and local AI tooling (mcp.json / claude_desktop_config.json).
- Skill: `knowledge-base` — build and maintain a Markdown knowledge base any AI agent can navigate without a vector database.
- Skill: `obsidian-vault` — organize Obsidian vaults: MOCs, wikilinks, properties, Dataview/Bases dashboards, and orphan/link cleanup.
## Usage
Install the plugin in Claude Code, then ask Claude to use Desktop Commander when it needs persistent shells, long-running processes, local file reads, Excel/DOCX/PDF handling, large CSV analysis, remote SSH sessions, a system health check, AI-tooling setup, or knowledge-base/Obsidian organization.
For full project documentation, see the repository README.
## skills/ai-tools-setup/SKILL.md
---
name: ai-tools-setup
version: 0.1.0
audience: agent
description: >-
Set up, connect, validate, and repair Claude Desktop and MCP servers using
Desktop Commander — inspecting and fixing mcp.json / claude_desktop_config.json,
getting MCP servers to connect, and diagnosing local AI tooling. Use when a
user wants to install, configure, connect, validate, or fix Claude Desktop, an
MCP server, an MCP config file, or a local AI agent/gateway. Trigger on the
symptoms that actually bring people in: "Claude can't see my tools", "my MCP
server isn't showing up", "tools aren't loading in Claude", "add an MCP
server", "my MCP isn't connecting", "fix my Claude Desktop config", "the agent
won't respond", "wire up Ollama / LM Studio", "restart Claude Desktop". Also
covers local agent gateways like OpenClaw and Hermes.
---
# AI Tools Setup Assistant
Help users install, configure, and repair AI tooling on their own machine using
Desktop Commander's file and terminal tools. The work is usually
**configure-and-troubleshoot**, not clean installs — assume something already
exists and may be half-broken.
## Golden rules (read before doing anything)
1. **Detect the OS and shell first.** Read `get_config` and use its `systemInfo`
and `allowedDirectories` — file paths, commands, and config locations differ
across macOS, Windows, and Linux, so confirm the platform before assuming
anything.
2. **Verify the model/API key works before you build.** The most common reason
these sessions dead-end is a provider auth or billing error discovered
*after* a lot of setup work. Make one tiny test call with `start_process` (a quick
curl to the provider) early, and tell the user plainly if the key is invalid
or out of credit.
3. **Translate errors, don't dump them.** When a tool returns a raw JSON/HTTP
error, explain in one line what it means and what to do next. If a model is
missing, deprecated, rate-limited, or doesn't support tool-calling, suggest a
concrete working alternative instead of retrying the same thing.
4. **Never echo secrets.** API keys, tokens, and passwords go *into the right
config or `.env` file* — never repeated back in chat. If a user pastes a live
secret, warn them, use it, and suggest they rotate it if it was shared
insecurely. Redact secrets in any output, logs, or summaries you produce.
5. **Back up before you edit.** Copy the config to a `.bak` first with
`start_process` (`cp file.json file.json.bak`, or `copy` on Windows), then make
the change with `edit_block` so existing entries survive — reach for
`write_file` only on a from-scratch config. Validate the JSON after every edit
by parsing it with `start_process`.
6. **Verify, then stop.** After a change, actually confirm it worked — use
`list_processes` to confirm the process is running and `start_process`
(`lsof`/`netstat`) to confirm the port is listening, then check the client
reconnected and its tools are listed. Don't declare success on a guess.
7. **Make it repeatable.** Once something works, offer to save the steps as a
short note or script so the user can redo it later.
## What this skill covers
This skill routes to one of three reference files depending on the task. Read
the relevant file before acting — they contain the exact paths, commands, and
known failure modes.
- **Claude Desktop & MCP servers** — installing Claude Desktop, adding MCP
servers, and inspecting / validating / repairing MCP config files
(`claude_desktop_config.json`, `.claude/mcp.json`, `~/.lmstudio/mcp.json`,
and similar). Also connection health checks.
→ Read [`references/claude-desktop-mcp.md`](references/claude-desktop-mcp.md)
- **OpenClaw** — a self-hosted multi-channel gateway for AI agents. Install,
onboard, wire a model/provider, connect channels (Telegram, Slack, iMessage,
etc.), diagnose the gateway, and uninstall.
→ Read [`references/openclaw.md`](references/openclaw.md)
- **Hermes** — disambiguate first: **Hermes Agent** (the Nous Research
self-improving agent framework) vs. **Hermes 3** (just a local LLM you run via
Ollama). Install, run `hermes setup --portal`, configure providers, personality
(`SOUL.md`), memory/skills, MCP, and messaging.
→ Read [`references/hermes.md`](references/hermes.md)
When in doubt about a tool's current behavior, fetch the official docs:
OpenClaw — https://docs.openclaw.ai/ ·
Hermes — https://hermes-agent.nousresearch.com/docs/
## General workflow
1. **Clarify the goal and platform.** Install vs. configure vs. fix? Which OS?
Which tool/client?
2. **Inspect current state.** `read_file` the relevant config files and use
`list_processes` to check whether the relevant process/port/service is already
running before changing anything.
3. **Read the matching reference file** for exact paths and commands.
4. **Make the smallest change that moves forward**, backing up configs first.
5. **Verify** the result concretely.
6. **Summarize** what changed, where, and how to undo it — with secrets redacted.
## A generic "my agent isn't responding" diagnostic
Use this order for OpenClaw, Hermes, or any local agent/gateway:
1. **Provider/auth** — is a valid API key configured for the active provider,
and does it have credit? (Most failures stop here.)
2. **Model** — does the chosen model exist, and does it support tool-calling?
Local models especially often don't.
3. **Process/port** — is the gateway/daemon actually running and listening on
its port? Is another process holding that port?
4. **Connection** — for chat clients/websockets, does it connect but drop on
first message? That usually points back to provider/model, not networking.
5. **Logs** — read the tool's logs for the first real error, not the last one.
## skills/computer-health-check/SKILL.md
---
name: computer-health-check
version: 0.1.0
audience: agent
description: >-
Run a comprehensive, read-only health check on the user's computer and return a
scored chat summary with prioritized, plain-English recommendations and safe cleanup
suggestions. Use this whenever the user wants to check their computer's health, speed
it up, free up / reclaim disk space, find what's eating CPU / memory / storage, check
battery health and wear, audit login & startup items, see pending updates, or asks for
a "tune-up", "checkup", "system report", "health check", or "is my Mac/PC/laptop
healthy". Trigger even on casual phrasing like "my laptop feels slow", "why is my fan
so loud", "my computer is laggy", "running out of space", or "clean up my machine".
Works on macOS, Windows, and Linux. This is a Desktop Commander skill: it relies on a
real local shell (start_process / interact_with_process) and is strictly read-only by
default — it never needs sudo and only performs cleanups the user explicitly approves.
---
# Computer Health Check
## What this skill does
Give the user a fast, trustworthy picture of their computer's health and a short list
of actions worth taking — the way a good technician would: look first, explain plainly,
fix only with permission.
It runs entirely through Desktop Commander's local shell, gathers a batch of **read-only**
diagnostics, scores each area, prints a concise summary **in the chat**, and then offers
cleanup suggestions the user can approve one by one.
## The safety contract (read this first)
This is the part that makes users trust the skill, so honor it strictly:
- **Read-only by default.** The collection phase only *observes* (sizes, counts, status).
It changes nothing.
- **Never use `sudo` or elevation.** DC blocks `sudo`, `shutdown`, `reboot`, `dd`, `mount`,
`mkfs`, `diskpart`, etc. for good reason. Every check below is designed to work without
them. If something seems to need elevation, skip it and say so — don't try to work around
the block.
- **Cleanups are opt-in.** You may *suggest* cleanups freely, but only *execute* one after
the user explicitly approves that specific action, and only show the exact command first.
- **Prefer reversible, non-destructive actions.** Emptying caches that regenerate, clearing
a package-manager download cache, or emptying Trash are fine to offer. Deleting user
documents, uninstalling apps, or editing system files are not — suggest those, let the
user do them.
## Workflow
### Step 1 — Detect the OS
Determine the platform before doing anything else, because the commands differ.
- Quickest: read Desktop Commander's config (`get_config`) and use the
`systemInfo.isMacOS` / `isWindows` / `isLinux` booleans (or `platformName`) to
pick the platform.
- Or run `uname` (macOS/Linux) — if it fails, assume Windows.
Then open the matching reference file and use its command set:
- macOS → [`references/macos.md`](references/macos.md)
- Windows → [`references/windows.md`](references/windows.md)
- Linux → [`references/linux.md`](references/linux.md)
Read **only** the one that matches. Each file contains a single batched collection script
plus interpretation notes and cleanup commands.
### Step 2 — Collect (read-only)
Run the batched collection script from the reference file with `start_process`. Batching
everything into one call is much faster than many small calls and keeps the output tidy.
Guidance:
- Keep outputs bounded (`head`, `Select-Object -First`, etc.) so a long process list or
file listing doesn't flood the response.
- Skip the genuinely slow / network checks (full OS-update list, internet speed test) on the
first pass unless the user asked about updates or network. Mention they're available.
- If a single command errors (e.g., a tool isn't installed), continue — partial data is fine.
### Step 3 — Score each area
Rate each category 🟢 Good / 🟡 Watch / 🔴 Act using the rubric below, then compute a simple
overall score. Start at 100 and subtract 8 per 🟡 and 18 per 🔴; floor at 0. Report the
number and a one-word verdict (90+ Excellent, 75–89 Good, 60–74 Fair, <60 Needs attention).
| Area | 🟢 Good | 🟡 Watch | 🔴 Act |
|---|---|---|---|
| Free disk space | >20% free | 10–20% | <10% |
| Disk health (SMART) | Verified / OK / PASSED | — | failing / not supported & errors present |
| Memory pressure | low swap, free pages healthy | noticeable swap/compression | heavy swapping, near-zero free |
| Battery (laptops) | ≥80% max capacity, Normal | 70–80% | <70% or "Service/Replace" |
| Maintenance | uptime <7d, no pending updates | uptime 7–30d or minor updates | uptime >30d or security updates pending |
| Startup load | few third-party login items | moderate | many heavy third-party agents |
| Live resource hogs | nothing >50% at idle | one sustained heavy process | multiple / runaway processes |
Battery is laptop-only — skip it on desktops/VMs. Reclaimable space is reported as an
informational figure, not scored.
### Step 4 — Report in the chat
Use this exact structure. Keep it tight and scannable — this is the deliverable.
```
🖥️ Health Check — <Model>, <OS version> Score: <N>/100 (<verdict>)
🟢/🟡/🔴 Storage — <free> free of <total> (<%>). Reclaimable: ~<X> GB
🟢/🟡/🔴 Memory — <one-line state>
🟢/🟡/🔴 Battery — <cycles> cycles, <max capacity>%, <condition>
🟢/🟡/🔴 Maintenance — up <days>d, <updates state>
🟢/🟡/🔴 Startup — <count> login items (<notable ones>)
🟢/🟡/🔴 Right now — top: <proc> <cpu%>, <proc> <cpu%>
Top recommendations
1. <highest-impact action> (<expected benefit, e.g. frees ~13 GB>)
2. <next>
3. <next>
```
List at most the 3–5 highest-impact recommendations, ordered by benefit. Don't dump every
finding — the goal is signal, not a wall of text.
### Step 5 — Suggest cleanups, execute only on approval
For each recommendation that maps to a concrete command (see the reference file's "Cleanup"
section), offer it and show the exact command. Then:
- **Safe, reversible** (offer to run on a yes): empty Trash, package-manager cache cleanup
(`brew cleanup`, `npm cache clean`), clearing a regenerating user cache folder. (On Linux,
`apt-get clean` / `dnf clean` need root — suggest, don't auto-run.)
- **Needs the user to decide / act** (suggest, don't auto-run): disabling login items,
installing OS updates (requires restart), uninstalling apps, deleting files in Downloads.
- **Never**: anything requiring sudo/admin, removing system files, disk/partition operations.
When the user approves a safe action, run it, then report what changed (e.g., space freed).
Re-running Step 2's storage check afterward is a nice confirmation.
## Recommendation rules (findings → advice)
These are the high-value mappings; adapt the wording to the platform.
- **Uptime > 30 days** → "Restart your computer — it's been up <N> days. A reboot clears
memory and applies pending updates." (Highest ROI, lowest effort.)
- **Pending OS/security updates** → platform update step; flag security updates as higher
priority.
- **Free space < 15%** → lead with the biggest reclaimable buckets you measured.
- **Large Downloads / Caches / Trash** → empty Trash; review largest Downloads items by name;
clear caches that regenerate.
- **Package manager has many outdated items / big cache** → `upgrade` + cache cleanup.
- **Battery max capacity < 80%** → explain wear is normal; consider a battery service if it's
affecting runtime.
- **Many third-party startup agents** → name them and suggest disabling the ones the user
doesn't recognize/need (point to System Settings / Task Manager — don't edit them directly).
- **A process pinned high at idle** → name it and suggest quitting/investigating.
## Notes & pitfalls
- **Don't assume — measure.** Always run the commands and report real numbers. Never
fabricate sizes, cycle counts, or statuses.
- **Bounded output.** Process and file listings can be huge; always cap them.
- **Optional deep checks** (mention, run on request): internet speed test, full update list,
per-folder disk scan of the whole home directory, crash-report trend analysis.
- **Privacy.** This reads local system metadata only. Don't send anything off the machine;
the public-IP check is optional and should be labeled.
- **Cross-platform parity.** The three reference files mirror the same categories so the
report looks the same regardless of OS.
## skills/desktop-commander-overview/SKILL.md
---
name: desktop-commander-overview
description: Use for Desktop Commander MCP capabilities — persistent shells and REPLs, long-running processes, filesystem beyond the workspace, structured files (.xlsx, .docx, .pdf, images) and large local data files such as CSVs, ripgrep search at scale, SSH, or cross-turn state.
version: 0.1.0
audience: agent
---
# Desktop Commander MCP
Desktop Commander gives the agent reach across the user's actual computer — files, folders, terminals, processes, structured documents, and remote machines reachable over SSH. The tools' detailed schemas (parameters, return shapes, format-specific behavior) live in the MCP itself; this skill explains what they enable and how they compose into common workflows.
## What this MCP gives the agent
**Persistent shell sessions.** Desktop Commander keeps a started process or session alive across tool calls. Inside a single long-lived shell, REPL, or SSH session, state carries forward — environment variables, working directory, activated virtualenvs, open connections, REPL variables — so the agent can `cd`, activate a venv, then send commands or code into that same session many turns later without re-setup. (Note: separate `start_process` calls open separate sessions and do **not** share shell state with each other; persistence is inside one session, not across them.)
**Long-running processes.** Start a dev server, watcher, build, training run, or test suite in the background and keep working. The MCP returns a process handle the agent can tail, interact with, or terminate across many turns. Long-running commands don't need to block the workflow waiting for a foreground command to exit.
**Filesystem reach beyond the IDE workspace.** Read, write, move, list, and inspect files anywhere the user has granted scope — Downloads, Documents, project folders outside the IDE, or any other granted folders. Useful for organize-and-clean tasks, batch document work, and any "look at the file my coworker just sent me" request that doesn't fit inside the IDE sandbox.
**Surgical edits to existing files.** The `edit_block` tool does exact-string find-and-replace with built-in safety: ambiguous matches fail loudly instead of silently overwriting the wrong thing, and an `expected_replacements` count prevents partial-match disasters. Lower data-loss risk than rewriting whole files based on the slice you happened to read — though a wrong `old_string` or wrong `expected_replacements` can still corrupt content, so review the changed content before considering the edit done.
**Binary and structured files handled directly by the MCP.** Excel, DOCX, and PDF are first-class — read and modified through format-specific mechanisms rather than text-only approximations: Excel via cell-range JSON, DOCX via raw-XML edits, PDF via page-level operations on a new output file. The result is the real file in its original format, not a regenerated approximation. Images and PDFs return as viewable content for the agent.
**Search at scale.** Streaming, ripgrep-backed search across whole projects or folder trees. The agent picks between filename search and in-file content search, pages through results progressively without flooding context, and runs multiple concurrent searches when the query is ambiguous.
**Remote machines via SSH.** A long-lived SSH session inside a persistent shell turns the agent into a real ops tool: connect once, then tail logs, run diagnostics, deploy, or debug across many turns without reconnecting each step.
**Process management.** List, inspect, tail, and kill accessible processes (subject to OS permissions). Useful for cleaning up stale dev servers from previous sessions and for diagnosing CPU / memory issues.
## Example workflows
Each example names the actual tool sequence. Calls below are written in pseudocode shorthand (`tool_name("arg", flag=value)`); the real tools take object-shaped arguments. Tool descriptions and full parameter sets live in the MCP itself.
### "Debug this production issue"
Before running production-impacting SSH commands, explain the intended action and get user confirmation when the risk is non-trivial.
`start_process("ssh user@prod.example.com", timeout_ms=...)` opens a long-lived SSH session and returns a PID. `interact_with_process(pid, "tail -f /var/log/app.log\n")` starts streaming logs. Subsequent turns: `read_process_output(pid, offset=-50)` to see the last 50 lines as they arrive, `interact_with_process(pid, "...")` to run diagnostic commands in the same session. `force_terminate(pid)` to close the session when done — for sessions opened by `start_process`, `force_terminate` is the correct cleanup tool; `kill_process` is for arbitrary OS PIDs found via `list_processes`.
### "Deploy this to staging"
Before deploys, restarts, migrations, or other environment-changing commands, summarize the action and confirm with the user unless they already explicitly asked for that exact operation.
`start_process` for the deploy command (could be a script, an SSH-piped command, or `kubectl`/`gh` etc.). `read_process_output` to track output and surface errors. If the deploy needs an interactive confirmation, `interact_with_process(pid, "yes\n")`. The session stays alive while the agent watches for completion or rollback.
### "Run the dev server and iterate on the API"
`start_process("npm run dev", timeout_ms=...)` keeps the server up. The agent then loops: `edit_block` on the route file, `read_process_output(pid, offset=-30)` to see the server's reload, `start_process("curl -s http://localhost:3000/api/...")` for a one-shot test, repeat. The dev server never has to restart between code changes.
### "Refactor across this monorepo"
`start_search(pattern="oldFunctionName", path=repo_root, searchType="content")` scopes every call site. `get_more_search_results(sessionId)` pages through. `read_multiple_files(paths=[...])` confirms ambiguous hits in context. `edit_block(file_path, old_string, new_string)` per site, with `expected_replacements` set when the same substring legitimately appears multiple times in one file. Verify by re-running `start_search` on the old name and paging the results with `get_more_search_results(sessionId)` until the run completes — only then can you confirm zero remaining hits.
### "Update the Q3 numbers in this spreadsheet and tweak the summary in the report"
`read_file(path="/.../q3.xlsx", sheet="Revenue", range="A1:F50")` returns the existing numbers as a JSON 2D array. `edit_block(file_path="/.../q3.xlsx", range="Revenue!C12:C24", content=[[12345], ...])` updates the cells in place. For the report, DOCX editing is a two-read flow: first `read_file(path="/.../report.docx")` (offset 0) returns the document's outline (headings + paragraph text) so you can locate the summary section. Then `read_file(path="/.../report.docx", offset=N, length=...)` with **`N > 0`** returns the raw underlying XML around that section — a non-zero offset is what flips the read into XML mode. Copy an XML fragment from that output as `old_string` and call `edit_block(file_path, old_string, new_string)` with the rewritten XML. The user gets back real `.xlsx` and `.docx` files, not regenerated approximations.
### "Generate the Q3 report as a PDF"
Compose markdown content (header, table, charts via embedded HTML), then call `write_pdf` to render it to a new PDF file. The MCP's `write_pdf` tool description specifies the exact parameters and filename rules — follow that.
### "Insert a cover page into this PDF"
`write_pdf` also supports modifying existing PDFs via an operations array (insert / delete pages). Use it for existing-PDF edits that produce a new PDF — adding a cover page, removing a section, merging in content from another file. See the `write_pdf` tool description for the operation shapes and parameter rules.
### "Analyze this 200MB CSV"
`start_process("python3 -i", timeout_ms=...)` opens a Python REPL and returns a PID. `interact_with_process(pid, "import pandas as pd; df = pd.read_csv('/abs/path.csv')")` loads it once. Every subsequent question — `df.describe()`, `df.groupby('col').size()`, plot a chart — runs in the same already-loaded REPL. Libraries don't re-import, the dataframe doesn't re-load. The MCP itself recommends this workflow for any local data-file analysis.
### "Run a quick Node script"
`start_process("node:local", timeout_ms=...)` opens a stateless Node execution mode on the MCP server itself — ES imports supported. `start_process` opens the runner; each piece of JS is sent via `interact_with_process(pid, "<your JS here>")` and runs independently (no shared state between calls). Good for one-shot transformations where keeping a long-lived REPL alive isn't worth it. Don't try to put code into the `start_process` command argument — only the runner type (`node:local`) goes there.
### "Explain this codebase"
`list_directory(path=repo_root, depth=3)` for shape. `start_search(pattern="export ", path=repo_root, searchType="content")` to find the public surface. `read_multiple_files(paths=[entrypoints])` for the actual code. The agent can keep narrowing without re-asking the user where to look.
### "Organize my Downloads folder"
Resolve the path to absolute first (e.g., `/Users/<user>/Downloads`, not `~/Downloads`). Then `list_directory(path="/Users/<user>/Downloads", depth=1)` to see what's there. `start_search(pattern="*.pdf", path="/Users/<user>/Downloads", searchType="files")` and similar for other types. `create_directory` for new folders. `move_file` per item. Preview the move plan before executing destructive ops.
### "Onboard me — what was happening last session?"
`get_recent_tool_calls(maxResults=200)` returns recent activity with arguments and outputs. `list_sessions` shows still-running terminal sessions. `list_searches` shows in-flight searches. `list_processes` shows what's still alive. Together they reconstruct the work without asking the user to recap.
### "Why isn't the REPL responding?"
`list_sessions` — if `Blocked: true`, the REPL is waiting for input rather than hung. `read_process_output(pid, offset=-100)` to see what it last printed (often a prompt). `interact_with_process(pid, "<the input it's waiting for>\n")` unblocks it.
## Core tool inventory
Grouped index of the tools an agent reaches for most often. Not exhaustive — the MCP exposes additional config / diagnostics / feedback tools beyond this list. Detailed parameters and return shapes for every tool are in the MCP's own tool descriptions.
- **Process / shell:** `start_process`, `interact_with_process`, `read_process_output`, `list_processes`, `list_sessions`, `kill_process`, `force_terminate`
- **Files (read/write):** `read_file`, `read_multiple_files`, `write_file`, `edit_block`, `write_pdf`
- **Filesystem:** `list_directory`, `get_file_info`, `move_file`, `create_directory`
- **Search:** `start_search`, `get_more_search_results`, `list_searches`, `stop_search`
- **Diagnostics / config:** `get_recent_tool_calls`, `get_config`
## Conventions
**Prefer absolute paths.** Relative paths may fail depending on the working directory, and tilde paths (`~/...`) may not expand in all contexts. Absolute paths are the most reliable; pass them whenever you can.
**Allowed-directory scope.** File operations only work inside the user's configured `allowedDirectories`. Expect `[DENIED]` markers in `list_directory` output and rejections from `read_file` / `write_file` when the path is out of scope. Surface the rejected path to the user — don't retry.
**When running on macOS:** default shell is zsh. Use `python3` not `python`. Some GNU tools have prefixed names (`gsed` for GNU sed). `brew` is the typical package manager. `open` opens files / apps from the terminal, `mdfind` is the fastest path to exact-filename search via Spotlight. Detect the host platform via `get_config` (or by inspecting `process.platform` / `uname` from a shell) before assuming any of the above — Windows and Linux hosts behave differently.
**Pagination.** Long outputs (file reads, process output, search results) all support `offset` and `length`. Negative offsets read from the end (tail mode). Use these instead of dumping huge results into context.
## skills/knowledge-base/SKILL.md
---
name: knowledge-base
version: 0.1.0
audience: agent
description: >-
Create and maintain a Markdown knowledge base that any AI agent can read,
search, and update. Use when the user wants to start a knowledge base, add or
update notes, organize docs/notes for an agent or LLM to consume, build an
index of notes, or run a cleanup/maintenance pass on an existing MD knowledge
base. Triggers include "knowledge base", "KB", "notes for the agent", "index
of notes", "second brain", "docs for AI context", "add a note", "update the
KB".
---
# Knowledge Base (Markdown, agent-readable)
A knowledge base (KB) here is a folder of Markdown files designed so **any** AI
agent can navigate it without a vector database: the agent reads one index file,
picks the relevant notes by their descriptions, and opens only those. Keep the
whole KB readable and the index lean — the index is what gets loaded into
context, so it must be high-signal.
Apply the rules below when creating a new KB, adding/editing notes, or doing a
maintenance pass. When the user's request is ambiguous (new KB vs. add note vs.
cleanup), ask which one before acting.
## Core principles (the "why")
1. **Index-first navigation.** The index is a map, not a container. An agent
reads `INDEX.md`, selects notes by their one-line descriptions, then opens
only those files. No note is "in" the KB unless it's registered in the index.
2. **Atomicity.** One topic per note. If a title needs an "and", it's probably
two notes. Atomic notes are easier to find, link, and reuse.
3. **Stable IDs.** Every note has a permanent ID that never changes and is never
reused, so links survive renames and moves.
4. **Linked with reason.** When two notes connect, state *why* (prerequisite,
supports, contrasts, see-also). Connections carry as much value as the notes.
5. **Lean instructions.** Keep `INDEX.md` instructions short and high-signal —
it competes for the agent's context budget. Bodies load on demand.
6. **Structured for retrieval.** Clear H1 title and H2/H3 sections so an agent
can grab the relevant slice of a note, not the whole thing.
## Folder structure (nested by topic)
```
knowledge-base/
INDEX.md # entry point: instructions + full note registry
topics/
<topic>/
_topic.md # topic map: what this topic covers + its notes
<slug>.md # one atomic note
assets/ # images / attachments referenced by notes
```
- Topic folders are short, lowercase nouns (`auth`, `billing`, `deploys`).
- `_topic.md` is the topic-level map of content (MOC): a short intro plus links
to every note in that topic. It is a convenience view; `INDEX.md` remains the
source of truth.
## Naming rules
- Lowercase **kebab-case**, predictable and greppable: `topics/auth/session-tokens.md`.
- No spaces, no uppercase, no dates in filenames (dates live in frontmatter).
- The filename slug should match the note's `id` slug portion.
## Required frontmatter (every note)
```yaml
---
id: 20260618-session-tokens # ID scheme: YYYYMMDD-slug. Stable. Never reuse or change.
title: Session tokens # human title, also the note's H1
tags: [auth, security] # only tags from the controlled list in INDEX.md
created: 2026-06-18
updated: 2026-06-18
related: [20260618-auth-flow] # IDs of linked notes
summary: One scannable sentence describing what this note covers.
---
```
- `id`: `YYYYMMDD-slug`. Sortable, readable, stable. Different-titled same-day
notes differ by slug; if two same-day notes would collide on the same slug,
append `-2`, `-3`, … (check the `INDEX.md` registry before assigning). Once
assigned, the id is permanent.
- `summary`: this exact sentence is what goes in the index registry — write it to
help an agent decide whether to open the note.
- `updated`: bump it whenever the body changes.
## Note body shape
```markdown
# Session tokens
> Summary: One sentence (mirrors frontmatter summary).
## Context
Why this note exists / when it applies.
## Details
The actual content, in short H2/H3 sections.
## Related
- [Auth flow](auth-flow.md) — prerequisite: tokens are issued during the auth flow.
- [Rate limiting](../api/rate-limiting.md) — see-also: tokens carry the rate-limit key.
```
- Use **relative links** between notes and annotate the relationship in a phrase.
- Every link target should also appear in the note's `related` frontmatter.
## INDEX.md (the single source of truth)
`INDEX.md` has two parts: operating instructions for agents, and the registry.
```markdown
# Knowledge Base — Index
## How to use this KB (for agents)
1. Read this index first. Pick notes by their descriptions; open only those.
2. To answer a question, prefer opening 1–3 specific notes over scanning everything.
3. Cite the note `id` when you use information from it.
## How to update this KB (for agents)
- New idea → create a new note (atomic). Same idea changed → edit the note in place and bump `updated`.
- Any create / rename / delete MUST update this registry and the topic's `_topic.md` in the same change.
- Use only tags from the controlled vocabulary below; add a new tag here before using it.
## Controlled tags
`auth`, `security`, `billing`, `api`, `ops` <!-- extend deliberately -->
## Registry
### auth
- `20260618-auth-flow` — **Authentication flow** — `topics/auth/auth-flow.md` — How a user session is established end to end.
- `20260618-session-tokens` — **Session tokens** — `topics/auth/session-tokens.md` — Token format, lifetime, and rotation.
### billing
- `20260618-invoicing` — **Invoicing** — `topics/billing/invoicing.md` — How invoices are generated and sent.
```
Registry line format: `` `id` — **Title** — `path` — one-line description.``
## _topic.md (topic map)
```markdown
# Auth
Notes covering authentication, sessions, and access control.
- [Authentication flow](auth-flow.md) — how a session is established.
- [Session tokens](session-tokens.md) — token format, lifetime, rotation.
```
## Workflows
### Create a new KB
1. `create_directory` for the folder structure above.
2. `write_file` `INDEX.md` with the instructions block, an empty controlled-tag
list, and an empty registry.
3. Add the first topic folder + `_topic.md`, then the first note (each via `write_file`).
4. Register the note in `INDEX.md` and link it from `_topic.md` — `edit_block`
both so you touch only the changed lines.
### Add a note
1. Pick or create the topic folder (`list_directory` to see what's there).
2. `write_file` the note (kebab-case slug) with full frontmatter and the body shape.
3. Add cross-links (and mirror them in `related`).
4. Register it in `INDEX.md` and link it in `_topic.md` with `edit_block` — same change.
### Update a note
- Same idea, new information → `edit_block` the note in place, bump `updated`, and
`edit_block` the registry line if the scope changed.
- Genuinely new idea → `write_file` a new atomic note instead of expanding this one.
### Maintenance pass (run on demand)
Use `start_search` (ripgrep) for text scans and `get_file_info` / `list_directory`
for existence checks — together they make this tractable at scale:
- **Orphans** (no *inbound* links — outbound doesn't matter): `start_search` the
KB for the note's `id` and filename slug, then discount the self-matches that
always exist — the note's own file, `INDEX.md`, and its `_topic.md`. Anything
left is a genuine inbound reference; nothing left = orphan, so link it from a
relevant note/MOC or archive it.
- **Broken links / drift**: don't infer resolution from a text hit — a string
existing doesn't mean the file does. Confirm each registry path and `related:`
target exists with `get_file_info` (or `list_directory` per topic), and that
every file on disk is registered. Use a text compare only for the
titles/summaries-out-of-sync half.
- **Non-atomic notes**: notes that grew to cover multiple topics → split them.
- **Duplicates**: near-identical notes → merge, keep one `id`, redirect links.
- **Tag sprawl**: read the controlled list from `INDEX.md`, then `start_search`
the frontmatter `tags:` lines and flag any tag not on the list → reconcile.
Pull candidates in bulk with `read_multiple_files`, apply fixes with `edit_block`,
and report what changed.
## Checklist before finishing any KB edit
- [ ] Every new/changed note has complete, valid frontmatter.
- [ ] `id` is unique and unchanged; filename slug matches the id slug.
- [ ] All links resolve and are mirrored in `related`.
- [ ] `INDEX.md` registry and the topic `_topic.md` reflect the change.
- [ ] Tags are from the controlled vocabulary.
- [ ] `updated` bumped on every changed note.
## skills/obsidian-vault/SKILL.md
---
name: obsidian-vault
version: 0.1.0
audience: agent
description: >-
Organize Obsidian vaults with MOCs, wikilinks, frontmatter/properties,
dashboards, orphan-note checks, and cleanup workflows. Use ONLY when the user
explicitly refers to Obsidian — by naming "Obsidian", an Obsidian "vault", or
an Obsidian-specific feature such as wikilinks ("[[ ]]"), the Dataview or Bases
plugins, or Obsidian Properties. Within that Obsidian context it covers
creating Maps of Content, adding/fixing wikilinks, finding orphan notes,
normalizing YAML frontmatter, generating Dataview/Bases dashboards, organizing
folders, deduplicating or renaming notes, and preparing the vault for AI use.
Do NOT use this skill for generic note-taking, Markdown, or knowledge-base
requests that don't mention Obsidian.
---
# Obsidian Vault Assistant
Help the user organize and maintain an Obsidian vault: build navigation with
MOCs and wikilinks, normalize metadata, generate dashboards, find and fix
orphans, organize folders, deduplicate/rename, and prepare the vault for AI use.
Obsidian-specific facts that shape every rule here:
- Links are **wikilinks** resolved by **filename**, not path: `[[Note title]]`.
Renaming a note auto-updates links inside Obsidian, but moving files outside
Obsidian breaks them — always rename via Obsidian when possible.
- Metadata is **Properties** (YAML frontmatter) at the top of a note.
- Dashboards come from **Dataview** (query language, read-only, flexible) or
**Bases** (native, editable tables, fast on big vaults, properties-only).
Before acting, confirm the vault's root folder and whether the user has the
Dataview plugin installed (Bases is built in since Obsidian 1.9). When a request
is ambiguous (organize vs. clean up vs. dashboard), ask which task.
## Wikilinks
- Basic: `[[Three laws of motion]]` — resolves by filename, no extension/path.
- Display text (pipe): `[[atomic-habits|James Clear — Atomic Habits]]`.
- Heading link: `[[Note#Section]]`. Block link: `[[Note#^block-id]]`.
- Embed/transclude: `![[Note]]`, `![[Note#Section]]`, `![[image.png]]`.
- Aliases: add an `aliases` property so the note resolves under other names.
- Avoid `# | ^ : %` and `[ ]` in filenames — they have special meaning in links.
- Prefer wikilinks for internal navigation; use standard Markdown links only if
the vault is also published to a tool that can't parse wikilinks.
When adding links, also surface **unlinked mentions**: if a note's title appears
as plain text in other notes, convert those to wikilinks.
## Maps of Content (MOCs)
A MOC is a note that links the related notes on a topic — the vault's navigation
layer (more flexible than folders or tags, and needs no institutional knowledge).
Conventions:
- Name MOCs clearly and tag them: `tags: [moc]` (or a `type: moc` property) so
every MOC is itself discoverable.
- Keep a top-level **Home / Index MOC** that links to all topic MOCs.
- A MOC holds a short intro plus groupe

