rigjs 4.0.4 → 4.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,14 +15,22 @@ metadata:
15
15
 
16
16
  **Positioning.** rig wiki is an **agent-facing tool**. Humans don't memorise the CLI; they tell their agent (you) what they want, and you orchestrate `rig wiki *`. Treat any direct user-typed `rig wiki ...` invocation as a fallback — your job is to make raw CLI use unnecessary. Never just hand the user a command and walk away; run it, observe, report.
17
17
 
18
- You orchestrate `rig wiki *` on behalf of the user. The user speaks in intent; you map to commands. Below is the intent → action table. Resolve the **target wiki** by reading `rig wiki list` once at session start; if none registered, see "Setup" at the bottom.
18
+ ## Vault discovery (no registry)
19
+
20
+ There is **no global registry**. The active vault is resolved by walking up from the current working directory looking for a `.rig/config.yml`. The directory that contains that file IS the vault.
21
+
22
+ This means:
23
+ - **Always `cd` into the project first.** If the user is in some other CWD, change directory before running any `rig wiki *` command.
24
+ - **No `--wiki <name>` flag exists.** Don't try to pass one.
25
+ - **No `rig wiki list`, `register`, or `unregister` commands.** They've been removed.
26
+ - If the user is in a project that has no vault, the next step is `rig wiki init <subdir>` (see "Setup" below).
19
27
 
20
28
  ## Intent → command map
21
29
 
22
30
  | User intent (any language) | Action |
23
31
  |---|---|
24
32
  | "把 / record / take notes on / 添加 / 收一下 / 收藏 …" + a URL | `rig wiki fetch <url>` then `rig wiki ingest raw/<resulting-file>` |
25
- | "…" + a local file path or content paste | Write the content to `<wiki>/raw/YYYY-MM-DD-<kebab-slug>.md` with frontmatter (`source-url`, `fetched-at`, `fetcher: agent-paste`, `content-sha`). Then `rig wiki ingest <that-path>`. |
33
+ | "…" + a local file path or content paste | Write the content to `<vault>/raw/YYYY-MM-DD-<kebab-slug>.md` with frontmatter (`source-url`, `fetched-at`, `fetcher: agent-paste`, `content-sha`). Then `rig wiki ingest <that-path>`. |
26
34
  | "ingest / re-process / 重新整理 / 重新 ingest <something>" | `rig wiki ingest <path>` — handles new sources AND re-ingest of modified ones. |
27
35
  | "what's new / 有什么变化 / scan / diff" | `rig wiki scan` — surface the NEW / MODIFIED / DELETED / RAW DRIFT report verbatim. |
28
36
  | "ingest everything new / 把新东西都收一下" | `rig wiki scan` → for each NEW path → `rig wiki ingest <path>` (one call per file). |
@@ -30,43 +38,70 @@ You orchestrate `rig wiki *` on behalf of the user. The user speaks in intent; y
30
38
  | "summarize what we know about X / 总结一下 X" | `rig wiki query "<X>" --synth` — adds a Claude-synthesized paragraph with `[[wikilink]]` citations after the hit list. |
31
39
  | "lint / 检查一遍 / what's broken in my wiki" | `rig wiki lint`. Surface the report. Exit code 11 = severe (broken refs / missing source). |
32
40
  | "rebuild / 全部重 embed / 换了模型 / 新机器" | `rig wiki rebuild` — full nuclear refresh. Only suggest this when the user mentions a new device or explicitly switching the embed model. |
33
- | "wiki list / what wikis are registered" | `rig wiki list` |
34
41
 
35
- Always run from inside the registered project (or pass `--wiki <name>`). If the user is in some other CWD, `cd` to the wiki's project first.
42
+ ## Vault layout (flat no inner `wiki/` subdir)
43
+
44
+ ```
45
+ <vault>/
46
+ purpose.md ← human-authored, never write
47
+ schema.md ← human-authored, never write
48
+ index.md ← LLM-writable
49
+ overview.md ← LLM-writable
50
+ log.md ← append-only LLM log
51
+ reviews.md ← LLM-writable backlog of human-review items
52
+ raw/ ← immutable source files (never edit existing)
53
+ sources/ ← one .md per ingested source — page tree at vault root
54
+ entities/
55
+ concepts/
56
+ synthesis/
57
+ queries/
58
+ .rig/config.yml ← per-vault settings (name, root, include, exclude, …)
59
+ .gitignore
60
+ ```
61
+
62
+ Note: there is no `<vault>/wiki/` subdirectory. Page directories (`sources/`, `entities/`, `concepts/`, `synthesis/`, `queries/`) live directly under the vault root.
36
63
 
