superlocalmemory 4.1.22 → 4.1.24

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.
Files changed (172) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +145 -0
  3. package/README.md +72 -46
  4. package/antigravity-plugin/_GENERATED.md +33 -0
  5. package/antigravity-plugin/agents/slm-governance-advisor.md +78 -0
  6. package/antigravity-plugin/agents/slm-loop-runner.md +82 -0
  7. package/antigravity-plugin/agents/slm-memory-advisor.md +50 -0
  8. package/antigravity-plugin/agents/slm-optimize-advisor.md +44 -0
  9. package/antigravity-plugin/commands/slm-loop.md +33 -0
  10. package/antigravity-plugin/hooks/hooks.json +59 -0
  11. package/antigravity-plugin/hooks.json +42 -0
  12. package/antigravity-plugin/mcp_config.json +14 -0
  13. package/antigravity-plugin/plugin.json +25 -0
  14. package/antigravity-plugin/scripts/antigravity_hook_adapter.py +85 -0
  15. package/antigravity-plugin/skills/slm-bot-memory/SKILL.md +146 -0
  16. package/antigravity-plugin/skills/slm-cache/SKILL.md +147 -0
  17. package/antigravity-plugin/skills/slm-compress/SKILL.md +150 -0
  18. package/antigravity-plugin/skills/slm-getting-started-bot/SKILL.md +146 -0
  19. package/antigravity-plugin/skills/slm-governance/SKILL.md +221 -0
  20. package/antigravity-plugin/skills/slm-graph/SKILL.md +327 -0
  21. package/antigravity-plugin/skills/slm-loop/SKILL.md +153 -0
  22. package/antigravity-plugin/skills/slm-mesh/SKILL.md +287 -0
  23. package/antigravity-plugin/skills/slm-profile/SKILL.md +159 -0
  24. package/antigravity-plugin/skills/slm-recall/SKILL.md +430 -0
  25. package/antigravity-plugin/skills/slm-remember/SKILL.md +370 -0
  26. package/antigravity-plugin/skills/slm-scope/SKILL.md +183 -0
  27. package/antigravity-plugin/skills/slm-session/SKILL.md +291 -0
  28. package/antigravity-plugin/skills/slm-status/SKILL.md +185 -0
  29. package/antigravity-plugin/skills/slm-web-access/SKILL.md +93 -0
  30. package/codex-plugin/.claude-plugin/plugin.json +19 -0
  31. package/codex-plugin/.codex/config.toml +40 -0
  32. package/codex-plugin/.codex-plugin/plugin.json +43 -0
  33. package/codex-plugin/.mcp.json +16 -0
  34. package/codex-plugin/AGENTS.md +161 -0
  35. package/codex-plugin/README.md +205 -0
  36. package/codex-plugin/_GENERATED.md +52 -0
  37. package/codex-plugin/agents/slm-governance-advisor.md +78 -0
  38. package/codex-plugin/agents/slm-loop-runner.md +82 -0
  39. package/codex-plugin/agents/slm-memory-advisor.md +50 -0
  40. package/codex-plugin/agents/slm-optimize-advisor.md +44 -0
  41. package/codex-plugin/commands/slm-loop.md +33 -0
  42. package/codex-plugin/hooks/hooks.json +59 -0
  43. package/codex-plugin/scripts/ensure-venv.bat +108 -0
  44. package/codex-plugin/scripts/ensure-venv.sh +100 -0
  45. package/codex-plugin/scripts/slm-launch +55 -0
  46. package/codex-plugin/scripts/slm-launch.bat +30 -0
  47. package/codex-plugin/skills/slm-bot-memory/SKILL.md +146 -0
  48. package/codex-plugin/skills/slm-cache/SKILL.md +147 -0
  49. package/codex-plugin/skills/slm-compress/SKILL.md +150 -0
  50. package/codex-plugin/skills/slm-getting-started-bot/SKILL.md +146 -0
  51. package/codex-plugin/skills/slm-governance/SKILL.md +221 -0
  52. package/codex-plugin/skills/slm-graph/SKILL.md +327 -0
  53. package/codex-plugin/skills/slm-loop/SKILL.md +153 -0
  54. package/codex-plugin/skills/slm-mesh/SKILL.md +287 -0
  55. package/codex-plugin/skills/slm-profile/SKILL.md +159 -0
  56. package/codex-plugin/skills/slm-recall/SKILL.md +430 -0
  57. package/codex-plugin/skills/slm-remember/SKILL.md +370 -0
  58. package/codex-plugin/skills/slm-scope/SKILL.md +183 -0
  59. package/codex-plugin/skills/slm-session/SKILL.md +291 -0
  60. package/codex-plugin/skills/slm-status/SKILL.md +185 -0
  61. package/codex-plugin/skills/slm-web-access/SKILL.md +93 -0
  62. package/copilot-plugin/.github/agents/slm-governance-advisor.agent.md +80 -0
  63. package/copilot-plugin/.github/agents/slm-loop-runner.agent.md +84 -0
  64. package/copilot-plugin/.github/agents/slm-memory-advisor.agent.md +52 -0
  65. package/copilot-plugin/.github/agents/slm-optimize-advisor.agent.md +46 -0
  66. package/copilot-plugin/.github/copilot-instructions.md +52 -0
  67. package/copilot-plugin/.github/hooks/slm-hooks.json +44 -0
  68. package/copilot-plugin/.github/prompts/slm-bot-memory.prompt.md +147 -0
  69. package/copilot-plugin/.github/prompts/slm-cache.prompt.md +151 -0
  70. package/copilot-plugin/.github/prompts/slm-compress.prompt.md +154 -0
  71. package/copilot-plugin/.github/prompts/slm-getting-started-bot.prompt.md +147 -0
  72. package/copilot-plugin/.github/prompts/slm-governance.prompt.md +224 -0
  73. package/copilot-plugin/.github/prompts/slm-graph.prompt.md +322 -0
  74. package/copilot-plugin/.github/prompts/slm-loop.prompt.md +159 -0
  75. package/copilot-plugin/.github/prompts/slm-mesh.prompt.md +290 -0
  76. package/copilot-plugin/.github/prompts/slm-profile.prompt.md +155 -0
  77. package/copilot-plugin/.github/prompts/slm-recall.prompt.md +434 -0
  78. package/copilot-plugin/.github/prompts/slm-remember.prompt.md +375 -0
  79. package/copilot-plugin/.github/prompts/slm-scope.prompt.md +183 -0
  80. package/copilot-plugin/.github/prompts/slm-session.prompt.md +291 -0
  81. package/copilot-plugin/.github/prompts/slm-status.prompt.md +190 -0
  82. package/copilot-plugin/.github/prompts/slm-web-access.prompt.md +97 -0
  83. package/copilot-plugin/.vscode/mcp.json +11 -0
  84. package/copilot-plugin/README.md +26 -0
  85. package/copilot-plugin/_GENERATED.md +49 -0
  86. package/copilot-plugin/scripts/ensure-venv.bat +122 -0
  87. package/copilot-plugin/scripts/ensure-venv.sh +169 -0
  88. package/copilot-plugin/scripts/slm-launch +207 -0
  89. package/copilot-plugin/scripts/slm-launch.bat +32 -0
  90. package/copilot-plugin/scripts/slm-resolve.sh +128 -0
  91. package/copilot-plugin/scripts/slm-run +76 -0
  92. package/copilot-plugin/scripts/torch-cpu-resolve.sh +86 -0
  93. package/docs/pi-dev-integration.md +0 -2
  94. package/hermes-plugin/README.md +30 -0
  95. package/hermes-plugin/_GENERATED.md +3 -0
  96. package/hermes-plugin/__init__.py +417 -0
  97. package/hermes-plugin/agents/slm-governance-advisor.md +78 -0
  98. package/hermes-plugin/agents/slm-loop-runner.md +82 -0
  99. package/hermes-plugin/agents/slm-memory-advisor.md +50 -0
  100. package/hermes-plugin/agents/slm-optimize-advisor.md +44 -0
  101. package/hermes-plugin/command-inventory.json +7 -0
  102. package/hermes-plugin/plugin.yaml +24 -0
  103. package/hermes-plugin/remote.py +390 -0
  104. package/hermes-plugin/skills/slm-bot-memory/SKILL.md +146 -0
  105. package/hermes-plugin/skills/slm-cache/SKILL.md +147 -0
  106. package/hermes-plugin/skills/slm-compress/SKILL.md +150 -0
  107. package/hermes-plugin/skills/slm-getting-started-bot/SKILL.md +146 -0
  108. package/hermes-plugin/skills/slm-governance/SKILL.md +221 -0
  109. package/hermes-plugin/skills/slm-graph/SKILL.md +327 -0
  110. package/hermes-plugin/skills/slm-loop/SKILL.md +153 -0
  111. package/hermes-plugin/skills/slm-mesh/SKILL.md +287 -0
  112. package/hermes-plugin/skills/slm-profile/SKILL.md +159 -0
  113. package/hermes-plugin/skills/slm-recall/SKILL.md +430 -0
  114. package/hermes-plugin/skills/slm-remember/SKILL.md +370 -0
  115. package/hermes-plugin/skills/slm-scope/SKILL.md +183 -0
  116. package/hermes-plugin/skills/slm-session/SKILL.md +291 -0
  117. package/hermes-plugin/skills/slm-status/SKILL.md +185 -0
  118. package/hermes-plugin/skills/slm-web-access/SKILL.md +93 -0
  119. package/package.json +9 -18
  120. package/plugin/.claude-plugin/plugin.json +1 -1
  121. package/plugin/.cursor-plugin/plugin.json +1 -1
  122. package/plugin/CLAUDE.md +14 -12
  123. package/plugin/agents/slm-governance-advisor.md +14 -16
  124. package/plugin/agents/slm-loop-runner.md +22 -11
  125. package/plugin/agents/slm-memory-advisor.md +14 -14
  126. package/plugin/agents/slm-optimize-advisor.md +5 -5
  127. package/plugin/commands/slm-loop.md +5 -3
  128. package/plugin/cursor-skills/slm-bot-memory/SKILL.md +19 -12
  129. package/plugin/cursor-skills/slm-getting-started-bot/SKILL.md +17 -9
  130. package/plugin/cursor-skills/slm-recall/SKILL.md +151 -54
  131. package/plugin/cursor-skills/slm-remember/SKILL.md +132 -35
  132. package/plugin/cursor-skills/slm-scope/SKILL.md +24 -17
  133. package/plugin/cursor-skills/slm-session/SKILL.md +77 -57
  134. package/plugin/mcp.cursor.json +1 -1
  135. package/plugin/requirements.txt +1 -1
  136. package/plugin/skills/slm-bot-memory/SKILL.md +19 -12
  137. package/plugin/skills/slm-cache/SKILL.md +6 -7
  138. package/plugin/skills/slm-compress/SKILL.md +3 -3
  139. package/plugin/skills/slm-getting-started-bot/SKILL.md +17 -9
  140. package/plugin/skills/slm-governance/SKILL.md +126 -153
  141. package/plugin/skills/slm-graph/SKILL.md +27 -15
  142. package/plugin/skills/slm-loop/SKILL.md +74 -20
  143. package/plugin/skills/slm-mesh/SKILL.md +17 -12
  144. package/plugin/skills/slm-profile/SKILL.md +101 -92
  145. package/plugin/skills/slm-recall/SKILL.md +151 -54
  146. package/plugin/skills/slm-remember/SKILL.md +132 -35
  147. package/plugin/skills/slm-scope/SKILL.md +24 -17
  148. package/plugin/skills/slm-session/SKILL.md +77 -57
  149. package/plugin/skills/slm-status/SKILL.md +54 -35
  150. package/plugin/skills/slm-web-access/SKILL.md +93 -0
  151. package/plugin-src/agents/slm-governance-advisor.md +78 -0
  152. package/plugin-src/agents/slm-loop-runner.md +82 -0
  153. package/plugin-src/agents/slm-memory-advisor.md +14 -14
  154. package/plugin-src/agents/slm-optimize-advisor.md +5 -5
  155. package/plugin-src/commands/slm-loop.md +33 -0
  156. package/plugin-src/rules/AGENTS.md +45 -36
  157. package/plugin-src/rules/CLAUDE.md.fragment +47 -0
  158. package/plugin-src/skills/slm-bot-memory/SKILL.md +19 -12
  159. package/plugin-src/skills/slm-cache/SKILL.md +6 -7
  160. package/plugin-src/skills/slm-compress/SKILL.md +3 -3
  161. package/plugin-src/skills/slm-getting-started-bot/SKILL.md +17 -9
  162. package/plugin-src/skills/slm-governance/SKILL.md +126 -153
  163. package/plugin-src/skills/slm-graph/SKILL.md +27 -15
  164. package/plugin-src/skills/slm-loop/SKILL.md +74 -20
  165. package/plugin-src/skills/slm-mesh/SKILL.md +17 -12
  166. package/plugin-src/skills/slm-profile/SKILL.md +101 -92
  167. package/plugin-src/skills/slm-recall/SKILL.md +151 -54
  168. package/plugin-src/skills/slm-remember/SKILL.md +132 -35
  169. package/plugin-src/skills/slm-scope/SKILL.md +24 -17
  170. package/plugin-src/skills/slm-session/SKILL.md +77 -57
  171. package/plugin-src/skills/slm-status/SKILL.md +54 -35
  172. package/plugin-src/skills/slm-web-access/SKILL.md +93 -0
