Skip to content

Commit 76fa445

Browse files
committed
#7220 query results interpretations
1 parent e22dfad commit 76fa445

1 file changed

Lines changed: 56 additions & 30 deletions

File tree

AGENTS.md

Lines changed: 56 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,59 @@ At the beginning of every new session, you **MUST** perform the following steps
1818

1919
This gives the agent a top-down understanding: from the overall structure down to the core implementation details.
2020

21-
## 3. Understanding the Knowledge Base
22-
23-
To get a high-level overview of the available documentation and learning resources, you can read the file `learn/README.md`. This file explains the structure of the learning materials and the key concepts of the neo.mjs framework.
24-
25-
However, for finding specific information, always prefer using the `ai:query` command.
26-
27-
## 4. The Anti-Hallucination Policy
28-
29-
You must **NEVER** make guesses, assumptions, or "hallucinate" answers about the neo.mjs framework. If you do not know something, you must find the answer using the tools available within this repository.
30-
31-
## 5. The Primary Tool: The Knowledge Base Query API
32-
33-
Your most important tool is the local AI knowledge base. You **MUST** use it frequently to answer questions, understand concepts, and find relevant code.
34-
35-
To use the tool, execute the following shell command:
36-
37-
`npm run ai:query -- -q "Your question here"`
38-
39-
### Query Examples:
40-
41-
* To understand how reactivity works:
42-
`npm run ai:query -- -q "Tell me about reactivity"`
43-
44-
* To find information about the `Component` class:
45-
`npm run ai:query -- -q "What is the purpose of Neo.component.Base?"`
46-
47-
* To learn about the framework's build scripts:
48-
`npm run ai:query -- -q "How do I build the project?"`
49-
50-
Rely on this tool as your primary method for information gathering. It is your window into the project's "current truth".
21+
## 3. The Knowledge Base: Your Primary Source of Truth
22+
23+
Your primary directive is to rely on the project's internal knowledge base, not your pre-existing training data.
24+
25+
### The Anti-Hallucination Policy
26+
You must **NEVER** make guesses, assumptions, or "hallucinate" answers about the neo.mjs framework. If you do not know something, you must find the answer using the query tool.
27+
28+
### The Query Command
29+
Your most important tool is the local AI knowledge base. To use it, execute the following shell command:
30+
```bash
31+
npm run ai:query -- -q "Your question here"
32+
```
33+
34+
### How to Interpret Query Results
35+
The query tool will return a ranked list of source file paths based on relevance. The output will look like this:
36+
```
37+
Most relevant source files (by weighted score):
38+
- /path/to/relevant/file1.mjs (Score: 350)
39+
- /path/to/relevant/file2.md (Score: 210)
40+
- /path/to/relevant/file3.mjs (Score: 150)
41+
42+
Top result: /path/to/relevant/file1.mjs
43+
```
44+
You should always start by reading the top-ranked file. If it does not contain the answer, proceed to the next 2-3 files.
45+
46+
### Query Strategies
47+
Do not assume you will get the perfect answer on the first try. Use a systematic approach to querying.
48+
49+
#### 1. Discovery Pattern (Broad to Narrow)
50+
When you need to understand a new concept or feature area:
51+
1. **Start broad:** Use conceptual queries to get a high-level overview.
52+
- `npm run ai:query -- -q "framework architecture"`
53+
- `npm run ai:query -- -q "how does the config system work?"`
54+
2. **Narrow down:** Use the results from your broad query to ask about specific implementations.
55+
- `npm run ai:query -- -q "Button component examples"`
56+
- `npm run ai:query -- -q "what is Neo.component.Base?"`
57+
3. **Find related patterns:** Look for common conventions and approaches.
58+
- `npm run ai:query -- -q "form validation patterns"`
59+
- `npm run ai:query -- -q "how are stores implemented?"`
60+
61+
#### 2. Implementation Pattern (Query Before Coding)
62+
Before writing or modifying any code, **always** query the knowledge base first to:
63+
- Look for existing similar implementations.
64+
- Understand framework conventions for the task you are performing.
65+
- Identify common patterns used in the relevant area of the codebase.
66+
67+
### Handling Failed Queries
68+
If a query fails or returns no results, do not guess. Rephrase your query. Try to be more specific or use different keywords based on the knowledge you've gathered from reading the core files.
69+
70+
## 4. Development Workflow
71+
Integrate the query tool into your development process.
72+
73+
1. **Understand the Task & Query:** For any new task (e.g., "implement a new component," "fix a bug in the grid"), start by using the **Discovery Pattern** to understand the context and find relevant files.
74+
2. **Analyze Existing Code:** Read the top 1-3 files returned by your queries. Pay close attention to the code style, architecture, and existing patterns. Your goal is to make your changes fit in seamlessly.
75+
3. **Implement Changes:** Write or modify the code, strictly adhering to the conventions you observed.
76+
4. **Verify:** After making changes, run any relevant verification tools, such as tests or linting scripts, to ensure your changes are correct and meet the project's standards.

0 commit comments

Comments
 (0)