rigjs 4.0.7 → 4.0.10
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.
- package/.claude/skills/rig-wiki/SKILL.md +23 -1
- package/RIG_CREW_SKILL.md +31 -8
- package/RIG_WIKI_SKILL.md +23 -1
- package/built/index.js +186 -224
- package/lib/crew/board.ts +8 -3
- package/lib/crew/doctor.ts +7 -3
- package/lib/crew/index.ts +11 -1
- package/lib/crew/project.ts +88 -2
- package/lib/crew/role.ts +6 -6
- package/lib/crew/task.ts +59 -10
- package/lib/crew/vault.ts +67 -17
- package/lib/wiki/config.ts +5 -1
- package/lib/wiki/db.ts +29 -0
- package/lib/wiki/fileTypes.ts +52 -0
- package/lib/wiki/index.ts +10 -0
- package/lib/wiki/ingest.ts +53 -9
- package/lib/wiki/init.ts +46 -5
- package/lib/wiki/scan.ts +0 -0
- package/lib/wiki/survey.ts +300 -0
- package/package.json +2 -2
|
@@ -15,6 +15,8 @@ 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
|
+
**Substrate.** rig wiki runs **on top of an Obsidian vault**. The project root IS the Obsidian vault (e.g. `overmind/`); `rig-wiki/` is the metadata subdirectory rig manages inside it. Sibling dirs (`personal/`, `research/`, …) are user-authored data — sources for ingest. All cross-references generated by ingest use `obsidian://open?vault=<name>&file=<vault-rel-path>` URLs, not filesystem paths, so links work the same from inside Obsidian and from terminal-launched tools.
|
|
19
|
+
|
|
18
20
|
## Vault model — one fixed dir per project
|
|
19
21
|
|
|
20
22
|
A vault is **a single `rig-wiki/` dir at the project root** holding metadata (purpose.md, schema.md, page tree, `.rig/config.yml`). The project root itself is the conceptual "vault" — `rig-wiki/` is just the metadata subdir living inside it, named `rig-wiki/` by convention. User-authored data (`personal/`, `research/`, etc.) lives in sibling dirs and is NEVER touched.
|
|
@@ -36,6 +38,9 @@ This means:
|
|
|
36
38
|
| "ingest / re-process / 重新整理 / 重新 ingest <something>" | `rig wiki ingest <path>` — handles new sources AND re-ingest of modified ones. |
|
|
37
39
|
| "what's new / 有什么变化 / scan / diff" | `rig wiki scan` — surface the NEW / MODIFIED / DELETED / RAW DRIFT report verbatim. |
|
|
38
40
|
| "ingest everything new / 把新东西都收一下" | `rig wiki scan` → for each NEW path → `rig wiki ingest <path>` (one call per file). |
|
|
41
|
+
| "看看哪些文件能进 wiki / what's eligible / survey / 看一下能 ingest 什么 / triage" | `rig wiki survey` — walks scan root, asks the agent to apply `schema.md` "Ingestion policy" rules to every non-binary visible candidate; outputs ingest/skip/unclear per file. |
|
|
42
|
+
| "把符合策略的全收 / ingest everything that fits / 一键收录" | `rig wiki survey --apply` — survey + ingest all "ingest"-tagged candidates in series. Tell the user upfront how many it'll process. |
|
|
43
|
+
| "policy / 收录规则 / 该收什么文件" | Read `<vault>/schema.md` "Ingestion policy" section. To change rules, the user edits schema.md directly — DO NOT edit it for them (it's human-authored). |
|
|
39
44
|
| "wiki 里有没有 X / what does my wiki say about X / search the wiki for X" | `rig wiki query "<X>"` (Qwen3 vector + Qwen3 reranker; cross-lingual). Default limit 10. |
|
|
40
45
|
| "summarize what we know about X / 总结一下 X" | `rig wiki query "<X>" --synth` — adds a Claude-synthesized paragraph with `[[wikilink]]` citations after the hit list. |
|
|
41
46
|
| "lint / 检查一遍 / what's broken in my wiki" | `rig wiki lint`. Surface the report. Exit code 11 = severe (broken refs / missing source). |
|
|
@@ -73,6 +78,7 @@ Note: page directories (`sources/`, `entities/`, `concepts/`, `synthesis/`, `que
|
|
|
73
78
|
- **raw filename** = `YYYY-MM-DD-<slug>.md`. Pick today's local date; if filename collides, append `-2`, `-3`.
|
|
74
79
|
- **URL → slug**: last path segment, drop extension, lowercase, replace non-`[a-z0-9-]` with `-`, max 64 chars.
|
|
75
80
|
- **`rig wiki init <scope>` arg** is a data subdir NAME, not a path to create. Examples: `rig wiki init personal` (scopes to `./personal/`), `rig wiki init research`. The vault metadata dir is always `./rig-wiki/`. Never pass a path like `rig-wiki` — that's the metadata dir, not the scope.
|
|
81
|
+
- **Cross-references** in generated wiki pages: file links → `obsidian://open?vault=<name>&file=<vault-rel>` (the ingest prompt provides the vault name and rel-path); page-to-page links → `[[slug]]` wikilinks. Never put raw absolute paths or `../`-style relative paths in generated content.
|
|
76
82
|
|
|
77
83
|
## Hard rules — refuse and explain if violated
|
|
78
84
|
|
|
@@ -89,7 +95,23 @@ The scanner skips these automatically — do not waste user time adding them to
|
|
|
89
95
|
- Any path segment starting with `.` (`.git/`, `.obsidian/`, `.vscode/`, `.DS_Store`, …).
|
|
90
96
|
- Any path matched by the project's `.gitignore`.
|
|
91
97
|
|
|
92
|
-
|
|
98
|
+
Defaults in `.rig/config.yml` from `init`:
|
|
99
|
+
- `include: ['**']` — everything that survives the auto-skips
|
|
100
|
+
- `exclude:` — binary archives (`*.zip`, `*.tar`, `*.tar.gz`, `*.tgz`, `*.7z`, `*.rar`). Their contents can't be ingested without unpacking.
|
|
101
|
+
|
|
102
|
+
What you DO need to put in `exclude` is additional content-type filtering the user explicitly asks for.
|
|
103
|
+
|
|
104
|
+
## Multimodal ingest (what Claude Read can decode)
|
|
105
|
+
|
|
106
|
+
`rig wiki ingest <source>` invokes Claude (`claude -p`) and tells it to Read the source. By type:
|
|
107
|
+
|
|
108
|
+
| Type | Behaviour |
|
|
109
|
+
|---|---|
|
|
110
|
+
| `.md`, `.txt`, `.json`, `.csv`, `.yml`, `.py`, `.ts`, code etc. | Read directly as text. |
|
|
111
|
+
| `.png`, `.jpg`, `.jpeg`, `.gif`, `.webp`, `.bmp` | Claude Read returns visual input; the prompt instructs the model to describe contents, transcribe visible text/numbers, capture structure. |
|
|
112
|
+
| `.pdf` | Claude Read decodes natively. >10 pages: the prompt instructs chunked reads with the `pages` parameter. |
|
|
113
|
+
| `.xlsx`, `.xls`, `.ods`, `.numbers` | **Not natively supported by Read in v1.** Ingest writes a stub source page (filename + obsidian:// URL + last-modified date) and appends a `reviews.md` bullet asking the user to export to CSV / JSON for re-ingest. Don't invent contents. |
|
|
114
|
+
| `.zip` and other archives | Default-excluded; do not ingest. Unpack first, then ingest the unpacked tree. |
|
|
93
115
|
|
|
94
116
|
## Common error → recovery
|
|
95
117
|
|
package/RIG_CREW_SKILL.md
CHANGED
|
@@ -41,10 +41,13 @@ Project Owner management:
|
|
|
41
41
|
rig crew project add rig --path /path/to/projects/rig --executor claude --test-command "yarn build"
|
|
42
42
|
rig crew project add dsh-service --path /path/to/projects/dsh-service --executor codex --test-command "yarn test"
|
|
43
43
|
rig crew project add demo-web --path /path/to/ObsidianVault/tmp/demo-web --executor codex
|
|
44
|
+
rig crew project sync
|
|
44
45
|
rig crew project list
|
|
45
46
|
rig crew project status rig
|
|
46
47
|
```
|
|
47
48
|
|
|
49
|
+
Use `rig crew project sync` after directories are added to or removed from the Vault `projects/` folder. It refreshes the active Project Owner registry and project-scoped agent task folders under `<crew-root>/Projects/`.
|
|
50
|
+
|
|
48
51
|
## State Model
|
|
49
52
|
|
|
50
53
|
`rig crew` is file-backed. Do not assume a long-running multi-agent runtime exists.
|
|
@@ -57,8 +60,10 @@ rig crew project status rig
|
|
|
57
60
|
- Shared context: `<crew-root>/Shared/**`
|
|
58
61
|
- Role registry for Lead: `<crew-root>/Shared/Roles.md`
|
|
59
62
|
- Project owner memory: `<crew-root>/Projects/<project>/**`
|
|
63
|
+
- Project-scoped agent tasks: `<crew-root>/Projects/<project>/Agents/<role>/Tasks.md`
|
|
64
|
+
- Large active task batches: `<crew-root>/Projects/<project>/Tasklists/active/*.md` and `<crew-root>/Projects/<project>/Agents/<role>/Tasklists/active/*.md`
|
|
65
|
+
- Reusable role descriptions: `<crew-root>/<role>/Role.md` and `<crew-root>/Roles/<custom-role>/Role.md`
|
|
60
66
|
- Researcher memory and index: `<crew-root>/Researcher/**`
|
|
61
|
-
- Custom role workspaces: `<crew-root>/Roles/<role>/**`
|
|
62
67
|
- Vault agent instructions: `CLAUDE.md` and `AGENTS.md`
|
|
63
68
|
- Local cache: `~/.rig/crew-state.json`
|
|
64
69
|
- Config: `~/.rig/crew.config.json`
|
|
@@ -68,7 +73,24 @@ All multi-agent collaboration materials should live inside the Vault. Temporary
|
|
|
68
73
|
|
|
69
74
|
`rig crew` coordinates multiple roles on one device through one Vault. Do not assume a separate multi-agent runtime inside each project repository; project directories are execution workspaces, while tasks, reports, inbox, dashboard, and research indexes return to the Vault.
|
|
70
75
|
|
|
71
|
-
`rig crew init` is additive and non-destructive. It may create missing folders/files and update managed blocks, but it must not overwrite existing agent work files such as `Tasks.md`, `
|
|
76
|
+
`rig crew init` is additive and non-destructive. It may create missing folders/files and update managed blocks, but it must not overwrite existing agent work files such as project `Tasks.md`, `Role.md`, `Index.md`, reports, specs, decisions, or user-authored notes.
|
|
77
|
+
|
|
78
|
+
Built-in role directories are reusable role cards, not project task queues. Concrete PM/Coder/Tester/etc work should be assigned under a specific project:
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
<crew-root>/Projects/<project>/Tasks.md
|
|
82
|
+
<crew-root>/Projects/<project>/Agents/Coder/Tasks.md
|
|
83
|
+
<crew-root>/Projects/<project>/Agents/Tester/Tasks.md
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Keep each `Tasks.md` small. Use it as a current queue or index, not an unlimited backlog. When a project or role has many tasks, split the current work into focused files:
|
|
87
|
+
|
|
88
|
+
```text
|
|
89
|
+
<crew-root>/Projects/<project>/Tasklists/active/<feature-or-iteration>.md
|
|
90
|
+
<crew-root>/Projects/<project>/Agents/<role>/Tasklists/active/<feature-or-iteration>.md
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Move completed or stale batches to `Tasklists/archive/YYYY-MM.md`. The active dashboard scans `Tasks.md` and `Tasklists/active/**/*.md`; it does not scan archive files by default.
|
|
72
94
|
|
|
73
95
|
## Lead Orchestration
|
|
74
96
|
|
|
@@ -81,19 +103,20 @@ After handoff, read:
|
|
|
81
103
|
- `<crew-root>/Team-Dashboard.md`
|
|
82
104
|
- `<crew-root>/Inbox.md`
|
|
83
105
|
- `<crew-root>/Shared/Roles.md`
|
|
84
|
-
- role task files such as `<crew-root>/Tester/Tasks.md`
|
|
85
106
|
- relevant `<crew-root>/Projects/<project>/Tasks.md`
|
|
107
|
+
- relevant `<crew-root>/Projects/<project>/Agents/<role>/Tasks.md`
|
|
108
|
+
- relevant active tasklists under `<crew-root>/Projects/<project>/**/Tasklists/active/`
|
|
86
109
|
|
|
87
110
|
If the CLI is unavailable, use the file protocol:
|
|
88
111
|
|
|
89
112
|
1. Append the request to `<crew-root>/Current-Goal.md`.
|
|
90
|
-
2.
|
|
113
|
+
2. When a project is known, create or update small/current work in `<crew-root>/Projects/<project>/Tasks.md` or `<crew-root>/Projects/<project>/Agents/<role>/Tasks.md`; split larger batches into `Tasklists/active/<feature-or-iteration>.md`.
|
|
91
114
|
3. Route worker tasks with inline fields such as `[role:: tester]`, `[owner:: maintainer:rig]`, `[project:: rig]`, `[executor:: codex]`, `[status:: pending]`.
|
|
92
115
|
4. Put user-facing questions or approvals in `<crew-root>/Inbox.md`.
|
|
93
116
|
|
|
94
117
|
Lead communicates with workers through Markdown tasks, delegation packets, and result notes. Do not rely on private subagent chat state as the coordination source of truth. Subagents are optional executors for specific roles when the selected executor supports them; Vault files remain canonical.
|
|
95
118
|
|
|
96
|
-
Maintain status awareness before and after work: scan dashboard, inbox,
|
|
119
|
+
Maintain status awareness before and after work: scan dashboard, inbox, project owner tasks, project-scoped agent tasks, active tasklists, blockers, and todo status. The coding session should be able to answer what each role/project is doing without asking the human to inspect the Vault manually.
|
|
97
120
|
|
|
98
121
|
## Mixed Executors
|
|
99
122
|
|
|
@@ -145,13 +168,13 @@ When a role is materialized in a Vault, use:
|
|
|
145
168
|
|
|
146
169
|
```text
|
|
147
170
|
<crew-root>/Roles/<role>/
|
|
148
|
-
├── Tasks.md
|
|
149
|
-
├── Notes.md
|
|
150
171
|
├── Role.md
|
|
151
172
|
└── Reports/
|
|
152
173
|
```
|
|
153
174
|
|
|
154
|
-
`<crew-root>/
|
|
175
|
+
Built-in roles use `<crew-root>/<Role>/Role.md`. These role files are short editable descriptions. Do not use them as normal task queues.
|
|
176
|
+
|
|
177
|
+
`<crew-root>/Shared/Roles.md` is generated so Lead can load available roles. If the user asks Lead to use a specific role, match that role by `name` first, then route the task into `<crew-root>/Projects/<project>/Agents/<role>/Tasks.md` with `[role:: <name>]`. If the role defines `agent`, use that agent/subagent for role execution when the executor supports it.
|
|
155
178
|
|
|
156
179
|
## Researcher
|
|
157
180
|
|
package/RIG_WIKI_SKILL.md
CHANGED
|
@@ -15,6 +15,8 @@ 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
|
+
**Substrate.** rig wiki runs **on top of an Obsidian vault**. The project root IS the Obsidian vault (e.g. `overmind/`); `rig-wiki/` is the metadata subdirectory rig manages inside it. Sibling dirs (`personal/`, `research/`, …) are user-authored data — sources for ingest. All cross-references generated by ingest use `obsidian://open?vault=<name>&file=<vault-rel-path>` URLs, not filesystem paths, so links work the same from inside Obsidian and from terminal-launched tools.
|
|
19
|
+
|
|
18
20
|
## Vault model — one fixed dir per project
|
|
19
21
|
|
|
20
22
|
A vault is **a single `rig-wiki/` dir at the project root** holding metadata (purpose.md, schema.md, page tree, `.rig/config.yml`). The project root itself is the conceptual "vault" — `rig-wiki/` is just the metadata subdir living inside it, named `rig-wiki/` by convention. User-authored data (`personal/`, `research/`, etc.) lives in sibling dirs and is NEVER touched.
|
|
@@ -36,6 +38,9 @@ This means:
|
|
|
36
38
|
| "ingest / re-process / 重新整理 / 重新 ingest <something>" | `rig wiki ingest <path>` — handles new sources AND re-ingest of modified ones. |
|
|
37
39
|
| "what's new / 有什么变化 / scan / diff" | `rig wiki scan` — surface the NEW / MODIFIED / DELETED / RAW DRIFT report verbatim. |
|
|
38
40
|
| "ingest everything new / 把新东西都收一下" | `rig wiki scan` → for each NEW path → `rig wiki ingest <path>` (one call per file). |
|
|
41
|
+
| "看看哪些文件能进 wiki / what's eligible / survey / 看一下能 ingest 什么 / triage" | `rig wiki survey` — walks scan root, asks the agent to apply `schema.md` "Ingestion policy" rules to every non-binary visible candidate; outputs ingest/skip/unclear per file. |
|
|
42
|
+
| "把符合策略的全收 / ingest everything that fits / 一键收录" | `rig wiki survey --apply` — survey + ingest all "ingest"-tagged candidates in series. Tell the user upfront how many it'll process. |
|
|
43
|
+
| "policy / 收录规则 / 该收什么文件" | Read `<vault>/schema.md` "Ingestion policy" section. To change rules, the user edits schema.md directly — DO NOT edit it for them (it's human-authored). |
|
|
39
44
|
| "wiki 里有没有 X / what does my wiki say about X / search the wiki for X" | `rig wiki query "<X>"` (Qwen3 vector + Qwen3 reranker; cross-lingual). Default limit 10. |
|
|
40
45
|
| "summarize what we know about X / 总结一下 X" | `rig wiki query "<X>" --synth` — adds a Claude-synthesized paragraph with `[[wikilink]]` citations after the hit list. |
|
|
41
46
|
| "lint / 检查一遍 / what's broken in my wiki" | `rig wiki lint`. Surface the report. Exit code 11 = severe (broken refs / missing source). |
|
|
@@ -73,6 +78,7 @@ Note: page directories (`sources/`, `entities/`, `concepts/`, `synthesis/`, `que
|
|
|
73
78
|
- **raw filename** = `YYYY-MM-DD-<slug>.md`. Pick today's local date; if filename collides, append `-2`, `-3`.
|
|
74
79
|
- **URL → slug**: last path segment, drop extension, lowercase, replace non-`[a-z0-9-]` with `-`, max 64 chars.
|
|
75
80
|
- **`rig wiki init <scope>` arg** is a data subdir NAME, not a path to create. Examples: `rig wiki init personal` (scopes to `./personal/`), `rig wiki init research`. The vault metadata dir is always `./rig-wiki/`. Never pass a path like `rig-wiki` — that's the metadata dir, not the scope.
|
|
81
|
+
- **Cross-references** in generated wiki pages: file links → `obsidian://open?vault=<name>&file=<vault-rel>` (the ingest prompt provides the vault name and rel-path); page-to-page links → `[[slug]]` wikilinks. Never put raw absolute paths or `../`-style relative paths in generated content.
|
|
76
82
|
|
|
77
83
|
## Hard rules — refuse and explain if violated
|
|
78
84
|
|
|
@@ -89,7 +95,23 @@ The scanner skips these automatically — do not waste user time adding them to
|
|
|
89
95
|
- Any path segment starting with `.` (`.git/`, `.obsidian/`, `.vscode/`, `.DS_Store`, …).
|
|
90
96
|
- Any path matched by the project's `.gitignore`.
|
|
91
97
|
|
|
92
|
-
|
|
98
|
+
Defaults in `.rig/config.yml` from `init`:
|
|
99
|
+
- `include: ['**']` — everything that survives the auto-skips
|
|
100
|
+
- `exclude:` — binary archives (`*.zip`, `*.tar`, `*.tar.gz`, `*.tgz`, `*.7z`, `*.rar`). Their contents can't be ingested without unpacking.
|
|
101
|
+
|
|
102
|
+
What you DO need to put in `exclude` is additional content-type filtering the user explicitly asks for.
|
|
103
|
+
|
|
104
|
+
## Multimodal ingest (what Claude Read can decode)
|
|
105
|
+
|
|
106
|
+
`rig wiki ingest <source>` invokes Claude (`claude -p`) and tells it to Read the source. By type:
|
|
107
|
+
|
|
108
|
+
| Type | Behaviour |
|
|
109
|
+
|---|---|
|
|
110
|
+
| `.md`, `.txt`, `.json`, `.csv`, `.yml`, `.py`, `.ts`, code etc. | Read directly as text. |
|
|
111
|
+
| `.png`, `.jpg`, `.jpeg`, `.gif`, `.webp`, `.bmp` | Claude Read returns visual input; the prompt instructs the model to describe contents, transcribe visible text/numbers, capture structure. |
|
|
112
|
+
| `.pdf` | Claude Read decodes natively. >10 pages: the prompt instructs chunked reads with the `pages` parameter. |
|
|
113
|
+
| `.xlsx`, `.xls`, `.ods`, `.numbers` | **Not natively supported by Read in v1.** Ingest writes a stub source page (filename + obsidian:// URL + last-modified date) and appends a `reviews.md` bullet asking the user to export to CSV / JSON for re-ingest. Don't invent contents. |
|
|
114
|
+
| `.zip` and other archives | Default-excluded; do not ingest. Unpack first, then ingest the unpacked tree. |
|
|
93
115
|
|
|
94
116
|
## Common error → recovery
|
|
95
117
|
|