@oh-my-pi/pi-coding-agent 14.5.3 → 14.5.6
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/CHANGELOG.md +49 -0
- package/examples/extensions/plan-mode.ts +1 -1
- package/examples/sdk/README.md +1 -1
- package/package.json +7 -7
- package/src/config/prompt-templates.ts +103 -8
- package/src/config/settings-schema.ts +14 -13
- package/src/config/settings.ts +1 -1
- package/src/cursor.ts +4 -4
- package/src/edit/index.ts +111 -109
- package/src/edit/line-hash.ts +33 -3
- package/src/edit/modes/apply-patch.ts +6 -4
- package/src/edit/modes/atom.lark +27 -0
- package/src/edit/modes/atom.ts +1039 -841
- package/src/edit/modes/hashline.ts +9 -10
- package/src/edit/modes/patch.ts +23 -19
- package/src/edit/modes/replace.ts +19 -15
- package/src/edit/renderer.ts +65 -8
- package/src/edit/streaming.ts +47 -77
- package/src/extensibility/extensions/types.ts +11 -11
- package/src/extensibility/hooks/types.ts +6 -6
- package/src/lsp/edits.ts +8 -5
- package/src/lsp/index.ts +4 -4
- package/src/lsp/utils.ts +7 -7
- package/src/mcp/discoverable-tool-metadata.ts +1 -1
- package/src/mcp/manager.ts +3 -3
- package/src/mcp/tool-bridge.ts +4 -4
- package/src/memories/index.ts +1 -1
- package/src/modes/acp/acp-event-mapper.ts +1 -1
- package/src/modes/components/session-observer-overlay.ts +1 -1
- package/src/modes/components/settings-defs.ts +3 -3
- package/src/modes/components/tree-selector.ts +2 -2
- package/src/modes/utils/ui-helpers.ts +31 -7
- package/src/prompts/agents/explore.md +1 -1
- package/src/prompts/agents/librarian.md +2 -2
- package/src/prompts/agents/plan.md +2 -2
- package/src/prompts/agents/reviewer.md +1 -1
- package/src/prompts/agents/task.md +2 -2
- package/src/prompts/system/plan-mode-active.md +1 -1
- package/src/prompts/system/system-prompt.md +116 -60
- package/src/prompts/tools/apply-patch.md +0 -2
- package/src/prompts/tools/atom.md +81 -63
- package/src/prompts/tools/bash.md +7 -4
- package/src/prompts/tools/checkpoint.md +1 -1
- package/src/prompts/tools/find.md +6 -1
- package/src/prompts/tools/hashline.md +10 -11
- package/src/prompts/tools/patch.md +13 -13
- package/src/prompts/tools/read.md +4 -4
- package/src/prompts/tools/replace.md +3 -3
- package/src/prompts/tools/{grep.md → search.md} +4 -4
- package/src/sdk.ts +19 -9
- package/src/session/agent-session.ts +65 -0
- package/src/system-prompt.ts +15 -5
- package/src/task/executor.ts +5 -0
- package/src/task/index.ts +10 -1
- package/src/tools/ast-edit.ts +4 -6
- package/src/tools/ast-grep.ts +4 -6
- package/src/tools/bash.ts +1 -1
- package/src/tools/file-recorder.ts +6 -6
- package/src/tools/find.ts +11 -13
- package/src/tools/index.ts +7 -7
- package/src/tools/path-utils.ts +31 -4
- package/src/tools/read.ts +12 -6
- package/src/tools/renderers.ts +2 -2
- package/src/tools/{grep.ts → search.ts} +32 -40
- package/src/tools/write.ts +8 -4
- package/src/web/search/index.ts +1 -1
- package/src/edit/block.ts +0 -308
- package/src/edit/indent.ts +0 -150
package/src/lsp/edits.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as fs from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
+
import { formatPathRelativeToCwd } from "../tools/path-utils";
|
|
3
4
|
import type { CreateFile, DeleteFile, RenameFile, TextDocumentEdit, TextEdit, WorkspaceEdit } from "./types";
|
|
4
5
|
import { uriToFile } from "./utils";
|
|
5
6
|
|
|
@@ -67,7 +68,7 @@ export async function applyWorkspaceEdit(edit: WorkspaceEdit, cwd: string): Prom
|
|
|
67
68
|
for (const [uri, textEdits] of Object.entries(edit.changes)) {
|
|
68
69
|
const filePath = uriToFile(uri);
|
|
69
70
|
await applyTextEdits(filePath, textEdits);
|
|
70
|
-
applied.push(`Applied ${textEdits.length} edit(s) to ${
|
|
71
|
+
applied.push(`Applied ${textEdits.length} edit(s) to ${formatPathRelativeToCwd(filePath, cwd)}`);
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
|
|
@@ -80,26 +81,28 @@ export async function applyWorkspaceEdit(edit: WorkspaceEdit, cwd: string): Prom
|
|
|
80
81
|
const filePath = uriToFile(docChange.textDocument.uri);
|
|
81
82
|
const textEdits = docChange.edits.filter((e): e is TextEdit => "range" in e && "newText" in e);
|
|
82
83
|
await applyTextEdits(filePath, textEdits);
|
|
83
|
-
applied.push(`Applied ${textEdits.length} edit(s) to ${
|
|
84
|
+
applied.push(`Applied ${textEdits.length} edit(s) to ${formatPathRelativeToCwd(filePath, cwd)}`);
|
|
84
85
|
} else if ("kind" in change && change.kind) {
|
|
85
86
|
// Resource operations
|
|
86
87
|
if (change.kind === "create") {
|
|
87
88
|
const createOp = change as CreateFile;
|
|
88
89
|
const filePath = uriToFile(createOp.uri);
|
|
89
90
|
await Bun.write(filePath, "");
|
|
90
|
-
applied.push(`Created ${
|
|
91
|
+
applied.push(`Created ${formatPathRelativeToCwd(filePath, cwd)}`);
|
|
91
92
|
} else if (change.kind === "rename") {
|
|
92
93
|
const renameOp = change as RenameFile;
|
|
93
94
|
const oldPath = uriToFile(renameOp.oldUri);
|
|
94
95
|
const newPath = uriToFile(renameOp.newUri);
|
|
95
96
|
await fs.mkdir(path.dirname(newPath), { recursive: true });
|
|
96
97
|
await fs.rename(oldPath, newPath);
|
|
97
|
-
applied.push(
|
|
98
|
+
applied.push(
|
|
99
|
+
`Renamed ${formatPathRelativeToCwd(oldPath, cwd)} → ${formatPathRelativeToCwd(newPath, cwd)}`,
|
|
100
|
+
);
|
|
98
101
|
} else if (change.kind === "delete") {
|
|
99
102
|
const deleteOp = change as DeleteFile;
|
|
100
103
|
const filePath = uriToFile(deleteOp.uri);
|
|
101
104
|
await fs.rm(filePath, { recursive: true });
|
|
102
|
-
applied.push(`Deleted ${
|
|
105
|
+
applied.push(`Deleted ${formatPathRelativeToCwd(filePath, cwd)}`);
|
|
103
106
|
}
|
|
104
107
|
}
|
|
105
108
|
}
|
package/src/lsp/index.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { BunFile } from "bun";
|
|
|
6
6
|
import { type Theme, theme } from "../modes/theme/theme";
|
|
7
7
|
import lspDescription from "../prompts/tools/lsp.md" with { type: "text" };
|
|
8
8
|
import type { ToolSession } from "../tools";
|
|
9
|
-
import { resolveToCwd } from "../tools/path-utils";
|
|
9
|
+
import { formatPathRelativeToCwd, resolveToCwd } from "../tools/path-utils";
|
|
10
10
|
import { ToolAbortError, throwIfAborted } from "../tools/tool-errors";
|
|
11
11
|
import { clampTimeout } from "../tools/tool-timeouts";
|
|
12
12
|
import {
|
|
@@ -562,7 +562,7 @@ async function getDiagnosticsForFile(
|
|
|
562
562
|
}
|
|
563
563
|
|
|
564
564
|
const uri = fileToUri(absolutePath);
|
|
565
|
-
const relPath =
|
|
565
|
+
const relPath = formatPathRelativeToCwd(absolutePath, cwd);
|
|
566
566
|
const allDiagnostics: Diagnostic[] = [];
|
|
567
567
|
const serverNames: string[] = [];
|
|
568
568
|
|
|
@@ -1229,7 +1229,7 @@ export class LspTool implements AgentTool<typeof lspSchema, LspToolDetails, Them
|
|
|
1229
1229
|
}
|
|
1230
1230
|
|
|
1231
1231
|
const uri = fileToUri(resolved);
|
|
1232
|
-
const relPath =
|
|
1232
|
+
const relPath = formatPathRelativeToCwd(resolved, this.session.cwd);
|
|
1233
1233
|
const allDiagnostics: Diagnostic[] = [];
|
|
1234
1234
|
|
|
1235
1235
|
// Query all applicable servers for this file
|
|
@@ -1707,7 +1707,7 @@ export class LspTool implements AgentTool<typeof lspSchema, LspToolDetails, Them
|
|
|
1707
1707
|
if (!result || result.length === 0) {
|
|
1708
1708
|
output = "No symbols found";
|
|
1709
1709
|
} else {
|
|
1710
|
-
const relPath =
|
|
1710
|
+
const relPath = formatPathRelativeToCwd(targetFile, this.session.cwd);
|
|
1711
1711
|
if ("selectionRange" in result[0]) {
|
|
1712
1712
|
const lines = (result as DocumentSymbol[]).flatMap(s => formatDocumentSymbol(s));
|
|
1713
1713
|
output = `Symbols in ${relPath}:\n${lines.join("\n")}`;
|
package/src/lsp/utils.ts
CHANGED
|
@@ -5,7 +5,7 @@ import path from "node:path";
|
|
|
5
5
|
import { isEnoent } from "@oh-my-pi/pi-utils";
|
|
6
6
|
import { type Theme, theme } from "../modes/theme/theme";
|
|
7
7
|
import { formatGroupedFiles } from "../tools/grouped-file-output";
|
|
8
|
-
import { resolveToCwd } from "../tools/path-utils";
|
|
8
|
+
import { formatPathRelativeToCwd, resolveToCwd } from "../tools/path-utils";
|
|
9
9
|
import type {
|
|
10
10
|
CodeAction,
|
|
11
11
|
Command,
|
|
@@ -229,7 +229,7 @@ export function formatDiagnosticsSummary(diagnostics: Diagnostic[]): string {
|
|
|
229
229
|
* Format a location as file:line:col relative to cwd.
|
|
230
230
|
*/
|
|
231
231
|
export function formatLocation(location: Location, cwd: string): string {
|
|
232
|
-
const file =
|
|
232
|
+
const file = formatPathRelativeToCwd(uriToFile(location.uri), cwd);
|
|
233
233
|
const line = location.range.start.line + 1;
|
|
234
234
|
const col = location.range.start.character + 1;
|
|
235
235
|
return `${file}:${line}:${col}`;
|
|
@@ -255,7 +255,7 @@ export function formatWorkspaceEdit(edit: WorkspaceEdit, cwd: string): string[]
|
|
|
255
255
|
// Handle changes map (legacy format)
|
|
256
256
|
if (edit.changes) {
|
|
257
257
|
for (const [uri, textEdits] of Object.entries(edit.changes)) {
|
|
258
|
-
const file =
|
|
258
|
+
const file = formatPathRelativeToCwd(uriToFile(uri), cwd);
|
|
259
259
|
results.push(`${file}: ${textEdits.length} edit${textEdits.length > 1 ? "s" : ""}`);
|
|
260
260
|
}
|
|
261
261
|
}
|
|
@@ -264,20 +264,20 @@ export function formatWorkspaceEdit(edit: WorkspaceEdit, cwd: string): string[]
|
|
|
264
264
|
if (edit.documentChanges) {
|
|
265
265
|
for (const change of edit.documentChanges) {
|
|
266
266
|
if ("edits" in change && change.textDocument) {
|
|
267
|
-
const file =
|
|
267
|
+
const file = formatPathRelativeToCwd(uriToFile(change.textDocument.uri), cwd);
|
|
268
268
|
results.push(`${file}: ${change.edits.length} edit${change.edits.length > 1 ? "s" : ""}`);
|
|
269
269
|
} else if ("kind" in change) {
|
|
270
270
|
switch (change.kind) {
|
|
271
271
|
case "create":
|
|
272
|
-
results.push(`CREATE: ${
|
|
272
|
+
results.push(`CREATE: ${formatPathRelativeToCwd(uriToFile(change.uri), cwd)}`);
|
|
273
273
|
break;
|
|
274
274
|
case "rename":
|
|
275
275
|
results.push(
|
|
276
|
-
`RENAME: ${
|
|
276
|
+
`RENAME: ${formatPathRelativeToCwd(uriToFile(change.oldUri), cwd)} ${theme.nav.cursor} ${formatPathRelativeToCwd(uriToFile(change.newUri), cwd)}`,
|
|
277
277
|
);
|
|
278
278
|
break;
|
|
279
279
|
case "delete":
|
|
280
|
-
results.push(`DELETE: ${
|
|
280
|
+
results.push(`DELETE: ${formatPathRelativeToCwd(uriToFile(change.uri), cwd)}`);
|
|
281
281
|
break;
|
|
282
282
|
}
|
|
283
283
|
}
|
package/src/mcp/manager.ts
CHANGED
|
@@ -472,7 +472,7 @@ export class MCPManager {
|
|
|
472
472
|
}
|
|
473
473
|
|
|
474
474
|
#replaceServerTools(name: string, tools: CustomTool<TSchema, MCPToolDetails>[]): void {
|
|
475
|
-
this.#tools = this.#tools.filter(t => !t.name.startsWith(`
|
|
475
|
+
this.#tools = this.#tools.filter(t => !t.name.startsWith(`mcp__${name}_`));
|
|
476
476
|
this.#tools.push(...tools);
|
|
477
477
|
}
|
|
478
478
|
|
|
@@ -644,8 +644,8 @@ export class MCPManager {
|
|
|
644
644
|
}
|
|
645
645
|
|
|
646
646
|
// Remove tools from this server and notify consumers
|
|
647
|
-
const hadTools = this.#tools.some(t => t.name.startsWith(`
|
|
648
|
-
this.#tools = this.#tools.filter(t => !t.name.startsWith(`
|
|
647
|
+
const hadTools = this.#tools.some(t => t.name.startsWith(`mcp__${name}_`));
|
|
648
|
+
this.#tools = this.#tools.filter(t => !t.name.startsWith(`mcp__${name}_`));
|
|
649
649
|
if (hadTools) this.#onToolsChanged?.(this.#tools);
|
|
650
650
|
|
|
651
651
|
// Notify prompt consumers so stale commands are cleared
|
package/src/mcp/tool-bridge.ts
CHANGED
|
@@ -159,7 +159,7 @@ async function reconnectWithAbort(reconnect: MCPReconnect, signal?: AbortSignal)
|
|
|
159
159
|
* Prefixes with server name to avoid conflicts. If the tool name already
|
|
160
160
|
* starts with the server name (e.g., server "puppeteer" with tool
|
|
161
161
|
* "puppeteer_screenshot"), strips the redundant prefix to produce
|
|
162
|
-
* "
|
|
162
|
+
* "mcp__puppeteer_screenshot" instead of "mcp__puppeteer_puppeteer_screenshot".
|
|
163
163
|
*/
|
|
164
164
|
function sanitizeMCPToolNamePart(value: string, fallback: string): string {
|
|
165
165
|
const sanitized = value
|
|
@@ -183,7 +183,7 @@ export function createMCPToolName(serverName: string, toolName: string): string
|
|
|
183
183
|
normalizedToolName = sanitizedToolName.slice(prefixWithUnderscore.length);
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
return `
|
|
186
|
+
return `mcp__${sanitizedServerName}_${normalizedToolName}`;
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
/**
|
|
@@ -193,9 +193,9 @@ export function createMCPToolName(serverName: string, toolName: string): string
|
|
|
193
193
|
* The original MCP tool name may have had the server name as a prefix.
|
|
194
194
|
*/
|
|
195
195
|
export function parseMCPToolName(name: string): { serverName: string; toolName: string } | null {
|
|
196
|
-
if (!name.startsWith("
|
|
196
|
+
if (!name.startsWith("mcp__")) return null;
|
|
197
197
|
|
|
198
|
-
const rest = name.slice(
|
|
198
|
+
const rest = name.slice(5);
|
|
199
199
|
const underscoreIdx = rest.indexOf("_");
|
|
200
200
|
if (underscoreIdx === -1) return null;
|
|
201
201
|
|
package/src/memories/index.ts
CHANGED
|
@@ -539,7 +539,7 @@ function shouldPersistResponseItemForMemories(message: AgentMessage): boolean {
|
|
|
539
539
|
}
|
|
540
540
|
if (role !== "toolResult") return false;
|
|
541
541
|
const toolName = (message as { toolName?: string }).toolName;
|
|
542
|
-
if (toolName === "bash" || toolName === "python" || toolName === "read" || toolName === "
|
|
542
|
+
if (toolName === "bash" || toolName === "python" || toolName === "read" || toolName === "search") {
|
|
543
543
|
const text = extractMessageText(message);
|
|
544
544
|
return text.length > 0 && text.length <= 32_000;
|
|
545
545
|
}
|
|
@@ -518,7 +518,7 @@ export class SessionObserverOverlayComponent extends Container {
|
|
|
518
518
|
case "write":
|
|
519
519
|
case "edit":
|
|
520
520
|
return args.path ? `path: ${args.path}` : "";
|
|
521
|
-
case "
|
|
521
|
+
case "search":
|
|
522
522
|
return [args.pattern ? `pattern: ${args.pattern}` : "", args.path ? `path: ${args.path}` : ""]
|
|
523
523
|
.filter(Boolean)
|
|
524
524
|
.join(", ");
|
|
@@ -214,15 +214,15 @@ const OPTION_PROVIDERS: Partial<Record<SettingPath, OptionProvider>> = {
|
|
|
214
214
|
{ value: "3", label: "3 reminders" },
|
|
215
215
|
{ value: "5", label: "5 reminders" },
|
|
216
216
|
],
|
|
217
|
-
//
|
|
218
|
-
"
|
|
217
|
+
// Search context
|
|
218
|
+
"search.contextBefore": [
|
|
219
219
|
{ value: "0", label: "0 lines" },
|
|
220
220
|
{ value: "1", label: "1 line" },
|
|
221
221
|
{ value: "2", label: "2 lines" },
|
|
222
222
|
{ value: "3", label: "3 lines" },
|
|
223
223
|
{ value: "5", label: "5 lines" },
|
|
224
224
|
],
|
|
225
|
-
"
|
|
225
|
+
"search.contextAfter": [
|
|
226
226
|
{ value: "0", label: "0 lines" },
|
|
227
227
|
{ value: "1", label: "1 line" },
|
|
228
228
|
{ value: "2", label: "2 lines" },
|
|
@@ -665,10 +665,10 @@ class TreeList implements Component {
|
|
|
665
665
|
.slice(0, 50);
|
|
666
666
|
return `[bash: ${cmd}${rawCmd.length > 50 ? "..." : ""}]`;
|
|
667
667
|
}
|
|
668
|
-
case "
|
|
668
|
+
case "search": {
|
|
669
669
|
const pattern = String(args.pattern || "");
|
|
670
670
|
const path = shortenPath(String(args.path || "."));
|
|
671
|
-
return `[
|
|
671
|
+
return `[search: /${pattern}/ in ${path}]`;
|
|
672
672
|
}
|
|
673
673
|
case "find": {
|
|
674
674
|
const pattern = String(args.pattern || "");
|
|
@@ -127,14 +127,38 @@ export class UiHelpers {
|
|
|
127
127
|
this.ctx.chatContainer.addChild(component);
|
|
128
128
|
break;
|
|
129
129
|
}
|
|
130
|
-
if (
|
|
130
|
+
if (
|
|
131
|
+
message.customType === "irc:incoming" ||
|
|
132
|
+
message.customType === "irc:autoreply" ||
|
|
133
|
+
message.customType === "irc:relay"
|
|
134
|
+
) {
|
|
131
135
|
const details = (
|
|
132
|
-
message as CustomMessage<{
|
|
136
|
+
message as CustomMessage<{
|
|
137
|
+
from?: string;
|
|
138
|
+
to?: string;
|
|
139
|
+
message?: string;
|
|
140
|
+
reply?: string;
|
|
141
|
+
body?: string;
|
|
142
|
+
kind?: "message" | "reply";
|
|
143
|
+
}>
|
|
133
144
|
).details;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
145
|
+
let arrow: string;
|
|
146
|
+
let body: string;
|
|
147
|
+
if (message.customType === "irc:incoming") {
|
|
148
|
+
const peer = details?.from ?? "?";
|
|
149
|
+
body = details?.message ?? "";
|
|
150
|
+
arrow = `\u21e6 ${peer}`;
|
|
151
|
+
} else if (message.customType === "irc:autoreply") {
|
|
152
|
+
const peer = details?.to ?? "?";
|
|
153
|
+
body = details?.reply ?? "";
|
|
154
|
+
arrow = `\u21e8 ${peer} (auto)`;
|
|
155
|
+
} else {
|
|
156
|
+
const from = details?.from ?? "?";
|
|
157
|
+
const to = details?.to ?? "?";
|
|
158
|
+
body = details?.body ?? "";
|
|
159
|
+
const suffix = details?.kind === "reply" ? " (auto)" : "";
|
|
160
|
+
arrow = `${from} \u21e8 ${to}${suffix}`;
|
|
161
|
+
}
|
|
138
162
|
const header = `${theme.fg("accent", `[IRC] ${arrow}`)}`;
|
|
139
163
|
this.ctx.chatContainer.addChild(new Text(header, 1, 0));
|
|
140
164
|
if (body) {
|
|
@@ -226,7 +250,7 @@ export class UiHelpers {
|
|
|
226
250
|
sessionContext: SessionContext,
|
|
227
251
|
options: { updateFooter?: boolean; populateHistory?: boolean } = {},
|
|
228
252
|
): void {
|
|
229
|
-
this
|
|
253
|
+
// Preserved: message_start handler owns this lifecycle (see #783)
|
|
230
254
|
this.ctx.pendingTools.clear();
|
|
231
255
|
|
|
232
256
|
if (options.updateFooter) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: librarian
|
|
3
3
|
description: Researches external libraries and APIs by reading source code. Returns definitive, source-verified answers.
|
|
4
|
-
tools: read,
|
|
4
|
+
tools: read, search, find, bash, lsp, web_search, ast_grep
|
|
5
5
|
model: pi/smol
|
|
6
6
|
thinking-level: minimal
|
|
7
7
|
output:
|
|
@@ -87,7 +87,7 @@ Before acting, determine what kind of question this is:
|
|
|
87
87
|
|
|
88
88
|
## 3. Investigate
|
|
89
89
|
- Read `package.json`, `Cargo.toml`, or equivalent for version info and entry points.
|
|
90
|
-
- Use `
|
|
90
|
+
- Use `search`, `find`, and `ast_grep` to locate relevant source, type definitions, and docs. Parallelize searches.
|
|
91
91
|
- Read the actual implementation — not just README examples. READMEs are aspirational; source code is truth.
|
|
92
92
|
- For behavior questions: trace through the implementation. Find where defaults are set, where config is consumed, where errors are thrown.
|
|
93
93
|
- Check tests for usage examples and edge case behavior — tests are the most honest documentation.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: plan
|
|
3
3
|
description: Software architect for complex multi-file architectural decisions. NOT for simple tasks, single-file changes, or tasks completable in <5 tool calls.
|
|
4
|
-
tools: read,
|
|
4
|
+
tools: read, search, find, bash, lsp, web_search, ast_grep
|
|
5
5
|
spawns: explore
|
|
6
6
|
model: pi/plan, pi/slow
|
|
7
7
|
thinking-level: high
|
|
@@ -14,7 +14,7 @@ You are an expert software architect analyzing the codebase and the user's reque
|
|
|
14
14
|
2. Identify ambiguities; list assumptions
|
|
15
15
|
|
|
16
16
|
## Phase 2: Explore
|
|
17
|
-
1. Find existing patterns via
|
|
17
|
+
1. Find existing patterns via `search`/`find`
|
|
18
18
|
2. Read key files; understand architecture
|
|
19
19
|
3. Trace data flow through relevant paths
|
|
20
20
|
4. Identify types, interfaces, contracts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: reviewer
|
|
3
3
|
description: "Code review specialist for quality/security analysis"
|
|
4
|
-
tools: read,
|
|
4
|
+
tools: read, search, find, bash, lsp, web_search, ast_grep, report_finding
|
|
5
5
|
spawns: explore
|
|
6
6
|
model: pi/slow
|
|
7
7
|
thinking-level: high
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
You are a worker agent for delegated tasks.
|
|
2
2
|
|
|
3
|
-
You have FULL access to all tools (edit, write, bash,
|
|
3
|
+
You have FULL access to all tools (edit, write, bash, search, read, etc.) and you **MUST** use them as needed to complete your task.
|
|
4
4
|
|
|
5
5
|
You **MUST** maintain hyperfocus on the task at hand, do not deviate from what was assigned to you.
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ You **MUST** maintain hyperfocus on the task at hand, do not deviate from what w
|
|
|
8
8
|
- You **MUST** finish only the assigned work and return the minimum useful result. Do not repeat what you have written to the filesystem.
|
|
9
9
|
- You **MAY** make file edits, run commands, and create files when your task requires it—and **SHOULD** do so.
|
|
10
10
|
- You **MUST** be concise. You **MUST NOT** include filler, repetition, or tool transcripts. User cannot even see you. Your result is just the notes you are leaving for yourself.
|
|
11
|
-
- You **SHOULD** prefer narrow
|
|
11
|
+
- You **SHOULD** prefer narrow lookups (`search`/`find`) then read only needed ranges. Do not bother yourself with anything beyond your current scope.
|
|
12
12
|
- You **SHOULD NOT** do full-file reads unless necessary.
|
|
13
13
|
- You **SHOULD** prefer edits to existing files over creating new ones.
|
|
14
14
|
- You **MUST NOT** create documentation files (*.md) unless explicitly requested.
|
|
@@ -42,7 +42,7 @@ Plan execution runs in fresh context (session cleared). You **MUST** make the pl
|
|
|
42
42
|
|
|
43
43
|
<procedure>
|
|
44
44
|
### 1. Explore
|
|
45
|
-
You **MUST** use `find`, `
|
|
45
|
+
You **MUST** use `find`, `search`, `read` to understand the codebase.
|
|
46
46
|
### 2. Interview
|
|
47
47
|
You **MUST** use `{{askToolName}}` to clarify:
|
|
48
48
|
- Ambiguous requirements
|