37
64
  ## Argument inference rules
38
65
 
39
- - **slug** = kebab-case, no dates inside `wiki/`, dates only on `raw/YYYY-MM-DD-*` prefix.
66
+ - **slug** = kebab-case, no dates in page filenames; dates only on `raw/YYYY-MM-DD-*` prefix.
40
67
  - **raw filename** = `YYYY-MM-DD-<slug>.md`. Pick today's local date; if filename collides, append `-2`, `-3`.
41
68
  - **URL → slug**: last path segment, drop extension, lowercase, replace non-`[a-z0-9-]` with `-`, max 64 chars.
42
- - **wiki dir name** when initializing: prefer user-stated name; if absent, ask once. Never default to `wiki` or CWD silently.
69
+ - **Default vault dir name** when the user says "init a vault / make a wiki here" without specifying: suggest `rig-wiki` at the project root. Never default silently confirm the name once.
43
70
 
44
71
  ## Hard rules — refuse and explain if violated
45
72
 
46
73
  - **Never** edit `raw/`, `purpose.md`, or `schema.md` directly. Those are human-authored. If the user asks you to, tell them to do it manually.
47
- - **Never** ingest or init at a **hidden path** (any segment starting with `.`) or a **.gitignored** path. rig wiki refuses at the CLI level — it sees these as "the project deliberately doesn't want this in the wiki." Workaround if the user insists: `cp -R <hidden-or-ignored> <wiki>/raw/<slug>/` first, then ingest the copy. Never bypass the guard.
48
- - **Never** ingest a path outside the wiki's `include[]` scope (anything in `raw/` is always fine; outside that requires the path to be listed in the registered wiki's `include`).
74
+ - **Never** init a vault INSIDE a user-authored data directory (e.g. `personal/wiki/`). The vault dir contaminates the user's source tree. Put the vault at the project root (e.g. `<project>/rig-wiki/`) and point `include[]` at the data dirs via `<vault>/.rig/config.yml`.
75
+ - **Never** init a vault at a **hidden path** (any segment starting with `.`) or a **.gitignored** path. rig wiki refuses at the CLI level.
49
76
  - **`rig wiki scan` exit 10 (RAW DRIFT)** = a `raw/` file's bytes changed since last scan. Do NOT auto-fix or re-ingest. Surface to the user as a data-integrity warning.
50
77
  - **`rig wiki lint` exit 11** = severe findings. Surface the report path and the top findings; do not auto-fix unless the user asks.
51
78
  - **Never** suggest editing `~/.rig/cache/qmd/*.sqlite` or `~/.cache/qmd/`. Those are rebuildable caches.
52
79
 
80
+ ## Auto-exclusions (no config needed)
81
+
82
+ The scanner skips these automatically — do not waste user time adding them to `exclude`:
83
+ - Any path segment starting with `.` (`.git/`, `.obsidian/`, `.vscode/`, `.DS_Store`, …).
84
+ - Any path matched by the project's `.gitignore`.
85
+
86
+ What you DO need to put in `exclude` are content-type filters the user cares about — e.g. `**/*.zip`, `**/*.pdf` if they don't want those in their text wiki.
87
+
53
88
  ## Common error → recovery
54
89
 
55
90
  | Error | What it means | Action |
56
91
  |---|---|---|
57
- | `qmd query failed. Run \`rig wiki index\` first` | No vector index for this wiki | `rig wiki index --wiki <name>` then retry |
58
- | `no wiki resolved` | CWD is not inside a registered wiki and no `--wiki` flag | Either `cd` into the project or pass `--wiki <name>` |
59
- | `claude not installed on PATH` (during ingest/synth) | Claude Code CLI missing | Tell the user; suggest `yarn dlx @anthropics/claude-code` or use a non-agent flow |
92
+ | `No rig wiki vault found.` | CWD has no `.rig/config.yml` and no parent does either | `cd` into the vault (or the project that contains one), or run `rig wiki init <subdir>` |
93
+ | `qmd query failed. Run \`rig wiki index\` first` | No vector index for this vault | `rig wiki index`, then retry |
94
+ | `claude not installed on PATH` (during ingest/synth) | Claude Code CLI missing | Tell the user; suggest `yarn dlx @anthropics/claude-code` |
60
95
  | Reranker download stalls on first query | CDN cold node, can take ~1 min | Just wait; subsequent queries are instant |
