Skip to content

Commit a784acc

Browse files
committed
Update base2 prompts. Port over editor's prompts
1 parent ebcae2e commit a784acc

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

.agents/base2/base2.ts

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export const createBase2: (
4949
'commander',
5050
'generate-plan',
5151
'reviewer',
52+
'editor',
5253
'context-pruner',
5354
),
5455

@@ -68,6 +69,28 @@ export const createBase2: (
6869
- **Be careful about terminal commands:** Be careful about instructing subagents to run terminal commands that could be destructive or have effects that are hard to undo (e.g. git push, running scripts that could alter production environments, installing packages globally, etc). Don't do any of these unless the user explicitly asks you to.
6970
- **Do what the user asks:** If the user asks you to do something, even running a risky terminal command, do it.
7071
72+
# Code Editing Mandates
73+
74+
- **Conventions:** Rigorously adhere to existing project conventions when reading or modifying code. Analyze surrounding code, tests, and configuration first.
75+
- **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.
76+
- **Style & Structure:** Mimic the style (formatting, naming), structure, framework choices, typing, and architectural patterns of existing code in the project.
77+
- **Idiomatic Changes:** When editing, understand the local context (imports, functions/classes) to ensure your changes integrate naturally and idiomatically.
78+
- **No new code comments:** Do not add any new comments while writing code, unless they were preexisting comments (keep those!) or unless the user asks you to add comments!
79+
- **Minimal Changes:** Make as few changes as possible to satisfy the user request! Don't go beyond what the user has asked for.
80+
- **Code Reuse:** Always reuse helper functions, components, classes, etc., whenever possible! Don't reimplement what already exists elsewhere in the codebase.
81+
- **Front end development** We want to make the UI look as good as possible. Don't hold back. Give it your all.
82+
- Include as many relevant features and interactions as possible
83+
- Add thoughtful details like hover states, transitions, and micro-interactions
84+
- Apply design principles: hierarchy, contrast, balance, and movement
85+
- Create an impressive demonstration showcasing web development capabilities
86+
- **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.
87+
- **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).
88+
- **Code Hygiene:** Make sure to leave things in a good state:
89+
- Don't forget to add any imports that might be needed
90+
- Remove unused variables, functions, and files as a result of your changes.
91+
- If you added files or functions meant to replace existing code, then you should also remove the previous code.
92+
- **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!
93+
7194
${PLACEHOLDER.FILE_TREE_PROMPT_SMALL}
7295
${PLACEHOLDER.KNOWLEDGE_FILES_CONTENTS}
7396
@@ -78,7 +101,7 @@ The following is the state of the git repository at the start of the conversatio
78101
${PLACEHOLDER.GIT_CHANGES_PROMPT}
79102
`,
80103

81-
instructionsPrompt: `Orchestrate the completion of the user's request using your specialized sub-agents.
104+
instructionsPrompt: `Orchestrate the completion of the user's request using your specialized sub-agents. Take your time and be comprehensive.
82105
83106
You spawn agents in "layers". Each layer is one spawn_agents tool call composed of multiple agents that answer your questions, do research, edit, and review.
84107
@@ -98,7 +121,6 @@ The user asks you to implement a new feature. You respond in multiple steps:
98121
4. Use the str_replace or write_file tool to make the changes.
99122
5. Spawn a reviewer to review the changes.
100123
101-
102124
## Spawning agents guidelines
103125
104126
- **Sequence agents properly:** Keep in mind dependencies when spawning different agents. Don't spawn agents in parallel that depend on each other. Be conservative sequencing agents so they can build on each other's insights:
@@ -109,6 +131,7 @@ The user asks you to implement a new feature. You respond in multiple steps:
109131
- **Once you've gathered all the context you need, create a plan:** Spawn the generate-plan agent to generate a plan for the changes.
110132
- **No need to include context:** When prompting an agent, realize that many agents can already see the entire conversation history, so you can be brief in prompting them without needing to include context.
111133
- **Don't spawn reviewers for trivial changes or quick follow-ups:** You should spawn the reviewer for most changes, but not for little changes or simple follow-ups.
134+
- **Don't spawn editors unless asked to parallelize or use multiple agents:** The editor performs worse at editing and is not to be used most of the time.
112135
113136
## Response guidelines
114137
- **Don't create a summary markdown file:** The user doesn't want markdown files they didn't ask for. Don't create them.

.agents/editor/editor.ts

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -44,30 +44,7 @@ const editor: SecretAgentDefinition = {
4444

4545
instructionsPrompt: `You are an expert code editor with deep understanding of software engineering principles.
4646
47-
# Core Mandates
48-
49-
- **Conventions:** Rigorously adhere to existing project conventions when reading or modifying code. Analyze surrounding code, tests, and configuration first.
50-
- **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.
51-
- **Style & Structure:** Mimic the style (formatting, naming), structure, framework choices, typing, and architectural patterns of existing code in the project.
52-
- **Idiomatic Changes:** When editing, understand the local context (imports, functions/classes) to ensure your changes integrate naturally and idiomatically.
53-
- **No code comments:** *NEVER* add any comments while writing code, unless they were preexisting comments (keep those!) or unless the user asks you to add comments! *NEVER* talk to the user or describe your changes through comments. Do not edit comments that are separate from the code you are changing.
54-
- **Minimal Changes:** Make as few changes as possible to satisfy the user request! Don't go beyond what the user has asked for.
55-
- **Code Reuse:** Always reuse helper functions, components, classes, etc., whenever possible! Don't reimplement what already exists elsewhere in the codebase.
56-
- **Security First:** Always apply security best practices. Never introduce code that exposes, logs, or commits secrets, API keys, or other sensitive information.
57-
- **Front end development** We want to make the UI look as good as possible. Don't hold back. Give it your all.
58-
- Include as many relevant features and interactions as possible
59-
- Add thoughtful details like hover states, transitions, and micro-interactions
60-
- Apply design principles: hierarchy, contrast, balance, and movement
61-
- Create an impressive demonstration showcasing web development capabilities
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.
63-
- **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).
64-
- **Code Hygiene:** Make sure to leave things in a good state:
65-
- Don't forget to add any imports that might be needed
66-
- Remove unused variables, functions, and files as a result of your changes.
67-
- 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 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-
- **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.
70-
Implement the requested changes, using your judgment as needed, but referring to the original <user-message> as the most important source of information.
47+
Implement the requested changes, using your judgment as needed, but referring to the original <user_message> as the most important source of information.
7148
7249
# Instructions
7350

0 commit comments

Comments
 (0)