From ralph-knowledge
Set up or rebuild the ralph-knowledge index from markdown documents. Use when setting up ralph-knowledge for the first time, reindexing after adding new documents, rebuilding a corrupted knowledge DB, or when knowledge_search returns empty results. Also use when the user mentions "index thoughts", "reindex", "set up knowledge", or "knowledge search not working".
How this skill is triggered — by the user, by Claude, or both
Slash command
/ralph-knowledge:setupThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Interactive setup and reindex skill for the ralph-knowledge plugin. Indexes markdown documents from one or more directories into a SQLite database with full-text search and semantic embeddings.
Interactive setup and reindex skill for the ralph-knowledge plugin. Indexes markdown documents from one or more directories into a SQLite database with full-text search and semantic embeddings.
The ralph-knowledge MCP server must be running. If knowledge_search and knowledge_traverse tools aren't available, tell the user:
The ralph-knowledge MCP server isn't connected.
To install:
1. Add to .claude/settings.local.json:
"enabledPlugins": { "ralph-knowledge@ralph-hero": true }
2. Restart Claude Code
3. Run this skill again
If an argument was provided, use it as the thoughts directory path.
Otherwise, look for a thoughts/ directory in these locations (in order):
./thoughts/ (current project root)../thoughts/ (parent directory, for worktree setups)If found, confirm with the user:
Found thoughts directory: [path]
Contains [N] markdown files
Proceed with indexing?
If not found, ask the user for the path.
After confirming the thoughts directory, check if RALPH_KNOWLEDGE_DIRS is set in the environment. If it contains additional directories beyond the one found in Step 1, note them:
Also indexing from RALPH_KNOWLEDGE_DIRS: docs/plans, docs/adr
If RALPH_KNOWLEDGE_DIRS is NOT set, ask:
Would you like to index additional directories alongside thoughts/?
Common choices: docs/, docs/plans/, docs/adr/
Enter comma-separated paths (relative to project root), or press Enter to skip:
If the user provides additional directories, validate each exists. Combine all directories into a single list for Step 3.
If the user wants to persist this, suggest:
To persist, add to .claude/settings.local.json:
{
"env": {
"RALPH_KNOWLEDGE_DIRS": "thoughts,docs/plans"
}
}
The default DB path is ~/.ralph-hero/knowledge.db. The directory is auto-created if it doesn't exist.
If RALPH_KNOWLEDGE_DB is set in the environment, that overrides the default. Use it instead.
Pass the resolved DB path to the reindex script in Step 3.
The reindex script is bundled in the npm package. Install it to a temp location and run:
cd /tmp && npm install --no-save ralph-hero-knowledge-index@latest 2>&1 | tail -3
node /tmp/node_modules/ralph-hero-knowledge-index/dist/reindex.js [dir1] [dir2] ... [db-path]
Pass all directories as separate arguments, followed by the database path (ending in .db).
Display the output as it runs. The script will:
.md files recursively (skipping dot-directories)## Prior Work relationships (builds_on, tensions, superseded_by)The first run downloads the embedding model (~80MB) which takes a minute. Subsequent runs are faster.
After indexing completes, verify the tools work by running a test search:
knowledge_search(query="recent research", limit=3)
Display the results. If results come back, setup is complete. If results are empty or an error occurs:
~/.ralph-hero/knowledge.db — if overriding, ensure RALPH_KNOWLEDGE_DB matches the path passed to reindex./reload-plugins or restart Claude Code./reload-plugins or restart Claude Code.Knowledge Index Ready
=====================
Documents indexed: [N]
Database: [db-path]
Directories indexed:
- thoughts/
- docs/plans/
Tools available:
- knowledge_search: Keyword + semantic search across documents
- knowledge_traverse: Walk relationship edges between documents
To reindex after adding new documents:
/ralph-knowledge:setup
Then suggest:
Want to browse your knowledge documents in Obsidian?
Run /ralph-knowledge:setup-obsidian to set up navigational indexes and vault config.
Then suggest:
Want to browse your knowledge documents in Obsidian?
Run /ralph-knowledge:setup-obsidian to set up navigational indexes and vault config.
npx claudepluginhub cdubiel08/ralph-hero --plugin ralph-knowledgeIndex and search document collections using hybrid semantic, graph, and full-text search. Use for knowledge bases, finding connections between documents, or querying markdown collections.
Upgrades existing Knowledge Base to latest Claude plugin practices: Obsidian graph-view links, structured 'When to Load' format, CLAUDE.md preamble, index schema, frontmatter health. Safe, preview-first, re-runnable.