rlm-navigator 0.1.1 → 0.1.3
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/bin/cli.js +2 -2
- package/package.json +2 -2
- package/server/src/index.ts +20 -1
- package/templates/CLAUDE_SNIPPET.md +17 -9
package/bin/cli.js
CHANGED
|
@@ -132,8 +132,8 @@ async function install() {
|
|
|
132
132
|
if (existing.includes("<!-- rlm-navigator:start -->")) {
|
|
133
133
|
console.log(" CLAUDE.md already contains RLM Navigator block — skipped.\n");
|
|
134
134
|
} else {
|
|
135
|
-
fs.writeFileSync(claudeMdPath,
|
|
136
|
-
console.log("
|
|
135
|
+
fs.writeFileSync(claudeMdPath, snippet + "\n" + existing);
|
|
136
|
+
console.log(" Prepended RLM Navigator block to CLAUDE.md.\n");
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
|
package/package.json
CHANGED
package/server/src/index.ts
CHANGED
|
@@ -13,11 +13,30 @@ import { z } from "zod";
|
|
|
13
13
|
import * as net from "node:net";
|
|
14
14
|
import * as fs from "node:fs";
|
|
15
15
|
import * as path from "node:path";
|
|
16
|
+
import { fileURLToPath } from "node:url";
|
|
16
17
|
import { spawn, ChildProcess } from "node:child_process";
|
|
17
18
|
|
|
18
19
|
const DAEMON_HOST = "127.0.0.1";
|
|
19
20
|
const MAX_RESPONSE_CHARS = parseInt(process.env.RLM_MAX_RESPONSE || "8000", 10);
|
|
20
|
-
|
|
21
|
+
|
|
22
|
+
function resolveProjectRoot(): string {
|
|
23
|
+
// 1. Explicit env var
|
|
24
|
+
if (process.env.RLM_PROJECT_ROOT) return process.env.RLM_PROJECT_ROOT;
|
|
25
|
+
|
|
26
|
+
// 2. Detect from script location: if running from <project>/.rlm/server/build/index.js,
|
|
27
|
+
// walk up to find the .rlm parent
|
|
28
|
+
const scriptDir = path.dirname(fileURLToPath(import.meta.url));
|
|
29
|
+
const parts = scriptDir.split(path.sep);
|
|
30
|
+
const rlmIdx = parts.lastIndexOf(".rlm");
|
|
31
|
+
if (rlmIdx > 0) {
|
|
32
|
+
return parts.slice(0, rlmIdx).join(path.sep);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// 3. Fallback
|
|
36
|
+
return process.cwd();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const PROJECT_ROOT = resolveProjectRoot();
|
|
21
40
|
|
|
22
41
|
let daemonChild: ChildProcess | null = null;
|
|
23
42
|
|
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
<!-- rlm-navigator:start -->
|
|
2
2
|
|
|
3
|
-
## RLM Navigator
|
|
3
|
+
## REQUIRED: Use RLM Navigator for All Codebase Navigation
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
This project uses the `/rlm-navigator` skill. You MUST follow the RLM Navigator workflow for ALL codebase exploration, file reading, and code search. This is NOT optional.
|
|
6
|
+
|
|
7
|
+
**Mandatory workflow: `rlm_tree` → `rlm_map` → `rlm_drill` → Edit**
|
|
8
|
+
|
|
9
|
+
### What you MUST do:
|
|
10
|
+
- Use `rlm_tree` instead of `ls`, `find`, or `Glob` for directory exploration
|
|
11
|
+
- Use `rlm_map` instead of `Read` or `cat` to understand file contents
|
|
12
|
+
- Use `rlm_drill` to read only the specific symbol you need
|
|
13
|
+
- Use `rlm_search` to find symbols across files
|
|
14
|
+
|
|
15
|
+
### What you MUST NOT do:
|
|
16
|
+
- Do NOT read full files with the `Read` tool unless the file is under 50 lines or is a config file
|
|
17
|
+
- Do NOT use `Glob` or `find` to explore the project structure
|
|
18
|
+
- Do NOT use `grep` or `Grep` for code search — use `rlm_search` or the REPL's `grep()` helper
|
|
11
19
|
|
|
12
20
|
### Navigation Tools
|
|
13
21
|
|
|
14
22
|
| Tool | Purpose |
|
|
15
23
|
|------|---------|
|
|
16
24
|
| `get_status` | Check daemon health |
|
|
17
|
-
| `rlm_tree` | See directory structure (replaces ls/find) |
|
|
18
|
-
| `rlm_map` | See file signatures only (replaces cat
|
|
25
|
+
| `rlm_tree` | See directory structure (replaces ls/find/Glob) |
|
|
26
|
+
| `rlm_map` | See file signatures only (replaces Read/cat) |
|
|
19
27
|
| `rlm_drill` | Read specific symbol implementation |
|
|
20
28
|
| `rlm_search` | Find symbols across files |
|
|
21
29
|
|