You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Revise context-engine skill documentation across .codex/ and skills/ to make `search` the recommended/primary entrypoint, add guidance to always use `search` first, and show example auto-routing. Expand and clarify tool docs: symbol_graph query types (callers, callees, definition, importers), optional graph_query capabilities and fallbacks, new admin/diagnostics commands, error fallbacks, and session/workspace recommendations. Replace many repo_search examples with search, streamline index/workspace tooling sections (remove some qdrant index instructions), and add best practices (TOON format, multi-query patterns, commit-history predictions). Minor formatting and example updates throughout for clarity and consistency.
Copy file name to clipboardExpand all lines: .codex/skills/context-engine/SKILL.md
+46-18Lines changed: 46 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,49 +7,64 @@ description: Hybrid semantic/lexical code search with neural reranking via MCP t
7
7
8
8
Hybrid vector search (semantic + lexical) with neural reranking for codebase retrieval.
9
9
10
+
> **IMPORTANT: Always use `search` as your FIRST tool for ANY code exploration, lookup, or question.** It auto-detects intent and routes to the best specialized tool. Only use `repo_search`, `symbol_graph`, or other tools directly when you need specific parameters or features that `search` does not expose (cross-repo, memory, admin). When in doubt, use `search`.
11
+
10
12
## Core Decision Tree
11
13
12
14
```
13
15
Need to find code?
14
16
├── UNSURE / GENERAL QUERY → search (RECOMMENDED DEFAULT)
15
-
│ └── Auto-routes to the best tool based on query intent
17
+
│ └── Auto-routes to best tool based on query intent
Query types: `callers`, `callees`, `definition`, `importers`. Use `depth=2` for multi-hop. Falls back to semantic search if no graph hits. Results include ~500-char source snippets.
65
+
66
+
**graph_query** (OPTIONAL -- only if NEO4J_GRAPH=1 or MEMGRAPH_GRAPH=1):
67
+
Extra query types: `transitive_callers`, `transitive_callees`, `impact`, `dependencies`, `cycles`. If not in your tool list, use `symbol_graph` instead.
53
68
54
69
**context_answer** - LLM-generated explanation with citations:
55
70
```json
@@ -82,7 +97,10 @@ Use `depth=2` for multi-hop (callers of callers).
@@ -92,13 +110,23 @@ Use `depth=2` for multi-hop (callers of callers).
92
110
93
111
## Best Practices
94
112
95
-
1.**Use `search` as your default tool** - Auto-routes to the best specialized tool
96
-
2.**NEVER use grep/cat/find for code exploration** - Use MCP tools instead
97
-
3.**Start with `symbol_graph`** for all relationship queries
98
-
4.**Use multi-query** for complex searches: pass 2-3 variations
113
+
1.**ALWAYS start with `search`** - It is your PRIMARY tool. Auto-routes to the best specialized tool. Only fall back to specific tools when you need params `search` doesn't expose.
114
+
2.**NEVER use grep/cat/find for code exploration** - Use MCP tools instead. Only acceptable use: confirming exact literal strings.
115
+
3.**Start with `symbol_graph`** for all relationship queries - always available, no Neo4j needed
116
+
4.**Use multi-query** for complex searches: pass 2-3 variations as a list
99
117
5.**Two-phase search**: Discovery (`limit=3, compact=true`) → Deep dive (`limit=8, include_snippet=true`)
100
118
6.**Fire parallel calls** - Multiple independent `search`, `repo_search`, `symbol_graph` in one message
- Supports `language`, `under`, `depth`, and `output_format` like other tools.
314
327
- Use `depth=2` or `depth=3` for multi-hop traversals (callers of callers).
315
328
- If there are no graph hits, it falls back to semantic search.
316
329
-**Note**: Results are "hydrated" with ~500-char source snippets for immediate context.
317
330
318
331
**graph_query** - Advanced graph traversals (OPTIONAL — ONLY available when NEO4J_GRAPH=1 or MEMGRAPH_GRAPH=1):
319
332
320
-
> **If `graph_query` is not in your MCP tool list, it is NOT enabled. Use `symbol_graph` for all graph queries instead. Do NOT error or warn about missing Neo4j.**
333
+
> **If `graph_query` is not in your MCP tool list, it is NOT enabled. Use `symbol_graph` for all graph queries instead. Do NOT error or warn about missing Neo4j/Memgraph.**
Use `cross_repo_search` when you need breadth across repos. Use `repo_search` with explicit `collection` when you need depth in one repo.
524
+
Use `cross_repo_search` when you need breadth across repos. Use `search` (or `repo_search`) with explicit `collection` when you need depth in one repo.
537
525
538
526
### Multi-Repo Anti-Patterns
539
527
-**DON'T** search both repos with the same vague query (noisy, confusing)
540
-
-**DON'T** assume the default collection is correct — verify with `collection_map`
528
+
-**DON'T** assume the default collection is correct — verify with `qdrant_list`
541
529
-**DON'T** forget to "cd back" after cross-referencing another repo
542
530
-**DO** extract exact strings (route paths, event names, type names) as search anchors
543
531
@@ -578,7 +566,7 @@ Tools return structured errors, typically via `error` field and sometimes `ok: f
578
566
```
579
567
580
568
Common issues:
581
-
-**Collection not found** - Run `qdrant_index_root` to create the index
569
+
-**Collection not found** - Verify collection with `qdrant_list` or check that the codebase has been indexed
582
570
-**Empty results** - Broaden query, check filters, verify index exists
583
571
-**Timeout on rerank** - Set `rerank_enabled: false` or reduce `limit`
584
572
@@ -592,8 +580,6 @@ Common issues:
592
580
6.**Include snippets** - Set `include_snippet: true` to see code context in results
593
581
7.**Store decisions** - Use `memory_store` to save architectural decisions and context for later
594
582
8.**Check index health** - Run `qdrant_status` if searches return unexpected results
595
-
9.**Prune after refactors** - Run `qdrant_prune` after moving/deleting files
596
-
10.**Index before search** - Always run `qdrant_index_root` on first use or after cloning a repo
597
583
11.**Use pattern_search for structural matching** - When looking for code with similar control flow (retry loops, error handling), use `pattern_search` instead of `repo_search` (if enabled)
598
584
12.**Describe patterns in natural language** - `pattern_search` understands "retry with backoff" just as well as actual code examples (if enabled)
599
585
13.**Fire independent searches in parallel** - Call multiple `search`, `repo_search`, `symbol_graph`, etc. in the same message block for 2-3x speedup
0 commit comments