code-graph-llm 2.1.1 → 2.1.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/AGENT_RULES.md +1 -1
- package/README.md +46 -1
- package/package.json +1 -1
package/AGENT_RULES.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# AGENT OPERATIONAL PROTOCOL (STRICT)
|
|
2
2
|
> This protocol is MANDATORY for all LLM agents. Failure to update memory is a failure of the task.
|
|
3
3
|
## 🧠 THE REFLECTION CYCLE
|
|
4
|
-
Every execution
|
|
4
|
+
Every execution MUST follow this cycle:
|
|
5
5
|
1. **PRE-TASK:** Read \`PROJECT_REFLECTIONS.md\` to identify existing pitfalls.
|
|
6
6
|
2. **EXECUTION:** Monitor for "Learned Moments" (failures, unexpected behaviors, or non-obvious fixes).
|
|
7
7
|
3. **POST-TASK:** If a significant lesson was learned, run \`code-graph reflect <CAT> <LESSON>\`.
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# CODE-GRAPH (v2.1.
|
|
1
|
+
# CODE-GRAPH (v2.1.3)
|
|
2
2
|
|
|
3
3
|
A language-agnostic, ultra-compact codebase mapper and **agent memory system** designed specifically for LLM agents. It optimizes context and token usage while enabling agents to learn from their own mistakes across sessions.
|
|
4
4
|
|
|
@@ -68,6 +68,51 @@ The `llm-code-graph.md` file provides a high-level map and structural graph for
|
|
|
68
68
|
### 3. Example System Prompt
|
|
69
69
|
> "Before acting, read `llm-code-graph.md`. Follow the protocol in `AGENT_RULES.md`. If you encounter a bug or an environment quirk, use the `code-graph reflect` tool to record the lesson in `PROJECT_REFLECTIONS.md`."
|
|
70
70
|
|
|
71
|
+
## 🤖 Agent-Specific Integration
|
|
72
|
+
|
|
73
|
+
Maximize efficiency by pointing your agent directly to the `llm-code-graph.md` and `AGENT_RULES.md` files.
|
|
74
|
+
|
|
75
|
+
### Roo Code (Cline)
|
|
76
|
+
Add this to your `.clinerules` file:
|
|
77
|
+
```markdown
|
|
78
|
+
Before starting any task:
|
|
79
|
+
1. Read `llm-code-graph.md` for project structure.
|
|
80
|
+
2. Read `AGENT_RULES.md` for operational protocol.
|
|
81
|
+
3. Read `PROJECT_REFLECTIONS.md` for past lessons.
|
|
82
|
+
4. **MANDATORY:** After any fix or learning event, you MUST update `PROJECT_REFLECTIONS.md` using `code-graph reflect`.
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Cursor / Windsurf
|
|
86
|
+
Add to `.cursorrules` or `.windsurfrules`:
|
|
87
|
+
```text
|
|
88
|
+
Always reference `llm-code-graph.md` before editing. You are REQUIRED to follow the "Reflection Cycle" in `AGENT_RULES.md`. If a task involves a non-obvious fix or an environment quirk, you MUST record it in `PROJECT_REFLECTIONS.md` immediately.
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### GitHub Copilot
|
|
92
|
+
Add to `.github/copilot-instructions.md`:
|
|
93
|
+
```markdown
|
|
94
|
+
When answering questions about this codebase, prioritize the mapping data in `llm-code-graph.md`. You MUST suggest or perform a reflection entry for `PROJECT_REFLECTIONS.md` after every bug fix or identified pitfall.
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Gemini CLI
|
|
98
|
+
Create a `GEMINI.md` file (if not already using `AGENT_RULES.md`):
|
|
99
|
+
```markdown
|
|
100
|
+
- Always read `llm-code-graph.md` as the primary source of truth.
|
|
101
|
+
- **CRITICAL:** Use `run_shell_command` to execute `code-graph reflect` after any bug fix or discovered quirk. Memory persistence is a mandatory part of every task completion.
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### OpenCode / OpenDevin / Aider
|
|
105
|
+
In your project instructions or session startup:
|
|
106
|
+
> "Read `llm-code-graph.md` for a high-level overview. You are FORCED to record any project-specific quirk or non-obvious lesson using `code-graph reflect <CAT> <LESSON>` before finishing a task."
|
|
107
|
+
|
|
108
|
+
### Codex / GPT-Engineer / AutoGPT
|
|
109
|
+
Add to your project prompt or `prompts.md`:
|
|
110
|
+
> "Use `llm-code-graph.md` to navigate. Strictly adhere to the reflection cycle in `AGENT_RULES.md`. You MUST persist project memory by updating `PROJECT_REFLECTIONS.md` on every failure or learned moment."
|
|
111
|
+
|
|
112
|
+
### Generic Agent (System Prompt)
|
|
113
|
+
For any other agent, add this to your system instructions:
|
|
114
|
+
> "This project uses `code-graph-llm` for context management. Always consult `llm-code-graph.md`. You ARE REQUIRED to persist new knowledge about the environment or logic using the `code-graph reflect` tool. Failure to update memory is a failure of the task."
|
|
115
|
+
|
|
71
116
|
## How it works
|
|
72
117
|
1. **File Scanning:** Recursively walks the directory, ignoring patterns in `.gitignore`.
|
|
73
118
|
2. **Context Extraction:** Scans for classes, functions, and variables while ignoring matches in comments.
|