indexer-cli 0.5.1 → 0.6.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/dist/cli/commands/skills.js +128 -28
- package/dist/cli/commands/skills.js.map +1 -1
- package/dist/cli/entry.js +0 -2
- package/dist/cli/entry.js.map +1 -1
- package/package.json +1 -1
|
@@ -31,33 +31,133 @@ const SKILL_DEFINITIONS = [
|
|
|
31
31
|
{
|
|
32
32
|
name: "semantic-search",
|
|
33
33
|
directory: "semantic-search",
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
34
|
+
rawContent: `---
|
|
35
|
+
name: semantic-search
|
|
36
|
+
description:
|
|
37
|
+
FIRST choice for CONCEPT and BEHAVIOR questions — "how is scoring calculated", "what happens on order cancel", "what if a user stops paying", "how does the system handle expired subscriptions", "lifecycle of a payment", "flow when X fails". Use BEFORE spawning explore agents for these questions — it traces cross-module behavior that grep misses. Do NOT use for keyword/identifier lookups (use grep/ast-grep instead). If the search term is a code identifier (class name, variable name, function name), this is the WRONG tool — use symbol-explain or grep instead.
|
|
38
|
+
allowed-tools: Bash(npx indexer-cli search:*)
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
# Use semantic-search for implementation hunting
|
|
42
|
+
|
|
43
|
+
Use when semantic search is already the right tool.
|
|
44
|
+
Keep the query short and centered on one code concept.
|
|
45
|
+
|
|
46
|
+
## Mandatory rules
|
|
47
|
+
|
|
48
|
+
### 1) Search count
|
|
49
|
+
|
|
50
|
+
- 1 search per question
|
|
51
|
+
- Max 2 only if the second is a truly different angle
|
|
52
|
+
- If search 1 answers the question: STOP
|
|
53
|
+
|
|
54
|
+
Never run 3+ overlapping searches.
|
|
55
|
+
|
|
56
|
+
### 2) Query shape
|
|
57
|
+
|
|
58
|
+
Use 1-3 domain-specific words. No synonyms.
|
|
59
|
+
|
|
60
|
+
Pick the single best concept word. Add words only to narrow scope.
|
|
61
|
+
|
|
62
|
+
- ✅ \`prize\`
|
|
63
|
+
- ✅ \`password reset\`
|
|
64
|
+
- ✅ \`rate limiting\`
|
|
65
|
+
- ❌ \`prize reward award\`
|
|
66
|
+
- ❌ \`chapter pass percent quiz result score\`
|
|
67
|
+
- ❌ \`order cancel payment failure refund\`
|
|
68
|
+
|
|
69
|
+
### 3) Two-phase retrieval — ALWAYS
|
|
70
|
+
|
|
71
|
+
#### Phase 1: Discover
|
|
72
|
+
|
|
73
|
+
Search without \`--include-content\`, with \`--fields filePath,startLine,endLine,primarySymbol\`.
|
|
74
|
+
|
|
75
|
+
\`\`\`bash
|
|
76
|
+
npx indexer-cli search "prize" --fields filePath,startLine,endLine,primarySymbol
|
|
77
|
+
\`\`\`
|
|
78
|
+
|
|
79
|
+
#### Phase 2: Read
|
|
80
|
+
|
|
81
|
+
Use the Read tool on the exact files and line ranges from Phase 1.
|
|
82
|
+
|
|
83
|
+
Do NOT:
|
|
84
|
+
|
|
85
|
+
- run another semantic search for the same concept
|
|
86
|
+
- grep the same concept
|
|
87
|
+
- grep terms revealed by Phase 1
|
|
88
|
+
- replace reading with \`--include-content\`
|
|
89
|
+
|
|
90
|
+
### Hard stop after Phase 1
|
|
91
|
+
|
|
92
|
+
If Phase 1 returned useful file paths and ranges, read them.
|
|
93
|
+
|
|
94
|
+
Only if Phase 1 returns nothing useful, do one fallback:
|
|
95
|
+
|
|
96
|
+
- one alternative semantic query, or
|
|
97
|
+
- grep
|
|
98
|
+
|
|
99
|
+
### 4) \`--include-content\` is rare
|
|
100
|
+
|
|
101
|
+
Use it only for a quick scan when you expect fewer than 5 results.
|
|
102
|
+
|
|
103
|
+
### 5) Narrow early with \`--path-prefix\`
|
|
104
|
+
|
|
105
|
+
If you know the subsystem, add \`--path-prefix\`.
|
|
106
|
+
|
|
107
|
+
\`\`\`bash
|
|
108
|
+
npx indexer-cli search "password reset" --path-prefix src/auth --fields filePath,startLine,endLine,primarySymbol
|
|
109
|
+
\`\`\`
|
|
110
|
+
|
|
111
|
+
## Skip when
|
|
112
|
+
|
|
113
|
+
- you need a file tree or symbol inventory
|
|
114
|
+
- you already know the exact file and line range
|
|
115
|
+
- the query is an identifier; use grep/LSP/symbol-explain instead
|
|
116
|
+
|
|
117
|
+
## Command patterns
|
|
118
|
+
|
|
119
|
+
\`\`\`bash
|
|
120
|
+
# Phase 1: discover
|
|
121
|
+
npx indexer-cli search "rate limiting" --fields filePath,startLine,endLine,primarySymbol
|
|
122
|
+
npx indexer-cli search "password reset" --path-prefix src/auth --fields filePath,startLine,endLine,primarySymbol
|
|
123
|
+
|
|
124
|
+
# Phase 2: Read returned files/lines with Read tool
|
|
125
|
+
|
|
126
|
+
# Rare exception: inline content when expecting <5 hits
|
|
127
|
+
npx indexer-cli search "input validation" --include-content --max-files 3
|
|
128
|
+
\`\`\`
|
|
129
|
+
|
|
130
|
+
## CLI reference
|
|
131
|
+
|
|
132
|
+
- Positional args: \`<query>\`
|
|
133
|
+
- Options: \`--max-files\`, \`--path-prefix\`, \`--chunk-types\`, \`--fields\`, \`--min-score\`, \`--include-content\`,
|
|
134
|
+
\`--include-imports\`
|
|
135
|
+
|
|
136
|
+
### Allowed \`--chunk-types\`
|
|
137
|
+
|
|
138
|
+
\`full_file\`, \`imports\`, \`preamble\`, \`declaration\`, \`module_section\`, \`impl\`, \`types\`
|
|
139
|
+
|
|
140
|
+
Imports and preamble are excluded by default. Use \`--include-imports\` to include them.
|
|
141
|
+
|
|
142
|
+
### Allowed \`--fields\`
|
|
143
|
+
|
|
144
|
+
\`filePath\`, \`startLine\`, \`endLine\`, \`score\`, \`primarySymbol\`, \`content\`
|
|
145
|
+
|
|
146
|
+
## Anti-patterns
|
|
147
|
+
|
|
148
|
+
- ❌ 3+ overlapping searches
|
|
149
|
+
- ❌ broad searches with \`--include-content\`
|
|
150
|
+
- ❌ long synonym-heavy queries
|
|
151
|
+
- ❌ re-searching after Phase 1 already found the locations
|
|
152
|
+
- ❌ grepping the same concept after semantic search already found it
|
|
153
|
+
- ❌ loading this skill via \`skill\` when you already know the \`indexer-cli\` command
|
|
154
|
+
`,
|
|
155
|
+
description: "",
|
|
156
|
+
heading: "",
|
|
157
|
+
useWhen: "",
|
|
158
|
+
allowedTools: [],
|
|
159
|
+
rules: [],
|
|
160
|
+
commandSamples: [],
|
|
61
161
|
},
|
|
62
162
|
{
|
|
63
163
|
name: "repo-structure",
|
|
@@ -202,7 +302,7 @@ const SKILL_DEFINITIONS = [
|
|
|
202
302
|
exports.GENERATED_SKILLS = SKILL_DEFINITIONS.map((definition) => ({
|
|
203
303
|
name: definition.name,
|
|
204
304
|
directory: definition.directory,
|
|
205
|
-
content: renderSkill(definition),
|
|
305
|
+
content: definition.rawContent ?? renderSkill(definition),
|
|
206
306
|
}));
|
|
207
307
|
exports.DEPRECATED_SKILL_DIRECTORIES = ["context-pack"];
|
|
208
308
|
exports.GENERATED_SKILL_DIRECTORIES = exports.GENERATED_SKILLS.map((skill) => skill.directory);
|
|
@@ -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":";;;AAeA,SAAS,WAAW,CAAC,UAA2B;IAC/C,MAAM,QAAQ,GAAG;QAChB,KAAK;QACL,SAAS,UAAU,CAAC,IAAI,EAAE;QAC1B,gBAAgB,UAAU,CAAC,WAAW,EAAE;QACxC,kBAAkB,UAAU,CAAC,YAAY,CAAC,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;YACT,kEAAkE;YAClE,iDAAiD;SACjD;QACD,cAAc,EAAE;YACf,6BAA6B;YAC7B,iDAAiD;YACjD,iDAAiD;SACjD;QACD,YAAY,EAAE;YACb,0BAA0B;YAC1B,6DAA6D;YAC7D,iDAAiD;YACjD,qDAAqD;YACrD,6DAA6D;SAC7D;KACD;CACD,CAAC;AAQW,QAAA,gBAAgB,GAAqB,iBAAiB,CAAC,GAAG,CACtE,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAChB,IAAI,EAAE,UAAU,CAAC,IAAI;IACrB,SAAS,EAAE,UAAU,CAAC,SAAS;IAC/B,OAAO,EAAE,UAAU,CAAC,UAAU,IAAI,WAAW,CAAC,UAAU,CAAC;CACzD,CAAC,CACF,CAAC;AAEW,QAAA,4BAA4B,GAAG,CAAC,cAAc,CAAC,CAAC;AAEhD,QAAA,2BAA2B,GAAG,wBAAgB,CAAC,GAAG,CAC9D,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAC1B,CAAC"}
|
package/dist/cli/entry.js
CHANGED
|
@@ -12,7 +12,6 @@ const context_js_1 = require("./commands/context.js");
|
|
|
12
12
|
const explain_js_1 = require("./commands/explain.js");
|
|
13
13
|
const deps_js_1 = require("./commands/deps.js");
|
|
14
14
|
const version_js_1 = require("../core/version.js");
|
|
15
|
-
const update_check_js_1 = require("../core/update-check.js");
|
|
16
15
|
const version_check_js_1 = require("../core/version-check.js");
|
|
17
16
|
const help_text_js_1 = require("./help-text.js");
|
|
18
17
|
const SKIP_MIGRATION_COMMANDS = new Set(["setup", "init", "uninstall"]);
|
|
@@ -60,7 +59,6 @@ async function main() {
|
|
|
60
59
|
throw error;
|
|
61
60
|
}
|
|
62
61
|
}
|
|
63
|
-
(0, update_check_js_1.checkForUpdates)().catch(() => { });
|
|
64
62
|
}
|
|
65
63
|
main();
|
|
66
64
|
//# sourceMappingURL=entry.js.map
|
package/dist/cli/entry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry.js","sourceRoot":"","sources":["../../src/cli/entry.ts"],"names":[],"mappings":";;AAAA,yCAAoC;AACpC,gDAAyD;AACzD,kDAA2D;AAC3D,oDAA6D;AAC7D,0DAAmE;AACnE,gEAAyE;AACzE,0DAAmE;AACnE,kDAA2D;AAC3D,sDAA+D;AAC/D,sDAA+D;AAC/D,gDAAyD;AACzD,mDAAqD;AACrD
|
|
1
|
+
{"version":3,"file":"entry.js","sourceRoot":"","sources":["../../src/cli/entry.ts"],"names":[],"mappings":";;AAAA,yCAAoC;AACpC,gDAAyD;AACzD,kDAA2D;AAC3D,oDAA6D;AAC7D,0DAAmE;AACnE,gEAAyE;AACzE,0DAAmE;AACnE,kDAA2D;AAC3D,sDAA+D;AAC/D,sDAA+D;AAC/D,gDAAyD;AACzD,mDAAqD;AACrD,+DAAmE;AACnE,iDAA2D;AAE3D,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;AAExE,MAAM,4BAA4B,GAAG,IAAI,GAAG,CAAC;IAC5C,yBAAyB;IACzB,gBAAgB;IAChB,mBAAmB;IACnB,0BAA0B;CAC1B,CAAC,CAAC;AAEH,SAAS,sBAAsB,CAAC,KAAc;IAC7C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,EAAE,CAAC;QACvE,OAAO,KAAK,CAAC;IACd,CAAC;IAED,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACxC,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,4BAA4B,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC3E,CAAC;AAED,mBAAO;KACL,IAAI,CAAC,aAAa,CAAC;KACnB,WAAW,CACX,uIAAuI,CACvI;KACA,OAAO,CAAC,4BAAe,CAAC;KAC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