Skip to content

Commit d9e30ea

Browse files
committed
refactor: improve context retrieval instructions and clarify tool usage
1 parent 375ed52 commit d9e30ea

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

.agent/rules/context.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22
trigger: always_on
33
---
44

5-
Always call the tool `retrieve_context_for_query` before answering to determine if sufficient local context is available.
6-
Use `task_type=auto`, `max_tokens=3000`, `limit_entities=3`, `expand_deps=true`.
7-
8-
In addition to context retrieval, you have access to specialized KnowCode tools:
5+
to determine if sufficient local context is available.
6+
When the user submits a query, use the following sources for generating the required context -
7+
1. Check the context window of the current chat session. If you need more context,
8+
2. Use the knowcode mcp tool `retrieve_context_for_query` with the following arguments: `task_type=auto`, `max_tokens=3000`, `limit_entities=3`, `expand_deps=true`.
9+
3. Consider using the other knowcode mcp tools (listed below) if relevant:
910
- `search_codebase`: Use to find code entities (functions, classes, modules) by name or pattern.
1011
- `get_entity_context`: Use to get detailed context for a specific entity (source code, docstrings, callers/callees).
1112
- `trace_calls`: Use to trace the call graph (callers or callees) for an entity up to N hops.
1213

1314
If `sufficiency_score >= 0.88` and `context_text` is non-empty, you may answer from the retrieved context alone to maximize efficiency.
14-
If more information is needed, or if the score is low, use the other KnowCode tools or proceed with a full LLM answer.
15+
If more information is needed, or if the score is low, inform the user that you do not have a satisfactory answer to the query and stop.
16+
17+
DO NOT use the external frontier LLMs (e.g. Gemini 3 Flash, Gemini 3 Pro, Claude Sonnet 4.5, Claud Opus 4.5, etc.) at all.

0 commit comments

Comments
 (0)