opencode-codebase-index 0.5.2 ā 0.6.0
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 +189 -101
- package/commands/definition.md +24 -0
- package/dist/cli.cjs +1335 -172
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +1308 -151
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +110 -52
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +111 -59
- package/dist/index.js.map +1 -1
- package/native/codebase-index-native.darwin-arm64.node +0 -0
- package/native/codebase-index-native.darwin-x64.node +0 -0
- package/native/codebase-index-native.linux-arm64-gnu.node +0 -0
- package/native/codebase-index-native.linux-x64-gnu.node +0 -0
- package/native/codebase-index-native.win32-x64-msvc.node +0 -0
- package/package.json +8 -1
package/README.md
CHANGED
|
@@ -10,6 +10,24 @@
|
|
|
10
10
|
|
|
11
11
|
**opencode-codebase-index** brings semantic understanding to your [OpenCode](https://opencode.ai) workflow ā and now to any MCP-compatible client like Cursor, Claude Code, and Windsurf. Instead of guessing function names or grepping for keywords, ask your codebase questions in plain English.
|
|
12
12
|
|
|
13
|
+
## š Quick Navigation
|
|
14
|
+
|
|
15
|
+
- [ā” Quick Start](#-quick-start)
|
|
16
|
+
- [š MCP Server (Cursor, Claude Code, Windsurf, etc.)](#-mcp-server-cursor-claude-code-windsurf-etc)
|
|
17
|
+
- [šÆ When to Use What](#-when-to-use-what)
|
|
18
|
+
- [š§° Tools Available](#-tools-available)
|
|
19
|
+
- [š® Slash Commands](#-slash-commands)
|
|
20
|
+
- [āļø Configuration](#ļø-configuration)
|
|
21
|
+
- [š¤ Contributing](#-contributing)
|
|
22
|
+
|
|
23
|
+
## š Choose Your Path
|
|
24
|
+
|
|
25
|
+
- **I want to try it now** ā go to [Quick Start](#-quick-start)
|
|
26
|
+
- **I use Cursor/Claude Code/Windsurf** ā go to [MCP Server setup](#-mcp-server-cursor-claude-code-windsurf-etc)
|
|
27
|
+
- **Iām comparing tools and workflows** ā go to [When to Use What](#-when-to-use-what)
|
|
28
|
+
- **Iām tuning behavior/cost/performance** ā go to [Configuration](#ļø-configuration)
|
|
29
|
+
- **I want to contribute** ā go to [Contributing](#-contributing)
|
|
30
|
+
|
|
13
31
|
## š Why Use This?
|
|
14
32
|
|
|
15
33
|
- š§ **Semantic Search**: Finds "user authentication" logic even if the function is named `check_creds`.
|
|
@@ -168,7 +186,7 @@ graph TD
|
|
|
168
186
|
|
|
169
187
|
1. **Parsing**: We use `tree-sitter` to intelligently parse your code into meaningful blocks (functions, classes, interfaces). JSDoc comments and docstrings are automatically included with their associated code.
|
|
170
188
|
|
|
171
|
-
**Supported Languages**: TypeScript, JavaScript, Python, Rust, Go, Java, C#, Ruby, Bash, C, C++, JSON, TOML, YAML
|
|
189
|
+
**Supported Languages**: TypeScript, JavaScript, Python, Rust, Go, Java, C#, Ruby, PHP, Bash, C, C++, JSON, TOML, YAML
|
|
172
190
|
2. **Chunking**: Large blocks are split with overlapping windows to preserve context across chunk boundaries.
|
|
173
191
|
3. **Embedding**: These blocks are converted into vector representations using your configured AI provider.
|
|
174
192
|
4. **Storage**: Embeddings are stored in SQLite (deduplicated by content hash) and vectors in `usearch` with F16 quantization for 50% memory savings. A branch catalog tracks which chunks exist on each branch.
|
|
@@ -290,6 +308,7 @@ The plugin automatically registers these slash commands:
|
|
|
290
308
|
| ------- | ----------- |
|
|
291
309
|
| `/search <query>` | **Pure Semantic Search**. Best for "How does X work?" |
|
|
292
310
|
| `/find <query>` | **Hybrid Search**. Combines semantic search + grep. Best for "Find usage of X". |
|
|
311
|
+
| `/call-graph <query>` | **Call Graph Trace**. Find callers/callees to understand execution flow. |
|
|
293
312
|
| `/index` | **Update Index**. Forces a refresh of the codebase index. |
|
|
294
313
|
| `/status` | **Check Status**. Shows if indexed, chunk count, and provider info. |
|
|
295
314
|
|
|
@@ -365,7 +384,7 @@ Zero-config by default (uses `auto` mode). Customize in `.opencode/codebase-inde
|
|
|
365
384
|
| `logBranch` | `true` | Log branch detection and switches |
|
|
366
385
|
| `metrics` | `false` | Enable metrics collection (indexing stats, search timing, cache performance) |
|
|
367
386
|
|
|
368
|
-
### Retrieval ranking behavior
|
|
387
|
+
### Retrieval ranking behavior
|
|
369
388
|
|
|
370
389
|
- `codebase_search` and `codebase_peek` use the hybrid path: semantic + keyword retrieval ā fusion (`fusionStrategy`) ā deterministic rerank (`rerankTopN`) ā filtering.
|
|
371
390
|
- `find_similar` stays semantic-only: semantic retrieval + deterministic rerank only (no keyword retrieval, no RRF).
|
|
@@ -374,6 +393,135 @@ Zero-config by default (uses `auto` mode). Customize in `.opencode/codebase-inde
|
|
|
374
393
|
- baseline (versioned): `benchmarks/baselines/retrieval-baseline.json`
|
|
375
394
|
- latest candidate run (generated): `benchmark-results/retrieval-candidate.json`
|
|
376
395
|
|
|
396
|
+
## š Evaluation Harness
|
|
397
|
+
|
|
398
|
+
This repository includes a first-class eval system for retrieval quality with versioned golden sets, compare mode, parameter sweeps, CI budgets, and run artifacts.
|
|
399
|
+
|
|
400
|
+
### Commands
|
|
401
|
+
|
|
402
|
+
```bash
|
|
403
|
+
npm run eval
|
|
404
|
+
npm run eval:ci
|
|
405
|
+
npm run eval:ci:ollama
|
|
406
|
+
npm run eval:compare -- --against benchmarks/baselines/eval-baseline-summary.json
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
CI usage split:
|
|
410
|
+
|
|
411
|
+
- `npm run eval:smoke`: harness smoke check with local mock embeddings (used in main CI)
|
|
412
|
+
- `npm run eval:ci`: real quality gate against baseline/budget (for scheduled/manual quality workflow)
|
|
413
|
+
|
|
414
|
+
For `eval-quality.yml`, the default CI path uses **GitHub Models** with the workflow `GITHUB_TOKEN` plus `models: read`, so you do not need a separate OpenAI API key just to run the scheduled gate.
|
|
415
|
+
|
|
416
|
+
That default GitHub Models path uses `benchmarks/budgets/github-models.json`, which applies stable absolute thresholds instead of the stricter baseline-regression budget used for explicit external providers.
|
|
417
|
+
|
|
418
|
+
Optional override secrets for another OpenAI-compatible endpoint:
|
|
419
|
+
|
|
420
|
+
- `EVAL_EMBED_BASE_URL`
|
|
421
|
+
- `EVAL_EMBED_API_KEY`
|
|
422
|
+
- `EVAL_EMBED_MODEL` (optional, default `text-embedding-3-small`)
|
|
423
|
+
- `EVAL_EMBED_DIMENSIONS` (optional, default `1536`)
|
|
424
|
+
|
|
425
|
+
If you override the provider, set both `EVAL_EMBED_BASE_URL` and `EVAL_EMBED_API_KEY`. Otherwise the workflow falls back to GitHub Models automatically. Override providers continue to use the baseline-driven budget in `benchmarks/budgets/default.json`.
|
|
426
|
+
|
|
427
|
+
No OpenAI API access? Use Ollama quality gate locally:
|
|
428
|
+
|
|
429
|
+
- Config: `.github/eval-ollama-config.json`
|
|
430
|
+
- Script: `npm run eval:ci:ollama`
|
|
431
|
+
|
|
432
|
+
Prerequisites: Ollama installed, `ollama serve` running on `127.0.0.1:11434`, and `nomic-embed-text` pulled.
|
|
433
|
+
|
|
434
|
+
Examples:
|
|
435
|
+
|
|
436
|
+
```bash
|
|
437
|
+
# Run against small golden set
|
|
438
|
+
npm run eval -- --dataset benchmarks/golden/small.json
|
|
439
|
+
|
|
440
|
+
# Compare against baseline
|
|
441
|
+
npm run eval:compare -- --against benchmarks/baselines/eval-baseline-summary.json --dataset benchmarks/golden/medium.json
|
|
442
|
+
|
|
443
|
+
# Sweep retrieval parameters
|
|
444
|
+
npm run eval -- --dataset benchmarks/golden/small.json --sweepFusionStrategy rrf,weighted --sweepHybridWeight 0.3,0.5,0.7 --sweepRrfK 30,60 --sweepRerankTopN 10,20
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
### What it reports
|
|
448
|
+
|
|
449
|
+
- Hit@1, Hit@3, Hit@5, Hit@10
|
|
450
|
+
- MRR@10, nDCG@10
|
|
451
|
+
- Latency p50/p95/p99
|
|
452
|
+
- Token estimates, embedding call counts, estimated embedding cost
|
|
453
|
+
- Failure buckets (`wrong-file`, `wrong-symbol`, `docs-tests-outranking-source`, `no-relevant-hit-top-k`)
|
|
454
|
+
|
|
455
|
+
### Artifacts
|
|
456
|
+
|
|
457
|
+
Each run writes:
|
|
458
|
+
|
|
459
|
+
`benchmarks/results/<timestamp>/`
|
|
460
|
+
|
|
461
|
+
- `summary.json`
|
|
462
|
+
- `summary.md`
|
|
463
|
+
- `per-query.json`
|
|
464
|
+
- `compare.json` (when baseline/sweep used)
|
|
465
|
+
|
|
466
|
+
### Golden sets and budgets
|
|
467
|
+
|
|
468
|
+
- Golden datasets:
|
|
469
|
+
- `benchmarks/golden/small.json`
|
|
470
|
+
- `benchmarks/golden/medium.json`
|
|
471
|
+
- `benchmarks/golden/large.json`
|
|
472
|
+
- CI budgets:
|
|
473
|
+
- `benchmarks/budgets/github-models.json` for the default GitHub Models workflow path
|
|
474
|
+
- `benchmarks/budgets/default.json` for explicit external provider overrides with baseline comparison
|
|
475
|
+
|
|
476
|
+
Full docs: `docs/evaluation.md`
|
|
477
|
+
|
|
478
|
+
### Cross-repo benchmark results snapshot
|
|
479
|
+
|
|
480
|
+
Recent representative runs (plugin vs `ripgrep` vs `ast-grep`) on two medium repos:
|
|
481
|
+
|
|
482
|
+
Methodology for the snapshot below:
|
|
483
|
+
|
|
484
|
+
- Dataset: auto-generated cross-repo golden sets for `axios` + `express`
|
|
485
|
+
- Repeats: **20** per mode
|
|
486
|
+
- Aggregation: **median** metric per tool (then averaged across repos)
|
|
487
|
+
- Reindex behavior: when enabled, index reset applies on repeat #1 only; subsequent repeats measure warm-index query behavior
|
|
488
|
+
- Sampling note: repository parsing can be capped; benchmark reports include truncation metadata
|
|
489
|
+
- ast-grep scope note: sg metrics are computed on its compatible query subset (`definition`, `keyword-heavy`) with scoped denominators shown in run reports
|
|
490
|
+
|
|
491
|
+
#### Without reindex (`--no-reindex`, default)
|
|
492
|
+
|
|
493
|
+
| Metric | Plugin | ripgrep | ast-grep (5/10 queries) |
|
|
494
|
+
|---|---:|---:|---:|
|
|
495
|
+
| Hit@5 | 50% | 5% | 100% |
|
|
496
|
+
| MRR@10 | 0.48 | 0.04 | 0.90 |
|
|
497
|
+
| nDCG@10 | 0.48 | 0.08 | 0.93 |
|
|
498
|
+
| Latency p50 (ms) | 17.5 | 36.9 | 66.6 |
|
|
499
|
+
| Latency p95 (ms) | 30.9 | 44.1 | 70.7 |
|
|
500
|
+
|
|
501
|
+
#### With reindex (`--reindex`)
|
|
502
|
+
|
|
503
|
+
| Metric | Plugin | ripgrep | ast-grep (5/10 queries) |
|
|
504
|
+
|---|---:|---:|---:|
|
|
505
|
+
| Hit@5 | 50% | 5% | 100% |
|
|
506
|
+
| MRR@10 | 0.48 | 0.04 | 0.98 |
|
|
507
|
+
| nDCG@10 | 0.48 | 0.07 | 0.98 |
|
|
508
|
+
| Latency p50 (ms) | 17.1 | 35.9 | 69.1 |
|
|
509
|
+
| Latency p95 (ms) | 30.4 | 43.7 | 75.1 |
|
|
510
|
+
|
|
511
|
+
ast-grep metrics are computed on its compatible query subset only (`definition` + `keyword-heavy`, 5/10 queries per repo). Plugin and ripgrep are scored on all 10 queries.
|
|
512
|
+
|
|
513
|
+
Interpretation:
|
|
514
|
+
|
|
515
|
+
- ast-grep dominates on its scoped subset (structural definition queries), but only handles 50% of query types. Plugin handles all query types including natural language.
|
|
516
|
+
- Plugin leads on rank-sensitive quality (MRR/nDCG) vs ripgrep across all query types.
|
|
517
|
+
- ripgrep remains a useful speed-oriented lexical baseline but has significantly lower retrieval relevance for intent-style queries.
|
|
518
|
+
- Plugin is the fastest tool at p50 (~17ms), ahead of ripgrep (~36ms) and ast-grep (~67ms).
|
|
519
|
+
- Reported numbers are rounded to avoid false precision; use report artifacts for full per-repeat audit trails.
|
|
520
|
+
|
|
521
|
+
For reproducible setup and commands (including with/without reindex), see:
|
|
522
|
+
|
|
523
|
+
- `docs/benchmarking-cross-repo.md`
|
|
524
|
+
|
|
377
525
|
### Embedding Providers
|
|
378
526
|
The plugin automatically detects available credentials in this order:
|
|
379
527
|
1. **GitHub Copilot** (Free if you have it)
|
|
@@ -411,79 +559,22 @@ ollama pull nomic-embed-text
|
|
|
411
559
|
|
|
412
560
|
## š Performance
|
|
413
561
|
|
|
414
|
-
The plugin is built for speed with a Rust native module.
|
|
415
|
-
|
|
416
|
-
### Parsing (tree-sitter)
|
|
417
|
-
|
|
418
|
-
| Files | Chunks | Time |
|
|
419
|
-
|-------|--------|------|
|
|
420
|
-
| 100 | 1,200 | ~7ms |
|
|
421
|
-
| 500 | 6,000 | ~32ms |
|
|
562
|
+
The plugin is built for speed with a Rust native module (`tree-sitter`, `usearch`, SQLite). In practice, indexing and retrieval remain fast enough for interactive use on medium/large repositories.
|
|
422
563
|
|
|
423
|
-
|
|
564
|
+
- Typical query latency: ~800-1000ms (mostly embedding API time)
|
|
565
|
+
- Incremental indexing: only changed files are re-embedded
|
|
566
|
+
- Batch DB operations: significant write-speed improvements for large indexes
|
|
424
567
|
|
|
425
|
-
|
|
426
|
-
|------------|-------------|------------|
|
|
427
|
-
| 1,000 vectors | 0.7ms | 1,400 ops/sec |
|
|
428
|
-
| 5,000 vectors | 1.2ms | 850 ops/sec |
|
|
429
|
-
| 10,000 vectors | 1.3ms | 780 ops/sec |
|
|
430
|
-
|
|
431
|
-
### Database Operations (SQLite with batch)
|
|
432
|
-
|
|
433
|
-
| Operation | 1,000 items | 10,000 items |
|
|
434
|
-
|-----------|-------------|--------------|
|
|
435
|
-
| Insert chunks | 4ms | 44ms |
|
|
436
|
-
| Add to branch | 2ms | 22ms |
|
|
437
|
-
| Check embedding exists | <0.01ms | <0.01ms |
|
|
438
|
-
|
|
439
|
-
### Batch vs Sequential Performance
|
|
440
|
-
|
|
441
|
-
Batch operations provide significant speedups:
|
|
442
|
-
|
|
443
|
-
| Operation | Sequential | Batch | Speedup |
|
|
444
|
-
|-----------|------------|-------|---------|
|
|
445
|
-
| Insert 1,000 chunks | 38ms | 4ms | **~10x** |
|
|
446
|
-
| Add 1,000 to branch | 29ms | 2ms | **~14x** |
|
|
447
|
-
| Insert 1,000 embeddings | 59ms | 40ms | **~1.5x** |
|
|
448
|
-
|
|
449
|
-
Run benchmarks yourself: `npx tsx benchmarks/run.ts`
|
|
568
|
+
For reproducible measurements on your machine, run: `npx tsx benchmarks/run.ts`.
|
|
450
569
|
|
|
451
570
|
## šÆ Choosing a Provider
|
|
452
571
|
|
|
453
|
-
|
|
572
|
+
Quick recommendation:
|
|
454
573
|
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
āāāāāāā“āāāāāā
|
|
460
|
-
YES NO
|
|
461
|
-
ā ā
|
|
462
|
-
āāāāāāāāāāāāā¼āāāāāāāā ā
|
|
463
|
-
ā Codebase < 1k ā ā
|
|
464
|
-
ā files? ā ā
|
|
465
|
-
āāāāāāāāāāā¬āāāāāāāāāā ā
|
|
466
|
-
āāāāāāā“āāāāāā ā
|
|
467
|
-
YES NO ā
|
|
468
|
-
ā ā ā
|
|
469
|
-
ā¼ ā ā
|
|
470
|
-
āāāāāāāāāāāā ā ā
|
|
471
|
-
ā Copilot ā ā ā
|
|
472
|
-
ā (free) ā ā ā
|
|
473
|
-
āāāāāāāāāāāā ā ā
|
|
474
|
-
ā¼ ā¼
|
|
475
|
-
āāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
476
|
-
ā Need fastest indexing? ā
|
|
477
|
-
āāāāāāāāāāāāā¬āāāāāāāāāāāāāā
|
|
478
|
-
āāāāāāā“āāāāāā
|
|
479
|
-
YES NO
|
|
480
|
-
ā ā
|
|
481
|
-
ā¼ ā¼
|
|
482
|
-
āāāāāāāāāāāā āāāāāāāāāāāāāāāā
|
|
483
|
-
ā Ollama ā ā OpenAI or ā
|
|
484
|
-
ā (local) ā ā Google ā
|
|
485
|
-
āāāāāāāāāāāā āāāāāāāāāāāāāāāā
|
|
486
|
-
```
|
|
574
|
+
- **Want local + private + fast indexing** ā use **Ollama**
|
|
575
|
+
- **Already have Copilot and a smaller repo** ā use **GitHub Copilot**
|
|
576
|
+
- **General cloud setup** ā use **OpenAI** or **Google**
|
|
577
|
+
- **Custom/OpenAI-compatible endpoint** ā use **custom** provider
|
|
487
578
|
|
|
488
579
|
### Provider Comparison
|
|
489
580
|
|
|
@@ -499,35 +590,13 @@ Use this decision tree to pick the right embedding provider:
|
|
|
499
590
|
|
|
500
591
|
### Setup by Provider
|
|
501
592
|
|
|
502
|
-
|
|
503
|
-
```bash
|
|
504
|
-
ollama pull nomic-embed-text
|
|
505
|
-
```
|
|
506
|
-
```json
|
|
507
|
-
{ "embeddingProvider": "ollama" }
|
|
508
|
-
```
|
|
509
|
-
|
|
510
|
-
**OpenAI**
|
|
511
|
-
```bash
|
|
512
|
-
export OPENAI_API_KEY=sk-...
|
|
513
|
-
```
|
|
514
|
-
```json
|
|
515
|
-
{ "embeddingProvider": "openai" }
|
|
516
|
-
```
|
|
593
|
+
Set the provider in `.opencode/codebase-index.json`:
|
|
517
594
|
|
|
518
|
-
**Google**
|
|
519
|
-
```bash
|
|
520
|
-
export GOOGLE_API_KEY=...
|
|
521
|
-
```
|
|
522
595
|
```json
|
|
523
|
-
{ "embeddingProvider": "
|
|
596
|
+
{ "embeddingProvider": "ollama" }
|
|
524
597
|
```
|
|
525
598
|
|
|
526
|
-
|
|
527
|
-
No setup needed if you have an active Copilot subscription.
|
|
528
|
-
```json
|
|
529
|
-
{ "embeddingProvider": "github-copilot" }
|
|
530
|
-
```
|
|
599
|
+
Credentials (if required) are read from environment variables (for example `OPENAI_API_KEY` or `GOOGLE_API_KEY`).
|
|
531
600
|
|
|
532
601
|
**Custom (OpenAI-compatible)**
|
|
533
602
|
Works with any server that implements the OpenAI `/v1/embeddings` API format (llama.cpp, vLLM, text-embeddings-inference, LiteLLM, etc.).
|
|
@@ -578,14 +647,33 @@ Be aware of these characteristics:
|
|
|
578
647
|
|
|
579
648
|
## š¤ Contributing
|
|
580
649
|
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
650
|
+
For contribution workflow, standards, and release-label requirements, see [`CONTRIBUTING.md`](./CONTRIBUTING.md).
|
|
651
|
+
|
|
652
|
+
If you want to add support for a new language, see [`docs/adding-language-support.md`](./docs/adding-language-support.md) for the full Rust + TypeScript checklist.
|
|
653
|
+
|
|
654
|
+
Quick path:
|
|
655
|
+
|
|
656
|
+
1. Fork + branch
|
|
657
|
+
2. Implement + tests
|
|
658
|
+
3. Run checks: `npm run build && npm run typecheck && npm run lint && npm run test:run`
|
|
659
|
+
4. Open PR with a release category label
|
|
660
|
+
|
|
661
|
+
### Release process (structured + complete notes)
|
|
662
|
+
|
|
663
|
+
To ensure release notes reflect all merged work, this repo uses a draft-release workflow.
|
|
664
|
+
|
|
665
|
+
1. **Label every PR** with at least one semantic label:
|
|
666
|
+
- `feature`, `bug`, `performance`, `documentation`, `dependencies`, `refactor`, `test`, `chore`
|
|
667
|
+
- and (when relevant) `semver:major`, `semver:minor`, or `semver:patch`
|
|
668
|
+
- PRs are validated by CI (`Release Label Check`) and fail if no release category label is present
|
|
669
|
+
2. **Let Release Drafter build the draft notes** automatically from merged PRs on `main`.
|
|
670
|
+
3. **Before publishing**:
|
|
671
|
+
- copy/finalize relevant highlights into `CHANGELOG.md`
|
|
672
|
+
- bump `package.json` version
|
|
673
|
+
- run: `npm run build && npm run typecheck && npm run lint && npm run test:run`
|
|
674
|
+
4. **Publish release** from the draft (or via `gh release create` after reviewing draft content).
|
|
587
675
|
|
|
588
|
-
|
|
676
|
+
PRs labeled `skip-changelog` are intentionally excluded from release notes.
|
|
589
677
|
|
|
590
678
|
### Project Structure
|
|
591
679
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Find where a symbol is defined in the codebase
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Find the authoritative definition of a symbol in the codebase.
|
|
6
|
+
|
|
7
|
+
User input: $ARGUMENTS
|
|
8
|
+
|
|
9
|
+
The input is a symbol name or description of what to find the definition of.
|
|
10
|
+
|
|
11
|
+
Look for optional parameters:
|
|
12
|
+
- `limit=N` or "top N" ā set limit
|
|
13
|
+
- `dir=X` or "in folder X" ā set directory filter
|
|
14
|
+
- File extensions like ".ts", ".py" ā set fileType
|
|
15
|
+
|
|
16
|
+
Call `implementation_lookup` with the parsed arguments.
|
|
17
|
+
|
|
18
|
+
Examples:
|
|
19
|
+
- `/definition validateToken` ā query="validateToken"
|
|
20
|
+
- `/definition payment handler` ā query="payment handler"
|
|
21
|
+
- `/definition createSystem dir=packages/react` ā query="createSystem", directory="packages/react"
|
|
22
|
+
|
|
23
|
+
This prioritizes real implementation files over tests, docs, and examples.
|
|
24
|
+
If no definition is found, suggest using `codebase_search` for broader discovery.
|