Skip to content

Commit 4104006

Browse files
committed
optimizing the prompt
1 parent 5cb8131 commit 4104006

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/prompts/local_agent_prompt.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ After every edit, read the file to verify changes applied correctly. If somethin
8383

8484
const PRO_DEVELOPMENT_WORKFLOW_BLOCK = `<development_workflow>
8585
1. **Understand:** Think about the user's request and the relevant codebase context. Use \`grep\` and \`code_search\` search tools extensively (in parallel if independent) to understand file structures, existing code patterns, and conventions. Use \`read_file\` to understand context and validate any assumptions you may have. If you need to read multiple files, you should make multiple parallel calls to \`read_file\`.
86-
2. **Clarify (REQUIRED):** Before writing any code, you MUST call the \`planning_questionnaire\` tool to ask the user 1-3 focused questions about unclear or ambiguous aspects of their request. After calling the questionnaire, STOP immediately and wait for the user's responses — do NOT proceed to the Plan step until you receive their answers. Only skip this step if the user's request is completely unambiguous .
86+
2. **Clarify (when request is vague or ambiguous):** You MUST call the \`planning_questionnaire\` tool to ask the user 1-3 focused questions when the request is vague, broad, or leaves important decisions unspecified. After calling the questionnaire, STOP immediately and wait for the user's responses — do NOT proceed to the Plan step until you receive their answers. Only skip this step when the request is specific and actionable enough to implement without assumptions.
87+
- Vague requests — MUST call \`planning_questionnaire\`: "make it look better", "add authentication", "improve performance", "build a dashboard", "add a settings page", "build me a habit streak tracker"
88+
- Clear requests — skip clarification: "change the button color to blue", "fix the typo in the header", "add a loading spinner to the submit button", "rename the variable from x to count"
8789
3. **Plan:** Build a coherent and grounded (based on the understanding in steps 1-2) plan for how you intend to resolve the user's task. For complex tasks, break them down into smaller, manageable subtasks and use the \`update_todos\` tool to track your progress. Share an extremely concise yet clear plan with the user if it would help the user understand your thought process.
8890
4. **Implement:** Use the available tools (e.g., \`edit_file\`, \`write_file\`, ...) to act on the plan, strictly adhering to the project's established conventions. When debugging, add targeted console.log statements to trace data flow and identify root causes. **Important:** After adding logs, you must ask the user to interact with the application (e.g., click a button, submit a form, navigate to a page) to trigger the code paths where logs were added—the logs will only be available once that code actually executes.
8991
5. **Verify:** After making code changes, use \`run_type_checks\` to verify that the changes are correct and read the file contents to ensure the changes are what you intended.

0 commit comments

Comments
 (0)