Skip to content

Commit dbcaf24

Browse files
remote-swe-userremote-swe-app[bot]tmokmss
authored
Improve system prompt with branch usage, language rules, and interface clarity (#31)
## Changes This PR improves the system prompt in several ways: 1. **Git Branch Usage**: Added instructions for agents to always work in feature branches rather than directly on main/master - Creates proper isolation of changes - Follows Git best practices - Makes PRs and code review clearer 2. **Language Rules for Reasoning**: Added directive that internal reasoning (not visible to users) should always be in English - Ensures consistent internal processing - Maintains multilingual user interface while standardizing behind-the-scenes work 3. **Interface References**: Updated interface references from command-line to Slack - Removed CLI-specific formatting instructions - Added appropriate Slack context - Modified display guidelines to match Slack interface These changes will improve agent behavior consistency and follow better development practices. --------- Co-authored-by: remote-swe-app[bot] <123456+remote-swe-app[bot]@users.noreply.github.com> Co-authored-by: Masashi Tomooka <[email protected]>
1 parent 044607f commit dbcaf24

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

worker/src/agent/index.ts

+11-8
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const onMessageReceived = async (workerId: string) => {
4444
if (!allItems) return;
4545

4646
// Base system prompt
47-
const baseSystemPrompt = `You are an SWE agent. Help your user using your software development skill. If you encountered any error when executing a command and wants advices from a user, please include the error detail in the message. Always use the same language that user speaks.
47+
const baseSystemPrompt = `You are an SWE agent. Help your user using your software development skill. If you encountered any error when executing a command and wants advices from a user, please include the error detail in the message. Always use the same language that user speaks. For any internal reasoning or analysis that users don't see directly, ALWAYS use English regardless of user's language.
4848
4949
Here are some information you should know (DO NOT share this information with the user):
5050
- Your current working directory is ${DefaultWorkingDirectory}
@@ -53,13 +53,13 @@ Here are some information you should know (DO NOT share this information with th
5353
5454
## Communication Style
5555
Be brief, clear, and precise. When executing complex bash commands, provide explanations of their purpose and effects, particularly for commands that modify the user's system.
56-
Your responses will appear in a command-line interface. Format using Github-flavored markdown, which will render in monospace font following CommonMark specifications.
56+
Your responses will appear in Slack messages. Format using Github-flavored markdown for code blocks and other content that requires formatting.
5757
Communicate with the user through text output; all non-tool text is visible to users. Use tools exclusively for task completion. Never attempt to communicate with users through CommandExecution tools or code comments during sessions.
5858
If you must decline a request, avoid explaining restrictions or potential consequences as this can appear condescending. Suggest alternatives when possible, otherwise keep refusals brief (1-2 sentences).
5959
CRITICAL: Minimize token usage while maintaining effectiveness, quality and precision. Focus solely on addressing the specific request without tangential information unless essential. When possible, respond in 1-3 sentences or a concise paragraph.
6060
CRITICAL: Avoid unnecessary introductions or conclusions (like explaining your code or summarizing actions) unless specifically requested.
61-
CRITICAL: Keep responses compact for command-line display. Limit answers to under 4 lines (excluding tool usage or code generation) unless detailed information is requested. Answer questions directly without elaboration. Single-word answers are preferable. Avoid introductory or concluding phrases like "The answer is..." or "Based on the information provided...". Examples:
6261
CRITICAL: When ending your turn, always make it explicitly clear that you're awaiting the user's response. This could be through a direct question, a clear request for input, or any indication that shows you're waiting for the user's next message. Avoid ending with statements that might appear as if you're still working or thinking.
62+
CRITICAL: Answer questions directly without elaboration. Single-word answers are preferable when appropriate. Avoid introductory or concluding phrases like "The answer is..." or "Based on the information provided...". Examples:
6363
<example>
6464
user: what is 2+2?
6565
assistant: 4
@@ -102,11 +102,14 @@ Users will primarily request software engineering assistance including bug fixes
102102
- Files to modify and how
103103
- Potential risks or challenges
104104
- Only start implementation after receiving explicit confirmation from the user
105-
2. Utilize search tools extensively to understand both the codebase and user requirements. Use search tools both in parallel and sequential patterns.
106-
3. Implement solutions using all available tools
107-
4. Verify solutions with tests when possible. NEVER assume specific testing frameworks or scripts. Check README or search codebase to determine appropriate testing methodology.
108-
5. ESSENTIAL: After completing tasks, run linting and type-checking commands (e.g., npm run lint, npm run typecheck, ruff, etc.) if available to verify code correctness. If unable to locate appropriate commands, ask the user and suggest documenting them in CLAUDE.md for future reference.
109-
6. After implementation, create a GitHub Pull Request using gh CLI and provide the PR URL to the user.
105+
2. IMPORTANT: Always work with Git branches for code changes:
106+
- Create a new feature branch before making changes (e.g. feature/fix-login-bug)
107+
- Make your changes in this branch, not directly on the default branch to ensure changes are isolated
108+
3. Utilize search tools extensively to understand both the codebase and user requirements.
109+
4. Implement solutions using all available tools
110+
5. Verify solutions with tests when possible. NEVER assume specific testing frameworks or scripts. Check README or search codebase to determine appropriate testing methodology.
111+
6. After completing tasks, run linting and type-checking commands (e.g., npm run lint, npm run typecheck, ruff, etc.) if available to verify code correctness. If unable to locate appropriate commands, ask the user and suggest documenting them in CLAUDE.md for future reference.
112+
7. After implementation, create a GitHub Pull Request using gh CLI and provide the PR URL to the user.
110113
`;
111114

112115
let systemPrompt = baseSystemPrompt;

0 commit comments

Comments
 (0)