61
96
 
62
97
  ## Output handling
63
98
 
64
- - After running a `rig wiki *` command, **summarise in natural language** what changed. Don't dump raw `rig` output unless the user asks ("show me the raw output"). Examples:
99
+ - After running a `rig wiki *` command, **summarise in natural language** what changed. Don't dump raw `rig` output unless the user asks. Examples:
65
100
  - After `rig wiki ingest`: "Wrote 11 pages (1 source, 2 entities, 5 concepts, …). Lint clean."
66
- - After `rig wiki query`: cite the top hit by slug `[[wikilink]]` and quote a 1-line snippet; offer to run `--synth` if user wants a paragraph.
101
+ - After `rig wiki query`: cite the top hit by slug `[[wikilink]]` and quote a 1-line snippet; offer `--synth` for a paragraph.
67
102
  - After `rig wiki scan`: "3 new, 1 modified. Want me to ingest them?"
68
103
  - For **machine** consumption (chaining): use `--json` on any command. Shape is `{ ok, code, data?, error? }`.
69
- - **Long ingest** (Claude two-step CoT): expect 1–3 minutes. Tell the user once at the start; don't ping them mid-run.
104
+ - **Long ingest** (Claude two-step CoT): expect 1–3 minutes per source. Tell the user once at the start; don't ping them mid-run.
70
105
  - **First-run model download** (embed model on first `ingest` / `index`, reranker on first `query`): each is ~610MB from the rig CDN — usually under a minute. Mention it the first time, then forget.
71
106
 
72
107
  ## When NOT to use this skill
@@ -76,38 +111,36 @@ Always run from inside the registered project (or pass `--wiki <name>`). If the
76
111
  - User is talking about a different knowledge system (Obsidian-only, Notion, etc.).
77
112
  - Task is unrelated to personal knowledge capture (e.g. code search → use `grep`).
78
113
 
79
- ## Setup — if no wiki is registered
114
+ ## Setup — if no vault is found
80
115
 
