Skip to content

Installation and Setup

Chris Sweet edited this page Jul 14, 2026 · 2 revisions

type: reference up: "What-is-the-llm-wiki-Template" related:


Installation and Setup

How to get from zero to a working project on the llm-wiki template. Grounded in the template's README.md, scripts/instantiate.sh (as documented), wiki/init-wiki.sh, the Claude Code overlay setup.sh, and scripts/check-template-version.sh / update-from-template.sh.

What are the prerequisites?

  • git — the wiki is a git repo, and the whole model (the wiki sub-repo, the write protocol, the auto-clone hook) assumes git.
  • An LLM coding agent — Claude Code is the validated one; Cursor and a minimal no-overlay mode also ship (see below).
  • Python 3 — only if you use the optional knowledge-graph pipeline. The core wiki needs no Python.

Which Python version is needed, and which packages?

The scripts/kg/README.md lists the KG pipeline dependencies as Bash 4+ and Python 3 with PyYAML, plus the rdflib and pyshacl packages. It specifies "Python 3" without pinning a minor version. CI installs them as python3-yaml + pip install rdflib pyshacl on Linux and pip install --break-system-packages pyyaml rdflib pyshacl on macOS. If you never build the graph, none of this is required.

Which LLM agents are supported?

  • Claude Code — behaviorally validated end-to-end (slash commands, skills, auto-commit, hooks).
  • Cursor — an overlay ships (.cursor/rules/wiki-*.mdc), but it is structurally validated only; no live Cursor session has confirmed the procedures fire as designed.
  • Minimal mode (--agent=none) — installs no overlay; the derived project ships only the wiki, SCHEMA, and a generated CLAUDE.md. The hypothesis is that a non-instructed agent (OpenCode, Pi, or another assistant) can still follow the documented procedures by reading CLAUDE.md; whether any specific agent does is empirically open.

How do I create a new project from the template?

Use the template repo's scripts/instantiate.sh. Two paths, per the README:

  • Path B — local-only wiki (no GitHub UI step):
    ./scripts/instantiate.sh "My Project Name" --agent=claude-code
    git add -A && git commit -m "chore: instantiate from llm-wiki-memory-template"
    git push origin main
  • Path A — GitHub-wiki backend (one manual step first): open https://github.com/<owner>/<repo>/wiki and create the first page titled "Home", then:
    ./scripts/instantiate.sh "My Project Name" --agent=claude-code --github-wiki
    then commit and push the generated files plus wiki seed pages.

You can also enable opt-in features at instantiation with --features=<name> (see Extending-the-Template).

What does scripts/instantiate.sh do?

Per the README, the bootstrap performs five actions: substitutes placeholders in CLAUDE.md.template (and README.md.template) with your project details; initializes the wiki sub-repo (GitHub-hosted or local) via init-wiki.sh; strips the Knowledge Graph sections if scripts/kg/ is absent; configures the chosen agent overlay(s); and then self-deletes after a successful run. Because it deletes itself, you will not find instantiate.sh in an already-instantiated project (this bundle, for instance, has no scripts/instantiate.sh).

What files land in a fresh project after instantiation?

A generated CLAUDE.md (with the memory-boundary and wiki-maintenance sections), a generated README.md, the chosen agent overlay (for Claude Code: .claude/commands/wiki-*.md, .claude/skills/wiki-*.md, .claude/settings.json, and optionally hooks under .claude/hooks/), the agent-agnostic policy files under wiki/agents/, and the wiki sub-repo at wiki/<repo>.wiki/ seeded with Home, index, log, SCHEMA, and Edge-Types. See Wiki-Structure-and-Conventions.

Why is the wiki a separate git repository?

Because it is durable memory with its own lifecycle, distinct from the project's code. Keeping it as a sibling sub-repo at wiki/<repo>.wiki/ gives it its own history and its own remote (on GitHub, the project's built-in wiki remote at <repo>.wiki.git). This is what lets the wiki be pushed, cloned, and shared as a bundle independently of the code, and it is why wiki commits go in the wiki repo, not the project repo.

How do I clone or bootstrap the wiki subdirectory?

For a fresh checkout of an existing project, clone the wiki as a sibling sub-repo:

[ -d wiki/<repo>.wiki ] || \
    git clone https://github.com/<owner>/<repo>.wiki.git wiki/<repo>.wiki

The [ -d … ] || guard is there because the Claude Code overlay's SessionStart hook auto-clones the wiki on first session start; if you opened Claude Code first, the inner clone is a harmless no-op. Teammates on other agents (or no agent) still get the clone this way.

What does the SessionStart hook do (auto-clone the wiki)?

The Claude Code overlay installs ensure-wiki.py as a SessionStart hook. On each session start it checks for wiki/<repo>.wiki/; if absent, it clones it non-interactively (with a 30-second timeout, never blocking on a credential prompt) using the same VCS that manages the project, deriving the GitHub wiki URL from the project's origin remote. If the wiki is already present and clean, it fast-forwards it to upstream; if it cannot (unpushed local commits or divergence) it emits a note asking you to reconcile. If the clone fails (no network, private repo, wiki not created yet) it falls back to asking the agent to clone it. A second SessionStart hook, session-start.sh, surfaces the wiki index and recent log into context. Both are installed by setup.sh --hook.

What is init-wiki.sh and when do I run it?

wiki/init-wiki.sh is the agent-agnostic bootstrap/update tool for the wiki itself. instantiate.sh runs it for you during project creation. You run it directly only when scaffolding a wiki manually, or to bring an existing wiki's SCHEMA and CLAUDE.md up to current conventions. It is idempotent and auto-detects create-vs-update mode. Execute it; do not reimplement what it does by hand.

How do I set up the GitHub wiki remote?

For a GitHub-hosted wiki, the remote already exists once you create the first "Home" page in the repo's wiki tab; it lives at <repo>.wiki.git. Instantiating with --github-wiki wires the sub-repo to it. The ensure-wiki.py hook derives that same URL from origin automatically, so no per-project configuration is needed. Push the wiki with git -C wiki/<repo>.wiki push origin master (only when publishing).

How do I check the template version I am on?

Run ./scripts/check-template-version.sh. It is read-only: it adds a template remote, fetches the template's default branch, and reports the template HEAD SHA, the last recorded sync, and a per-file status (in sync / out of date / missing locally / not in template). If drift exists it exits non-zero and points you at the update command.

How do I pull template updates into an existing project?

Run ./scripts/update-from-template.sh. Preview first with --dry-run. It syncs template improvements (pattern docs, wiki bootstrap, agent setup scripts, slash commands, rules, update tooling) governed by a manifest (scripts/lib/template-manifest.sh), while preserving your project narrative (CLAUDE.md), settings, hooks, wiki history, and source code. A file that is not in the manifest does not propagate, which is why some template assets (such as scripts/kg/) may not arrive automatically. See Extending-the-Template.

See also

Clone this wiki locally