@workser/engine 0.1.0

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 (64) hide show
  1. package/NOTICE +8 -0
  2. package/README.md +70 -0
  3. package/dist/src/compact.d.ts +44 -0
  4. package/dist/src/compact.js +116 -0
  5. package/dist/src/engine.d.ts +84 -0
  6. package/dist/src/engine.js +142 -0
  7. package/dist/src/index.d.ts +13 -0
  8. package/dist/src/index.js +13 -0
  9. package/dist/src/model.d.ts +56 -0
  10. package/dist/src/model.js +153 -0
  11. package/dist/src/place/e2b.d.ts +76 -0
  12. package/dist/src/place/e2b.js +114 -0
  13. package/dist/src/place/env.d.ts +3 -0
  14. package/dist/src/place/env.js +14 -0
  15. package/dist/src/place/local.d.ts +33 -0
  16. package/dist/src/place/local.js +138 -0
  17. package/dist/src/prompts.d.ts +27 -0
  18. package/dist/src/prompts.js +108 -0
  19. package/dist/src/session.d.ts +115 -0
  20. package/dist/src/session.js +523 -0
  21. package/dist/src/tools/files.d.ts +9 -0
  22. package/dist/src/tools/files.js +209 -0
  23. package/dist/src/tools/patch.d.ts +49 -0
  24. package/dist/src/tools/patch.js +272 -0
  25. package/dist/src/tools/relay.d.ts +25 -0
  26. package/dist/src/tools/relay.js +82 -0
  27. package/dist/src/tools/search.d.ts +5 -0
  28. package/dist/src/tools/search.js +99 -0
  29. package/dist/src/tools/shell.d.ts +26 -0
  30. package/dist/src/tools/shell.js +123 -0
  31. package/dist/src/tools/types.d.ts +49 -0
  32. package/dist/src/tools/types.js +16 -0
  33. package/dist/src/tools/workser-tool.d.ts +39 -0
  34. package/dist/src/tools/workser-tool.js +51 -0
  35. package/dist/src/vendor.d.ts +4 -0
  36. package/dist/src/vendor.js +17 -0
  37. package/package.json +42 -0
  38. package/vendor/opencode-1.18.23/COMMIT +1 -0
  39. package/vendor/opencode-1.18.23/LICENSE +21 -0
  40. package/vendor/opencode-1.18.23/session/prompt/anthropic.txt +105 -0
  41. package/vendor/opencode-1.18.23/session/prompt/beast.txt +147 -0
  42. package/vendor/opencode-1.18.23/session/prompt/build-switch.txt +5 -0
  43. package/vendor/opencode-1.18.23/session/prompt/codex.txt +79 -0
  44. package/vendor/opencode-1.18.23/session/prompt/copilot-gpt-5.txt +143 -0
  45. package/vendor/opencode-1.18.23/session/prompt/default.txt +95 -0
  46. package/vendor/opencode-1.18.23/session/prompt/gemini.txt +155 -0
  47. package/vendor/opencode-1.18.23/session/prompt/gpt.txt +107 -0
  48. package/vendor/opencode-1.18.23/session/prompt/kimi.txt +95 -0
  49. package/vendor/opencode-1.18.23/session/prompt/meta.txt +65 -0
  50. package/vendor/opencode-1.18.23/session/prompt/plan-mode.txt +70 -0
  51. package/vendor/opencode-1.18.23/session/prompt/plan-reminder-anthropic.txt +67 -0
  52. package/vendor/opencode-1.18.23/session/prompt/plan.txt +26 -0
  53. package/vendor/opencode-1.18.23/session/prompt/trinity.txt +97 -0
  54. package/vendor/opencode-1.18.23/session/system.ts.ref +152 -0
  55. package/vendor/opencode-1.18.23/tool/apply_patch.txt +33 -0
  56. package/vendor/opencode-1.18.23/tool/edit-replace.ts +535 -0
  57. package/vendor/opencode-1.18.23/tool/edit.txt +10 -0
  58. package/vendor/opencode-1.18.23/tool/glob.txt +6 -0
  59. package/vendor/opencode-1.18.23/tool/grep.txt +8 -0
  60. package/vendor/opencode-1.18.23/tool/read.txt +14 -0
  61. package/vendor/opencode-1.18.23/tool/shell/prompt.ts.ref +293 -0
  62. package/vendor/opencode-1.18.23/tool/shell/shell.txt +21 -0
  63. package/vendor/opencode-1.18.23/tool/todowrite.txt +44 -0
  64. package/vendor/opencode-1.18.23/tool/write.txt +8 -0
