Skip to content

Commit dd6804f

Browse files
committed
Standardize agentic CLI prompt requirements for preloaded context and forbidden tools across commands and docs
- fix 'requirements' in readme - add preloaded_context to 'code at cursor' and 'commit messages' requirements
1 parent 41bc9c5 commit dd6804f

6 files changed

Lines changed: 23 additions & 13 deletions

File tree

‎README.md‎

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ Output strictly as a bulleted list of file paths without explanations or any oth
150150
151151
# Requirements
152152
153-
- Modifying the file system or running any shell commands (grep, glob, ls, git, etc.) is FORBIDDEN.
153+
- All project's files were preloaded to [files](#files). You cannot look for other files.
154+
- Calling tools, including shell commands (e.g. grep, glob, ls, git, etc.) is FORBIDDEN.
154155
155156
# Query
156157
@@ -194,8 +195,10 @@ Whenever showing a new, updated, renamed, or deleted file, provide a brief expla
194195
195196
# Requirements
196197
197-
- All project's files were preloaded to [files](#files). If [task](#task) includes *.png image paths, read them using the appropriate tool.
198-
- You may only perform file operations (create, update, delete) required to complete the [task](#task); running any shell commands (grep, glob, ls, git, etc.) is FORBIDDEN.
198+
- All project's files were preloaded to [files](#files). You cannot look for other files.
199+
- Calling tools, including shell commands (e.g. grep, glob, ls, git, etc.) is FORBIDDEN.
200+
- Exception: If [task](#task) includes *.png image paths, read them using the appropriate tool.
201+
- Exception: Perform file system operations (create, update, delete) required to complete the [task](#task).
199202
200203
# Task
201204
@@ -233,8 +236,9 @@ _Explanations, planning, and analysis._
233236
234237
# Requirements
235238
236-
- All project's files were preloaded to [files](#files). If [task](#task) includes *.png image paths, read them using the appropriate tool.
237-
- You may only use tools to read images from [task](#task). Modifying the file system or running any shell commands (grep, glob, ls, git, etc.) is FORBIDDEN.
239+
- All project's files were preloaded to [files](#files). You cannot look for other files.
240+
- Calling tools, including shell commands (e.g. grep, glob, ls, git, etc.) is FORBIDDEN.
241+
- Exception: If [task](#task) includes *.png image paths, read them using the appropriate tool.
238242
239243
# Task
240244
@@ -323,7 +327,8 @@ Example:
323327
324328
# Requirements
325329
326-
- Modifying the file system or running any shell commands (grep, glob, ls, git, etc.) is FORBIDDEN.
330+
- All project's files were preloaded to [files](#files). You cannot look for other files.
331+
- Calling tools, including shell commands (e.g. grep, glob, ls, git, etc.) is FORBIDDEN.
327332
328333
# Task
329334
@@ -382,7 +387,8 @@ Your response must begin with "**Commit message:**", then proceed with the messa
382387
383388
# Requirements
384389
385-
- Modifying the file system or running any shell commands (grep, glob, ls, git, etc.) is FORBIDDEN.
390+
- All project's files were preloaded to [files](#files). You cannot look for other files.
391+
- Calling tools, including shell commands (e.g. grep, glob, ls, git, etc.) is FORBIDDEN.
386392
387393
# Task
388394

‎apps/editor/src/commands/code-at-cursor-command/utils/perform-code-at-cursor.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,10 @@ export const perform_code_at_cursor = async (params: {
356356
}${text_after_cursor}`
357357
},
358358
output_formatting: code_at_cursor_output_formatting,
359-
requirements: [cli_edit_ask_requirements.restrict_shell_commands],
359+
requirements: [
360+
cli_edit_ask_requirements.preloaded_context,
361+
cli_edit_ask_requirements.restrict_shell_commands
362+
],
360363
user_instructions: code_at_cursor_user_instructions
361364
})
362365

‎apps/editor/src/commands/generate-commit-message-commands/utils/build-commit-message-prompt.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ export const build_commit_message_prompt = async (
220220

221221
const api_prompt = `${prompt_sections}\n\n# Task\n\n${commit_message_prompt}`
222222
const chatbot_prompt = `${prompt_sections}\n\n# Output formatting\n\n${commit_message_format}\n\n# Task\n\n${commit_message_prompt}`
223-
const cli_prompt = `${prompt_sections}\n\n# Output formatting\n\n${commit_message_format}\n\n# Requirements\n\n- ${cli_edit_ask_requirements.restrict_shell_commands}\n\n# Task\n\n${commit_message_prompt}`
223+
const cli_prompt = `${prompt_sections}\n\n# Output formatting\n\n${commit_message_format}\n\n# Requirements\n\n- ${cli_edit_ask_requirements.preloaded_context}\n- ${cli_edit_ask_requirements.restrict_shell_commands}\n\n# Task\n\n${commit_message_prompt}`
224224

225225
return { api_prompt, chatbot_prompt, cli_prompt }
226226
}

‎apps/editor/src/constants/instructions.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,10 @@ export const voice_input_instructions =
6969
'Respond with a transcription of the following audio recording or text "INAUDIBLE", and nothing else.'
7070

7171
export const cli_edit_ask_requirements = {
72-
preloaded_context: "All project's files were preloaded to [files](#files).",
72+
preloaded_context:
73+
"All project's files were preloaded to [files](#files). You cannot look for other files.",
7374
restrict_shell_commands:
74-
'Calling tools, including shell commands (grep, glob, ls, git, etc.) is FORBIDDEN.',
75+
'Calling tools, including shell commands (e.g. grep, glob, ls, git, etc.) is FORBIDDEN.',
7576
exception_read_images:
7677
'Exception: If [task](#task) includes *.png image paths, read them using the appropriate tool.',
7778
exception_allow_file_system_operations:

‎apps/editor/src/features/search-files/search-modes/perform-intelligent-search-mode.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ export const perform_intelligent_search_mode = async (params: {
404404
?.defaultValue ||
405405
''
406406

407-
const cli_prompt = `# Files\n\n${md_files}# Task\n\n${base_instructions}\n\n# Output formatting\n\n${ai_file_search_format_instructions}\n\n# Requirements\n\n- ${cli_edit_ask_requirements.restrict_shell_commands}\n\n# Query\n\n${search_term}`
407+
const cli_prompt = `# Files\n\n${md_files}# Task\n\n${base_instructions}\n\n# Output formatting\n\n${ai_file_search_format_instructions}\n\n# Requirements\n\n- ${cli_edit_ask_requirements.preloaded_context}\n- ${cli_edit_ask_requirements.restrict_shell_commands}\n\n# Query\n\n${search_term}`
408408

409409
const invoke_cli_result = await invoke_agentic_cli({
410410
workspace_provider: params.workspace_provider,

‎apps/editor/src/views/prompt/backend/message-handlers/utils/build-cli-prompt.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ export const build_cli_prompt = async (params: {
7575
}
7676

7777
const requirements_list = [cli_edit_ask_requirements.preloaded_context]
78+
requirements_list.push(cli_edit_ask_requirements.restrict_shell_commands)
7879

7980
if (prompt_view_provider.cli_prompt_type == 'edit-files') {
8081
requirements_list.push(cli_edit_ask_requirements.exception_read_images)
8182
requirements_list.push(
8283
cli_edit_ask_requirements.exception_allow_file_system_operations
8384
)
8485
} else {
85-
requirements_list.push(cli_edit_ask_requirements.restrict_shell_commands)
8686
requirements_list.push(cli_edit_ask_requirements.exception_read_images)
8787
}
8888

0 commit comments

Comments
 (0)