81
- `rig wiki list` shows zero entries → ask the user **once** (don't list multiple defaults; pick one suggestion and confirm):
116
+ `rig wiki scan` (or any command) reports `No rig wiki vault found.` → ask the user **once** (don't list multiple defaults; pick one suggestion and confirm):
82
117
 
83
- > "No wiki registered here. Want me to init one under `knowledge/`? (or pick another subdir name)"
118
+ > "No vault here. Want me to init one as `rig-wiki/` at the project root? (or pick another path)"
84
119
 
85
120
  Then orchestrate without further prompting:
86
121
 
87
122
  ```bash
88
- rig wiki init <subdir> # REQUIRED fails if path missing or hidden/gitignored
89
- rig wiki register <subdir>
123
+ rig wiki init rig-wiki # creates <project>/rig-wiki/ with templates + .rig/config.yml
90
124
  ```
91
125
 
92
- After init, **pause and ask the user to edit `<subdir>/purpose.md`** (one-time human scoping — define what this wiki is for, in/out of scope). Don't write purpose.md yourself; it's the only human-authored anchor for everything downstream.
126
+ After init, **pause and ask the user to edit `<vault>/purpose.md`** (one-time human scoping — define what this wiki is for, in/out of scope). Don't write purpose.md yourself; it's the only human-authored anchor for everything downstream.
93
127
 
94
- If the user describes a scan scope that differs from the defaults (e.g. "include every md file in the parent dir but ignore zip files"), translate that into edits to `<subdir>/.rig/config.yml` that's the per-vault settings file (`name`, `root`, `include`, `exclude`, `schedule`, `ingestRules`). The vault is self-contained: nothing about its identity or scope lives outside its own directory.
128
+ If the user describes a scan scope that differs from the defaults (e.g. "include every md file in `personal/` but ignore zip files"), translate that into edits to `<vault>/.rig/config.yml`. Fields: `name`, optional `root` (relative scan base, default `..`), `include[]`, `exclude[]`, `schedule`, `ingestRules`. The vault is self-contained nothing about its identity or scope lives outside its own directory.
95
129
 
96
- ## Configuration model (read once, then forget)
130
+ ## Configuration files
97
131
 
98
- Two layers, both YAML:
132
+ Two YAML files, both optional except where noted:
99
133
 
100
- - `~/.rig/config.yml` — rig-global prefs only (default agent, qmd toggle, log rotation). Touched by `rig wiki agent use`.
101
- - `~/.rig/wikis.yml` — registry. **Just a flat list of vault paths** for discovery. No per-wiki settings here.
102
- - `<vault>/.rig/config.yml` — **the only place per-vault settings live.** `name`, optional `root` (relative scan base, default `..`), `include[]`, `exclude[]`, `schedule`, `ingestRules`. Created automatically by `init`. Safe to edit by hand.
134
+ - `~/.rig/config.yml` — rig-global prefs (default agent, qmd toggle, log rotation). Touched by `rig wiki agent use`.
135
+ - `<vault>/.rig/config.yml` — **the only place per-vault settings live.** Auto-created by `rig wiki init`. Safe to edit by hand.
103
136
 
104
- Never edit `~/.rig/wikis.yml` to change a wiki's name, scope, or schedule — those belong in the vault. Never invent a `package.rig.json5` wiki block; that file is unrelated to rig wiki (legacy rig CICD only).
137
+ No global registry. No `package.rig.json5` wiki block (that file is for legacy rig CICD, unrelated).
105
138
 
106
139
  ## Architecture (read once, then forget)
107
140
 
108
141
  - Vector-only retrieval: Qwen3-Embedding-0.6B (~610MB) + Qwen3-Reranker-0.6B (~610MB), both CDN-mirrored at `assets.terncloud.com/rig/models/`.
109
142
  - Models auto-downloaded on first use into `~/.cache/qmd/models/`; subsequent runs are instant.
110
- - Per-wiki SQLite at `~/.rig/cache/qmd/<wiki>.sqlite` (sqlite-vec extension). `.gitignore`'d by default.
143
+ - Per-vault SQLite at `~/.rig/cache/qmd/<vault-name>.sqlite` (sqlite-vec extension). `.gitignore`'d by default.
111
144
  - `ingest` triggers incremental embed at the end — no need to manually call `index` in routine use.
112
145
  - macOS-only in v1.
113
146
 
package/RIG_WIKI_SKILL.md CHANGED
@@ -15,14 +15,22 @@ metadata:
15
15
 
16
16
  **Positioning.** rig wiki is an **agent-facing tool**. Humans don't memorise the CLI; they tell their agent (you) what they want, and you orchestrate `rig wiki *`. Treat any direct user-typed `rig wiki ...` invocation as a fallback — your job is to make raw CLI use unnecessary. Never just hand the user a command and walk away; run it, observe, report.
17
17
 
18
- You orchestrate `rig wiki *` on behalf of the user. The user speaks in intent; you map to commands. Below is the intent → action table. Resolve the **target wiki** by reading `rig wiki list` once at session start; if none registered, see "Setup" at the bottom.
18
+ ## Vault discovery (no registry)
19
+
20
+ There is **no global registry**. The active vault is resolved by walking up from the current working directory looking for a `.rig/config.yml`. The directory that contains that file IS the vault.
21
+
22
+ This means:
23
+ - **Always `cd` into the project first.** If the user is in some other CWD, change directory before running any `rig wiki *` command.
24
+ - **No `--wiki <name>` flag exists.** Don't try to pass one.
25
+ - **No `rig wiki list`, `register`, or `unregister` commands.** They've been removed.
26
+ - If the user is in a project that has no vault, the next step is `rig wiki init <subdir>` (see "Setup" below).
19
27
 
20
28
  ## Intent → command map
21
29
 
22
30
  | User intent (any language) | Action |
23
31
  |---|---|
24
32
  | "把 / record / take notes on / 添加 / 收一下 / 收藏 …" + a URL | `rig wiki fetch <url>` then `rig wiki ingest raw/<resulting-file>` |
25
- | "…" + a local file path or content paste | Write the content to `<wiki>/raw/YYYY-MM-DD-<kebab-slug>.md` with frontmatter (`source-url`, `fetched-at`, `fetcher: agent-paste`, `content-sha`). Then `rig wiki ingest <that-path>`. |
33
+ | "…" + a local file path or content paste | Write the content to `<vault>/raw/YYYY-MM-DD-<kebab-slug>.md` with frontmatter (`source-url`, `fetched-at`, `fetcher: agent-paste`, `content-sha`). Then `rig wiki ingest <that-path>`. |
26
34
  | "ingest / re-process / 重新整理 / 重新 ingest <something>" | `rig wiki ingest <path>` — handles new sources AND re-ingest of modified ones. |
27
35
  | "what's new / 有什么变化 / scan / diff" | `rig wiki scan` — surface the NEW / MODIFIED / DELETED / RAW DRIFT report verbatim. |
28
36
  | "ingest everything new / 把新东西都收一下" | `rig wiki scan` → for each NEW path → `rig wiki ingest <path>` (one call per file). |
@@ -30,43 +38,70 @@ You orchestrate `rig wiki *` on behalf of the user. The user speaks in intent; y
30
38
  | "summarize what we know about X / 总结一下 X" | `rig wiki query "<X>" --synth` — adds a Claude-synthesized paragraph with `[[wikilink]]` citations after the hit list. |
31
39
  | "lint / 检查一遍 / what's broken in my wiki" | `rig wiki lint`. Surface the report. Exit code 11 = severe (broken refs / missing source). |
32
40
  | "rebuild / 全部重 embed / 换了模型 / 新机器" | `rig wiki rebuild` — full nuclear refresh. Only suggest this when the user mentions a new device or explicitly switching the embed model. |
33
- | "wiki list / what wikis are registered" | `rig wiki list` |
34
41
 
35
- Always run from inside the registered project (or pass `--wiki <name>`). If the user is in some other CWD, `cd` to the wiki's project first.
42
+ ## Vault layout (flat no inner `wiki/` subdir)
43
+
44
+ ```
45
+ <vault>/
46
+ purpose.md ← human-authored, never write
47
+ schema.md ← human-authored, never write
48
+ index.md ← LLM-writable
49
+ overview.md ← LLM-writable
50
+ log.md ← append-only LLM log
51
+ reviews.md ← LLM-writable backlog of human-review items
52
+ raw/ ← immutable source files (never edit existing)
53
+ sources/ ← one .md per ingested source — page tree at vault root
54
+ entities/
55
+ concepts/
56
+ synthesis/
57
+ queries/
58
+ .rig/config.yml ← per-vault settings (name, root, include, exclude, …)
59
+ .gitignore
60
+ ```
61
+
62
+ Note: there is no `<vault>/wiki/` subdirectory. Page directories (`sources/`, `entities/`, `concepts/`, `synthesis/`, `queries/`) live directly under the vault root.
36
63
 
37
64
  ## Argument inference rules
38
65
 
39
- - **slug** = kebab-case, no dates inside `wiki/`, dates only on `raw/YYYY-MM-DD-*` prefix.
66
+ - **slug** = kebab-case, no dates in page filenames; dates only on `raw/YYYY-MM-DD-*` prefix.
40
67
  - **raw filename** = `YYYY-MM-DD-<slug>.md`. Pick today's local date; if filename collides, append `-2`, `-3`.
41
68
  - **URL → slug**: last path segment, drop extension, lowercase, replace non-`[a-z0-9-]` with `-`, max 64 chars.
42
- - **wiki dir name** when initializing: prefer user-stated name; if absent, ask once. Never default to `wiki` or CWD silently.
69
+ - **Default vault dir name** when the user says "init a vault / make a wiki here" without specifying: suggest `rig-wiki` at the project root. Never default silently confirm the name once.
43
70
 
44
71
  ## Hard rules — refuse and explain if violated
45
72
 
46
73
  - **Never** edit `raw/`, `purpose.md`, or `schema.md` directly. Those are human-authored. If the user asks you to, tell them to do it manually.
47
- - **Never** ingest or init at a **hidden path** (any segment starting with `.`) or a **.gitignored** path. rig wiki refuses at the CLI level — it sees these as "the project deliberately doesn't want this in the wiki." Workaround if the user insists: `cp -R <hidden-or-ignored> <wiki>/raw/<slug>/` first, then ingest the copy. Never bypass the guard.
48
- - **Never** ingest a path outside the wiki's `include[]` scope (anything in `raw/` is always fine; outside that requires the path to be listed in the registered wiki's `include`).
74
+ - **Never** init a vault INSIDE a user-authored data directory (e.g. `personal/wiki/`). The vault dir contaminates the user's source tree. Put the vault at the project root (e.g. `<project>/rig-wiki/`) and point `include[]` at the data dirs via `<vault>/.rig/config.yml`.
75
+ - **Never** init a vault at a **hidden path** (any segment starting with `.`) or a **.gitignored** path. rig wiki refuses at the CLI level.
49
76
  - **`rig wiki scan` exit 10 (RAW DRIFT)** = a `raw/` file's bytes changed since last scan. Do NOT auto-fix or re-ingest. Surface to the user as a data-integrity warning.
50
77
  - **`rig wiki lint` exit 11** = severe findings. Surface the report path and the top findings; do not auto-fix unless the user asks.
51
78
  - **Never** suggest editing `~/.rig/cache/qmd/*.sqlite` or `~/.cache/qmd/`. Those are rebuildable caches.
52
79
 
80
+ ## Auto-exclusions (no config needed)
81
+
82
+ The scanner skips these automatically — do not waste user time adding them to `exclude`:
83
+ - Any path segment starting with `.` (`.git/`, `.obsidian/`, `.vscode/`, `.DS_Store`, …).
84
+ - Any path matched by the project's `.gitignore`.
85
+
86
+ What you DO need to put in `exclude` are content-type filters the user cares about — e.g. `**/*.zip`, `**/*.pdf` if they don't want those in their text wiki.
87
+
53
88
  ## Common error → recovery
54
89
 
55
90
  | Error | What it means | Action |
56
91
  |---|---|---|
57
- | `qmd query failed. Run \`rig wiki index\` first` | No vector index for this wiki | `rig wiki index --wiki <name>` then retry |
58
- | `no wiki resolved` | CWD is not inside a registered wiki and no `--wiki` flag | Either `cd` into the project or pass `--wiki <name>` |
59
- | `claude not installed on PATH` (during ingest/synth) | Claude Code CLI missing | Tell the user; suggest `yarn dlx @anthropics/claude-code` or use a non-agent flow |
92
+ | `No rig wiki vault found.` | CWD has no `.rig/config.yml` and no parent does either | `cd` into the vault (or the project that contains one), or run `rig wiki init <subdir>` |
93
+ | `qmd query failed. Run \`rig wiki index\` first` | No vector index for this vault | `rig wiki index`, then retry |
94
+ | `claude not installed on PATH` (during ingest/synth) | Claude Code CLI missing | Tell the user; suggest `yarn dlx @anthropics/claude-code` |
60
95
  | Reranker download stalls on first query | CDN cold node, can take ~1 min | Just wait; subsequent queries are instant |
61
96
 
62
97
  ## Output handling
63
98
 
64
- - After running a `rig wiki *` command, **summarise in natural language** what changed. Don't dump raw `rig` output unless the user asks ("show me the raw output"). Examples:
99
+ - After running a `rig wiki *` command, **summarise in natural language** what changed. Don't dump raw `rig` output unless the user asks. Examples:
65
100
  - After `rig wiki ingest`: "Wrote 11 pages (1 source, 2 entities, 5 concepts, …). Lint clean."
66
- - After `rig wiki query`: cite the top hit by slug `[[wikilink]]` and quote a 1-line snippet; offer to run `--synth` if user wants a paragraph.
101
+ - After `rig wiki query`: cite the top hit by slug `[[wikilink]]` and quote a 1-line snippet; offer `--synth` for a paragraph.
67
102
  - After `rig wiki scan`: "3 new, 1 modified. Want me to ingest them?"
68
103
  - For **machine** consumption (chaining): use `--json` on any command. Shape is `{ ok, code, data?, error? }`.
69
- - **Long ingest** (Claude two-step CoT): expect 1–3 minutes. Tell the user once at the start; don't ping them mid-run.
104
+ - **Long ingest** (Claude two-step CoT): expect 1–3 minutes per source. Tell the user once at the start; don't ping them mid-run.
70
105
  - **First-run model download** (embed model on first `ingest` / `index`, reranker on first `query`): each is ~610MB from the rig CDN — usually under a minute. Mention it the first time, then forget.
71
106
 
72
107
  ## When NOT to use this skill
@@ -76,38 +111,36 @@ Always run from inside the registered project (or pass `--wiki <name>`). If the
76
111
  - User is talking about a different knowledge system (Obsidian-only, Notion, etc.).
77
112
  - Task is unrelated to personal knowledge capture (e.g. code search → use `grep`).
78
113
 
79
- ## Setup — if no wiki is registered
114
+ ## Setup — if no vault is found
80
115
 
81
- `rig wiki list` shows zero entries → ask the user **once** (don't list multiple defaults; pick one suggestion and confirm):
116
+ `rig wiki scan` (or any command) reports `No rig wiki vault found.` → ask the user **once** (don't list multiple defaults; pick one suggestion and confirm):
82
117
 
83
- > "No wiki registered here. Want me to init one under `knowledge/`? (or pick another subdir name)"
118
+ > "No vault here. Want me to init one as `rig-wiki/` at the project root? (or pick another path)"
84
119
 
85
120
  Then orchestrate without further prompting:
86
121
 
87
122
  ```bash
88
- rig wiki init <subdir> # REQUIRED fails if path missing or hidden/gitignored
89
- rig wiki register <subdir>
123
+ rig wiki init rig-wiki # creates <project>/rig-wiki/ with templates + .rig/config.yml
90
124
  ```
91
125
 
92
- After init, **pause and ask the user to edit `<subdir>/purpose.md`** (one-time human scoping — define what this wiki is for, in/out of scope). Don't write purpose.md yourself; it's the only human-authored anchor for everything downstream.
126
+ After init, **pause and ask the user to edit `<vault>/purpose.md`** (one-time human scoping — define what this wiki is for, in/out of scope). Don't write purpose.md yourself; it's the only human-authored anchor for everything downstream.
93
127
 
94
- If the user describes a scan scope that differs from the defaults (e.g. "include every md file in the parent dir but ignore zip files"), translate that into edits to `<subdir>/.rig/config.yml` that's the per-vault settings file (`name`, `root`, `include`, `exclude`, `schedule`, `ingestRules`). The vault is self-contained: nothing about its identity or scope lives outside its own directory.
128
+ If the user describes a scan scope that differs from the defaults (e.g. "include every md file in `personal/` but ignore zip files"), translate that into edits to `<vault>/.rig/config.yml`. Fields: `name`, optional `root` (relative scan base, default `..`), `include[]`, `exclude[]`, `schedule`, `ingestRules`. The vault is self-contained nothing about its identity or scope lives outside its own directory.
95
129
 
96
- ## Configuration model (read once, then forget)
130
+ ## Configuration files
97
131
 
98
- Two layers, both YAML:
132
+ Two YAML files, both optional except where noted:
99
133
 
100
- - `~/.rig/config.yml` — rig-global prefs only (default agent, qmd toggle, log rotation). Touched by `rig wiki agent use`.
101
- - `~/.rig/wikis.yml` — registry. **Just a flat list of vault paths** for discovery. No per-wiki settings here.
102
- - `<vault>/.rig/config.yml` — **the only place per-vault settings live.** `name`, optional `root` (relative scan base, default `..`), `include[]`, `exclude[]`, `schedule`, `ingestRules`. Created automatically by `init`. Safe to edit by hand.
134
+ - `~/.rig/config.yml` — rig-global prefs (default agent, qmd toggle, log rotation). Touched by `rig wiki agent use`.
135
+ - `<vault>/.rig/config.yml` — **the only place per-vault settings live.** Auto-created by `rig wiki init`. Safe to edit by hand.
103
136
 
104
- Never edit `~/.rig/wikis.yml` to change a wiki's name, scope, or schedule — those belong in the vault. Never invent a `package.rig.json5` wiki block; that file is unrelated to rig wiki (legacy rig CICD only).
137
+ No global registry. No `package.rig.json5` wiki block (that file is for legacy rig CICD, unrelated).
105
138
 
106
139
  ## Architecture (read once, then forget)
107
140
 
108
141
  - Vector-only retrieval: Qwen3-Embedding-0.6B (~610MB) + Qwen3-Reranker-0.6B (~610MB), both CDN-mirrored at `assets.terncloud.com/rig/models/`.
109
142
  - Models auto-downloaded on first use into `~/.cache/qmd/models/`; subsequent runs are instant.
110
- - Per-wiki SQLite at `~/.rig/cache/qmd/<wiki>.sqlite` (sqlite-vec extension). `.gitignore`'d by default.
143
+ - Per-vault SQLite at `~/.rig/cache/qmd/<vault-name>.sqlite` (sqlite-vec extension). `.gitignore`'d by default.
111
144
  - `ingest` triggers incremental embed at the end — no need to manually call `index` in routine use.
112
145
  - macOS-only in v1.
113
146