From 36010d01430ad4fa08ebc39f33cbc942eebf9dbf Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Thu, 30 Apr 2026 11:14:13 +0200 Subject: [PATCH] prompts: add tools-lsp prompt, wire into all agents --- agents/coding.json | 1 + agents/default.json | 1 + agents/devops.json | 1 + agents/qa.json | 1 + agents/reviewer.json | 1 + agents/sysarchitect.json | 1 + agents/writer.json | 1 + prompts/tools-lsp.md | 32 ++++++++++++++++++++++++++++++++ 8 files changed, 39 insertions(+) create mode 100644 prompts/tools-lsp.md diff --git a/agents/coding.json b/agents/coding.json index 71c3897..f0503b2 100644 --- a/agents/coding.json +++ b/agents/coding.json @@ -4,6 +4,7 @@ "prime tools-task 2>/dev/null || true", "$OLLIE/x/prime agent-coding", "$OLLIE/x/prime tools-file", + "$OLLIE/x/prime tools-lsp", "$OLLIE/x/prime tools-reasoning", "$OLLIE/x/prime tools-memory", "$OLLIE/x/prime tools-subagent", diff --git a/agents/default.json b/agents/default.json index 85f6f68..106fb06 100644 --- a/agents/default.json +++ b/agents/default.json @@ -3,6 +3,7 @@ "$OLLIE/x/prime SYSTEM_PROMPT", "prime tools-task 2>/dev/null || true", "$OLLIE/x/prime tools-file", + "$OLLIE/x/prime tools-lsp", "$OLLIE/x/prime tools-reasoning", "$OLLIE/x/prime tools-memory", "$OLLIE/x/prime tools-subagent", diff --git a/agents/devops.json b/agents/devops.json index d7e937e..38dd988 100644 --- a/agents/devops.json +++ b/agents/devops.json @@ -4,6 +4,7 @@ "prime tools-task 2>/dev/null || true", "$OLLIE/x/prime agent-devops", "$OLLIE/x/prime tools-file", + "$OLLIE/x/prime tools-lsp", "$OLLIE/x/prime tools-reasoning", "$OLLIE/x/prime tools-memory", "$OLLIE/x/prime tools-subagent", diff --git a/agents/qa.json b/agents/qa.json index b98b6f9..16b8b4c 100644 --- a/agents/qa.json +++ b/agents/qa.json @@ -4,6 +4,7 @@ "prime tools-task 2>/dev/null || true", "$OLLIE/x/prime agent-qa", "$OLLIE/x/prime tools-file", + "$OLLIE/x/prime tools-lsp", "$OLLIE/x/prime tools-reasoning", "$OLLIE/x/prime tools-memory", "$OLLIE/x/prime tools-subagent", diff --git a/agents/reviewer.json b/agents/reviewer.json index 4531686..466d3ea 100644 --- a/agents/reviewer.json +++ b/agents/reviewer.json @@ -4,6 +4,7 @@ "prime tools-task 2>/dev/null || true", "$OLLIE/x/prime agent-reviewer", "$OLLIE/x/prime tools-file", + "$OLLIE/x/prime tools-lsp", "$OLLIE/x/prime tools-reasoning", "$OLLIE/x/prime tools-memory", "$OLLIE/x/prime tools-subagent", diff --git a/agents/sysarchitect.json b/agents/sysarchitect.json index 55a2620..bceca6e 100644 --- a/agents/sysarchitect.json +++ b/agents/sysarchitect.json @@ -4,6 +4,7 @@ "prime tools-task 2>/dev/null || true", "$OLLIE/x/prime agent-sysarchitect", "$OLLIE/x/prime tools-file", + "$OLLIE/x/prime tools-lsp", "$OLLIE/x/prime tools-reasoning", "$OLLIE/x/prime tools-memory", "$OLLIE/x/prime tools-subagent", diff --git a/agents/writer.json b/agents/writer.json index 476414e..5c7deb3 100644 --- a/agents/writer.json +++ b/agents/writer.json @@ -4,6 +4,7 @@ "prime tools-task 2>/dev/null || true", "$OLLIE/x/prime agent-writer", "$OLLIE/x/prime tools-file", + "$OLLIE/x/prime tools-lsp", "$OLLIE/x/prime tools-reasoning", "$OLLIE/x/prime tools-memory", "$OLLIE/x/prime tools-subagent", diff --git a/prompts/tools-lsp.md b/prompts/tools-lsp.md new file mode 100644 index 0000000..cac9f3a --- /dev/null +++ b/prompts/tools-lsp.md @@ -0,0 +1,32 @@ +# LSP Tools + +Code intelligence via language servers (gopls, clangd, intelephense). The bridge daemon starts automatically on first use and stays alive between calls. + +| Tool | Args | Output | +|------|------|--------| +| `lsp_definition` | ` ` | Definition location(s) as `file:line:col` | +| `lsp_references` | ` ` | All references as `file:line:col` | +| `lsp_hover` | ` ` | Type signature and documentation | +| `lsp_rename` | ` ` | Applies rename across workspace, prints summary | +| `lsp_symbols` | ` [--workspace]` | Symbols in file or workspace-wide search | +| `lsp_diagnostics` | `` | Errors and warnings with positions | + +**Trigger condition**: when you need semantic code understanding — finding callers before refactoring, checking a type signature, renaming across a codebase, or verifying a file compiles cleanly. + +**Calling convention**: +``` +execute_code: steps=[{tool: "lsp_definition", args: ["/abs/path/to/file.go", "42", "10"]}] +execute_code: steps=[{tool: "lsp_references", args: ["/abs/path/to/file.go", "42", "10"]}] +execute_code: steps=[{tool: "lsp_hover", args: ["/abs/path/to/file.go", "42", "10"]}] +execute_code: steps=[{tool: "lsp_rename", args: ["/abs/path/to/file.go", "42", "10", "NewName"]}] +execute_code: steps=[{tool: "lsp_symbols", args: ["/abs/path/to/file.go"]}] +execute_code: steps=[{tool: "lsp_diagnostics", args: ["/abs/path/to/file.go"]}] +``` + +**Line/col are 1-indexed** — matching `file_read` output. Use the line numbers from `file_read` directly. + +**Supported languages**: Go (`.go`), C/C++ (`.c`, `.h`, `.cc`, `.cpp`, `.cxx`, `.hpp`), PHP (`.php`). + +**Prefer `lsp_rename` over manual find-and-replace** for symbol renames — it understands scope, interfaces, and cross-package references. + +**Prefer `lsp_references` over `file_grep`** when you need semantic references (not just text matches) — it won't return comments, strings, or unrelated identifiers that happen to share a name.