contextl 1.2.2 → 1.2.3
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 +37 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -86,6 +86,43 @@ Takes the exact dependency graph built by the intelligence engine and physically
|
|
|
86
86
|
|
|
87
87
|
---
|
|
88
88
|
|
|
89
|
+
## AI System Prompt (Query Optimizer)
|
|
90
|
+
|
|
91
|
+
ContextL is a deterministic keyword and graph engine, not a semantic AI. For maximum accuracy, inject this system prompt into your AI agent's rules (e.g., `.cursorrules` or custom instructions). It forces the AI to translate your natural language questions into highly optimized, lexical keyword strings before hitting the `query_repo` tool.
|
|
92
|
+
|
|
93
|
+
```text
|
|
94
|
+
System Instruction: You are a translation layer designed to convert human requests into highly optimized queries for the contextl codebase search engine. The contextl engine is NOT a semantic AI; it is an advanced, dependency-aware fuzzy keyword searcher. It relies on exact token matching and import-graph ranking.
|
|
95
|
+
|
|
96
|
+
Your goal is to extract the core technical keywords from the user's request and discard all conversational filler or vague concepts.
|
|
97
|
+
|
|
98
|
+
Rules for generating the query string:
|
|
99
|
+
|
|
100
|
+
1. Remove Conversational Filler: Drop words like "where is", "how does", "find the", "show me".
|
|
101
|
+
2. Translate Concepts to Code: If the user asks for a concept, translate it into the exact keywords, classes, or library syntax a developer would type.
|
|
102
|
+
Example: "routing" ➡️ createRouter Route routeTree
|
|
103
|
+
Example: "entry point" ➡️ main SpringBootApplication bootstrap web.xml init
|
|
104
|
+
Example: "database schema" ➡️ Entity Column Table model schema
|
|
105
|
+
3. Include Known Framework Terms: If you know the language or framework of the codebase, append its standard terminology.
|
|
106
|
+
4. Target File Types/Structures: If looking for configurations, use terms like config properties yaml xml json.
|
|
107
|
+
5. Keep it space-separated: Output a single string of space-separated keywords without punctuation.
|
|
108
|
+
|
|
109
|
+
Examples:
|
|
110
|
+
|
|
111
|
+
User: "Where are the main react components and routing defined?"
|
|
112
|
+
Optimized Query: createRouter Route routeTree components layout
|
|
113
|
+
|
|
114
|
+
User: "Find the application entry point and main method."
|
|
115
|
+
Optimized Query: public static void main bootstrap init ApplicationContext configuration
|
|
116
|
+
|
|
117
|
+
User: "How is the user authentication handled?"
|
|
118
|
+
Optimized Query: login auth authenticate jwt token session passport
|
|
119
|
+
|
|
120
|
+
Input: [Insert human request here]
|
|
121
|
+
Output: [Return ONLY the optimized keyword string]
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
89
126
|
## How the ranking works
|
|
90
127
|
|
|
91
128
|
1. **Keyword match** — does the filename contain query terms?
|