Skip to content

praneybehl/llm-wiki-plugin / skills/llm-wiki

llm-wiki

Verified

Build and maintain an LLM-curated knowledge base from papers, articles, transcripts, notes and project findings. Ingest sources into linked Markdown, answer questions with citations, lint or upgrade a wiki, and preserve useful synthesis across sessions and agents. Also capture verified task experience, consolidate success/failure patterns, and propose, evaluate, apply or roll back evidence-linked skill improvements. Trigger on "add this to my wiki", "what does the wiki say", "learn from this task", "improve this procedure", /wiki:learn or /wiki:evolve. Works on a local folder or a hosted wiki URL (MCP). Use index-first navigation, atomic pages and hybrid search.

FileKindSize
SKILL.mdskill md24.6 KB
assets/SCHEMA.md.templateother7.4 KB
assets/decision-questions.jsonconfig3.1 KB
assets/evolution_README.md.templateother2.3 KB
assets/experience.json.templateother660 B
assets/graph_README.md.templateother2.0 KB
assets/graph_gitignore.templateother27 B
assets/index.md.templateother775 B
assets/log.md.templateother499 B
assets/ontology.yaml.templateother3.2 KB
assets/page.md.templateother805 B
assets/pattern.md.templateother839 B
assets/wiki-cache_gitignore.templateother14 B
references/agent-memory-integration.mdmarkdown7.5 KB
references/architecture.mdmarkdown9.6 KB
references/decision-models.mdmarkdown6.5 KB
references/evolution-workflow.mdmarkdown19.7 KB
references/graph-workflow.mdmarkdown7.1 KB
references/hosted-mode.mdmarkdown11.4 KB
references/ingest-workflow.mdmarkdown11.1 KB
references/lint-workflow.mdmarkdown8.3 KB
references/page-conventions.mdmarkdown5.8 KB
references/query-workflow.mdmarkdown8.6 KB
references/retrieval-setup.mdmarkdown5.6 KB
references/scaling-playbook.mdmarkdown6.8 KB
scripts/init_wiki.pyscript9.5 KB
scripts/setup_wiki.pyexecutablescript2.5 KB
scripts/test_link_resolution.pyscript6.2 KB
scripts/wiki_decide.pyexecutablescript31.6 KB
scripts/wiki_evolve.pyscript29.1 KB
scripts/wiki_evolve_agent.pyscript15.1 KB
scripts/wiki_evolve_api.pyscript7.0 KB
scripts/wiki_evolve_claude.pyscript2.4 KB
scripts/wiki_evolve_loop.pyscript43.4 KB
scripts/wiki_evolve_stream.pyscript13.0 KB
scripts/wiki_graph_extract.pyscript21.0 KB
scripts/wiki_graph_lint.pyscript22.0 KB
scripts/wiki_graph_query.pyscript9.3 KB
scripts/wiki_lint.pyscript14.5 KB
scripts/wiki_remote.pyexecutablescript76.6 KB
scripts/wiki_search.pyscript35.9 KB
scripts/wiki_stats.pyscript5.9 KB

references/agent-memory-integration.md

View on GitHub
# Agent memory integration

After a wiki is bootstrapped, add a short stanza so the AI agent knows its location in future sessions. Use global agent instructions with a stable user-level path for one personal wiki shared across projects, or a project memory file with relative paths for a project-only wiki. Without this pointer, the agent will often answer from training data instead of reading the wiki.

## Which file to use

The memory-file convention varies by agent. Use this table to pick the right one:

| Agent | Memory file | Notes |
|---|---|---|
| Claude Code | `CLAUDE.md` | Project root; Claude walks up to the git root searching for it. |
| Codex (OpenAI) | `AGENTS.md` | Standard `agents.md` convention. |
| Cursor | `AGENTS.md` (or `.cursor/rules/*.mdc`) | AGENTS.md is simpler and portable across other agents. |
| OpenCode | `AGENTS.md` | Also reads `CLAUDE.md`, so either works. |
| Gemini CLI | `GEMINI.md` | Gemini-specific filename. |
| Pi Agent | `AGENTS.md` | Follows the `agents.md` standard. |
| OMP (Oh My Pi) | `AGENTS.md` | Follows the `agents.md` standard. |
| OpenClaw | `AGENTS.md` | Follows the `agents.md` standard. |

If the user runs multiple agents in the same project, prefer `AGENTS.md` as the canonical file and symlink `CLAUDE.md` to it (or duplicate the content). Claude Code will read a symlinked `CLAUDE.md` without issue.

If the user is unsure which agent they use most, default to `AGENTS.md`: it works for the widest set of runtimes.

## The canonical stanza

Append this stanza to the project's chosen memory file. Keep it tight. Memory files live in the agent's context on every session, so every line has a cost.