@@ -0,0 +1,293 @@
1
+ import { Schema } from "effect"
2
+ import DESCRIPTION from "./shell.txt"
3
+ import { PositiveInt } from "@opencode-ai/core/schema"
4
+ import { Global } from "@opencode-ai/core/global"
5
+ import { ShellID } from "./id"
6
+
7
+ const PS = new Set(["powershell", "pwsh"])
8
+ const CMD = new Set(["cmd"])
9
+
10
+ export type Limits = {
11
+ maxLines: number
12
+ maxBytes: number
13
+ }
14
+
15
+ export function parameterSchema() {
16
+ return Schema.Struct({
17
+ command: Schema.String.annotate({ description: "The command to execute" }),
18
+ timeout: Schema.optional(PositiveInt).annotate({ description: "Optional timeout in milliseconds" }),
19
+ workdir: Schema.optional(Schema.String).annotate({
20
+ description: `The working directory to run the command in. Defaults to the current directory. Use this instead of 'cd' commands.`,
21
+ }),
22
+ })
23
+ }
24
+
25
+ export const Parameters = parameterSchema()
26
+ export type Parameters = Schema.Schema.Type<typeof Parameters>
27
+
28
+ function renderPrompt(template: string, values: Record<string, string>) {
29
+ return template.replace(/\$\{(\w+)\}/g, (_, key: string) => {
30
+ const value = values[key]
31
+ if (value === undefined) throw new Error(`Missing shell prompt value: ${key}`)
32
+ return value
33
+ })
34
+ }
35
+
36
+ function shellDisplayName(name: string) {
37
+ if (name === "pwsh") return "PowerShell (7+)"
38
+ if (name === "powershell") return "Windows PowerShell (5.1)"
39
+ if (name === "cmd") return "cmd.exe"
40
+ return name
41
+ }
42
+
43
+ function powershellNotes(name: string) {
44
+ if (name === "pwsh") {
45
+ return `# PowerShell (7+) shell notes
46
+ - This cross-platform shell supports pipeline chain operators (\`&&\` and \`||\`).
47
+ - Use double quotes for interpolated strings (\`"Hello $name"\`), single quotes for verbatim strings.
48
+ - Prefer full cmdlet names like \`Get-ChildItem\`, \`Set-Content\`, \`Remove-Item\`, and \`New-Item\` over aliases.
49
+ - Use \`$(...)\` for subexpressions. Use \`@(...)\` for array expressions.
50
+ - To call a native executable whose path contains spaces, use the call operator: \`& "path/to/exe" args\`.
51
+ - Escape special characters with the PowerShell backtick character.`
52
+ }
53
+ if (name === "powershell") {
54
+ return `# Windows PowerShell (5.1) shell notes
55
+ - Use \`cmd1; if ($?) { cmd2 }\` to chain dependent commands.
56
+ - Use double quotes for interpolated strings (\`"Hello $name"\`), single quotes for verbatim strings.
57
+ - Prefer full cmdlet names like \`Get-ChildItem\`, \`Set-Content\`, \`Remove-Item\`, and \`New-Item\` over aliases.
58
+ - Use \`$(...)\` for subexpressions. Use \`@(...)\` for array expressions.
59
+ - To call a native executable whose path contains spaces, use the call operator: \`& "path/to/exe" args\`.
60
+ - Escape special characters with the PowerShell backtick character.`
61
+ }
62
+ return ""
63
+ }
64
+
65
+ function chainGuidance(name: string) {
66
+ if (name === "powershell") {
67
+ return "If the commands depend on each other and must run sequentially, avoid '&&' in this shell because Windows PowerShell (5.1) does not support it. Use PowerShell conditionals such as `cmd1; if ($?) { cmd2 }` when later commands must depend on earlier success."
68
+ }
69
+ if (PS.has(name)) {
70
+ return "If the commands depend on each other and must run sequentially, use a single bash tool call with '&&' to chain them together (e.g., `git add . && git commit -m \"message\" && git push`). For instance, if one operation must complete before another starts (like New-Item before Copy-Item, Write before bash for git operations, or git add before git commit), run these operations sequentially instead."
71
+ }
72
+ if (CMD.has(name)) {
73
+ return "If the commands depend on each other and must run sequentially, use a single bash tool call with `&&` to chain them together (e.g., `mkdir out && dir out`). For instance, if one operation must complete before another starts, run these operations sequentially instead."
74
+ }
75
+ return "If the commands depend on each other and must run sequentially, use a single Bash call with '&&' to chain them together (e.g., `git add . && git commit -m \"message\" && git push`). For instance, if one operation must complete before another starts (like mkdir before cp, Write before Bash for git operations, or git add before git commit), run these operations sequentially instead."
76
+ }
77
+
78
+ function bashCommandSection(chain: string, limits: Limits, defaultTimeoutMs: number) {
79
+ return `Before executing the command, please follow these steps:
80
+
81
+ 1. Directory Verification:
82
+ - If the command will create new directories or files, first use \`ls\` to verify the parent directory exists and is the correct location
83
+ - For example, before running "mkdir foo/bar", first use \`ls foo\` to check that "foo" exists and is the intended parent directory
84
+
85
+ 2. Command Execution:
86
+ - Always quote file paths that contain spaces with double quotes (e.g., rm "path with spaces/file.txt")
87
+ - Examples of proper quoting:
88
+ - mkdir "/Users/name/My Documents" (correct)
89
+ - mkdir /Users/name/My Documents (incorrect - will fail)
90
+ - python "/path/with spaces/script.py" (correct)
91
+ - python /path/with spaces/script.py (incorrect - will fail)
92
+ - After ensuring proper quoting, execute the command.
93
+ - Capture the output of the command.
94
+
95
+ Usage notes:
96
+ - The command argument is required.
97
+ - You can specify an optional timeout in milliseconds. If not specified, commands will time out after ${defaultTimeoutMs}ms.
98
+ - If the output exceeds ${limits.maxLines} lines or ${limits.maxBytes} bytes, it will be truncated and the full output will be written to a file. You can use Read with offset/limit to read specific sections or Grep to search the full content. Do NOT use \`head\`, \`tail\`, or other truncation commands to limit output; the full output will already be captured to a file for more precise searching.
99
+
100
+ - Avoid using Bash with the \`find\`, \`grep\`, \`cat\`, \`head\`, \`tail\`, \`sed\`, \`awk\`, or \`echo\` commands, unless explicitly instructed or when these commands are truly necessary for the task. Instead, always prefer using the dedicated tools for these commands:
101
+ - File search: Use Glob (NOT find or ls)
102
+ - Content search: Use Grep (NOT grep or rg)
103
+ - Read files: Use Read (NOT cat/head/tail)
104
+ - Edit files: Use Edit (NOT sed/awk)
105
+ - Write files: Use Write (NOT echo >/cat <<EOF)
106
+ - Communication: Output text directly (NOT echo/printf)
107
+ - When issuing multiple commands:
108
+ - If the commands are independent and can run in parallel, make multiple bash tool calls in a single message. For example, if you need to run "git status" and "git diff", send a single message with two bash tool calls in parallel.
109
+ - ${chain}
110
+ - Use ';' only when you need to run commands sequentially but don't care if earlier commands fail
111
+ - DO NOT use newlines to separate commands (newlines are ok in quoted strings)
112
+ - AVOID using \`cd <directory> && <command>\`. Use the \`workdir\` parameter to change directories instead.
113
+ <good-example>
114
+ Use workdir="/foo/bar" with command: pytest tests
115
+ </good-example>
116
+ <bad-example>
117
+ cd /foo/bar && pytest tests
118
+ </bad-example>`
119
+ }
120
+
121
+ function powershellCommandSection(
122
+ name: string,
123
+ chain: string,
124
+ pathSep: string,
125
+ limits: Limits,
126
+ defaultTimeoutMs: number,
127
+ ) {
128
+ return `${powershellNotes(name)}
129
+
130
+ Before executing the command, please follow these steps:
131
+
132
+ 1. Directory Verification:
133
+ - If the command will create new directories or files, first use \`Test-Path -LiteralPath <parent>\` to verify the parent directory exists and is the correct location
134
+ - For example, before creating \`foo${pathSep}bar\`, first use \`Test-Path -LiteralPath "foo"\` to check that \`foo\` exists and is the intended parent directory
135
+
136
+ 2. Command Execution:
137
+ - Always quote file paths that contain spaces with double quotes (e.g., Remove-Item -LiteralPath "path with spaces${pathSep}file.txt")
138
+ - Examples of proper quoting:
139
+ - New-Item -ItemType Directory -Path "My Documents" (correct)
140
+ - New-Item -ItemType Directory -Path My Documents (incorrect - path is split)
141
+ - & "path with spaces${pathSep}script.ps1" (correct)
142
+ - path with spaces${pathSep}script.ps1 (incorrect - path is split and not invoked)
143
+ - After ensuring proper quoting, execute the command.
144
+ - Capture the output of the command.
145
+
146
+ Usage notes:
147
+ - The command argument is required.
148
+ - You can specify an optional timeout in milliseconds. If not specified, commands will time out after ${defaultTimeoutMs}ms.
149
+ - If the output exceeds ${limits.maxLines} lines or ${limits.maxBytes} bytes, it will be truncated and the full output will be written to a file. You can use Read with offset/limit to read specific sections or Grep to search the full content. Do NOT use \`Select-Object -First\`, \`Select-Object -Last\`, or other truncation commands to limit output; the full output will already be captured to a file for more precise searching.
150
+
151
+ - Avoid using Shell with PowerShell file/content cmdlets unless explicitly instructed or when these cmdlets are truly necessary for the task. Instead, always prefer using the dedicated tools for these commands:
152
+ - File search: Use Glob (NOT Get-ChildItem)
153
+ - Content search: Use Grep (NOT Select-String)
154
+ - Read files: Use Read (NOT Get-Content)
155
+ - Edit files: Use Edit (NOT Set-Content)
156
+ - Write files: Use Write (NOT Set-Content/Out-File or here-strings)
157
+ - Communication: Output text directly (NOT Write-Output/Write-Host)
158
+ - When issuing multiple commands:
159
+ - If the commands are independent and can run in parallel, make multiple bash tool calls in a single message. For example, if you need to run "git status" and "git diff", send a single message with two bash tool calls in parallel.
160
+ - ${chain}
161
+ - Use \`;\` only when you need to run commands sequentially but don't care if earlier commands fail
162
+ - DO NOT use newlines to separate commands (newlines are ok in quoted strings)
163
+ - AVOID changing directories inside the command. Use the \`workdir\` parameter to change directories instead.
164
+ <good-example>
165
+ Use workdir="project${pathSep}subdir" with command: pytest tests
166
+ </good-example>
167
+ <bad-example>
168
+ ${name === "powershell" ? `Set-Location -LiteralPath "project${pathSep}subdir"; if ($?) { pytest tests }` : `Set-Location -LiteralPath "project${pathSep}subdir" && pytest tests`}
169
+ </bad-example>`
170
+ }
171
+
172
+ function cmdCommandSection(chain: string, limits: Limits, defaultTimeoutMs: number) {
173
+ return `# cmd.exe shell notes
174
+ - Use double quotes for paths with spaces.
175
+ - Use %VAR% for environment variables.
176
+ - Use \`if exist\` for existence checks.
177
+ - Use \`call\` when invoking batch files from another batch-style command.
178
+
179
+ Before executing the command, please follow these steps:
180
+
181
+ 1. Directory Verification:
182
+ - If the command will create new directories or files, first use \`if exist\` to verify the parent directory exists and is the correct location
183
+ - For example, before creating \`foo\\bar\`, first use \`if exist "foo\\" dir "foo"\` to check that \`foo\` exists and is the intended parent directory
184
+
185
+ 2. Command Execution:
186
+ - Always quote file paths that contain spaces with double quotes (e.g., del "path with spaces\\file.txt")
187
+ - Examples of proper quoting:
188
+ - mkdir "My Documents" (correct)
189
+ - mkdir My Documents (incorrect - path is split)
190
+ - call "path with spaces\\script.bat" (correct)
191
+ - path with spaces\\script.bat (incorrect - path is split and not invoked correctly)
192
+ - After ensuring proper quoting, execute the command.
193
+ - Capture the output of the command.
194
+
195
+ Usage notes:
196
+ - The command argument is required.
197
+ - You can specify an optional timeout in milliseconds. If not specified, commands will time out after ${defaultTimeoutMs}ms.
198
+ - If the output exceeds ${limits.maxLines} lines or ${limits.maxBytes} bytes, it will be truncated and the full output will be written to a file. You can use Read with offset/limit to read specific sections or Grep to search the full content. Do NOT use \`more\` or other pagination commands to limit output; the full output will already be captured to a file for more precise searching.
199
+
200
+ - Avoid using Shell with cmd.exe file/content commands unless explicitly instructed or when these commands are truly necessary for the task. Instead, always prefer using the dedicated tools for these commands:
201
+ - File search: Use Glob (NOT dir /s)
202
+ - Content search: Use Grep (NOT findstr)
203
+ - Read files: Use Read (NOT type)
204
+ - Edit files: Use Edit (NOT copy)
205
+ - Write files: Use Write (NOT echo > file)
206
+ - Communication: Output text directly (NOT echo)
207
+ - When issuing multiple commands:
208
+ - If the commands are independent and can run in parallel, make multiple bash tool calls in a single message. For example, if you need to run "dir" and "where cmd", send a single message with two bash tool calls in parallel.
209
+ - ${chain}
210
+ - Use \`&\` only when you need to run commands sequentially but don't care if earlier commands fail
211
+ - DO NOT use newlines to separate commands (newlines are ok in quoted strings)
212
+ - AVOID changing directories inside the command. Use the \`workdir\` parameter to change directories instead.
213
+ <good-example>
214
+ Use workdir="project\\subdir" with command: dir
215
+ </good-example>
216
+ <bad-example>
217
+ cd /d "project\\subdir" && dir
218
+ </bad-example>`
219
+ }
220
+
221
+ function profile(name: string, platform: NodeJS.Platform, limits: Limits, defaultTimeoutMs: number) {
222
+ const isPowerShell = PS.has(name)
223
+ const chain = chainGuidance(name)
224
+ if (CMD.has(name)) {
225
+ return {
226
+ intro: `Executes a given ${shellDisplayName(name)} command with optional timeout, ensuring proper handling and security measures.`,
227
+ workdirSection:
228
+ "All commands run in the current working directory by default. Use the `workdir` parameter if you need to run a command in a different directory. AVOID changing directories inside the command - use `workdir` instead.",
229
+ commandSection: cmdCommandSection(chain, limits, defaultTimeoutMs),
230
+ gitCommands: "git commands",
231
+ gitCommandRestriction: "git commands",
232
+ createPrInstruction: "Create PR using a temporary body file so cmd.exe quoting stays simple.",
233
+ createPrExample: `(\n echo ## Summary\n echo - ^<1-3 bullet points^>\n) > pr-body.txt\ngh pr create --title "the pr title" --body-file pr-body.txt`,
234
+ }
235
+ }
236
+ if (isPowerShell) {
237
+ return {
238
+ intro: `Executes a given ${shellDisplayName(name)} command with optional timeout, ensuring proper handling and security measures.`,
239
+ workdirSection:
240
+ "All commands run in the current working directory by default. Use the `workdir` parameter if you need to run a command in a different directory. AVOID changing directories inside the command - use `workdir` instead.",
241
+ commandSection: powershellCommandSection(
242
+ name,
243
+ chain,
244
+ platform === "win32" ? "\\" : "/",
245
+ limits,
246
+ defaultTimeoutMs,
247
+ ),
248
+ gitCommands: "git commands",
249
+ gitCommandRestriction: "git commands",
250
+ createPrInstruction: "Create PR using gh pr create with a PowerShell here-string to pass the body correctly.",
251
+ createPrExample: `gh pr create --title "the pr title" --body @'
252
+ ## Summary
253
+ - <1-3 bullet points>
254
+ '@`,
255
+ }
256
+ }
257
+ return {
258
+ intro:
259
+ "Executes a given bash command in a persistent shell session with optional timeout, ensuring proper handling and security measures.",
260
+ workdirSection:
261
+ "All commands run in the current working directory by default. Use the `workdir` parameter if you need to run a command in a different directory. AVOID using `cd <directory> && <command>` patterns - use `workdir` instead.",
262
+ commandSection: bashCommandSection(chain, limits, defaultTimeoutMs),
263
+ gitCommands: "bash commands",
264
+ gitCommandRestriction: "git bash commands",
265
+ createPrInstruction:
266
+ "Create PR using gh pr create with the format below. Use a HEREDOC to pass the body to ensure correct formatting.",
267
+ createPrExample: `gh pr create --title "the pr title" --body "$(cat <<'EOF'
268
+ ## Summary
269
+ <1-3 bullet points>`,
270
+ }
271
+ }
272
+
273
+ export function render(name: string, platform: NodeJS.Platform, limits: Limits, defaultTimeoutMs: number) {
274
+ const selected = profile(name, platform, limits, defaultTimeoutMs)
275
+ return {
276
+ description: renderPrompt(DESCRIPTION, {
277
+ intro: selected.intro,
278
+ os: platform,
279
+ shell: name,
280
+ tmp: Global.Path.tmp,
281
+ workdirSection: selected.workdirSection,
282
+ commandSection: selected.commandSection,
283
+ gitCommands: selected.gitCommands,
284
+ toolName: ShellID.ToolID,
285
+ gitCommandRestriction: selected.gitCommandRestriction,
286
+ createPrInstruction: selected.createPrInstruction,
287
+ createPrExample: selected.createPrExample,
288
+ }),
289
+ parameters: parameterSchema(),
290
+ }
291
+ }
292
+
293
+ export * as ShellPrompt from "./prompt"
@@ -0,0 +1,21 @@
1
+ ${intro}
2
+
3
+ Be aware: OS: ${os}, Shell: ${shell}
4
+
5
+ ${workdirSection}
6
+
7
+ Use `${tmp}` for temporary work outside the workspace. This directory has already been created, already exists, and is pre-approved for external directory access.
8
+
9
+ IMPORTANT: This tool is for terminal operations like git, npm, docker, etc. DO NOT use it for file operations (reading, writing, editing, searching, finding files) - use the specialized tools for this instead.
10
+
11
+ ${commandSection}
12
+
13
+ # Git and GitHub
14
+ - Only commit, amend, push, or create PRs when explicitly requested.
15
+ - Before committing, inspect `git status`, `git diff`, and `git log --oneline -10`; stage only intended files and never commit secrets.
16
+ - Write a concise commit message that matches the repo style.
17
+ - Do not update git config, skip hooks, use interactive `-i`, force-push, or create empty commits unless explicitly requested.
18
+ - If a commit fails or hooks reject it, fix the issue and create a new commit; do not amend the failed commit.
19
+ - Before creating a PR, inspect status, diff, remote tracking, recent commits, and the diff from the base branch.
20
+ - Review all commits included in the PR, not just the latest commit.
21
+ - Use `gh` for GitHub tasks, including PRs, issues, checks, and releases; return the PR URL when done.
@@ -0,0 +1,44 @@
1
+ Create and maintain a structured task list for the current coding session. Tracks progress, organizes multi-step work, and surfaces status to the user.
2
+
3
+ ## When to use
4
+ Use proactively when:
5
+ - The task requires 3+ distinct steps or actions (not just 3 tool calls for a single conceptual step)
6
+ - The work is non-trivial and benefits from planning
7
+ - The user provides multiple tasks (numbered or comma-separated) or explicitly asks for a todo list
8
+ - New instructions arrive - capture them as todos
9
+ - You start a task - mark it `in_progress` (only one at a time) before working
10
+ - You finish a task - mark it `completed` and add any follow-ups discovered during the work
11
+
12
+ ## When NOT to use
13
+ Skip when:
14
+ - The work is a single, straightforward task (or <3 trivial steps)
15
+ - The request is purely informational or conversational
16
+ - Tracking adds no organizational value
17
+
18
+ ## States
19
+ - `pending` - not started
20
+ - `in_progress` - actively working (exactly ONE at a time)
21
+ - `completed` - finished successfully
22
+ - `cancelled` - no longer needed
23
+
24
+ ## Rules
25
+ - Update status in real time; don't batch completions
26
+ - Mark `completed` only after the required work is actually done, including any required verification. Never based on intent.
27
+ - Keep exactly one `in_progress` while work remains
28
+ - If blocked or partial, keep it `in_progress` and add a follow-up todo describing the blocker
29
+ - Preserve user-provided commands verbatim (flags, args, order)
30
+ - Items should be specific and actionable; break large work into smaller steps
31
+
32
+ ## Examples
33
+
34
+ Use it:
35
+ - "Add a dark mode toggle and run the tests" -> multi-step feature + explicit verification
36
+ - "Rename getCwd -> getCurrentWorkingDirectory across the repo" -> grep reveals 15 occurrences in 8 files
37
+ - "Implement registration, catalog, cart, checkout" -> multiple complex features
38
+
39
+ Skip it:
40
+ - "How do I print Hello World in Python?" -> informational
41
+ - "Add a comment to calculateTotal" -> single edit
42
+ - "Run npm install and tell me what happened" -> one command
43
+
44
+ When in doubt, use it.
@@ -0,0 +1,8 @@
1
+ Writes a file to the local filesystem.
2
+
3
+ Usage:
4
+ - This tool will overwrite the existing file if there is one at the provided path.
5
+ - If this is an existing file, you MUST use the Read tool first to read the file's contents. This tool will fail if you did not read the file first.
6
+ - ALWAYS prefer editing existing files in the codebase. NEVER write new files unless explicitly required.
7
+ - NEVER proactively create documentation files (*.md) or README files. Only create documentation files if explicitly requested by the User.
8
+ - Only use emojis if the user explicitly requests it. Avoid writing emojis to files unless asked.