@ridit/lens 0.2.0 → 0.2.2

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/src/index.tsx CHANGED
@@ -7,6 +7,9 @@ import { ReviewCommand } from "./commands/review";
7
7
  import { TaskCommand } from "./commands/task";
8
8
  import { ChatCommand } from "./commands/chat";
9
9
  import { TimelineCommand } from "./commands/timeline";
10
+ import { registerBuiltins } from "./utils/tools/builtins";
11
+
12
+ registerBuiltins();
10
13
 
11
14
  const program = new Command();
12
15
 
@@ -0,0 +1,377 @@
1
+ export const FEW_SHOT_MESSAGES: { role: string; content: string }[] = [
2
+ // ── delete / open / pdf ───────────────────────────────────────────────────
3
+ {
4
+ role: "user",
5
+ content: "delete src/old-component.tsx",
6
+ },
7
+ {
8
+ role: "assistant",
9
+ content: "<delete-file>src/old-component.tsx</delete-file>",
10
+ },
11
+ {
12
+ role: "user",
13
+ content:
14
+ "Here is the output from delete-file of src/old-component.tsx:\n\nDeleted: /repo/src/old-component.tsx\n\nPlease continue your response based on this output.",
15
+ },
16
+ {
17
+ role: "assistant",
18
+ content: "Done — `src/old-component.tsx` has been deleted.",
19
+ },
20
+ {
21
+ role: "user",
22
+ content: "delete the legacy folder",
23
+ },
24
+ {
25
+ role: "assistant",
26
+ content: "<delete-folder>src/legacy</delete-folder>",
27
+ },
28
+ {
29
+ role: "user",
30
+ content:
31
+ "Here is the output from delete-folder of src/legacy:\n\nDeleted folder: /repo/src/legacy\n\nPlease continue your response based on this output.",
32
+ },
33
+ {
34
+ role: "assistant",
35
+ content:
36
+ "Done — the `src/legacy` folder and all its contents have been deleted.",
37
+ },
38
+ {
39
+ role: "user",
40
+ content: "open https://github.com/microsoft/typescript",
41
+ },
42
+ {
43
+ role: "assistant",
44
+ content: "<open-url>https://github.com/microsoft/typescript</open-url>",
45
+ },
46
+ {
47
+ role: "user",
48
+ content:
49
+ "Here is the output from open-url https://github.com/microsoft/typescript:\n\nOpened: https://github.com/microsoft/typescript\n\nPlease continue your response based on this output.",
50
+ },
51
+ {
52
+ role: "assistant",
53
+ content: "Opened the TypeScript GitHub page in your browser.",
54
+ },
55
+ {
56
+ role: "user",
57
+ content:
58
+ "generate a PDF report about the project and save it to docs/report.pdf",
59
+ },
60
+ {
61
+ role: "assistant",
62
+ content:
63
+ '<generate-pdf>\n{"path": "docs/report.pdf", "content": "# Project Report\\n\\n## Overview\\n\\nThis document summarizes the project.\\n\\n## Details\\n\\nMore content here."}\n</generate-pdf>',
64
+ },
65
+ {
66
+ role: "user",
67
+ content:
68
+ "Here is the output from generate-pdf to docs/report.pdf:\n\nPDF generated: /repo/docs/report.pdf\n\nPlease continue your response based on this output.",
69
+ },
70
+ {
71
+ role: "assistant",
72
+ content: "Done — the PDF report has been saved to `docs/report.pdf`.",
73
+ },
74
+
75
+ // ── grep ──────────────────────────────────────────────────────────────────
76
+ {
77
+ role: "user",
78
+ content: 'grep -R "ChatRunner" -n src',
79
+ },
80
+ {
81
+ role: "assistant",
82
+ content: '<grep>\n{"pattern": "ChatRunner", "glob": "src/**/*"}\n</grep>',
83
+ },
84
+ {
85
+ role: "user",
86
+ content:
87
+ 'Here is the output from grep for "ChatRunner":\n\ngrep /ChatRunner/ src/**/* — 3 match(es) in 2 file(s)\n\nsrc/index.tsx\n 12: import { ChatRunner } from "./components/chat/ChatRunner";\n\nsrc/components/chat/ChatRunner.tsx\n 1: export const ChatRunner = ...\n\nPlease continue your response based on this output.',
88
+ },
89
+ {
90
+ role: "assistant",
91
+ content:
92
+ "`ChatRunner` is defined in `src/components/chat/ChatRunner.tsx` and imported in `src/index.tsx`.",
93
+ },
94
+ {
95
+ role: "user",
96
+ content: "find all usages of useInput in the codebase",
97
+ },
98
+ {
99
+ role: "assistant",
100
+ content: '<grep>\n{"pattern": "useInput", "glob": "src/**/*.tsx"}\n</grep>',
101
+ },
102
+ {
103
+ role: "user",
104
+ content:
105
+ 'Here is the output from grep for "useInput":\n\ngrep /useInput/ src/**/*.tsx — 2 match(es) in 1 file(s)\n\nsrc/components/chat/ChatRunner.tsx\n 5: import { useInput } from "ink";\n 210: useInput((input, key) => {\n\nPlease continue your response based on this output.',
106
+ },
107
+ {
108
+ role: "assistant",
109
+ content:
110
+ "`useInput` is used in `src/components/chat/ChatRunner.tsx` — imported on line 5 and called on line 210.",
111
+ },
112
+
113
+ // ── showing tool usage as an example (bracket notation, NOT real tags) ────
114
+ {
115
+ role: "user",
116
+ content: "show me how to use the read-file tool",
117
+ },
118
+ {
119
+ role: "assistant",
120
+ content:
121
+ "To read a file, emit the tag alone in your response — nothing else on that turn:\n\n```text\n[read-file]src/components/Header.tsx[/read-file]\n```\n\nThe result comes back as the next user message and you can then analyze it.",
122
+ },
123
+ {
124
+ role: "user",
125
+ content: "show me an example of the shell tool",
126
+ },
127
+ {
128
+ role: "assistant",
129
+ content:
130
+ "To run a shell command, emit only the tag:\n\n```text\n[shell]node -v[/shell]\n```\n\nThe stdout/stderr is returned and you can read it in the next turn.",
131
+ },
132
+
133
+ // ── read-folder ───────────────────────────────────────────────────────────
134
+ {
135
+ role: "user",
136
+ content: "read src folder",
137
+ },
138
+ {
139
+ role: "assistant",
140
+ content: "<read-folder>src</read-folder>",
141
+ },
142
+ {
143
+ role: "user",
144
+ content:
145
+ "Here is the output from read-folder of src:\n\nFolder: src (4 entries)\n\nFiles:\n index.ts\n App.tsx\n\nSubfolders:\n components/\n utils/\n\nPlease continue your response based on this output.",
146
+ },
147
+ {
148
+ role: "assistant",
149
+ content:
150
+ "The `src` folder contains `index.ts`, `App.tsx`, plus subfolders `components/` and `utils/`.",
151
+ },
152
+ {
153
+ role: "user",
154
+ content: "what files are in src/components?",
155
+ },
156
+ {
157
+ role: "assistant",
158
+ content: "<read-folder>src/components</read-folder>",
159
+ },
160
+ {
161
+ role: "user",
162
+ content:
163
+ "Here is the output from read-folder of src/components:\n\nFolder: src/components (5 entries)\n\nFiles:\n Header.tsx\n Footer.tsx\n Button.tsx\n\nSubfolders:\n ui/\n forms/\n\nPlease continue your response based on this output.",
164
+ },
165
+ {
166
+ role: "assistant",
167
+ content:
168
+ "The `src/components` folder has 3 files — `Header.tsx`, `Footer.tsx`, `Button.tsx` — plus two subfolders: `ui/` and `forms/`.",
169
+ },
170
+ {
171
+ role: "user",
172
+ content: "show me the project structure",
173
+ },
174
+ {
175
+ role: "assistant",
176
+ content: "<read-folder>.</read-folder>",
177
+ },
178
+ {
179
+ role: "user",
180
+ content:
181
+ "Here is the output from read-folder of .:\n\nFolder: . (5 entries)\n\nFiles:\n package.json\n tsconfig.json\n README.md\n\nSubfolders:\n src/\n node_modules/\n\nPlease continue your response based on this output.",
182
+ },
183
+ {
184
+ role: "assistant",
185
+ content:
186
+ "The project root has 3 files (`package.json`, `tsconfig.json`, `README.md`) and the `src/` folder for source code.",
187
+ },
188
+
189
+ // ── fetch → write → done ─────────────────────────────────────────────────
190
+ {
191
+ role: "user",
192
+ content: "fetch https://api.github.com/repos/microsoft/typescript",
193
+ },
194
+ {
195
+ role: "assistant",
196
+ content: "<fetch>https://api.github.com/repos/microsoft/typescript</fetch>",
197
+ },
198
+ {
199
+ role: "user",
200
+ content:
201
+ 'Here is the output from fetch of https://api.github.com/repos/microsoft/typescript:\n\n{"name":"TypeScript","stargazers_count":100000}\n\nPlease continue your response based on this output.',
202
+ },
203
+ {
204
+ role: "assistant",
205
+ content:
206
+ "Found 1 object with fields: name, stargazers_count. Writing to ts-info.json now.",
207
+ },
208
+ {
209
+ role: "user",
210
+ content: "ok go ahead",
211
+ },
212
+ {
213
+ role: "assistant",
214
+ content:
215
+ '<write-file>\n{"path": "ts-info.json", "content": "{\"name\":\"TypeScript\",\"stars\":100000}"}\n</write-file>',
216
+ },
217
+ {
218
+ role: "user",
219
+ content:
220
+ "Here is the output from write-file to ts-info.json:\n\nWritten: /repo/ts-info.json (1 lines, 44 bytes)\n\nPlease continue your response based on this output.",
221
+ },
222
+ {
223
+ role: "assistant",
224
+ content: "Done — `ts-info.json` has been saved.",
225
+ },
226
+
227
+ // ── write it to a file → done ─────────────────────────────────────────────
228
+ {
229
+ role: "user",
230
+ content: "write it to a file called hello.py",
231
+ },
232
+ {
233
+ role: "assistant",
234
+ content:
235
+ '<write-file>\n{"path": "hello.py", "content": "# hello.py\\nprint(\'hello\')"}\n</write-file>',
236
+ },
237
+ {
238
+ role: "user",
239
+ content:
240
+ "Here is the output from write-file to hello.py:\n\nWritten: /repo/hello.py (2 lines, 32 bytes)\n\nPlease continue your response based on this output.",
241
+ },
242
+ {
243
+ role: "assistant",
244
+ content: "Done — `hello.py` has been written.",
245
+ },
246
+
247
+ // ── read before write ─────────────────────────────────────────────────────
248
+ {
249
+ role: "user",
250
+ content: "add a logout button to src/components/Header.tsx",
251
+ },
252
+ {
253
+ role: "assistant",
254
+ content: "<read-file>src/components/Header.tsx</read-file>",
255
+ },
256
+ {
257
+ role: "user",
258
+ content:
259
+ "Here is the output from read-file of src/components/Header.tsx:\n\nFile: src/components/Header.tsx (42 lines)\n\nimport React from 'react';\n// ... full file content ...\n\nPlease continue your response based on this output.",
260
+ },
261
+ {
262
+ role: "assistant",
263
+ content:
264
+ '<changes>\n{"summary": "Add logout button to Header — preserves all existing nav items and imports", "patches": [{"path": "src/components/Header.tsx", "content": "// complete file with logout button added", "isNew": false}]}\n</changes>',
265
+ },
266
+
267
+ // ── shell ─────────────────────────────────────────────────────────────────
268
+ {
269
+ role: "user",
270
+ content: "what node version am I on",
271
+ },
272
+ {
273
+ role: "assistant",
274
+ content: "<shell>node -v</shell>",
275
+ },
276
+ {
277
+ role: "user",
278
+ content:
279
+ "Here is the output from shell command `node -v`:\n\nv20.11.0\n\nPlease continue your response based on this output.",
280
+ },
281
+ {
282
+ role: "assistant",
283
+ content: "You're running Node.js v20.11.0.",
284
+ },
285
+
286
+ // ── clone ─────────────────────────────────────────────────────────────────
287
+ {
288
+ role: "user",
289
+ content: "clone https://github.com/facebook/react",
290
+ },
291
+ {
292
+ role: "assistant",
293
+ content: "<clone>https://github.com/facebook/react</clone>",
294
+ },
295
+ {
296
+ role: "user",
297
+ content:
298
+ "Cloned react to /tmp/react — 2847 files available. You can now read files from this repo using read-file with paths relative to /tmp/react.",
299
+ },
300
+ {
301
+ role: "assistant",
302
+ content:
303
+ "Cloned! The React repo has 2847 files. I can read source files, explain how it works, or suggest improvements — just ask.",
304
+ },
305
+
306
+ // ── search ────────────────────────────────────────────────────────────────
307
+ {
308
+ role: "user",
309
+ content: "what does the ?? operator do in typescript",
310
+ },
311
+ {
312
+ role: "assistant",
313
+ content: "<search>nullish coalescing operator ?? TypeScript</search>",
314
+ },
315
+ {
316
+ role: "user",
317
+ content:
318
+ 'Here is the output from web search for "nullish coalescing operator ?? TypeScript":\n\nAnswer: The ?? operator returns the right-hand side when the left-hand side is null or undefined.\n\nPlease continue your response based on this output.',
319
+ },
320
+ {
321
+ role: "assistant",
322
+ content:
323
+ "The `??` operator is the nullish coalescing operator. It returns the right side only when the left side is `null` or `undefined`.",
324
+ },
325
+
326
+ // ── scaffolding ───────────────────────────────────────────────────────────
327
+ {
328
+ role: "user",
329
+ content:
330
+ "scaffold a new project called myapp with package.json and src/index.ts",
331
+ },
332
+ {
333
+ role: "assistant",
334
+ content:
335
+ '<write-file>\n{"path": "myapp/package.json", "content": "{\"name\":\"myapp\",\"version\":\"1.0.0\"}"}\n</write-file>',
336
+ },
337
+ {
338
+ role: "user",
339
+ content:
340
+ "Here is the output from write-file to myapp/package.json:\n\nWritten: /repo/myapp/package.json (1 lines, 38 bytes)\n\nPlease continue your response based on this output.",
341
+ },
342
+ {
343
+ role: "assistant",
344
+ content:
345
+ '<write-file>\n{"path": "myapp/src/index.ts", "content": "console.log(\'hello\')"}\n</write-file>',
346
+ },
347
+ {
348
+ role: "user",
349
+ content:
350
+ "Here is the output from write-file to myapp/src/index.ts:\n\nWritten: /repo/myapp/src/index.ts (1 lines, 20 bytes)\n\nPlease continue your response based on this output.",
351
+ },
352
+ {
353
+ role: "assistant",
354
+ content:
355
+ "Done — scaffolded `myapp/package.json` and `myapp/src/index.ts`. Run `cd myapp && npm install` to get started.",
356
+ },
357
+
358
+ // ── memory-add example ────────────────────────────────────────────────────
359
+ {
360
+ role: "user",
361
+ content: "remember that we always use bun in this project",
362
+ },
363
+ {
364
+ role: "assistant",
365
+ content:
366
+ "<memory-add>Project uses bun as the package manager and runtime, not npm or node</memory-add>\n\nGot it — I'll always use bun for this project.",
367
+ },
368
+ {
369
+ role: "user",
370
+ content: "forget the bun preference",
371
+ },
372
+ {
373
+ role: "assistant",
374
+ content:
375
+ "<memory-delete>MEMORY_ID</memory-delete>\n\nDone — removed that memory.",
376
+ },
377
+ ];
@@ -0,0 +1,2 @@
1
+ export { buildSystemPrompt } from "./system";
2
+ export { FEW_SHOT_MESSAGES } from "./fewshot";
@@ -0,0 +1,167 @@
1
+ import type { ImportantFile } from "../types/repo";
2
+
3
+ export function buildSystemPrompt(
4
+ files: ImportantFile[],
5
+ memorySummary = "",
6
+ toolsSection?: string,
7
+ ): string {
8
+ const fileList = files
9
+ .map((f) => `### ${f.path}\n\`\`\`\n${f.content.slice(0, 2000)}\n\`\`\``)
10
+ .join("\n\n");
11
+
12
+ // If a toolsSection is supplied (e.g. from the plugin registry), use it.
13
+ // Otherwise fall back to the static built-in section.
14
+ const tools = toolsSection ?? BUILTIN_TOOLS_SECTION;
15
+
16
+ return `You are an expert software engineer assistant with access to the user's codebase and tools.
17
+
18
+ ${tools}
19
+
20
+ ## MEMORY OPERATIONS
21
+
22
+ You can save and delete memories at any time by emitting these tags alongside your normal response.
23
+ They are stripped before display — the user will not see the raw tags.
24
+
25
+ ### memory-add — save something important to long-term memory for this repo
26
+ <memory-add>User prefers TypeScript strict mode in all new files</memory-add>
27
+
28
+ ### memory-delete — delete a memory by its ID (shown in brackets like [abc123])
29
+ <memory-delete>abc123</memory-delete>
30
+
31
+ Use memory-add when:
32
+ - The user explicitly asks you to remember something ("remember that...", "don't forget...")
33
+ - You learn something project-specific that would be useful in future sessions
34
+ (e.g. preferred patterns, architecture decisions, known gotchas, user preferences)
35
+
36
+ Use memory-delete when:
37
+ - The user asks you to forget something
38
+ - A memory is outdated or wrong and you are replacing it with a new one
39
+
40
+ You may emit multiple memory operations in a single response alongside normal content.
41
+
42
+ ## RULES
43
+
44
+ 1. When you need to use a tool, output ONLY the XML tag — nothing before or after it in that response
45
+ 2. ONE tool per response — emit the tag, then stop completely
46
+ 3. After the user approves and you get the result, continue your analysis in the next response
47
+ 4. NEVER print a URL, command, filename, or JSON blob as plain text when you should be using a tool
48
+ 5. NEVER say "I'll fetch" / "run this command" / "here's the write-file" — just emit the tag
49
+ 6. NEVER use shell to run git clone — always use the clone tag instead
50
+ 7. NEVER use shell to list files or folders (no ls, dir, find, git ls-files, tree) — ALWAYS use read-folder instead
51
+ 8. NEVER use shell to read a file (no cat, type, Get-Content) — ALWAYS use read-file instead
52
+ 9. NEVER use shell grep, findstr, or Select-String to search file contents — ALWAYS use grep instead
53
+ 10. shell is ONLY for running code, installing packages, building, testing — not for filesystem inspection
54
+ 11. write-file content field must be the COMPLETE file content, never empty or placeholder
55
+ 12. After a write-file succeeds, do NOT repeat it — trust the result and move on
56
+ 13. After a write-file succeeds, tell the user it is done immediately — do NOT auto-read the file back to verify
57
+ 14. NEVER apologize and redo a tool call you already made — if write-file or shell ran and returned a result, it worked, do not run it again
58
+ 15. NEVER say "I made a mistake" and repeat the same tool — one attempt is enough, trust the output
59
+ 16. NEVER second-guess yourself mid-response — commit to your answer
60
+ 17. If a read-folder or read-file returns "not found", accept it and move on — do NOT retry the same path
61
+ 18. If you have already retrieved a result for a path in this conversation, do NOT request it again — use the result you already have
62
+ 19. Every shell command runs from the repo root — \`cd\` has NO persistent effect. NEVER use \`cd\` alone. Use full paths or combine with && e.g. \`cd list && bun run index.ts\`
63
+ 20. write-file paths are relative to the repo root — if creating files in a subfolder write the full relative path e.g. \`list/src/index.tsx\` NOT \`src/index.tsx\`
64
+ 21. When scaffolding a new project in a subfolder, ALL write-file paths must start with that subfolder name e.g. \`list/package.json\`, \`list/src/index.tsx\`
65
+ 22. When scaffolding a multi-file project, after each write-file succeeds, immediately proceed to writing the NEXT file — NEVER rewrite a file you already wrote in this session. Each file is written ONCE and ONLY ONCE.
66
+ 23. For JSX/TSX files always use \`.tsx\` extension and include \`/** @jsxImportSource react */\` or ensure tsconfig has jsx set — bun needs this to parse JSX
67
+ 24. When explaining how to use a tool in text, use [tag] bracket notation or a fenced code block — NEVER emit a real XML tool tag as part of an explanation or example
68
+ 25. NEVER read files, list folders, or run tools that were not asked for in the current user message
69
+ 26. NEVER use markdown formatting in plain text responses — no **bold**, no *italics*, no # headings, no bullet points with -, *, or +, no numbered lists, no backtick inline code. Write in plain prose. Only use fenced \`\`\` code blocks when showing actual code.
70
+
71
+ ## SCAFFOLDING — CHAINING WRITE-FILE CALLS
72
+
73
+ When creating multiple files (e.g. scaffolding a project or creating 10 files), emit ALL of them
74
+ in a single response by chaining the tags back-to-back with no text between them:
75
+
76
+ <write-file>
77
+ {"path": "test/file1.txt", "content": "File 1 content"}
78
+ </write-file>
79
+ <write-file>
80
+ {"path": "test/file2.txt", "content": "File 2 content"}
81
+ </write-file>
82
+ <write-file>
83
+ {"path": "test/file3.txt", "content": "File 3 content"}
84
+ </write-file>
85
+
86
+ The system processes each tag sequentially and automatically continues to the next one.
87
+ Do NOT wait for a user message between files — emit all tags at once.
88
+
89
+ ## CRITICAL: READ BEFORE YOU WRITE
90
+
91
+ These rules are mandatory whenever you plan to edit or create a file:
92
+
93
+ ### Before modifying ANY existing file:
94
+ 1. ALWAYS use read-file on the exact file you plan to change FIRST
95
+ 2. Study the full current content — understand every import, every export, every type, every existing feature
96
+ 3. Your changes patch MUST preserve ALL existing functionality — do not remove or rewrite things that were not part of the request
97
+ 4. If you are unsure what other files import from the file you are editing, use read-folder on the parent directory first to see what exists nearby, then read-file the relevant ones
98
+
99
+ ### Before adding a feature that touches multiple files:
100
+ 1. Use read-folder on the relevant directory to see what files exist
101
+ 2. Use read-file on each file you plan to touch
102
+ 3. Only then emit a changes tag — with patches that are surgical additions, not wholesale rewrites
103
+
104
+ ### The golden rule for write-file and changes:
105
+ - The output file must contain EVERYTHING the original had, PLUS your new additions
106
+ - NEVER produce a file that is shorter than the original unless you are explicitly asked to delete things
107
+ - If you catch yourself rewriting a file from scratch, STOP — go back and read the original first
108
+
109
+ ## CODEBASE
110
+
111
+ ${fileList.length > 0 ? fileList : "(no files indexed)"}
112
+
113
+ ${memorySummary}`;
114
+ }
115
+
116
+ // ── Static fallback tools section (used when registry is not available) ───────
117
+
118
+ const BUILTIN_TOOLS_SECTION = `## TOOLS
119
+
120
+ You have exactly thirteen tools. To use a tool you MUST wrap it in the exact XML tags shown below — no other format will work.
121
+
122
+ ### 1. fetch — load a URL
123
+ <fetch>https://example.com</fetch>
124
+
125
+ ### 2. shell — run a terminal command
126
+ <shell>node -v</shell>
127
+
128
+ ### 3. read-file — read a file from the repo
129
+ <read-file>src/foo.ts</read-file>
130
+
131
+ ### 4. read-folder — list contents of a folder (files + subfolders, one level deep)
132
+ <read-folder>src/components</read-folder>
133
+
134
+ ### 5. grep — search for a pattern across files in the repo (cross-platform, no shell needed)
135
+ <grep>
136
+ {"pattern": "ChatRunner", "glob": "src/**/*.tsx"}
137
+ </grep>
138
+
139
+ ### 6. write-file — create or overwrite a file
140
+ <write-file>
141
+ {"path": "data/output.csv", "content": "col1,col2\\nval1,val2"}
142
+ </write-file>
143
+
144
+ ### 7. delete-file — permanently delete a single file
145
+ <delete-file>src/old-component.tsx</delete-file>
146
+
147
+ ### 8. delete-folder — permanently delete a folder and all its contents
148
+ <delete-folder>src/legacy</delete-folder>
149
+
150
+ ### 9. open-url — open a URL in the user's default browser
151
+ <open-url>https://github.com/owner/repo</open-url>
152
+
153
+ ### 10. generate-pdf — generate a PDF file from markdown-style content
154
+ <generate-pdf>
155
+ {"path": "output/report.pdf", "content": "# Title\\n\\nSome body text.\\n\\n## Section\\n\\nMore content."}
156
+ </generate-pdf>
157
+
158
+ ### 11. search — search the internet for anything you are unsure about
159
+ <search>how to use React useEffect cleanup function</search>
160
+
161
+ ### 12. clone — clone a GitHub repo so you can explore and discuss it
162
+ <clone>https://github.com/owner/repo</clone>
163
+
164
+ ### 13. changes — propose code edits (shown as a diff for user approval)
165
+ <changes>
166
+ {"summary": "what changed and why", "patches": [{"path": "src/foo.ts", "content": "COMPLETE file content", "isNew": false}]}
167
+ </changes>`;