LLM Wiki Init
Initialize a project-agnostic wiki workspace.
Purpose
lw-init is the canonical initialization contract.
It defines what every new LLM Wiki workspace must contain.
For a more operational repo-backed first run, pair it with:
scaffolds/repo-backed-starter/
scripts/bootstrap-repo-backed-wiki.sh
- the correct guide under
integrations/<agent>/
Steps
- Create the workspace root if missing.
- Create:
raw/web/
raw/pdfs/
raw/images/
raw/notes/
raw/repo/
raw/changes/
wiki/
wiki/concepts/
wiki/entities/
wiki/topics/
wiki/comparisons/
wiki/queries/
wiki/maps/
wiki/archive/
profiles/
.llm-wiki/
- Create
outputs/ only when the workspace expects non-canonical artifacts such as exports, slides, charts, reports, or automation logs.
- Write
wiki/index.md with empty sections.
- Write
wiki/log.md with a creation entry.
- Write
.llm-wiki/manifest.json with an empty generic shape:{
"repo_sync": {
"enabled": false,
"repo_path": null,
"repo_remote": "origin",
"default_branch": "main",
"provider": null,
"repo_slug": null,
"last_checked_at": null,
"last_seen_default_branch_sha": null,
"last_compiled_sha": null,
"last_compiled_at": null,
"last_repo_summary": null,
"pending_changes": [],
"processed_change_units": [],
"active_background_sync": null,
"last_sync_report": null,
"fallback_policy": {
"retry_github_api": 3,
"fallback_to_git_only": true
}
},
"staged_artifacts": []
}
- Write
.llm-wiki/reflect_state.json as { "last_reflected_at": null, "synthesized_articles": [] }.
- Write
.llm-wiki/profile.json with a placeholder pointing to a workspace-local profile markdown file.
- If the wiki is being created from a git repo, create
profiles/project-profile.md from the shared profile template and tell the operator to fill in the repo_sync block.
- If a more operational first-run baseline is desired, copy or adapt starter templates from
scaffolds/repo-backed-starter/ for:
.llm-wiki/manifest.json
.llm-wiki/profile.json
.llm-wiki/reflect_state.json
wiki/SCHEMA.md
wiki/index.md
wiki/log.md
- Copy or adapt agent instruction templates for
AGENTS.md and, when useful, CLAUDE.md, SOUL.md, and IDENTITY.md.
- Print the initialized path and the next required setup steps, including which integration guide under
integrations/<agent>/ to follow.
Repo-backed initializer contract
When used for a repo-backed wiki, lw-init should ensure the workspace is ready for these next steps:
- fill in the workspace-local project profile under
profiles/
- point
.llm-wiki/profile.json at that profile using a relative path
- install the relevant agent adapter files
- if the user has only a Git URL, run
lw-clone-repo (or bootstrap with --repo-url) to create raw/upstream and bind repo_sync; otherwise set repo_path to an existing checkout
- run
lw-sync-repo for first inspection
- continue into ingest, compile, lint, and reflect
Rules
- Keep compiled content under
wiki/, not at repository root.
- Keep staged inputs under
raw/.
- Keep state under
.llm-wiki/.
- Treat
outputs/ as optional non-canonical artifact storage, not core wiki structure.
- Keep the active profile workspace-local and referenced through a relative path in
.llm-wiki/profile.json.
1---2name: lw-init3description: Initialize a new LLM Wiki workspace with raw/, wiki/, profiles/, and .llm-wiki/ state files, plus optional outputs/ artifact storage when needed. Usage: /lw-init <workspace-path>4---56# LLM Wiki Init78Initialize a project-agnostic wiki workspace.910## Purpose1112`lw-init` is the canonical initialization contract.13It defines what every new LLM Wiki workspace must contain.1415For a more operational repo-backed first run, pair it with:16- `scaffolds/repo-backed-starter/`17- `scripts/bootstrap-repo-backed-wiki.sh`18- the correct guide under `integrations/<agent>/`1920## Steps211. Create the workspace root if missing.222. Create:23 - `raw/web/`24 - `raw/pdfs/`25 - `raw/images/`26 - `raw/notes/`27 - `raw/repo/`28 - `raw/changes/`29 - `wiki/`30 - `wiki/concepts/`31 - `wiki/entities/`32 - `wiki/topics/`33 - `wiki/comparisons/`34 - `wiki/queries/`35 - `wiki/maps/`36 - `wiki/archive/`37 - `profiles/`38 - `.llm-wiki/`393. Create `outputs/` only when the workspace expects non-canonical artifacts such as exports, slides, charts, reports, or automation logs.404. Write `wiki/index.md` with empty sections.415. Write `wiki/log.md` with a creation entry.426. Write `.llm-wiki/manifest.json` with an empty generic shape:43 ```json44 {45 "repo_sync": {46 "enabled": false,47 "repo_path": null,48 "repo_remote": "origin",49 "default_branch": "main",50 "provider": null,51 "repo_slug": null,52 "last_checked_at": null,53 "last_seen_default_branch_sha": null,54 "last_compiled_sha": null,55 "last_compiled_at": null,56 "last_repo_summary": null,57 "pending_changes": [],58 "processed_change_units": [],59 "active_background_sync": null,60 "last_sync_report": null,61 "fallback_policy": {62 "retry_github_api": 3,63 "fallback_to_git_only": true64 }65 },66 "staged_artifacts": []67 }68 ```697. Write `.llm-wiki/reflect_state.json` as `{ "last_reflected_at": null, "synthesized_articles": [] }`.708. Write `.llm-wiki/profile.json` with a placeholder pointing to a workspace-local profile markdown file.719. If the wiki is being created from a git repo, create `profiles/project-profile.md` from the shared profile template and tell the operator to fill in the `repo_sync` block.7210. If a more operational first-run baseline is desired, copy or adapt starter templates from `scaffolds/repo-backed-starter/` for:73 - `.llm-wiki/manifest.json`74 - `.llm-wiki/profile.json`75 - `.llm-wiki/reflect_state.json`76 - `wiki/SCHEMA.md`77 - `wiki/index.md`78 - `wiki/log.md`7911. Copy or adapt agent instruction templates for `AGENTS.md` and, when useful, `CLAUDE.md`, `SOUL.md`, and `IDENTITY.md`.8012. Print the initialized path and the next required setup steps, including which integration guide under `integrations/<agent>/` to follow.8182## Repo-backed initializer contract8384When used for a repo-backed wiki, `lw-init` should ensure the workspace is ready for these next steps:851. fill in the workspace-local project profile under `profiles/`862. point `.llm-wiki/profile.json` at that profile using a relative path873. install the relevant agent adapter files884. if the user has only a **Git URL**, run `lw-clone-repo` (or bootstrap with `--repo-url`) to create `raw/upstream` and bind `repo_sync`; otherwise set `repo_path` to an existing checkout895. run `lw-sync-repo` for first inspection906. continue into ingest, compile, lint, and reflect9192## Rules93- Keep compiled content under `wiki/`, not at repository root.94- Keep staged inputs under `raw/`.95- Keep state under `.llm-wiki/`.96- Treat `outputs/` as optional non-canonical artifact storage, not core wiki structure.97- Keep the active profile workspace-local and referenced through a relative path in `.llm-wiki/profile.json`.