docs(AGENTS): update code exploration instructions for clarity and mandatory steps
This commit is contained in:
1 parent
fb40ec9d99
commit
e9f54420ce
1 file changed
+32
-8
@@ -21,14 +21,38 @@ A DeepSeek Harness plugin for context insight, actions, and management.
|
||||
- Example plugins:
|
||||
- Available on GitHub topic `dsh-plugin`: https://github.com/topics/dsh-plugin
|
||||
|
||||
## Exploring code
|
||||
- ALWAYS consider `codegraph` and `pnpm dlx @colbymchenry/codegraph` for exploring the code, planning, investigating.
|
||||
- `codegraph` helps to search and explore the code graph of the dsh and plugin, which is very useful for understanding the code structure and dependencies.
|
||||
- Run `pnpm dlx @colbymchenry/codegraph explore <Query or KeyWords>` to explore the code graph of the dsh and plugin, in the corresponding path of the source code folder.
|
||||
- `pnpm dlx @colbymchenry/codegraph explore --path some-path --max-files 1000 "What's Context Stats?"`
|
||||
- `pnpm dlx @colbymchenry/codegraph query --path some-path --limit 10000 "FileActivity"`
|
||||
- Run `pnpm dlx @colbymchenry/codegraph sync` to sync the code graph with the latest code changes, before running the query command.
|
||||
- Run `pnpm dlx @colbymchenry/codegraph init` to initialize the code graph for the first time, if the code graph is not initialized yet as no `./.codegraph` folder present.
|
||||
## Code Exploration Protocol (Mandatory)
|
||||
|
||||
**Prerequisite:** The code graph in the current working directory has already been initialized (`.codegraph` directory exists). **Do not run `init` again.** Use it directly.
|
||||
|
||||
### Mandatory Pre-step
|
||||
Before any code analysis, exploration, or planning, you **MUST** first use `codegraph` to understand the codebase structure and dependencies. **This step is non-negotiable and cannot be skipped.**
|
||||
### Usage
|
||||
1. **Explore code structure**
|
||||
```bash
|
||||
pnpm dlx @colbymchenry/codegraph explore --max-files 1000 "<Query or Keywords>"
|
||||
```
|
||||
Example:
|
||||
```bash
|
||||
pnpm dlx @colbymchenry/codegraph explore --max-files 1000 "What's Context Stats?"
|
||||
```
|
||||
2. **Query specific symbols**
|
||||
```bash
|
||||
pnpm dlx @colbymchenry/codegraph query --limit 10000 "<SymbolName>"
|
||||
```
|
||||
Example:
|
||||
```bash
|
||||
pnpm dlx @colbymchenry/codegraph query --limit 10000 "FileActivity"
|
||||
```
|
||||
3. **Sync latest changes (only if code has been modified)**
|
||||
```bash
|
||||
pnpm dlx @colbymchenry/codegraph sync
|
||||
```
|
||||
|
||||
### Execution Order
|
||||
1. Run `codegraph explore` or `codegraph query` to gather code context
|
||||
2. Analyze, plan, or respond based on the returned results
|
||||
3. Run `sync` **only if** the codebase has changed since the last query
|
||||
|
||||
## Coding
|
||||
- Always consider the minimal change and the most performance efficient implementation.
|
||||
|
||||
Reference in new issue
Block a user