Scaffold an LLM-wiki "second brain" for the current folder in one shot — lays the vault skeleton, writes a note per project from its README/code, builds a graphify knowledge graph, and wires the graphify MCP so the current host can query prior work across projects. Auto-detects a single project vs a folder of many projects. Use when the user invokes /wiki, says "scaffold the LLM wiki", "build a second brain here", "graphify this folder", or "turn these projects into a knowledge base".
16 stars
0 votes
0 copies
0 views
Added November 15, 2026
ai-agentspythongobashnodesecurity
Works with
claude code
cli
mcp
Security analysis
A92/100
mediumInstalls packages at runtime which could introduce malicious dependencies
$npx -y skills add mhlaghari/stuntman --skill wiki --agent claude-code
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Wiki?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/mhlaghari-wiki)
---
name: wiki
description: Scaffold an LLM-wiki "second brain" for the current folder in one shot — lays the vault skeleton, writes a note per project from its README/code, builds a graphify knowledge graph, and wires the graphify MCP so the current host can query prior work across projects. Auto-detects a single project vs a folder of many projects. Use when the user invokes /wiki, says "scaffold the LLM wiki", "build a second brain here", "graphify this folder", or "turn these projects into a knowledge base".
---
# stuntman: wiki — stand up an LLM-wiki second brain + graphify
`/scaffold` gives one project a memory; **`/wiki`** gives a whole *folder of projects*
a shared brain: a navigable Obsidian vault of notes-about-projects, a graphify
knowledge graph, and a live MCP so any future session can ask *"did I already solve this?"*
across everything.
It's the Karpathy "LLM wiki" pattern, automated. Run it once in the target folder.
## Dependencies
- **graphify** (`pip install graphifyy`, or the user's `/graphify` skill) — builds the graph.
- **mcp** python package + the current host CLI (`claude` or `codex`) — to wire the live query server.
The skill installs/checks these along the way; if one is truly unavailable, do that step's fallback and tell the user.
## What to do
### 1. Scaffold the skeleton (deterministic, idempotent)
Read [host and tool setup](../runtime.md). Set `STUNTMAN_HOST` to `codex` in
Codex or `claude` in Claude Code; use `both` when requested.
```bash
WIKI="$STUNTMAN_ROOT/bin/wiki"
"$WIKI" --host "$STUNTMAN_HOST" # optionally append /path/to/folder
```
Read its output: `VAULT=…`, `MODE=single|folder`, and (folder mode) the `PROJECTS:` list.
Never clobbers — re-running only fills gaps. `$VAULT` is `<folder>-wiki/`.
### 2. Ensure graphify is installed
Resolve an interpreter that can `import graphify` (uv tool / pipx / venv / system). If none,
install it in a dedicated virtual environment or with uv/pipx. Save the interpreter path to
`$VAULT/graphify-out/.graphify_python` for later steps (create that directory first).
### 3. Populate the notes from reality
Write notes that a reader with zero memory of the codebase can use. Follow the schema in
the vault's `AGENTS.md` (Codex) or `CLAUDE.md` (Claude Code), including frontmatter + Summary / Architecture / Connections / Notable.
Every note's frontmatter needs `type:` and a one-line `description:` (OKF v0.1 — this is what
makes the vault portable across agent tooling). Wikilinks must target real page basenames
(kebab-case filenames, not Title Case) — broken links render as ghost nodes in Obsidian.
- **MODE=folder:** one `$VAULT/wiki/projects/<name>.md` per detected project. For more than ~4
projects, **use available native subagents within host limits** (one per cluster of 3–5 projects)
to read each project's README / manifest / structure / key entry files and return a structured
summary (read sequentially if no subagent tool is available); then **author the notes centrally** so cross-links are consistent (linking needs a
global view of all projects). Group projects into families and write `wiki/_PROJECTS_MOC.md`,
fill `wiki/index.md`, and seed `wiki/hot.md`. Create a `wiki/concepts/` or `wiki/patterns/` note
**only** where a pattern genuinely spans ≥3 projects.
- **MODE=single:** read the current project and write one `wiki/projects/<folder>.md`; point
`index.md` and `hot.md` at it.
- **Selective linking** is the quality lever — 2–4 high-signal `[[wikilinks]]` per note, only where
one project genuinely informs another. Capture any ⚠️ secrets/security issues in `wiki/lessons-learned/`.
### 4. Build the graph
Run graphify over `$VAULT/wiki` (the notes, not the project code — keeps it fast and at the right
altitude). The scaffold includes a `$VAULT/.graphifyignore` that keeps navigation pages
(index/hot/log/MOC/Dashboard/templates) OUT of the graph — they link to everything and would
become the top god nodes, hairballing the whole graph. graphify's `detect()` honors it
automatically; never hand-add those pages back. Do NOT use `graphify update` for notes:
verified on graphify 0.5.0, `update` only rebuilds code (it imports
`graphify.watch._rebuild_code`, prints "Re-extracting code files...", and directs doc
changes to `/graphify --update`) — it never re-extracts Markdown notes. Refreshing notes
means re-running the full semantic extraction pipeline below (or the `/wiki` skill itself).
Preferred: invoke the **`/graphify`** skill on `$VAULT/wiki`. If that skill isn't present,
run the pipeline directly with the saved interpreter: detect → semantic-extract the notes via
available native subagents or sequential extraction → `build_from_json` → `cluster` → `report.generate` → `export.to_json` /
`to_html`, and `export.to_canvas` into `$VAULT/graph.canvas`. Output lands in `$VAULT/graphify-out/`
(`graph.html`, `graph.json`, `GRAPH_REPORT.md`).
### 5. Wire the live MCP in the current host
```bash
INTERP="$(cat "$VAULT/graphify-out/.graphify_python")"
"$INTERP" -c "import mcp" 2>/dev/null || uv pip install --python "$INTERP" mcp -q || "$INTERP" -m pip install mcp -q
NAME="$(basename "$VAULT")" # e.g. myprojects-wiki
# Codex:
codex mcp add "$NAME" -- "$INTERP" -m graphify.serve "$VAULT/graphify-out/graph.json"
codex mcp get "$NAME"
# Claude Code (use this block instead when Claude Code is the host):
claude mcp add "$NAME" --scope user -- "$INTERP" -m graphify.serve "$VAULT/graphify-out/graph.json"
claude mcp get "$NAME"
```
The server loads `graph.json` at session start, so the brain is queryable from the user's **next**
session. (If the current host CLI is unavailable, give its exact add command.)
Check for an existing entry with `mcp get` before adding; preserve unrelated
entries and reuse an entry already pointing at this graph. A listed configuration
is not proof of a live connection: query the graph through MCP in a new session
when available, otherwise report that connection verification is pending.
### 6. Report
Show: the vault path, project/concept counts, and from `GRAPH_REPORT.md` the **God Nodes** and
**Surprising Connections**. Tell the user to open `$VAULT` as a vault in Obsidian (graph view is
pre-colored; `graph.canvas` is the community layout), that the `<name>` MCP is live next session,
and the maintenance loop: re-run `/wiki` after meaningful work — agents refresh the affected
notes and semantically rebuild their graph. Notes are maintained by agents, not on every file
write; there is no background watcher (the hook only nudges). `graphify update` rebuilds code
only (verified v0.5.0) and is insufficient for Markdown notes. The MCP loads `graph.json` at
session start, so after a rebuild the existing connection may need a restart / new session —
don't claim live auto-reloading. Existing vaults stay untouched: the scaffolder never clobbers
(contracts and user notes are preserved idempotently); if explicitly asked to refresh an existing
vault, review/update its old refresh advice without overwriting user notes. Optionally offer to add a "check the second brain before rebuilding"
note to their global `~/.claude/CLAUDE.md`.
## Notes
- **Notes only, never code.** The vault holds summaries/lessons; project code stays in its own folder, untouched.
- **Idempotent.** Safe to re-run — the scaffolder skips existing files; re-running mainly refreshes notes + graph.
- Pairs with `/scaffold` (per-project memory) and the graphify MCP (cross-project recall): scaffold makes
one project resumable; `/wiki` makes the *whole portfolio* searchable.