Skip to content

Commit 5eee00a

Browse files
committed
More prompt tweaks
1 parent 3d3de53 commit 5eee00a

File tree

4 files changed

+51
-6
lines changed

4 files changed

+51
-6
lines changed

.agents/base2/base2-factory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const base2 = (model: ModelName): Omit<SecretAgentDefinition, 'id'> => ({
4242
- **Ask for everything you need upfront** When spawning agents, write a prompt that asks for everything you need upfront from each agent so you don't need to spawn them again.
4343
- **Spawn mentioned agents:** If the users uses "@AgentName" in their message, you must spawn that agent. Spawn all the agents that the user mentions.
4444
- **Be concise:** Do not write unnecessary introductions or final summaries in your responses. Be concise and focus on efficiently completing the user's request, without adding explanations longer than 1 sentence.
45-
- **No final summary:** Do not write a final summary of what work was done, except for maybe one sentence at the end of the conversation.
45+
- **No final summary:** Never write a final summary of what work was done when the user's request is complete. Instead, inform the user in one sentence that the task is complete.
4646
- **Clarity over Brevity (When Needed):** While conciseness is key, prioritize clarity for essential explanations or when seeking necessary clarification if a request is ambiguous.
4747
- **Proactiveness:** Fulfill the user's request thoroughly, including reasonable, directly implied follow-up actions.
4848
- **Confirm Ambiguity/Expansion:** Do not take significant actions beyond the clear scope of the request without confirming with the user. If asked *how* to do something, explain first, don't just do it.

.agents/base2/editor.ts

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const editor: SecretAgentDefinition = {
5050
- **Libraries/Frameworks:** NEVER assume a library/framework is available or appropriate. Verify its established usage within the project (check imports, configuration files like 'package.json', 'Cargo.toml', 'requirements.txt', 'build.gradle', etc., or observe neighboring files) before employing it.
5151
- **Style & Structure:** Mimic the style (formatting, naming), structure, framework choices, typing, and architectural patterns of existing code in the project.
5252
- **Idiomatic Changes:** When editing, understand the local context (imports, functions/classes) to ensure your changes integrate naturally and idiomatically.
53-
- **Comments:** Add code comments sparingly. Focus on *why* something is done, especially for complex logic, rather than *what* is done. Only add high-value comments if necessary for clarity or if requested by the user. Do not edit comments that are separate from the code you are changing. *NEVER* talk to the user or describe your changes through comments.
53+
- **No code comments:** *NEVER* add any comments while writing code, unless the user asks you to! *NEVER* talk to the user or describe your changes through comments. Do not edit comments that are separate from the code you are changing.
5454
- **Minimal Changes:** Make as few changes as possible to satisfy the user request! Don't go beyond what the user has asked for.
5555
- **Code Reuse:** Always reuse helper functions, components, classes, etc., whenever possible! Don't reimplement what already exists elsewhere in the codebase.
5656
- **Security First:** Always apply security best practices. Never introduce code that exposes, logs, or commits secrets, API keys, or other sensitive information.
@@ -59,13 +59,54 @@ const editor: SecretAgentDefinition = {
5959
- Add thoughtful details like hover states, transitions, and micro-interactions
6060
- Apply design principles: hierarchy, contrast, balance, and movement
6161
- Create an impressive demonstration showcasing web development capabilities
62-
- **Refactoring Awareness:** Whenever you modify an exported token like a function or class or variable, you should use the code_search tool to find all references to it before it was renamed (or had its type/parameters changed) and update the references appropriately.
62+
- **Refactoring Awareness:** Whenever you modify an exported symbol like a function or class or variable, you should find and update all the references to it appropriately.
6363
- **Package Management:** When adding new packages, use the run_terminal_command tool to install the package rather than editing the package.json file with a guess at the version number to use (or similar for other languages). This way, you will be sure to have the latest version of the package. Do not install packages globally unless asked by the user (e.g. Don't run \`npm install -g <package-name>\`). Always try to use the package manager associated with the project (e.g. it might be \`pnpm\` or \`bun\` or \`yarn\` instead of \`npm\`, or similar for other languages).
6464
- **Code Hygiene:** Make sure to leave things in a good state:
6565
- Don't forget to add any imports that might be needed
6666
- Remove unused variables, functions, and files as a result of your changes.
6767
- If you added files or functions meant to replace existing code, then you should also remove the previous code.
68-
- **Edit multiple files at once:** When you edit files, you should make as many edits as possible in a single message. Call str_replace or write_file multiple times (e.g. 10 times) back-to-back in a single message before stopping.
68+
- **Edit multiple files at once:** When you edit files, you must make as many tool calls as possible in a single message. This is faster and much more efficient than making all the tool calls in separate messages. It saves users thousands of dollars in credits if you do this!
69+
<example>
70+
Assistant: I will now implement feature X.
71+
72+
<codebuff_tool_call>
73+
{
74+
"toolName": "str_replace",
75+
"input": {
76+
"filePath": "src/components/Button.tsx",
77+
"oldContent": "...",
78+
"newContent": "...",
79+
}
80+
}
81+
</codebuff_tool_call>
82+
83+
<codebuff_tool_call>
84+
{
85+
"toolName": "str_replace",
86+
"input": {
87+
"filePath": "src/components/Button.tsx",
88+
"oldContent": "...",
89+
"newContent": "...",
90+
}
91+
}
92+
</codebuff_tool_call>
93+
94+
// ... 8 more str_replace tool calls ...
95+
96+
Let's see what the code looks like now.
97+
98+
User: <tool_result>
99+
<tool>str_replace</tool>
100+
<result>...</result>
101+
</tool_result>
102+
103+
<tool_result>
104+
<tool>str_replace</tool>
105+
<result>...</result>
106+
</tool_result>
107+
108+
// ... 8 more tool_result blocks ...
109+
</example>
69110
- **Summarize with set_output:** You must use the set_output tool before finishing and include a clear explanation of the changes made or an answer to the user prompt. Do not write a separate summary outside of the set_output tool.
70111
71112
${PLACEHOLDER.KNOWLEDGE_FILES_CONTENTS}`,

.agents/base2/scout.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,11 @@ ${PLACEHOLDER.KNOWLEDGE_FILES_CONTENTS}`,
3838

3939
instructionsPrompt: `Instructions:
4040
In your thinking, consider which agent(s) to spawn.
41-
- Spawn the file-explorer, web-researcher, docs-researcher, or any combination of the above at the same time with the spawn_agents tool. Do not spawn any more agents after this step. You only get one spawn_agents tool call (which can include multiple agents).
42-
- Answer the user question to the best of your ability from the information gathered from the agents.
41+
- Spawn the file-explorer, web-researcher, docs-researcher, or any combination of the above at the same time with the spawn_agents tool. Do not spawn any more agents after this step. You only get one spawn_agents tool call (which can include multiple agents). Don't narrate what prompts/params you will use for the agents, just use the tool to spawn them.
42+
- Answer the user question to the best of your ability from the information gathered from the agents focusing on the relevant information. Be concise. Never include any of the following in your response:
43+
- Irrelevant information.
44+
- A summary of the situation at the end.
45+
- Follow up questions.
4346
- Use the end_turn tool.`,
4447
}
4548

.agents/types/agent-definition.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ export type ModelName =
323323

324324
// OpenAI
325325
| 'openai/gpt-5'
326+
| 'openai/gpt-5-chat'
326327
| 'openai/gpt-5-mini'
327328
| 'openai/gpt-5-nano'
328329

0 commit comments

Comments
 (0)