indexer-cli 0.9.32 → 0.10.1
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/README.md +15 -19
- package/dist/cli/commands/init.js +10 -2
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/skills.js +55 -259
- package/dist/cli/commands/skills.js.map +1 -1
- package/dist/core/skills-version.d.ts +1 -1
- package/dist/core/skills-version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
# indexer-cli
|
|
2
2
|
|
|
3
|
-
Project indexer that installs focused discovery
|
|
3
|
+
Project indexer that installs a focused discovery skill for coding agents and helps them spend fewer tokens finding the
|
|
4
4
|
right code.
|
|
5
5
|
|
|
6
6
|
## Overview
|
|
7
7
|
|
|
8
8
|
The main feature of `indexer-cli` is not just search on its own: it turns your repository into something coding agents
|
|
9
|
-
can navigate efficiently. Running `idx init` installs project-local discovery
|
|
10
|
-
|
|
11
|
-
`find`, and repeated file reads.
|
|
9
|
+
can navigate efficiently. Running `idx init` installs a project-local discovery skill so Claude, OpenCode, and similar
|
|
10
|
+
tools can pick the right indexed workflow instead of wasting tokens on blind `grep`, `find`, and repeated file reads.
|
|
12
11
|
|
|
13
12
|
Under the hood, `indexer-cli` indexes source code, generates vector embeddings through a local Ollama instance, and
|
|
14
13
|
stores everything in a per-project `.indexer-cli/` directory. That gives both humans and agents fast natural-language
|
|
@@ -17,7 +16,7 @@ post-commit hook keeps the index up to date automatically.
|
|
|
17
16
|
|
|
18
17
|
## Features
|
|
19
18
|
|
|
20
|
-
- **Code-agent repo
|
|
19
|
+
- **Code-agent repo skill**: `init` installs one focused autonomous discovery skill for Claude and OpenCode workflows
|
|
21
20
|
- **`idx` command alias**: `setup` installs or repairs a clean `idx` wrapper — no npm warnings in agent output
|
|
22
21
|
- **Token savings for agents**: Pushes agents toward indexed discovery instead of expensive blind search and repeated
|
|
23
22
|
context loading
|
|
@@ -42,7 +41,7 @@ post-commit hook keeps the index up to date automatically.
|
|
|
42
41
|
# 1. Check prerequisites, prepare the embedding model, and install or repair the idx command
|
|
43
42
|
npx indexer-cli@latest setup
|
|
44
43
|
|
|
45
|
-
# 2. Initialize indexing and install the discovery
|
|
44
|
+
# 2. Initialize indexing and install the discovery skill
|
|
46
45
|
cd /path/to/your/project
|
|
47
46
|
idx init
|
|
48
47
|
|
|
@@ -57,18 +56,15 @@ After `idx init`, you can run project commands from subdirectories too: `indexer
|
|
|
57
56
|
project root automatically. If a project has not been initialized yet, commands such as `idx search` and `idx index`
|
|
58
57
|
stop with a clear message telling you to run `idx init` first instead of creating data in the wrong directory.
|
|
59
58
|
|
|
60
|
-
After `init`, the repo contains
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
the right indexed discovery workflow for
|
|
64
|
-
`idx search`, `idx structure`, `idx architecture`,
|
|
65
|
-
`idx explain`, and `idx deps` before they start burning tokens on broad filesystem scans.
|
|
59
|
+
After `init`, the repo contains `.claude/skills/repo-discovery/SKILL.md`, so coding agents get one indexed discovery
|
|
60
|
+
entry point that routes them toward `idx search`, `idx structure`, `idx architecture`, `idx explain`, and `idx deps`
|
|
61
|
+
before they start burning tokens on broad filesystem scans.
|
|
66
62
|
|
|
67
63
|
## Why agents save tokens with this
|
|
68
64
|
|
|
69
65
|
Without repo-local skills, agents often spend tokens on repetitive repository discovery: broad `grep`, repeated file
|
|
70
|
-
reads, and trial-and-error navigation. With `indexer-cli`, agents can load
|
|
71
|
-
|
|
66
|
+
reads, and trial-and-error navigation. With `indexer-cli`, agents can load one focused discovery skill and start from
|
|
67
|
+
the right indexed path immediately.
|
|
72
68
|
|
|
73
69
|
In practice, that means:
|
|
74
70
|
|
|
@@ -79,10 +75,10 @@ In practice, that means:
|
|
|
79
75
|
|
|
80
76
|
## Agent Integration
|
|
81
77
|
|
|
82
|
-
When you run `idx init`, the CLI creates
|
|
83
|
-
|
|
78
|
+
When you run `idx init`, the CLI creates a single `repo-discovery` skill under `.claude/skills/` and adds `.claude/`
|
|
79
|
+
to `.gitignore`.
|
|
84
80
|
|
|
85
|
-
|
|
81
|
+
That skill routes repository discovery flows such as:
|
|
86
82
|
|
|
87
83
|
```bash
|
|
88
84
|
idx search "<query>"
|
|
@@ -109,14 +105,14 @@ After running `setup`, restart your shell to ensure `idx` is on `PATH`.
|
|
|
109
105
|
### `idx init`
|
|
110
106
|
|
|
111
107
|
Create the `.indexer-cli/` directory, initialize the SQLite database and sqlite-vec vector store, and add `.indexer-cli/`
|
|
112
|
-
to `.gitignore` in the current working directory. Also writes
|
|
108
|
+
to `.gitignore` in the current working directory. Also writes the `repo-discovery` skill under `.claude/skills/`,
|
|
113
109
|
adds `.claude/` to `.gitignore`, and installs a Git post-commit hook that automatically re-indexes changed files.
|
|
114
110
|
|
|
115
111
|
When run from a subdirectory of a Git project, `idx init` automatically initializes the Git project root.
|
|
116
112
|
|
|
117
113
|
| Option | Description |
|
|
118
114
|
|---------------------|---------------------------------------------------------------------------------|
|
|
119
|
-
| `--refresh-skills` | Remove this CLI's generated
|
|
115
|
+
| `--refresh-skills` | Remove this CLI's generated discovery skill under `.claude/skills/` and recreate it |
|
|
120
116
|
|
|
121
117
|
### `idx index`
|
|
122
118
|
|
|
@@ -31,6 +31,14 @@ async function pathExists(targetPath) {
|
|
|
31
31
|
return false;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
+
const DEFAULT_DEPRECATED_SKILL_DIRECTORIES = [
|
|
35
|
+
"context-pack",
|
|
36
|
+
"semantic-search",
|
|
37
|
+
"repo-structure",
|
|
38
|
+
"repo-architecture",
|
|
39
|
+
"symbol-explain",
|
|
40
|
+
"dependency-trace",
|
|
41
|
+
];
|
|
34
42
|
async function writeClaudeSkills(projectRoot, skills = skills_js_1.GENERATED_SKILLS) {
|
|
35
43
|
for (const skill of skills) {
|
|
36
44
|
const skillDir = node_path_1.default.join(projectRoot, ".claude", "skills", skill.directory);
|
|
@@ -40,7 +48,7 @@ async function writeClaudeSkills(projectRoot, skills = skills_js_1.GENERATED_SKI
|
|
|
40
48
|
console.log(` Skill: ${skillPath}`);
|
|
41
49
|
}
|
|
42
50
|
}
|
|
43
|
-
async function refreshClaudeSkills(projectRoot, skillDirectories = skills_js_1.GENERATED_SKILL_DIRECTORIES, skills = skills_js_1.GENERATED_SKILLS, deprecatedSkillDirectories =
|
|
51
|
+
async function refreshClaudeSkills(projectRoot, skillDirectories = skills_js_1.GENERATED_SKILL_DIRECTORIES, skills = skills_js_1.GENERATED_SKILLS, deprecatedSkillDirectories = DEFAULT_DEPRECATED_SKILL_DIRECTORIES) {
|
|
44
52
|
for (const skillDirectory of [
|
|
45
53
|
...skillDirectories,
|
|
46
54
|
...deprecatedSkillDirectories,
|
|
@@ -122,7 +130,7 @@ async function performInit(projectRoot, options) {
|
|
|
122
130
|
await refreshClaudeSkills(projectRoot);
|
|
123
131
|
}
|
|
124
132
|
else {
|
|
125
|
-
await
|
|
133
|
+
await refreshClaudeSkills(projectRoot, [], skills_js_1.GENERATED_SKILLS);
|
|
126
134
|
}
|
|
127
135
|
console.log(` SQLite: ${dbPath}`);
|
|
128
136
|
console.log(` Config: ${configPath}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":";;;;;AA8DA,kDAuBC;AAqDD,kCA4DC;AAED,kDAyBC;AAjOD,qCAAmD;AACnD,+CAO0B;AAC1B,0DAA6B;AAE7B,oDAA8C;AAC9C,oDAAkD;AAClD,sDAAwD;AACxD,uDAA8D;AAC9D,yDAAgE;AAChE,kDAA4D;AAC5D,2DAAoD;AACpD,2CAA4E;AAC5E,oEAA8D;AAC9D,wDAA4D;AAE5D,MAAM,iBAAiB,GAAG,uBAAuB,CAAC;AAClD,MAAM,eAAe,GAAG,uBAA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OAAO,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QAC9C,CAAC;IACF,CAAC;AACF,CAAC;AAED,SAAgB,mBAAmB,CAAC,OAAgB;IACnD,OAAO;SACL,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,0CAA0C,CAAC;SACvD,MAAM,CACN,kBAAkB,EAClB,2EAA2E,CAC3E;SACA,WAAW,CAAC,OAAO,EAAE,KAAK,wCAAyB,IAAI,CAAC;SACxD,MAAM,CAAC,KAAK,EAAE,OAAqC,EAAE,EAAE;QACvD,IAAI,CAAC;YACJ,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,IAAA,wCAAsB,GAAE,CAAC;YACzD,IAAI,MAAM,EAAE,CAAC;gBACZ,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACrB,CAAC;YAED,MAAM,WAAW,CAAC,WAAW,EAAE;gBAC9B,aAAa,EAAE,OAAO,EAAE,aAAa;aACrC,CAAC,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,OAAO,CAAC,KAAK,CAAC,iCAAiC,OAAO,EAAE,CAAC,CAAC;YAC1D,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACtB,CAAC;IACF,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,288 +1,84 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GENERATED_SKILL_DIRECTORIES = exports.DEPRECATED_SKILL_DIRECTORIES = exports.GENERATED_SKILLS = void 0;
|
|
4
|
-
|
|
5
|
-
const sections = [
|
|
6
|
-
"---",
|
|
7
|
-
`name: ${definition.name}`,
|
|
8
|
-
`description: ${definition.description}`,
|
|
9
|
-
`allowed-tools: ${definition.allowedTools.join(", ")}`,
|
|
10
|
-
"---",
|
|
11
|
-
"",
|
|
12
|
-
`# ${definition.heading}`,
|
|
13
|
-
"",
|
|
14
|
-
definition.useWhen,
|
|
15
|
-
"",
|
|
16
|
-
];
|
|
17
|
-
if (definition.focusHint) {
|
|
18
|
-
sections.push(definition.focusHint, "");
|
|
19
|
-
}
|
|
20
|
-
sections.push("## Rules", "", ...definition.rules.map((item) => `- ${item}`));
|
|
21
|
-
if (definition.skipWhen && definition.skipWhen.length > 0) {
|
|
22
|
-
sections.push("", "## Skip when", "", ...definition.skipWhen.map((item) => `- ${item}`));
|
|
23
|
-
}
|
|
24
|
-
sections.push("", "## Command samples", "", "Use one matching example; these are alternatives, not a sequence.", "", "```bash", ...definition.commandSamples, "```");
|
|
25
|
-
if (definition.cliReference && definition.cliReference.length > 0) {
|
|
26
|
-
sections.push("", "## CLI reference", "", ...definition.cliReference.map((item) => `- ${item}`));
|
|
27
|
-
}
|
|
28
|
-
return `${sections.join("\n")}\n`;
|
|
29
|
-
}
|
|
30
|
-
const SKILL_DEFINITIONS = [
|
|
4
|
+
exports.GENERATED_SKILLS = [
|
|
31
5
|
{
|
|
32
|
-
name: "
|
|
33
|
-
directory: "
|
|
34
|
-
|
|
35
|
-
name:
|
|
36
|
-
description: FIRST choice for
|
|
37
|
-
allowed-tools: Bash(idx search:*)
|
|
6
|
+
name: "repo-discovery",
|
|
7
|
+
directory: "repo-discovery",
|
|
8
|
+
content: `---
|
|
9
|
+
name: repo-discovery
|
|
10
|
+
description: FIRST choice for repository discovery and code understanding. Use this to choose the cheapest indexed path for architecture, structure, behavior, symbol, or dependency questions before broad file reads or grep.
|
|
11
|
+
allowed-tools: Bash(idx architecture:*), Bash(idx structure:*), Bash(idx search:*), Bash(idx explain:*), Bash(idx deps:*)
|
|
38
12
|
---
|
|
39
13
|
|
|
40
|
-
# Use
|
|
14
|
+
# Use repo-discovery as the single indexed entry point
|
|
41
15
|
|
|
42
|
-
Use when
|
|
43
|
-
Keep the query short and centered on one code concept.
|
|
16
|
+
Use this skill first when the task is about understanding an unfamiliar codebase, locating behavior, identifying important symbols, or tracing impact.
|
|
44
17
|
|
|
45
|
-
|
|
18
|
+
Choose the single cheapest discovery path, run it, and stop as soon as you have enough context.
|
|
46
19
|
|
|
47
|
-
|
|
20
|
+
## Routing rules
|
|
48
21
|
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
22
|
+
- Use \`idx architecture\` for repo shape, entry points, and high-level module boundaries.
|
|
23
|
+
- Use \`idx structure\` for file trees, exported symbols, and "what's in this directory/module?" questions.
|
|
24
|
+
- Use \`idx search\` for behavior and flow questions like "how does X work?" or "what happens when Y?".
|
|
25
|
+
- Use \`idx explain\` when the symbol name is already known.
|
|
26
|
+
- Use \`idx deps\` when the path/module is already known and you need callers, callees, or impact.
|
|
52
27
|
|
|
53
|
-
|
|
28
|
+
## Hard rules
|
|
54
29
|
|
|
55
|
-
|
|
30
|
+
- Start with exactly one indexed command, not several.
|
|
31
|
+
- Prefer the cheapest matching command.
|
|
32
|
+
- Do not run overlapping discovery commands for the same question unless the first one clearly failed.
|
|
33
|
+
- After \`idx search\`, read the returned files and ranges instead of re-running search from another angle.
|
|
34
|
+
- Narrow with \`--path-prefix\` whenever the subsystem is known.
|
|
35
|
+
- For \`idx structure\`, use \`--path-prefix\` or \`--kind\` unless the repo is tiny.
|
|
36
|
+
- For \`idx deps\`, start with \`--depth 1\` and increase only when first-hop impact is insufficient.
|
|
37
|
+
- For \`idx explain\`, prefer \`<file>::<symbol>\` when the name may be ambiguous.
|
|
56
38
|
|
|
57
|
-
|
|
39
|
+
## Escalation path
|
|
58
40
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
- ❌ \`prize reward award\`
|
|
65
|
-
- ❌ \`chapter pass percent quiz result score\`
|
|
66
|
-
- ❌ \`order cancel payment failure refund\`
|
|
67
|
-
|
|
68
|
-
### 3) Two-phase retrieval — ALWAYS
|
|
69
|
-
|
|
70
|
-
#### Phase 1: Discover
|
|
71
|
-
|
|
72
|
-
Search without \`--include-content\`.
|
|
73
|
-
|
|
74
|
-
\`\`\`bash
|
|
75
|
-
idx search "prize"
|
|
76
|
-
\`\`\`
|
|
77
|
-
|
|
78
|
-
#### Phase 2: Read
|
|
79
|
-
|
|
80
|
-
Use the Read tool on the exact files and line ranges from Phase 1.
|
|
81
|
-
|
|
82
|
-
Do NOT:
|
|
83
|
-
|
|
84
|
-
- run another semantic search for the same concept
|
|
85
|
-
- grep the same concept
|
|
86
|
-
- grep terms revealed by Phase 1
|
|
87
|
-
- replace reading with \`--include-content\`
|
|
88
|
-
|
|
89
|
-
### Hard stop after Phase 1
|
|
90
|
-
|
|
91
|
-
If Phase 1 returned useful file paths and ranges, read them.
|
|
92
|
-
|
|
93
|
-
Only if Phase 1 returns nothing useful, do one fallback:
|
|
94
|
-
|
|
95
|
-
- one alternative semantic query, or
|
|
96
|
-
- grep
|
|
97
|
-
|
|
98
|
-
### 4) \`--include-content\` is rare
|
|
99
|
-
|
|
100
|
-
Use it only for a quick scan when you expect fewer than 5 results.
|
|
101
|
-
|
|
102
|
-
### 5) Narrow early with \`--path-prefix\`
|
|
103
|
-
|
|
104
|
-
If you know the subsystem, add \`--path-prefix\`.
|
|
105
|
-
|
|
106
|
-
\`\`\`bash
|
|
107
|
-
idx search "password reset" --path-prefix auth
|
|
108
|
-
\`\`\`
|
|
41
|
+
- architecture → structure
|
|
42
|
+
- structure → explain
|
|
43
|
+
- search → Read tool on returned files
|
|
44
|
+
- explain → deps
|
|
45
|
+
- deps → architecture only if broader system context is still missing
|
|
109
46
|
|
|
110
47
|
## Skip when
|
|
111
48
|
|
|
112
|
-
- you
|
|
113
|
-
-
|
|
114
|
-
-
|
|
49
|
+
- you already know the exact file and lines to read
|
|
50
|
+
- the task is an exact identifier lookup better handled by grep/LSP
|
|
51
|
+
- you are no longer in discovery mode and are already editing code
|
|
115
52
|
|
|
116
|
-
## Command
|
|
53
|
+
## Command samples
|
|
117
54
|
|
|
118
|
-
|
|
119
|
-
# Phase 1: discover
|
|
120
|
-
idx search "rate limiting"
|
|
121
|
-
idx search "password reset" --path-prefix auth
|
|
55
|
+
Use one matching example; these are alternatives, not a sequence.
|
|
122
56
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
idx search "
|
|
57
|
+
\`\`\`bash
|
|
58
|
+
idx architecture --path-prefix src/cli
|
|
59
|
+
idx structure --path-prefix src/cli --kind function
|
|
60
|
+
idx search "refresh skills"
|
|
61
|
+
idx explain src/cli/commands/init.ts::refreshClaudeSkills
|
|
62
|
+
idx deps src/cli/commands/init.ts --direction callers
|
|
127
63
|
\`\`\`
|
|
128
64
|
|
|
129
65
|
## CLI reference
|
|
130
66
|
|
|
131
|
-
-
|
|
132
|
-
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
\`full_file\`, \`imports\`, \`preamble\`, \`declaration\`, \`module_section\`, \`impl\`, \`types\`
|
|
138
|
-
|
|
139
|
-
Imports and preamble are excluded by default. Use \`--include-imports\` to include them.
|
|
140
|
-
|
|
141
|
-
## Anti-patterns
|
|
142
|
-
|
|
143
|
-
- ❌ 3+ overlapping searches
|
|
144
|
-
- ❌ broad searches with \`--include-content\`
|
|
145
|
-
- ❌ long synonym-heavy queries
|
|
146
|
-
- ❌ re-searching after Phase 1 already found the locations
|
|
147
|
-
- ❌ grepping the same concept after semantic search already found it
|
|
148
|
-
- ❌ loading this skill via \`skill\` when you already know the \`idx\` command
|
|
67
|
+
- Architecture: \`idx architecture [--path-prefix <area>] [--include-fixtures]\`
|
|
68
|
+
- Structure: \`idx structure [--path-prefix <area>] [--kind <kind>] [--max-depth <n>] [--max-files <n>] [--include-internal] [--include-fixtures] [--no-tests]\`
|
|
69
|
+
- Search: \`idx search <query> [--max-files <n>] [--path-prefix <area>] [--chunk-types <types>] [--min-score <score>] [--include-content] [--include-imports]\`
|
|
70
|
+
- Explain: \`idx explain <symbol|file::symbol> [--path-prefix <area>] [--include-fixtures]\`
|
|
71
|
+
- Deps: \`idx deps <path> [--direction callers|callees|both] [--depth <n>]\`
|
|
149
72
|
`,
|
|
150
|
-
description: "",
|
|
151
|
-
heading: "",
|
|
152
|
-
useWhen: "",
|
|
153
|
-
allowedTools: [],
|
|
154
|
-
rules: [],
|
|
155
|
-
commandSamples: [],
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
name: "repo-structure",
|
|
159
|
-
directory: "repo-structure",
|
|
160
|
-
description: `FIRST choice when you need to see what's inside a package/directory — all files, classes, functions, exports in a compact tree. Produces a symbol-level map of any path prefix. Use BEFORE opening multiple files to understand layout. Triggers - "show me the structure of X", "what's in this module", "list the symbols". ALWAYS narrow with --path-prefix or --kind; unfiltered output can exceed 800 tokens.`,
|
|
161
|
-
heading: "Use repo-structure for tree and symbol-map questions",
|
|
162
|
-
useWhen: "Use this when the agent needs to see how files and symbols are organized in an area of the repo before reading implementation details.",
|
|
163
|
-
focusHint: "Keep the request centered on one repo area or one symbol kind so the tree stays readable.",
|
|
164
|
-
allowedTools: ["Bash(idx structure:*)"],
|
|
165
|
-
rules: [
|
|
166
|
-
"Prefer structure when layout matters more than implementation snippets.",
|
|
167
|
-
"ALWAYS use --path-prefix or --kind to keep output focused.",
|
|
168
|
-
"Combine --path-prefix with --kind for the tightest result (e.g. --path-prefix engine --kind class).",
|
|
169
|
-
"By default only exported symbols are shown. Use --include-internal to see private methods and non-exported helpers.",
|
|
170
|
-
"Fixtures and vendor paths are excluded by default. Use --include-fixtures to include them.",
|
|
171
|
-
"Test files are included by default. Use --no-tests to exclude them and focus on production code.",
|
|
172
|
-
],
|
|
173
|
-
skipWhen: [
|
|
174
|
-
"You need dependency relationships rather than physical structure",
|
|
175
|
-
"You need semantic search results rather than a tree",
|
|
176
|
-
],
|
|
177
|
-
commandSamples: [
|
|
178
|
-
"idx structure --path-prefix <area>",
|
|
179
|
-
"idx structure --path-prefix <area> --kind class",
|
|
180
|
-
"idx structure --kind function",
|
|
181
|
-
"idx structure --path-prefix <area> --include-internal",
|
|
182
|
-
"idx structure --include-fixtures",
|
|
183
|
-
"idx structure --no-tests",
|
|
184
|
-
"idx structure --path-prefix <area> --no-tests",
|
|
185
|
-
],
|
|
186
|
-
cliReference: [
|
|
187
|
-
"Options: --path-prefix <string>, --kind <string>, --max-depth <number>, --max-files <number>, --include-internal, --include-fixtures, --no-tests.",
|
|
188
|
-
"Allowed --kind values: function, class, method, interface, type, variable, module, signal.",
|
|
189
|
-
"By default shows only exported symbols. Add --include-internal to show all symbols (methods, private members).",
|
|
190
|
-
"By default excludes fixtures/vendor paths. Add --include-fixtures to include them.",
|
|
191
|
-
"By default includes test files. Add --no-tests to exclude test files from output.",
|
|
192
|
-
],
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
name: "repo-architecture",
|
|
196
|
-
directory: "repo-architecture",
|
|
197
|
-
description: `FIRST choice when user asks "what is this project", "explain the codebase", "how is this organized". Produces a full dependency graph, entry points, and module breakdown — everything needed to understand a repo without reading individual files. Use BEFORE reading package.json or exploring directories manually. Also the best starting point for onboarding: run this first, then drill into specific modules with deps or explain.`,
|
|
198
|
-
heading: "Use repo-architecture for dependency-graph questions",
|
|
199
|
-
useWhen: "Use this when the agent needs a high-level snapshot of modules, entry points, and dependency shape before going deeper. This is the cheapest way to orient in an unfamiliar codebase (~140 tokens for a typical project).",
|
|
200
|
-
focusHint: "Keep the scope to the subsystem that matters so the graph highlights the right boundaries.",
|
|
201
|
-
allowedTools: ["Bash(idx architecture:*)"],
|
|
202
|
-
rules: [
|
|
203
|
-
"Use architecture when the question is about system shape, not a single symbol.",
|
|
204
|
-
"Filter by path prefix when only one subsystem matters.",
|
|
205
|
-
"Pay attention to cyclic dependencies — they indicate tight coupling that may affect where you make changes.",
|
|
206
|
-
"Follow up with `deps <hot-path>` to drill into specific module relationships, or `explain <symbol>` to understand a key class.",
|
|
207
|
-
],
|
|
208
|
-
skipWhen: [
|
|
209
|
-
"You need callers/callees for one specific file or symbol",
|
|
210
|
-
"You need dense narrative context instead of a graph-shaped overview",
|
|
211
|
-
],
|
|
212
|
-
commandSamples: [
|
|
213
|
-
"idx architecture",
|
|
214
|
-
"idx architecture --path-prefix <area>",
|
|
215
|
-
],
|
|
216
|
-
cliReference: ["Options: --path-prefix <string>, --include-fixtures."],
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
name: "symbol-explain",
|
|
220
|
-
directory: "symbol-explain",
|
|
221
|
-
description: "FIRST choice once the symbol name is known. Load this before manual caller/signature tracing to get one symbol's signature, module context, and callers fast. Output is ~80 tokens — the cheapest way to understand a single symbol.",
|
|
222
|
-
heading: "Use symbol-explain for one symbol at a time",
|
|
223
|
-
useWhen: "Use this when the task centers on one function, class, type, or symbol and the agent needs signature, usage, and containing module context fast.",
|
|
224
|
-
focusHint: "Keep the request centered on one symbol name for the cleanest caller and signature output.",
|
|
225
|
-
allowedTools: ["Bash(idx explain:*)"],
|
|
226
|
-
rules: [
|
|
227
|
-
"Use explain only when the symbol name is already known.",
|
|
228
|
-
"Use <file>::<symbol> syntax when the same symbol name exists in multiple files (e.g. `explain engine/indexer.ts::IndexerEngine`).",
|
|
229
|
-
"Use bare <symbol> when the name is unique in the codebase.",
|
|
230
|
-
"Keep the prompt centered on a single symbol for the cleanest output.",
|
|
231
|
-
"Use --path-prefix to limit results to files under a specific path.",
|
|
232
|
-
"Tests and fixtures are excluded by default. Add --include-fixtures to include them.",
|
|
233
|
-
"Exact name matches take priority; fuzzy matches only appear when no exact match exists.",
|
|
234
|
-
],
|
|
235
|
-
skipWhen: [
|
|
236
|
-
"You need to discover candidate symbols first",
|
|
237
|
-
"You need repo-wide structure rather than one-symbol context",
|
|
238
|
-
],
|
|
239
|
-
commandSamples: [
|
|
240
|
-
"idx explain <symbol>",
|
|
241
|
-
"idx explain <file>::<symbol>",
|
|
242
|
-
"idx explain <symbol> --path-prefix <area>",
|
|
243
|
-
],
|
|
244
|
-
cliReference: [
|
|
245
|
-
"Positional args: <symbol> or <file>::<symbol>.",
|
|
246
|
-
"Options: --path-prefix <string>, --include-fixtures.",
|
|
247
|
-
"Tests/fixtures excluded by default. Exact matches prioritized over fuzzy matches.",
|
|
248
|
-
],
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
name: "dependency-trace",
|
|
252
|
-
directory: "dependency-trace",
|
|
253
|
-
description: "FIRST choice once the file or module is known and impact matters. Load this before manual import tracing to see callers, callees, and likely change impact. Output is ~140 tokens per depth level.",
|
|
254
|
-
heading: "Use dependency-trace for impact analysis",
|
|
255
|
-
useWhen: "Use this when the agent needs to know who imports a module, what it imports, or how far change impact may spread.",
|
|
256
|
-
focusHint: "Start with a single path or module and keep depth low until the first-hop trace stops being enough.",
|
|
257
|
-
allowedTools: ["Bash(idx deps:*)"],
|
|
258
|
-
rules: [
|
|
259
|
-
"Use deps when the question is about relationships, not source snippets.",
|
|
260
|
-
"Set --direction callers or --direction callees when only one side matters.",
|
|
261
|
-
"Start at depth 1 (default). Increase to --depth 2 only when the first hop is not enough — each depth level adds more callers/callees.",
|
|
262
|
-
],
|
|
263
|
-
skipWhen: [
|
|
264
|
-
"You need a repo-wide architecture snapshot rather than one trace",
|
|
265
|
-
"You do not yet know the path or symbol to trace",
|
|
266
|
-
],
|
|
267
|
-
commandSamples: [
|
|
268
|
-
"idx deps <path>",
|
|
269
|
-
"idx deps <path> --direction callers",
|
|
270
|
-
"idx deps <path> --direction callees",
|
|
271
|
-
"idx deps <path> --depth 2",
|
|
272
|
-
],
|
|
273
|
-
cliReference: [
|
|
274
|
-
"Positional args: <path>.",
|
|
275
|
-
"Options: --direction <dir>, --depth <n>.",
|
|
276
|
-
"Allowed --direction values: callers, callees, both.",
|
|
277
|
-
"Behavior: --depth is effectively clamped to the range 1..5.",
|
|
278
|
-
],
|
|
279
73
|
},
|
|
280
74
|
];
|
|
281
|
-
exports.
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
75
|
+
exports.DEPRECATED_SKILL_DIRECTORIES = [
|
|
76
|
+
"context-pack",
|
|
77
|
+
"semantic-search",
|
|
78
|
+
"repo-structure",
|
|
79
|
+
"repo-architecture",
|
|
80
|
+
"symbol-explain",
|
|
81
|
+
"dependency-trace",
|
|
82
|
+
];
|
|
287
83
|
exports.GENERATED_SKILL_DIRECTORIES = exports.GENERATED_SKILLS.map((skill) => skill.directory);
|
|
288
84
|
//# sourceMappingURL=skills.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills.js","sourceRoot":"","sources":["../../../src/cli/commands/skills.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"skills.js","sourceRoot":"","sources":["../../../src/cli/commands/skills.ts"],"names":[],"mappings":";;;AAMa,QAAA,gBAAgB,GAAqB;IACjD;QACC,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,gBAAgB;QAC3B,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgEV;KACC;CACD,CAAC;AAEW,QAAA,4BAA4B,GAAG;IAC3C,cAAc;IACd,iBAAiB;IACjB,gBAAgB;IAChB,mBAAmB;IACnB,gBAAgB;IAChB,kBAAkB;CAClB,CAAC;AAEW,QAAA,2BAA2B,GAAG,wBAAgB,CAAC,GAAG,CAC9D,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAC1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SKILLS_VERSION =
|
|
1
|
+
export declare const SKILLS_VERSION = 2355297332;
|