@khivi/opencode-codebase-index 0.5.2
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/LICENSE +21 -0
- package/README.md +658 -0
- package/commands/call-graph.md +24 -0
- package/commands/find.md +25 -0
- package/commands/index.md +21 -0
- package/commands/search.md +24 -0
- package/commands/status.md +15 -0
- package/dist/cli.cjs +6208 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.js +6213 -0
- package/dist/cli.js.map +1 -0
- package/dist/git-cli.cjs +6006 -0
- package/dist/git-cli.cjs.map +1 -0
- package/dist/git-cli.js +6011 -0
- package/dist/git-cli.js.map +1 -0
- package/dist/index.cjs +8224 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +8221 -0
- package/dist/index.js.map +1 -0
- package/native/codebase-index-native.darwin-arm64.node +0 -0
- package/package.json +103 -0
- package/skill/SKILL.md +78 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Trace callers or callees using the call graph
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Trace function dependencies using the `call_graph` tool.
|
|
6
|
+
|
|
7
|
+
User input: $ARGUMENTS
|
|
8
|
+
|
|
9
|
+
Interpret input as follows:
|
|
10
|
+
- Default to `direction="callers"` unless input asks for callees/calls/makes calls.
|
|
11
|
+
- `name=<function>` or plain text function name sets `name`.
|
|
12
|
+
- `symbolId=<id>` is required for `direction="callees"`.
|
|
13
|
+
|
|
14
|
+
Execution flow:
|
|
15
|
+
1. If direction is `callers`, call `call_graph` with `{ name, direction: "callers" }`.
|
|
16
|
+
2. If direction is `callees` and `symbolId` is present, call `call_graph` with `{ name, direction: "callees", symbolId }`.
|
|
17
|
+
3. If direction is `callees` and `symbolId` is missing, first call `call_graph` with `direction="callers"` to get symbol IDs, then ask the user to choose one if multiple are returned.
|
|
18
|
+
|
|
19
|
+
Examples:
|
|
20
|
+
- `/call-graph Database` → callers for `Database`
|
|
21
|
+
- `/call-graph callers name=Indexer` → callers for `Indexer`
|
|
22
|
+
- `/call-graph callees name=Database symbolId=sym_abc123` → callees for selected symbol
|
|
23
|
+
|
|
24
|
+
If output says no callers found, suggest running `/index force` first.
|
package/commands/find.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Find code using hybrid approach (semantic + grep)
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Find code using both semantic search and grep.
|
|
6
|
+
|
|
7
|
+
User input: $ARGUMENTS
|
|
8
|
+
|
|
9
|
+
Strategy:
|
|
10
|
+
1. Use `codebase_search` to find semantically related code
|
|
11
|
+
2. Identify specific function/class/variable names from results
|
|
12
|
+
3. Use grep to find all occurrences of those identifiers
|
|
13
|
+
4. Combine into a comprehensive answer
|
|
14
|
+
|
|
15
|
+
Parse optional parameters from input:
|
|
16
|
+
- `limit=N` → limit semantic results
|
|
17
|
+
- `type=X` or "functions"/"classes" → filter chunk type
|
|
18
|
+
- `dir=X` → filter directory
|
|
19
|
+
|
|
20
|
+
Examples:
|
|
21
|
+
- `/find error handling middleware`
|
|
22
|
+
- `/find payment validation type=function`
|
|
23
|
+
- `/find user auth in src/services`
|
|
24
|
+
|
|
25
|
+
If no index exists, run `index_codebase` first.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Index the codebase for semantic search
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Run the `index_codebase` tool with these settings:
|
|
6
|
+
|
|
7
|
+
User input: $ARGUMENTS
|
|
8
|
+
|
|
9
|
+
Parse the input and set tool arguments:
|
|
10
|
+
- force=true if input contains "force"
|
|
11
|
+
- estimateOnly=true if input contains "estimate"
|
|
12
|
+
- verbose=true (always, for detailed output)
|
|
13
|
+
|
|
14
|
+
Examples:
|
|
15
|
+
- `/index` → force=false, estimateOnly=false, verbose=true
|
|
16
|
+
- `/index force` → force=true, estimateOnly=false, verbose=true
|
|
17
|
+
- `/index estimate` → force=false, estimateOnly=true, verbose=true
|
|
18
|
+
|
|
19
|
+
IMPORTANT: You MUST pass the parsed arguments to `index_codebase`. Do not ignore them.
|
|
20
|
+
|
|
21
|
+
Show final statistics including files processed, chunks indexed, tokens used, and duration.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Search codebase by meaning using semantic search
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Search the codebase using semantic search.
|
|
6
|
+
|
|
7
|
+
User input: $ARGUMENTS
|
|
8
|
+
|
|
9
|
+
The first part is the search query. Look for optional parameters:
|
|
10
|
+
- `limit=N` or "top N" or "first N" → set limit
|
|
11
|
+
- `type=X` or mentions "functions"/"classes"/"methods" → set chunkType
|
|
12
|
+
- `dir=X` or "in folder X" → set directory filter
|
|
13
|
+
- File extensions like ".ts", "typescript", ".py" → set fileType
|
|
14
|
+
|
|
15
|
+
Call `codebase_search` with the parsed arguments.
|
|
16
|
+
|
|
17
|
+
Examples:
|
|
18
|
+
- `/search authentication logic` → query="authentication logic"
|
|
19
|
+
- `/search error handling limit=5` → query="error handling", limit=5
|
|
20
|
+
- `/search validation functions` → query="validation", chunkType="function"
|
|
21
|
+
|
|
22
|
+
If the index doesn't exist, run `index_codebase` first.
|
|
23
|
+
|
|
24
|
+
Return results with file paths and line numbers.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Check if the codebase is indexed and ready for semantic search
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Run the `index_status` tool to check if the codebase index is ready.
|
|
6
|
+
|
|
7
|
+
This shows:
|
|
8
|
+
- Whether the codebase is indexed
|
|
9
|
+
- Number of indexed chunks
|
|
10
|
+
- Embedding provider and model being used
|
|
11
|
+
- Current git branch
|
|
12
|
+
|
|
13
|
+
No arguments needed - just run `index_status`.
|
|
14
|
+
|
|
15
|
+
If not indexed, suggest running `/index` to create the index.
|