@@ -0,0 +1,322 @@
1
+ ---
2
+ name: slm-graph
3
+ description: >
4
+ version: "4.1.24"
5
+ agent: agent
6
+ tools:
7
+ - build_code_graph
8
+ - query_graph
9
+ - get_blast_radius
10
+ - semantic_search_code
11
+ - get_review_context
12
+ - detect_changes
13
+ - Bash
14
+ ---
15
+
16
+ # slm-graph — Code Intelligence Skill
17
+
18
+ Index any repo as a code knowledge graph and answer structural questions about it: callers, callees, impact radius, semantic search, and review context. These tools are only registered in the `code` MCP tool set (or with `SLM_MCP_ALL_TOOLS=1`); see "Tool set requirement" below.
19
+
20
+ **Prerequisite rule:** every tool except `build_code_graph` self-guards — if the graph is not built it returns `{"success": false, "error": "Code graph not built. Run build_code_graph first."}`. Always index first.
21
+
22
+ ---
23
+
24
+ ## Tool Reference
25
+
26
+ ### 1. `build_code_graph` — index a repository
27
+
28
+ ```
29
+ build_code_graph(
30
+ repo_path: str,
31
+ languages: str = "",
32
+ exclude_patterns: str = "",
33
+ ) -> {success, files_parsed, nodes, edges, flows, communities, duration_ms}
34
+ ```
35
+
36
+ Parses all supported source files, extracts functions/classes/imports, builds the call graph, detects execution flows, and identifies code communities. Replaces any previous index for the same repo.
37
+
38
+ - `repo_path` — absolute path to the repository root. Must exist and sit under your home directory; a path outside it is refused with `Invalid repo_path`.
39
+ - `languages` — comma-separated language filter, e.g. `"python,typescript"`. Empty string = index all supported languages.
40
+ - `exclude_patterns` — comma-separated glob patterns to exclude, e.g. `"**/node_modules/**,**/.venv/**"`. Empty = no exclusions.
41
+
42
+ When to (re)build:
43
+ - Before using any other graph tool for the first time on a repo.
44
+ - After significant changes to the codebase (pull, merge, large refactor).
45
+ - When `detect_changes` or `query_graph` returns stale/unexpected results.
46
+ - Rebuild is safe and idempotent — it replaces the previous index atomically per file.
47
+
48
+ ```
49
+ # Index the full repo
50
+ build_code_graph(repo_path="/abs/path/to/myrepo")
51
+
52
+ # Index only Python, skip tests and generated code
53
+ build_code_graph(
54
+ repo_path="/abs/path/to/myrepo",
55
+ languages="python",
56
+ exclude_patterns="**/tests/**,**/generated/**"
57
+ )
58
+ ```
59
+
60
+ ---
61
+
62
+ ### 2. `query_graph` — traverse relationships
63
+
64
+ ```
65
+ query_graph(
66
+ pattern: str,
67
+ target: str = "",
68
+ limit: int = 20,
69
+ ) -> {success, pattern, target, results: [{qualified_name, kind, file_path, name}]}
70
+ ```
71
+
72
+ Query the graph for structural relationships. `pattern` is required and must be one of the eight valid values below. `target` is a qualified name, partial name, or node ID — matched with exact-then-LIKE fallback.
73
+
74
+ Valid patterns:
75
+
76
+ | pattern | returns |
77
+ |---|---|
78
+ | `callers_of` | functions/methods that call `target` |
79
+ | `callees_of` | functions/methods that `target` calls |
80
+ | `imports_of` | modules/symbols that `target` imports |
81
+ | `imported_by` | who imports `target` |
82
+ | `tests_for` | test nodes associated with `target` |
83
+ | `inherits_from` | base classes of `target` |
84
+ | `inherited_by` | subclasses of `target` |
85
+ | `contains` | symbols defined inside `target` (e.g. methods in a class) |
86
+
87
+ ```
88
+ # Who calls the auth handler?
89
+ query_graph(pattern="callers_of", target="authenticate_user")
90
+
91
+ # What does the payment processor import?
92
+ query_graph(pattern="imports_of", target="PaymentProcessor", limit=30)
93
+
94
+ # What classes inherit from BaseModel?
95
+ query_graph(pattern="inherited_by", target="BaseModel")
96
+ ```
97
+
98
+ ---
99
+
100
+ ### 3. `get_blast_radius` — impact analysis
101
+
102
+ ```
103
+ get_blast_radius(
104
+ changed_files: str,
105
+ max_depth: int = 2,
106
+ max_nodes: int = 500,
107
+ ) -> {success, changed_nodes, impacted_nodes, impacted_files, edges, depth_reached, truncated}
108
+ ```
109
+
110
+ Computes the full impact radius for one or more changed files using bidirectional BFS (callers and callees). Returns every node and file reachable within `max_depth` hops. Use this before editing to understand risk surface.
111
+
112
+ - `changed_files` — comma-separated file paths relative to the repo root, e.g. `"src/auth/handler.py,src/auth/models.py"`.
113
+ - `max_depth` — BFS depth. Default 2. Increase to 3–4 for deep call chains; lower to 1 for a quick first-degree check.
114
+ - `max_nodes` — caps the result set. If `truncated=true` in the response, the real blast radius is larger.
115
+
116
+ ```
117
+ # What breaks if I change the auth handler?
118
+ get_blast_radius(changed_files="src/auth/handler.py")
119
+
120
+ # Deeper analysis across two files
121
+ get_blast_radius(
122
+ changed_files="src/payments/gateway.py,src/payments/models.py",
123
+ max_depth=3,
124
+ max_nodes=200
125
+ )
126
+ ```
127
+
128
+ If `truncated` is `true`, narrow the scope with `max_nodes` or reduce `max_depth` to get a reliable result.
129
+
130
+ ---
131
+
132
+ ### 4. `semantic_search_code` — find code by meaning
133
+
134
+ ```
135
+ semantic_search_code(
136
+ query: str,
137
+ kind: str = "",
138
+ limit: int = 20,
139
+ ) -> {success, results: [{qualified_name, kind, file_path, score, line_start, name}]}
140
+ ```
141
+
142
+ Hybrid FTS5 + vector search over all indexed code entities. Use when you know what the code *does* but not what it's *called*.
143
+
144
+ - `query` — natural language description, e.g. `"retry logic for HTTP requests"` or `"parse JWT token from header"`.
145
+ - `kind` — optional filter: `"Function"`, `"Class"`, `"File"`, or `"Test"`. Empty = all kinds. Case-insensitive match in the engine.
146
+ - `limit` — max results. Default 20.
147
+
148
+ Results include a `score` field (higher = more relevant).
149
+
150
+ ```
151
+ # Find where authentication is handled
152
+ semantic_search_code(query="authenticate user from request token")
153
+
154
+ # Find only test functions that cover database writes
155
+ semantic_search_code(query="database write transaction rollback", kind="Test")
156
+
157
+ # Find the rate limiter class
158
+ semantic_search_code(query="rate limiting middleware", kind="Class", limit=5)
159
+ ```
160
+
161
+ ---
162
+
163
+ ### 5. `get_review_context` — assemble PR review context
164
+
165
+ ```
166
+ get_review_context(
167
+ changed_files: str,
168
+ include_source: bool = True,
169
+ ) -> {success, summary, review_items, test_gaps, risk_score}
170
+ ```
171
+
172
+ Produces a token-optimized review package for a set of changed files: a plain-language summary, a ranked list of review items with per-node risk scores, and a list of changed symbols that have no associated test coverage.
173
+
174
+ - `changed_files` — comma-separated file paths relative to the repo root.
175
+ - `include_source` — whether to include source code snippets in the context (default `True`). Set `False` to reduce token usage when you only need the risk analysis.
176
+
177
+ `risk_score` is a float 0–1 on the overall changeset. `review_items[].risk_score` is per-node.
178
+
179
+ ```
180
+ # Get review context for a PR touching two files
181
+ get_review_context(changed_files="src/auth/handler.py,src/auth/utils.py")
182
+
183
+ # Risk summary only, no source snippets
184
+ get_review_context(
185
+ changed_files="src/payments/gateway.py",
186
+ include_source=False
187
+ )
188
+ ```
189
+
190
+ ---
191
+
192
+ ### 6. `detect_changes` — what changed since last index
193
+
194
+ ```
195
+ detect_changes(
196
+ base: str = "HEAD~1",
197
+ ) -> {success, summary, risk_score, changed_functions, test_gaps, review_priorities}
198
+ ```
199
+
200
+ Runs `git diff` against `base`, maps the changed hunks to graph nodes, and returns a risk-scored list of changed functions, test gaps, and review priorities. Requires the repo to be a git repository.
201
+
202
+ - `base` — git ref to diff against. Default `"HEAD~1"` (one commit back). Any valid git ref works: `"main"`, `"v1.4.0"`, a commit SHA, etc.
203
+
204
+ ```
205
+ # What changed in the last commit?
206
+ detect_changes()
207
+
208
+ # What changed since the release branch?
209
+ detect_changes(base="release/1.4")
210
+
211
+ # What changed relative to main?
212
+ detect_changes(base="main")
213
+ ```
214
+
215
+ Returns `error` if the repo root is not a git repository or if git is not available.
216
+
217
+ ---
218
+
219
+ ## Realistic Workflow
220
+
221
+ ### Explore an unfamiliar codebase
222
+
223
+ ```
224
+ # 1. Index it
225
+ build_code_graph(repo_path="/abs/path/to/repo")
226
+
227
+ # 2. Find the entry point by meaning
228
+ semantic_search_code(query="request router entry point", kind="Function")
229
+
230
+ # 3. Trace what it calls
231
+ query_graph(pattern="callees_of", target="handle_request")
232
+
233
+ # 4. See who else calls the same core function
234
+ query_graph(pattern="callers_of", target="authenticate_user")
235
+ ```
236
+
237
+ ### Before editing a function
238
+
239
+ ```
240
+ # 1. Know what you are touching
241
+ semantic_search_code(query="retry HTTP requests with backoff")
242
+
243
+ # 2. Understand blast radius before making the change
244
+ get_blast_radius(changed_files="src/http/client.py")
245
+
246
+ # 3. Check test gaps
247
+ get_review_context(changed_files="src/http/client.py")
248
+ ```
249
+
250
+ ### Pre-commit / PR review
251
+
252
+ ```
253
+ # 1. What changed in this branch vs main?
254
+ detect_changes(base="main")
255
+
256
+ # 2. Full impact analysis for the changed files
257
+ get_blast_radius(changed_files="src/auth/handler.py,src/auth/models.py")
258
+
259
+ # 3. Assemble review context
260
+ get_review_context(changed_files="src/auth/handler.py,src/auth/models.py")
261
+ ```
262
+
263
+ ---
264
+
265
+ ## Error Handling
266
+
267
+ All tools return `{"success": false, "error": "<message>"}` on failure — they never raise.
268
+
269
+ | Error message | Cause | Fix |
270
+ |---|---|---|
271
+ | `Code graph not built. Run build_code_graph first.` | No index exists | Call `build_code_graph(repo_path=...)` first |
272
+ | `Repository path does not exist: <path>` | Bad `repo_path` in build | Pass an absolute path that exists |
273
+ | `Git not available or not a git repository: ...` | `detect_changes` needs git | Only works in git repos with git installed |
274
+ | `Invalid pattern '...'` | Wrong `pattern` in `query_graph` | Use one of the 8 valid pattern strings |
275
+ | `No node found matching '<target>'` | Target not in index. Returned as `success: true` with an empty `results` and this `message`, not as an error | Rebuild or check the qualified name via `semantic_search_code` |
276
+ | `Invalid repo_path: ...` | `repo_path` is outside your home directory | Index a repository under your home directory |
277
+
278
+ If `build_code_graph` returns `files_parsed: 0`, no supported source files were found — check `repo_path` and `exclude_patterns`.
279
+
280
+ ---
281
+
282
+ ## Tool set requirement
283
+
284
+ The six tools above are registered only when the MCP server runs the `code` tool
285
+ set, or with `SLM_MCP_ALL_TOOLS=1` / `SLM_MCP_PROFILE=whole`, or when
286
+ `SLM_MCP_TOOLS` names them. They are **not** in `core`, `full`, `power` or the
287
+ no-profile default that the Claude Code and Codex plugins use, so with those
288
+ settings the tools simply do not exist and a call fails as an unknown tool. The
289
+ tool set is read when the server starts: set it in the host's MCP config and
290
+ restart the host.
291
+
292
+ ```json
293
+ "env": {
294
+ "SLM_MCP_PROFILE": "code",
295
+ "SLM_AGENT_ID": "claude_code"
296
+ }
297
+ ```
298
+
299
+ `switch_profile` does not change the tool set; it changes the active memory
300
+ profile. See `slm-profile`. The `code` set leaves out the mesh and several
301
+ administration tools, so ask the user before changing their tool set.
302
+
303
+ With `SLM_MCP_ALL_TOOLS=1` more graph tools appear: `update_code_graph` (refresh
304
+ for `changed_files` without a full rebuild), `list_graph_stats`,
305
+ `get_architecture_overview`, `list_communities`, `get_community`, `list_flows`,
306
+ `get_flow`, `get_affected_flows`, `find_large_functions`, `enrich_blast_radius`,
307
+ `refactor_preview`, and the code-to-memory tools `link_memory_to_code`,
308
+ `code_memory_search`, `code_entity_history` and `code_stale_check`. The memory
309
+ links need `"bridge_enabled": true` in `code_graph_config.json` and a rebuild.
310
+ All are host-only: a remote caller cannot use them.
311
+
312
+ ---
313
+
314
+ ## Related skills
315
+
316
+ - `slm-profile` — memory profiles and the tool sets that decide which tools exist
317
+ - `slm-recall` — retrieve architectural decisions before graph queries
318
+ - `slm-status` — confirm the active profile and graph index health
319
+
320
+ ---
321
+
322
+ SuperLocalMemory v4.1.24 · Qualixar · AGPL-3.0-or-later
@@ -0,0 +1,159 @@
1
+ ---
2
+ name: slm-loop
3
+ description: Gate-verified bounded loops with SuperLocalMemory as the durable ledger. Use when a task has a checkable acceptance condition and you must iterate until an INDEPENDENT gate passes — never stopping because the agent believes it is done. `slm_loop_run` (MCP) waits, under hard bounds, for a recall gate to pass; `slm loop demo` shows the control flow keyless; `slm loop history` and `slm loop show <run_id>` (or `slm_loop_history` / `slm_loop_show`) inspect past runs, whose every lap is stored as queryable SLM memory (tag `loop:<name>`). Terminal statuses are DONE / HALT / PAUSE / KILLED / ERROR — report them exactly, never converting HALT/PAUSE/ERROR into success.
4
+ version: "4.1.24"
5
+ agent: agent
6
+ tools:
7
+ - slm_loop_run
8
+ - slm_loop_history
9
+ - slm_loop_show
10
+ - recall
11
+ - Bash
12
+ ---
13
+
14
+ # slm-loop — Bounded, gate-verified agent loops
15
+
16
+ ## The one rule
17
+
18
+ A bounded loop is complete **only when an independent gate passes** — not when
19
+ the agent claims it is finished. The agent's own "I'm done" signal is recorded
20
+ for audit and is *never* used to terminate the loop. If you take one thing from
21
+ this skill: **the gate is the authority.**
22
+
23
+ Use a bounded loop whenever the goal has a mechanical, checkable contract: a
24
+ test suite, a JSON schema, a linter, a reconciliation rule, a citation checker,
25
+ a security scan. When the goal is subjective, keep a human approval gate.
26
+
27
+ ## What SLM runs, and what you run
28
+
29
+ SLM's loop engine runs the laps, enforces the bounds, calls the gate and writes
30
+ the ledger. It does **not** start your tests or linters: it carries no
31
+ subprocess or sandbox machinery. What each surface gives you:
32
+
33
+ | Surface | What it does |
34
+ |---|---|
35
+ | `slm_loop_run` (MCP) | A *watcher*: each lap is a recall of `gate_query`; the loop ends when a confident match appears, or a bound trips. Use it to wait for a verification or coordination memory another agent will write (for example "build passed"). |
36
+ | `slm loop demo` (CLI) | A keyless convergence demo: a stub proposer, a deterministic gate that passes on lap 3, every lap recorded. Proves the engine and ledger work end to end. |
37
+ | `slm loop history`, `slm loop show` / `slm_loop_history`, `slm_loop_show` | Read the ledger of past runs. |
38
+ | `superlocalmemory.loops.run_bounded_loop` (Python) | The engine itself, for code that supplies its own runner and gate callables. |
39
+
40
+ For a task whose gate is a command (`pytest -q`, a schema validation), you run
41
+ that command yourself each lap with Bash and read its exit code; the discipline
42
+ below still applies, but SLM is not recording those laps. For graph runs with
43
+ receipts, use the separate Bounded Loops product; SLM can take a read-only
44
+ snapshot of its finished runs with `observe_bounded_loop_evidence(workspace)`
45
+ (an absolute path), which records observations only and never changes recall or
46
+ ranking.
47
+
48
+ ## What SLM adds
49
+
50
+ Every lap SLM runs is written as a durable, queryable memory (tagged `loop:<name>`,
51
+ session `loop:<run_id>`). That makes a run:
52
+
53
+ - **auditable** — inspect the decision, gate verdict and budget for each lap;
54
+ - **historical** — a run's ledger survives across sessions;
55
+ - **discoverable** — visible via `slm recall`, the dashboard, and any
56
+ SLM-integrated tool, alongside everything else the agent remembers.
57
+
58
+ ## MCP: `slm_loop_run`
59
+
60
+ ```
61
+ slm_loop_run(
62
+ name: str, # 1–128 chars; also the memory tag
63
+ gate_query: str, # the recall the gate checks each lap (up to 2000 chars)
64
+ gate_min_score: float = 0.0, # minimum top-result score to pass
65
+ max_iterations: int = 20, # hard lap cap, 1–200
66
+ max_wallclock_s: float = 15.0,# hard time cap; 0 disables; never more than 120
67
+ poll_interval_s: float = 1.0, # wait between laps; at least 0.25
68
+ max_tokens: int = 0, # optional token budget; 0 disables
69
+ no_progress_window: int = 0, # halt after N no-change laps; leave 0 for a watcher
70
+ require_support: bool = False,# pass only if the answer check ran and judged it sufficient
71
+ )
72
+ ```
73
+
74
+ The call **blocks** until the gate passes or a bound trips, then returns
75
+ `{ok, status, reason, passed, laps, run_id, ledger: [{lap, decision, passed, detail}]}`.
76
+ The gate recalls at most three memories per lap and ignores the loop's own
77
+ ledger entries, so only a memory written by someone else can satisfy it. A
78
+ recall the answer check judged insufficient never passes, even with a high
79
+ score; with `require_support=True` an unchecked recall (check off, busy,
80
+ loading, out of time) does not pass either. When the answer check is on, each
81
+ lap asks it once about those memories; with the online check that is a request
82
+ to the provider and may be billed. `slm_loop_run` is not available to remote
83
+ callers.
84
+
85
+ ```
86
+ slm_loop_history(name, limit=20) # runs recorded under a loop name
87
+ slm_loop_show(run_id, limit=200) # every lap of one run, in order
88
+ ```
89
+
90
+ ## CLI
91
+
92
+ ```bash
93
+ slm loop demo [--iterations N] [--json] # keyless convergence demo
94
+ slm loop history [--name NAME] [--json] # list recorded runs
95
+ slm loop show <run_id> [--json] # every lap of one run
96
+ ```
97
+
98
+ There is no `slm loop run`.
99
+
100
+ ## The bounds
101
+
102
+ A loop runs inside a safety envelope. Any bound tripping ends the run with
103
+ `HALT` (never a success):
104
+
105
+ - **max_iterations** — a hard lap cap.
106
+ - **no_progress_window** — consecutive no-change laps before halting a spinning
107
+ agent.
108
+ - **token budget / wall-clock** — cumulative ceilings, checked again after each
109
+ lap, so an overshooting lap halts even if its gate would pass.
110
+ - **kill switch** — a non-empty `SLM_LOOP_KILL` in the loop's process
111
+ environment stops it before the next lap, with status `KILLED`.
112
+ - **approval rung** — L1 (report), L2 (assisted, pauses for approval), L3
113
+ (unattended). L2 and L3 require approval before a passing gate is accepted as
114
+ DONE unless approval is explicitly configured off. `slm_loop_run` and the demo
115
+ run at L1, so `PAUSE` arises only from code that sets a higher rung.
116
+
117
+ ## Terminal statuses — report exactly
118
+
119
+ | Status | Meaning |
120
+ |----------|---------|
121
+ | `DONE` | The independent gate passed **and** approval was granted or not required. |
122
+ | `HALT` | A bound tripped (iterations, no-progress, token, or wall-clock). |
123
+ | `PAUSE` | The gate passed but required approval is not yet granted. |
124
+ | `KILLED` | The external kill switch tripped between laps. |
125
+ | `ERROR` | The runner or gate failed to execute; inspect the lap detail. |
126
+
127
+ Say `DONE` only when the status is exactly `DONE`. Never describe `HALT`,
128
+ `PAUSE`, or `ERROR` as success. When halted, name which bound tripped; when
129
+ paused, name the approval needed; when errored, quote the short detail.
130
+
131
+ ## Reporting workflow
132
+
133
+ 1. Run or resume the loop.
134
+ 2. Read back the ledger with `slm_loop_show` or `slm loop show <run_id>` (or
135
+ `slm recall` on tag `loop:<name>`).
136
+ 3. Report the exact terminal status, the lap count, and the gate's final
137
+ verdict. Include the `run_id` so the run can be re-inspected later.
138
+
139
+ ## Gate discipline
140
+
141
+ - The gate verifies; the runner only proposes. They are separate.
142
+ - Prefer a typed, parseable gate (a test exit code, a schema validation, a
143
+ scanner report) over a vague check. A missing tool, an empty report, or a
144
+ crashed scanner is **not** a clean pass — fail closed.
145
+ - Never use "an LLM decides it looks good" as the gate. That reintroduces the
146
+ exact failure mode bounded loops exist to remove.
147
+
148
+ ---
149
+
150
+ ## Related skills
151
+
152
+ - `slm-status` — confirm SLM is healthy before relying on the ledger.
153
+ - `slm-recall` — query a loop's laps directly (`loop:<name>` tag), and the
154
+ answer-check fields the recall gate depends on.
155
+ - `slm-session` — session lifecycle around a longer loop run.
156
+
157
+ ---
158
+
159
+ SuperLocalMemory v4.1.24 · Qualixar · AGPL-3.0-or-later