knowledge-manager
CLAUDE.md251 starsChanged 5 months agoMITView on GitHub
This file is read automatically by Claude Code when it opens the knowledge-manager repo. It tells Claude how the placeholder system works and how to edit skill, agent, and command files without breaking portability for other users. knowledge-manager is a deployment repo. End users clone it, run /knowledge-manager-setup, and the wizard substitutes their personal paths into the skill/agent/command files. The source tree in this repo must stay portable — meaning it must contain {{PLACEHOLDER}} tokens, not one specific user's hardcoded…
In this repository2 other files it gives its agents.
- AGENTS.mdAGENTS.md
- baoyu-slide-deckSkill
The file
We split this CLAUDE.md 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 9
If you hardcode /home/tofu/AI/AI_Second_Brain (or any other personal path) into a skill file, every downstream user who pulls that change …
- Very specific: line 15
Every file under skills/, agents/, and commands/ is either:
- Very specific: line 46
Never hardcode a personal vault path: If you need to reference a vault location, use {{VAULT_PATH}}.
- Very specific: line 48
Never hardcode a personal Obsidian CLI path: Use {{OBSIDIAN_CLI}}. Example:
- Distinctive: line 63
Before committing any change that touches a skill, agent, or command file:
- Very specific: line 81
If a file you want to commit is marked S, you must git update-index --no-skip-worktree <file> before the change can be staged.
- Very specific: line 131
If you are opening a PR against knowledge-manager:
- Distinctive: line 134
Always grep for personal paths: before pushing (see step 1 above).
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md 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
CLAUDE.md — Claude Code project contract
This file is read automatically by Claude Code when it opens the knowledge-manager repo. It tells Claude how the placeholder system works and how to edit skill, agent, and command files without breaking portability for other users.
Repository purpose
knowledge-manager is a deployment repo. End users clone it, run /knowledge-manager-setup, and the wizard substitutes their personal paths into the skill/agent/command files. The source tree in this repo must stay portable — meaning it must contain {{PLACEHOLDER}} tokens, not one specific user's hardcoded vault path.
If you hardcode /home/tofu/AI/AI_Second_Brain (or any other personal path) into a skill file, every downstream user who pulls that change is broken until they manually reset it.
Critical: Placeholder System
Every file under skills/, agents/, and commands/ is either:
- Pristine source (what lives in git) — contains placeholder tokens like
{{VAULT_PATH}}. - Substituted local copy (what the user actually uses) — tokens replaced with real values from
km-config.json, and markedgit update-index --skip-worktreeso the changes don't show up as dirty.
The 5 placeholders
| Placeholder | Replaced with | Source config field |
{{VAULT_PATH}} | Absolute vault path, e.g. /home/user/Documents/MyVault | storage.obsidian.vaultPath |
{{VAULT_NAME}} | Basename of vault path, e.g. MyVault | (derived) |
{{OBSIDIAN_CLI}} | Path to Obsidian CLI executable, or empty | obsidianCli.path |
{{ZETTELKASTEN_ROOT}} | Vault-relative folder, e.g. Zettelkasten | storage.obsidian.zettelkastenRoot |
{{RESEARCH_ROOT}} | Vault-relative folder, e.g. Research | storage.obsidian.researchRoot |
Placeholders in source vs after setup
# IN SOURCE (what you commit):
Save the extracted note to {{VAULT_PATH}}/{{ZETTELKASTEN_ROOT}}/AI/note.md
# AFTER /knowledge-manager-setup (local user view):
Save the extracted note to /home/user/Documents/MyVault/Zettelkasten/AI/note.mdYou will sometimes read files where the substituted form is visible in your working tree because skip-worktree is active. Do not confuse that with source content. Run git show HEAD:<file> to see the committed form.
Rules for editing skill / agent / command files
- Never hardcode a personal vault path. If you need to reference a vault location, use
{{VAULT_PATH}}. If you need to reference a vault-relative subfolder, use{{VAULT_PATH}}/{{ZETTELKASTEN_ROOT}}/...or similar composition. - Never hardcode a personal Obsidian CLI path. Use
{{OBSIDIAN_CLI}}. Example:"{{OBSIDIAN_CLI}}" create --vault "{{VAULT_NAME}}" "Zettelkasten/note.md" - Single source: top-level
commands/ skills/ agents/. Project-mode install =scripts/install-to-project.sh. No mirror directory in the repo. - Do not edit
skills/km-storage-abstraction.md's anti-pattern example to use placeholders. That file intentionally teaches users not to prefix paths with the vault name, and the literal vault-name example is pedagogical. It uses the generic stringYourVaultNameinstead. - Do not touch
km-config.json. That file is gitignored and holds the user's personal values. Thekm-config.example.jsonis the template you commit to.
How to test your edits
Before committing any change that touches a skill, agent, or command file:
- Grep for personal paths to make sure you haven't accidentally introduced one:
Expected: 0 hits.grep -rE "/home/[^/]+/|/Users/[^/]+/|C:\\\\Users\\\\" skills/ agents/ commands/ - Dry-run the substitution engine against a sample
km-config.json:
Inspect the output; no errors, every placeholder should be replaced.bash scripts/configure-vault-paths.sh --dry-run - Check the skip-worktree state of files you edited:
If a file you want to commit is markedgit ls-files -v skills/ | grep '^S'S, you mustgit update-index --no-skip-worktree <file>before the change can be staged. - Run the
/knowledge-manager-setupwizard end-to-end in a scratch clone if you changed the substitution logic, wizard Phase 4, or the placeholder taxonomy.
Directory Layout
knowledge-manager/
├── km-config.example.json # Template schema (committed)
├── km-config.json # User's local config (gitignored)
├── README.md # End-user docs
├── CLAUDE.md # THIS FILE
├── AGENTS.md # Generic AI agent contract
├── docs/
│ ├── vault-path-configuration.md # Technical reference
│ └── plans/ # Design docs
├── scripts/
│ ├── _lib-config.sh # JSON parser (Node.js-backed)
│ ├── configure-vault-paths.sh # Substitution engine
│ ├── km-update.sh # Update orchestrator
│ ├── install-to-project.sh # Project-mode installer (copies commands/ skills/ agents/ + send_kakao.py)
│ ├── km_link_gate.py # Link gate
│ ├── send_kakao.py # KakaoTalk helper (copied by installer)
│ ├── graphrag-ops/ # tofugraph.sh + km-tools/ (GraphRAG ops)
│ └── tests/ # Shell tests + fixtures
├── skills/ # Skill .md files (placeholder form in HEAD)
├── agents/ # Agent .md files
├── templates/start-here/ # 000-START-HERE seed docs (used by setup Phase 5.5; not copied by installer)
├── .agent/skills/ # Codex/Gemini-CLI skill surface (.codex-plugin/plugin.json → skills)
├── agent-office/ # Agent Office assets
└── commands/ # Slash command .md filesCommands for Users
| Slash command | What it does |
/knowledge-manager-setup | Runs the setup wizard. Generates km-config.json, detects Obsidian CLI, then calls scripts/configure-vault-paths.sh to substitute all placeholders and lock the files with skip-worktree. |
/km-update | Unlocks placeholder files, restores pristine placeholder form, git pull, re-substitutes, re-locks. Safe replacement for raw git pull. |
/knowledge-manager | Main knowledge-management agent (content ingestion, summarization, note creation). |
/knowledge-manager-at | Agent-team variant (parallel Category Lead + RALPH + DA). |
For Contributors
If you are opening a PR against knowledge-manager:
- Never commit
km-config.json. It is in.gitignorefor good reason. - Always grep for personal paths before pushing (see step 1 above).
- Do not add a mirror directory — the top-level
commands/,skills/, andagents/are the single source, andscripts/install-to-project.shinstalls them into a project. - When adding a new skill file, use placeholders from day one, even if you're the only person who will ever read it. Future contributors will thank you.
- When editing an existing skill file, if you see a raw personal path left over from before the placeholder refactor, replace it with the correct placeholder token and note it in your commit message.
See AGENTS.md for the same contract in vendor-neutral form, and docs/vault-path-configuration.md for the full technical reference.
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.

