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
Copy file name to clipboardExpand all lines: AGENTS.md
+8-169Lines changed: 8 additions & 169 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,174 +73,13 @@ something, you must find the answer using the query tool.
73
73
74
74
Your most important tool is the local AI knowledge base. To use it, call the `query_documents` tool.
75
75
76
-
- The `query` parameter is your natural language search query.
77
-
- The `type` parameter is optional and allows you to filter results. Supported types are: `all` (default), `blog`, `example`, `guide`, `release`, `src` and `ticket`.
78
-
79
-
### How to Interpret Query Results
80
-
81
-
The query tool will return a ranked list of source file paths based on relevance. The output will look like this:
82
-
```
83
-
Most relevant source files (by weighted score):
84
-
- /path/to/relevant/file1.mjs (Score: 350)
85
-
- /path/to/relevant/file2.md (Score: 210)
86
-
- /path/to/relevant/file3.mjs (Score: 150)
87
-
88
-
Top result: /path/to/relevant/file1.mjs
89
-
```
90
-
You should always start by reading the top-ranked file. After reading the top result, scan the next 5-10 files in the list,
91
-
paying attention to the file types. Since `.md` guides often provide valuable conceptual context that `.mjs` source
92
-
files may lack, it is highly recommended to read the most relevant guide file from the top results, even if it is not
93
-
the #1 ranked file. A good heuristic is to aim to read the top 1-2 source files and the top 1-2 relevant guides to get
94
-
a balanced understanding.
95
-
96
-
-**Prioritize Content Types:** Always prioritize `guide` and `src` results for implementation details and current best
97
-
practices. Treat `blog` results as sources for historical and conceptual context; their code examples may be outdated.
98
-
99
-
### Query Strategies
100
-
101
-
Do not assume you will get the perfect answer on the first try. Use a systematic approach to querying.
102
-
103
-
#### 1. Strategy for High-Level Conceptual Questions
104
-
105
-
When asked a broad, high-level, or conceptual question (e.g., "what makes this framework stand out?"), you must use a
106
-
more guided approach to find the most important "pillar content".
107
-
108
-
1.**Consult the Information Architecture:** Before formulating a query, read the file `learn/tree.json`.
109
-
This file defines the intended structure of the learning content.
110
-
2.**Identify Key Concepts:** Use the top-level categories in the tree (e.g., "Benefits", "Fundamentals") to identify
111
-
the most important concepts.
112
-
3.**Formulate Initial Query:** Base your first query on these high-level concepts to ensure you start your exploration
113
-
from the project's intended information architecture.
114
-
115
-
#### 2. Discovery Pattern (Broad to Narrow)
116
-
117
-
When you need to understand a new concept or feature area:
118
-
1.**Query Foundational Concepts First:** Always begin a broad inquiry by querying for foundational terms like
119
-
`"benefits"`, `"concept"`, `"architecture"`, and `"vision"`. Prioritize reading files from the `learn/benefits`
120
-
directory or top-level `README.md` and `.github/*.md` files if they appear in these initial results.
121
-
2.**Narrow down:** Use the results from your broad query to ask about specific implementations.
**Strategy:** If a broad query returns too many source files and not enough conceptual documents, re-run the query with
141
-
`-t guide`. Conversely, if you have read the guides but need to see the actual implementation,
142
-
re-run with `-t src` or `-t example`.
143
-
144
-
#### 4. Knowledge Base Enhancement Strategy: Contributing Queryable, Intent-Driven Comments
145
-
146
-
When analyzing source files (e.g., during step 2 of the Development Workflow), if you encounter code that lacks
147
-
sufficient intent-driven comments or clear documentation, immediately enhance it with meaningful, structured
148
-
documentation before proceeding with your implementation. The goal is not just to explain the code, but to make it
149
-
more discoverable for future queries.
150
-
151
-
1.**Analyze the Implementation**: Study the source code carefully to understand:
152
-
- What the code does (mechanics).
153
-
- Why it does it (intent).
154
-
- How it fits into the broader architecture.
155
-
- What patterns it follows.
156
-
157
-
2.**Generate Structured, Intent-Driven Comments**: For class-level comments, add meaningful JSDoc tags that explain:
158
-
-`@summary`: A concise, one-sentence explanation of the class's purpose.
159
-
- A detailed description of the class's role, responsibilities, and architectural context.
160
-
-`@see`: Links to other relevant classes, guides, or examples.
161
-
162
-
3.**Anticipate Future Queries**: After documenting the class's purpose, think like a user. What broad concepts or
163
-
keywords would someone search for if this class were the answer? Explicitly include these concepts in the
164
-
class description. This acts as a "semantic signpost" that makes the class more discoverable. For example, a
165
-
component that manages state should mention concepts like `state management`, `reactivity`, or `data binding`.
166
-
167
-
4.**Enhance for Future Sessions**: Your rich, structured comments become part of the knowledge base, helping future
168
-
AI sessions understand the code's purpose and context more effectively and improving query results for everyone.
169
-
170
-
**Example of a Good Query-Driven Class Comment:**
171
-
```javascript
172
-
/**
173
-
* @summary Manages a tabbed interface with a header toolbar and a content body.
174
-
*
175
-
* This class acts as the main orchestrator for a tabbed view. It uses a flexbox layout to arrange its
176
-
* two primary children: a `Neo.tab.header.Toolbar` for the tab buttons and a `Neo.tab.BodyContainer`.
177
-
* The `BodyContainer` is configured with a `card` layout. To keep the live DOM tree minimal, this
178
-
* layout defaults to removing the DOM of inactive tabs, while keeping the component instances and
179
-
* their VDOM trees in memory for fast switching. This behavior can be changed via the `removeInactiveCards` config.
180
-
*
181
-
* This class is a key example of the framework's **push-based reactivity** model and demonstrates concepts like
182
-
* **component composition**, **event handling**, and **data binding**.
183
-
*
184
-
* @seeNeo.examples.tab.Container
185
-
* @class Neo.tab.Container
186
-
* @extendsNeo.container.Base
187
-
*/
188
-
classTabContainerextendsContainer {
189
-
// Implementation details...
190
-
}
191
-
```
192
-
193
-
#### 5. The Two-Stage Query Protocol: Knowledge and Memory
194
-
195
-
To make fully informed decisions, you must leverage both the project's technical knowledge base and your own historical memory. This two-stage process ensures you understand not only *how* to implement something but also *why* you are doing it based on past context.
196
-
197
-
1.**Stage 1: Query for Knowledge (`query_documents`)**
198
-
-**Purpose:** To understand the technical "how."
199
-
-**Action:** Use the `query_documents` tool to find relevant source code, guides, and examples from the framework's knowledge base. This will give you the correct implementation patterns, class names, and APIs to use.
200
-
201
-
2.**Stage 2: Query for Memory (`query_raw_memories`)**
202
-
-**Purpose:** To understand the historical "why."
203
-
-**Action:** After you have the technical context, use the `query_raw_memories` tool to search your own memory. This is crucial for understanding:
204
-
-**Past Decisions:** Why was a feature built a certain way?
205
-
-**User Requirements:** What were the specific needs or constraints mentioned in previous conversations?
206
-
-**Avoided Pitfalls:** Have you tried a similar approach before that failed?
207
-
208
-
**Synthesizing Information:**
209
-
Your final plan or response should be a synthesis of both queries. Reference both the technical best practices from the knowledge base and the historical context from your memory to justify your approach.
210
-
211
-
#### 6. When Queries Fail to Find Information
212
-
213
-
If you cannot find relevant information after systematic querying (including using the Knowledge Base Enhancement Strategy):
214
-
215
-
1.**Try alternative query terms**: Use synonyms, broader concepts, or different technical terminology
216
-
2.**Query for related concepts**: Look for similar patterns or analogous implementations
217
-
3.**Check fundamental concepts**: Ensure you understand the basic architecture before seeking specific solutions
218
-
219
-
If queries consistently return no relevant results for your task:
220
-
221
-
**STOP implementation and document the gap:**
222
-
- Clearly describe what you were trying to accomplish
223
-
- List the queries you attempted
224
-
- Explain why existing results were insufficient
225
-
- Suggest what type of documentation would help (guide, example, architectural explanation)
226
-
227
-
**Example escalation:**
228
-
```
229
-
Unable to find information about: "implementing custom layout managers in Neo.mjs"
230
-
231
-
Queries attempted:
232
-
- "custom layout manager"
233
-
- "layout implementation patterns"
234
-
- "extending layout base class"
235
-
236
-
Gap identified: Need learning guide covering layout manager development patterns,
237
-
lifecycle methods, and integration with container components.
238
-
```
239
-
240
-
**Do NOT:**
241
-
- Implement solutions based on incomplete information
242
-
- Use patterns from other frameworks inappropriately
243
-
- Create code based on assumptions or training data
76
+
**Critical**: The `query_documents` tool is self-documenting. Read its description carefully for:
77
+
- How to interpret results
78
+
- Query strategies for different scenarios
79
+
- Content type filtering
80
+
- Handling edge cases
81
+
82
+
The tool contains complete guidance on effective querying. Follow its documented patterns.
244
83
245
84
## 4. Development Workflow: Triage and Gating Protocol
246
85
@@ -259,7 +98,7 @@ First, classify the user's request into one of two categories:
259
98
**Note:** A conceptual discussion can become an actionable task. The moment the intent shifts from "what if..." to
260
99
"let's do...", you must treat it as a new actionable request and start this protocol from Step 1.
261
100
262
-
### 🚧 Step 2: The “Ticket-First” Gate
101
+
### Step 2: The “Ticket-First” Gate
263
102
264
103
For any actionable request that requires modifying the repository, you **MUST** ensure a GitHub issue exists for the task *before* you begin implementation. This is a critical gating protocol.
0 commit comments