```markdown
## LLM Wiki

This project maintains an LLM-curated wiki at `wiki/` following Andrej Karpathy's "LLM Wiki" pattern (https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f).

Before answering questions that rely on knowledge accumulated in this project, read `wiki/index.md` (or the relevant shard under `wiki/indexes/` if the wiki has been sharded) and use its one-line summaries to find the pages you need. Cite with `[[wikilinks]]`. If the index does not surface good candidates, fall back to `wiki_search.py` from the `llm-wiki` skill for local hybrid retrieval; add `--no-embed` for dependency-free BM25.

To add a new source, follow the `llm-wiki` skill's ingest workflow: decide placement under `wiki/sources/`, `wiki/entities/`, `wiki/concepts/`, or `wiki/synthesis/`; identify touched pages and make surgical `str_replace` updates rather than rewrites; update the index; append a one-line entry to `wiki/log.md`.

Scaling discipline: atomic pages (400-line soft cap, 800-line hard cap), sharded indexes past ~150 pages or 300 index lines, required YAML frontmatter on every page, `[[wikilinks]]` for every cross-reference.

Full conventions live in `wiki/SCHEMA.md`. Treat it as authoritative when it disagrees with this summary.
```

Adjust the path references if the user bootstrapped the wiki into a non-default directory (the schema file and the stanza should always agree with each other).

## Personal-global-wiki stanza

Put this variant in the agent's global instructions. Adjust `~/wiki/` if the wiki lives elsewhere.

```markdown
## LLM Wiki

My canonical LLM-curated wiki is at `~/wiki/` and is independent of any project. Before answering from accumulated knowledge, read `~/wiki/index.md` first, then the relevant shard under `~/wiki/indexes/`. Full conventions live in `~/wiki/SCHEMA.md`.

When work in any project produces durable facts, decisions, incidents, or post-mortems, preserve them in `~/wiki/` using the `llm-wiki` skill. Put captured source material under `~/wiki/raw/`. Do not ingest an entire project automatically; add only requested sources and durable findings.
```

## Hosted-wiki stanza

Use this variant when the wiki is on an LLM Wiki server (see `hosted-mode.md`). Put it in global instructions for a personal wiki, or in the project memory file for a project wiki. Replace the URL. Never put a token in a memory file.

```markdown
## LLM Wiki

My canonical LLM-curated wiki is hosted at `https://<worker>.workers.dev` (MCP server `llm-wiki`, endpoint `/mcp`). Use the `llm-wiki` skill in hosted mode.

Call `wiki_overview` first and follow the `SCHEMA.md` it returns. Use `index.md` first, then `wiki_search`. Cite with `[[wikilinks]]`. Write with `wiki_commit`: `edit` operations for surgical changes, `append` for `log.md` and index lines. After a conflict, read the page again and retry. If MCP is not available, use `python3 scripts/wiki_remote.py` with the token in `LLM_WIKI_TOKEN`.

Preserve durable facts, decisions and post-mortems from any project in this wiki. Do not ingest a full project automatically. A local `pull` mirror, if present, is read-only.
```

The agent also needs the MCP server configuration and a token. Run `python3 scripts/wiki_remote.py mcp-config <client>` and show the result. Add the configuration only after the user approves. Each agent gets its own token, so each commit shows which agent made it.

When a local wiki moves to a hosted wiki, replace the local stanza. Do not keep both. Change the stanza only after the import verification passes and the user approves the text.

## The bootstrap conversation

At init time, after the directory structure is in place and the schema walkthrough is done, propose the stanza. Don't silently append. The user owns their memory file.

A good script:

1. Ask whether the wiki is global across projects or belongs to the current project, then ask which agent(s) they run. For a global wiki, target that agent's global instructions and use a stable user-level path. For a project wiki, use `CLAUDE.md`, `AGENTS.md`, or `GEMINI.md` in the project as described above.
2. Check whether that file already exists.
   - If **not**, offer to create it with just the LLM Wiki stanza as the content.
   - If **yes**, show the proposed stanza and ask whether to append it.
3. Ask whether the user would prefer a shorter stanza. Some users keep their memory files to under 50 lines on principle; the canonical stanza above is already tight, but offer a three-line alternative:

```markdown
## LLM Wiki

This project has an LLM-curated wiki at `wiki/`. Read `wiki/index.md` before answering research questions. Full conventions in `wiki/SCHEMA.md`. Ingest and query workflows live in the `llm-wiki` skill.
```

4. Whatever the user picks, write it, then confirm.

## When the wiki changes shape

The stanza is a pointer, not a playbook. Most evolution of the wiki (new page types, new tags, domain conventions) should happen in `SCHEMA.md`, not in the memory file. The memory file only changes when:

- The wiki moves to a non-standard directory (update the path).
- The wiki moves to a hosted server (replace the stanza with the hosted-wiki stanza).
- The wiki shards its index (mention `wiki/indexes/` specifically so the agent starts there).
- The wiki is deprecated (remove the stanza; don't leave a dead pointer).

If you edit the memory file on the user's behalf during a lint or scaling-migration operation, show them the diff and get consent. Silent rewrites of agent-memory files are the fastest way to break user trust.

## Multiple projects

One global wiki is the simplest choice when knowledge should compound across projects. Its global instruction stanza must use a stable user-level path so every working directory resolves the same wiki. Project-specific wikis remain useful when their content should be isolated, committed with the repository, or governed separately. Never merge two wiki scopes silently; follow the closest explicit instruction or ask the user which wiki should receive the material.
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall