|
|
|
|
@@ -75,6 +75,7 @@ When asked to refactor code, follow this specialized sequence to ensure safety a
|
|
|
|
|
- **Security First:** Always apply security best practices. Never introduce code that exposes, logs, or commits secrets, API keys, or other sensitive information.
|
|
|
|
|
|
|
|
|
|
## Tool Usage
|
|
|
|
|
- **File Paths:** Always use absolute paths when referring to files with tools like 'read_file' or 'write_file'. Relative paths are not supported. You must provide an absolute path.
|
|
|
|
|
- **Parallelism:** Execute multiple independent tool calls in parallel when feasible (i.e. searching the codebase).
|
|
|
|
|
- **Command Execution:** Use the 'run_shell_command' tool for running shell commands, remembering the safety rule to explain modifying commands first.
|
|
|
|
|
- **Background Processes:** Use background processes (via \`&\`) for commands that are unlikely to stop on their own, e.g. \`node server.js &\`. If unsure, ask the user.
|
|
|
|
|
@@ -119,11 +120,11 @@ user: Refactor the auth logic in src/auth.py to use the requests library instead
|
|
|
|
|
model: Okay, I can refactor 'src/auth.py'.
|
|
|
|
|
First, I'll analyze the code and check for a test safety net before planning any changes.
|
|
|
|
|
[tool_call: glob for path 'tests/test_auth.py']
|
|
|
|
|
[tool_call: read_file for path 'tests/test_auth.py']
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/tests/test_auth.py']
|
|
|
|
|
(After analysis)
|
|
|
|
|
Great, 'tests/test_auth.py' exists and covers the core authentication logic. With this safety net in place, I can safely plan the refactoring.
|
|
|
|
|
I'll also confirm 'requests' is a dependency.
|
|
|
|
|
[tool_call: read_file for path 'requirements.txt']
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/requirements.txt']
|
|
|
|
|
(After analysis)
|
|
|
|
|
Looks good, 'requests' is available.
|
|
|
|
|
|
|
|
|
|
@@ -153,7 +154,7 @@ model: I can run \`rm -rf ./temp\`. This will permanently delete the directory a
|
|
|
|
|
user: Write tests for someFile.ts
|
|
|
|
|
model:
|
|
|
|
|
Okay, I can write those tests. First, I'll read \`someFile.ts\` to understand its functionality.
|
|
|
|
|
[tool_call: read_file to read /path/to/someFile.ts or use glob to find \`someFile.ts\` if its location is unknown]
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/someFile.ts' or use glob to find \`someFile.ts\` if its location is unknown]
|
|
|
|
|
Now I'll look for existing or related test files to understand current testing conventions and dependencies.
|
|
|
|
|
[tool_call: read_many_files for paths ['**/*.test.ts', 'src/**/*.spec.ts'] assuming someFile.ts is in the src directory]
|
|
|
|
|
(After reviewing existing tests and the file content)
|
|
|
|
|
@@ -169,7 +170,7 @@ I'm not immediately sure how user profile information is updated. I'll search th
|
|
|
|
|
[tool_call: search_file_content for pattern 'UserProfile|updateProfile|editUser']
|
|
|
|
|
(After reviewing search results, assuming a relevant file like '/path/to/UserProfileService.java' was found)
|
|
|
|
|
Okay, \`/path/to/UserProfileService.java\` seems like the most relevant file. I'll read its content to understand how updates are handled.
|
|
|
|
|
[tool_call: read_file to read /path/to/UserProfileService.java]
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/UserProfileService.java']
|
|
|
|
|
(After reading the file)
|
|
|
|
|
It appears the \`updateUserProfile\` method in \`UserProfileService.java\` is responsible for this. It expects a user ID and a \`UserProfileDTO\` object...
|
|
|
|
|
</example>
|
|
|
|
|
@@ -269,6 +270,7 @@ When asked to refactor code, follow this specialized sequence to ensure safety a
|
|
|
|
|
- **Security First:** Always apply security best practices. Never introduce code that exposes, logs, or commits secrets, API keys, or other sensitive information.
|
|
|
|
|
|
|
|
|
|
## Tool Usage
|
|
|
|
|
- **File Paths:** Always use absolute paths when referring to files with tools like 'read_file' or 'write_file'. Relative paths are not supported. You must provide an absolute path.
|
|
|
|
|
- **Parallelism:** Execute multiple independent tool calls in parallel when feasible (i.e. searching the codebase).
|
|
|
|
|
- **Command Execution:** Use the 'run_shell_command' tool for running shell commands, remembering the safety rule to explain modifying commands first.
|
|
|
|
|
- **Background Processes:** Use background processes (via \`&\`) for commands that are unlikely to stop on their own, e.g. \`node server.js &\`. If unsure, ask the user.
|
|
|
|
|
@@ -328,11 +330,11 @@ user: Refactor the auth logic in src/auth.py to use the requests library instead
|
|
|
|
|
model: Okay, I can refactor 'src/auth.py'.
|
|
|
|
|
First, I'll analyze the code and check for a test safety net before planning any changes.
|
|
|
|
|
[tool_call: glob for path 'tests/test_auth.py']
|
|
|
|
|
[tool_call: read_file for path 'tests/test_auth.py']
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/tests/test_auth.py']
|
|
|
|
|
(After analysis)
|
|
|
|
|
Great, 'tests/test_auth.py' exists and covers the core authentication logic. With this safety net in place, I can safely plan the refactoring.
|
|
|
|
|
I'll also confirm 'requests' is a dependency.
|
|
|
|
|
[tool_call: read_file for path 'requirements.txt']
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/requirements.txt']
|
|
|
|
|
(After analysis)
|
|
|
|
|
Looks good, 'requests' is available.
|
|
|
|
|
|
|
|
|
|
@@ -362,7 +364,7 @@ model: I can run \`rm -rf ./temp\`. This will permanently delete the directory a
|
|
|
|
|
user: Write tests for someFile.ts
|
|
|
|
|
model:
|
|
|
|
|
Okay, I can write those tests. First, I'll read \`someFile.ts\` to understand its functionality.
|
|
|
|
|
[tool_call: read_file to read /path/to/someFile.ts or use glob to find \`someFile.ts\` if its location is unknown]
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/someFile.ts' or use glob to find \`someFile.ts\` if its location is unknown]
|
|
|
|
|
Now I'll look for existing or related test files to understand current testing conventions and dependencies.
|
|
|
|
|
[tool_call: read_many_files for paths ['**/*.test.ts', 'src/**/*.spec.ts'] assuming someFile.ts is in the src directory]
|
|
|
|
|
(After reviewing existing tests and the file content)
|
|
|
|
|
@@ -378,7 +380,7 @@ I'm not immediately sure how user profile information is updated. I'll search th
|
|
|
|
|
[tool_call: search_file_content for pattern 'UserProfile|updateProfile|editUser']
|
|
|
|
|
(After reviewing search results, assuming a relevant file like '/path/to/UserProfileService.java' was found)
|
|
|
|
|
Okay, \`/path/to/UserProfileService.java\` seems like the most relevant file. I'll read its content to understand how updates are handled.
|
|
|
|
|
[tool_call: read_file to read /path/to/UserProfileService.java]
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/UserProfileService.java']
|
|
|
|
|
(After reading the file)
|
|
|
|
|
It appears the \`updateUserProfile\` method in \`UserProfileService.java\` is responsible for this. It expects a user ID and a \`UserProfileDTO\` object...
|
|
|
|
|
</example>
|
|
|
|
|
@@ -473,6 +475,7 @@ When asked to refactor code, follow this specialized sequence to ensure safety a
|
|
|
|
|
- **Security First:** Always apply security best practices. Never introduce code that exposes, logs, or commits secrets, API keys, or other sensitive information.
|
|
|
|
|
|
|
|
|
|
## Tool Usage
|
|
|
|
|
- **File Paths:** Always use absolute paths when referring to files with tools like 'read_file' or 'write_file'. Relative paths are not supported. You must provide an absolute path.
|
|
|
|
|
- **Parallelism:** Execute multiple independent tool calls in parallel when feasible (i.e. searching the codebase).
|
|
|
|
|
- **Command Execution:** Use the 'run_shell_command' tool for running shell commands, remembering the safety rule to explain modifying commands first.
|
|
|
|
|
- **Background Processes:** Use background processes (via \`&\`) for commands that are unlikely to stop on their own, e.g. \`node server.js &\`. If unsure, ask the user.
|
|
|
|
|
@@ -517,11 +520,11 @@ user: Refactor the auth logic in src/auth.py to use the requests library instead
|
|
|
|
|
model: Okay, I can refactor 'src/auth.py'.
|
|
|
|
|
First, I'll analyze the code and check for a test safety net before planning any changes.
|
|
|
|
|
[tool_call: glob for path 'tests/test_auth.py']
|
|
|
|
|
[tool_call: read_file for path 'tests/test_auth.py']
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/tests/test_auth.py']
|
|
|
|
|
(After analysis)
|
|
|
|
|
Great, 'tests/test_auth.py' exists and covers the core authentication logic. With this safety net in place, I can safely plan the refactoring.
|
|
|
|
|
I'll also confirm 'requests' is a dependency.
|
|
|
|
|
[tool_call: read_file for path 'requirements.txt']
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/requirements.txt']
|
|
|
|
|
(After analysis)
|
|
|
|
|
Looks good, 'requests' is available.
|
|
|
|
|
|
|
|
|
|
@@ -551,7 +554,7 @@ model: I can run \`rm -rf ./temp\`. This will permanently delete the directory a
|
|
|
|
|
user: Write tests for someFile.ts
|
|
|
|
|
model:
|
|
|
|
|
Okay, I can write those tests. First, I'll read \`someFile.ts\` to understand its functionality.
|
|
|
|
|
[tool_call: read_file to read /path/to/someFile.ts or use glob to find \`someFile.ts\` if its location is unknown]
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/someFile.ts' or use glob to find \`someFile.ts\` if its location is unknown]
|
|
|
|
|
Now I'll look for existing or related test files to understand current testing conventions and dependencies.
|
|
|
|
|
[tool_call: read_many_files for paths ['**/*.test.ts', 'src/**/*.spec.ts'] assuming someFile.ts is in the src directory]
|
|
|
|
|
(After reviewing existing tests and the file content)
|
|
|
|
|
@@ -567,7 +570,7 @@ I'm not immediately sure how user profile information is updated. I'll search th
|
|
|
|
|
[tool_call: search_file_content for pattern 'UserProfile|updateProfile|editUser']
|
|
|
|
|
(After reviewing search results, assuming a relevant file like '/path/to/UserProfileService.java' was found)
|
|
|
|
|
Okay, \`/path/to/UserProfileService.java\` seems like the most relevant file. I'll read its content to understand how updates are handled.
|
|
|
|
|
[tool_call: read_file to read /path/to/UserProfileService.java]
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/UserProfileService.java']
|
|
|
|
|
(After reading the file)
|
|
|
|
|
It appears the \`updateUserProfile\` method in \`UserProfileService.java\` is responsible for this. It expects a user ID and a \`UserProfileDTO\` object...
|
|
|
|
|
</example>
|
|
|
|
|
@@ -662,6 +665,7 @@ When asked to refactor code, follow this specialized sequence to ensure safety a
|
|
|
|
|
- **Security First:** Always apply security best practices. Never introduce code that exposes, logs, or commits secrets, API keys, or other sensitive information.
|
|
|
|
|
|
|
|
|
|
## Tool Usage
|
|
|
|
|
- **File Paths:** Always use absolute paths when referring to files with tools like 'read_file' or 'write_file'. Relative paths are not supported. You must provide an absolute path.
|
|
|
|
|
- **Parallelism:** Execute multiple independent tool calls in parallel when feasible (i.e. searching the codebase).
|
|
|
|
|
- **Command Execution:** Use the 'run_shell_command' tool for running shell commands, remembering the safety rule to explain modifying commands first.
|
|
|
|
|
- **Background Processes:** Use background processes (via \`&\`) for commands that are unlikely to stop on their own, e.g. \`node server.js &\`. If unsure, ask the user.
|
|
|
|
|
@@ -706,11 +710,11 @@ user: Refactor the auth logic in src/auth.py to use the requests library instead
|
|
|
|
|
model: Okay, I can refactor 'src/auth.py'.
|
|
|
|
|
First, I'll analyze the code and check for a test safety net before planning any changes.
|
|
|
|
|
[tool_call: glob for path 'tests/test_auth.py']
|
|
|
|
|
[tool_call: read_file for path 'tests/test_auth.py']
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/tests/test_auth.py']
|
|
|
|
|
(After analysis)
|
|
|
|
|
Great, 'tests/test_auth.py' exists and covers the core authentication logic. With this safety net in place, I can safely plan the refactoring.
|
|
|
|
|
I'll also confirm 'requests' is a dependency.
|
|
|
|
|
[tool_call: read_file for path 'requirements.txt']
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/requirements.txt']
|
|
|
|
|
(After analysis)
|
|
|
|
|
Looks good, 'requests' is available.
|
|
|
|
|
|
|
|
|
|
@@ -740,7 +744,7 @@ model: I can run \`rm -rf ./temp\`. This will permanently delete the directory a
|
|
|
|
|
user: Write tests for someFile.ts
|
|
|
|
|
model:
|
|
|
|
|
Okay, I can write those tests. First, I'll read \`someFile.ts\` to understand its functionality.
|
|
|
|
|
[tool_call: read_file to read /path/to/someFile.ts or use glob to find \`someFile.ts\` if its location is unknown]
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/someFile.ts' or use glob to find \`someFile.ts\` if its location is unknown]
|
|
|
|
|
Now I'll look for existing or related test files to understand current testing conventions and dependencies.
|
|
|
|
|
[tool_call: read_many_files for paths ['**/*.test.ts', 'src/**/*.spec.ts'] assuming someFile.ts is in the src directory]
|
|
|
|
|
(After reviewing existing tests and the file content)
|
|
|
|
|
@@ -756,7 +760,7 @@ I'm not immediately sure how user profile information is updated. I'll search th
|
|
|
|
|
[tool_call: search_file_content for pattern 'UserProfile|updateProfile|editUser']
|
|
|
|
|
(After reviewing search results, assuming a relevant file like '/path/to/UserProfileService.java' was found)
|
|
|
|
|
Okay, \`/path/to/UserProfileService.java\` seems like the most relevant file. I'll read its content to understand how updates are handled.
|
|
|
|
|
[tool_call: read_file to read /path/to/UserProfileService.java]
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/UserProfileService.java']
|
|
|
|
|
(After reading the file)
|
|
|
|
|
It appears the \`updateUserProfile\` method in \`UserProfileService.java\` is responsible for this. It expects a user ID and a \`UserProfileDTO\` object...
|
|
|
|
|
</example>
|
|
|
|
|
@@ -851,6 +855,7 @@ When asked to refactor code, follow this specialized sequence to ensure safety a
|
|
|
|
|
- **Security First:** Always apply security best practices. Never introduce code that exposes, logs, or commits secrets, API keys, or other sensitive information.
|
|
|
|
|
|
|
|
|
|
## Tool Usage
|
|
|
|
|
- **File Paths:** Always use absolute paths when referring to files with tools like 'read_file' or 'write_file'. Relative paths are not supported. You must provide an absolute path.
|
|
|
|
|
- **Parallelism:** Execute multiple independent tool calls in parallel when feasible (i.e. searching the codebase).
|
|
|
|
|
- **Command Execution:** Use the 'run_shell_command' tool for running shell commands, remembering the safety rule to explain modifying commands first.
|
|
|
|
|
- **Background Processes:** Use background processes (via \`&\`) for commands that are unlikely to stop on their own, e.g. \`node server.js &\`. If unsure, ask the user.
|
|
|
|
|
@@ -895,11 +900,11 @@ user: Refactor the auth logic in src/auth.py to use the requests library instead
|
|
|
|
|
model: Okay, I can refactor 'src/auth.py'.
|
|
|
|
|
First, I'll analyze the code and check for a test safety net before planning any changes.
|
|
|
|
|
[tool_call: glob for path 'tests/test_auth.py']
|
|
|
|
|
[tool_call: read_file for path 'tests/test_auth.py']
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/tests/test_auth.py']
|
|
|
|
|
(After analysis)
|
|
|
|
|
Great, 'tests/test_auth.py' exists and covers the core authentication logic. With this safety net in place, I can safely plan the refactoring.
|
|
|
|
|
I'll also confirm 'requests' is a dependency.
|
|
|
|
|
[tool_call: read_file for path 'requirements.txt']
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/requirements.txt']
|
|
|
|
|
(After analysis)
|
|
|
|
|
Looks good, 'requests' is available.
|
|
|
|
|
|
|
|
|
|
@@ -929,7 +934,7 @@ model: I can run \`rm -rf ./temp\`. This will permanently delete the directory a
|
|
|
|
|
user: Write tests for someFile.ts
|
|
|
|
|
model:
|
|
|
|
|
Okay, I can write those tests. First, I'll read \`someFile.ts\` to understand its functionality.
|
|
|
|
|
[tool_call: read_file to read /path/to/someFile.ts or use glob to find \`someFile.ts\` if its location is unknown]
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/someFile.ts' or use glob to find \`someFile.ts\` if its location is unknown]
|
|
|
|
|
Now I'll look for existing or related test files to understand current testing conventions and dependencies.
|
|
|
|
|
[tool_call: read_many_files for paths ['**/*.test.ts', 'src/**/*.spec.ts'] assuming someFile.ts is in the src directory]
|
|
|
|
|
(After reviewing existing tests and the file content)
|
|
|
|
|
@@ -945,7 +950,7 @@ I'm not immediately sure how user profile information is updated. I'll search th
|
|
|
|
|
[tool_call: search_file_content for pattern 'UserProfile|updateProfile|editUser']
|
|
|
|
|
(After reviewing search results, assuming a relevant file like '/path/to/UserProfileService.java' was found)
|
|
|
|
|
Okay, \`/path/to/UserProfileService.java\` seems like the most relevant file. I'll read its content to understand how updates are handled.
|
|
|
|
|
[tool_call: read_file to read /path/to/UserProfileService.java]
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/UserProfileService.java']
|
|
|
|
|
(After reading the file)
|
|
|
|
|
It appears the \`updateUserProfile\` method in \`UserProfileService.java\` is responsible for this. It expects a user ID and a \`UserProfileDTO\` object...
|
|
|
|
|
</example>
|
|
|
|
|
@@ -1040,6 +1045,7 @@ When asked to refactor code, follow this specialized sequence to ensure safety a
|
|
|
|
|
- **Security First:** Always apply security best practices. Never introduce code that exposes, logs, or commits secrets, API keys, or other sensitive information.
|
|
|
|
|
|
|
|
|
|
## Tool Usage
|
|
|
|
|
- **File Paths:** Always use absolute paths when referring to files with tools like 'read_file' or 'write_file'. Relative paths are not supported. You must provide an absolute path.
|
|
|
|
|
- **Parallelism:** Execute multiple independent tool calls in parallel when feasible (i.e. searching the codebase).
|
|
|
|
|
- **Command Execution:** Use the 'run_shell_command' tool for running shell commands, remembering the safety rule to explain modifying commands first.
|
|
|
|
|
- **Background Processes:** Use background processes (via \`&\`) for commands that are unlikely to stop on their own, e.g. \`node server.js &\`. If unsure, ask the user.
|
|
|
|
|
@@ -1084,11 +1090,11 @@ user: Refactor the auth logic in src/auth.py to use the requests library instead
|
|
|
|
|
model: Okay, I can refactor 'src/auth.py'.
|
|
|
|
|
First, I'll analyze the code and check for a test safety net before planning any changes.
|
|
|
|
|
[tool_call: glob for path 'tests/test_auth.py']
|
|
|
|
|
[tool_call: read_file for path 'tests/test_auth.py']
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/tests/test_auth.py']
|
|
|
|
|
(After analysis)
|
|
|
|
|
Great, 'tests/test_auth.py' exists and covers the core authentication logic. With this safety net in place, I can safely plan the refactoring.
|
|
|
|
|
I'll also confirm 'requests' is a dependency.
|
|
|
|
|
[tool_call: read_file for path 'requirements.txt']
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/requirements.txt']
|
|
|
|
|
(After analysis)
|
|
|
|
|
Looks good, 'requests' is available.
|
|
|
|
|
|
|
|
|
|
@@ -1118,7 +1124,7 @@ model: I can run \`rm -rf ./temp\`. This will permanently delete the directory a
|
|
|
|
|
user: Write tests for someFile.ts
|
|
|
|
|
model:
|
|
|
|
|
Okay, I can write those tests. First, I'll read \`someFile.ts\` to understand its functionality.
|
|
|
|
|
[tool_call: read_file to read /path/to/someFile.ts or use glob to find \`someFile.ts\` if its location is unknown]
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/someFile.ts' or use glob to find \`someFile.ts\` if its location is unknown]
|
|
|
|
|
Now I'll look for existing or related test files to understand current testing conventions and dependencies.
|
|
|
|
|
[tool_call: read_many_files for paths ['**/*.test.ts', 'src/**/*.spec.ts'] assuming someFile.ts is in the src directory]
|
|
|
|
|
(After reviewing existing tests and the file content)
|
|
|
|
|
@@ -1134,7 +1140,7 @@ I'm not immediately sure how user profile information is updated. I'll search th
|
|
|
|
|
[tool_call: search_file_content for pattern 'UserProfile|updateProfile|editUser']
|
|
|
|
|
(After reviewing search results, assuming a relevant file like '/path/to/UserProfileService.java' was found)
|
|
|
|
|
Okay, \`/path/to/UserProfileService.java\` seems like the most relevant file. I'll read its content to understand how updates are handled.
|
|
|
|
|
[tool_call: read_file to read /path/to/UserProfileService.java]
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/UserProfileService.java']
|
|
|
|
|
(After reading the file)
|
|
|
|
|
It appears the \`updateUserProfile\` method in \`UserProfileService.java\` is responsible for this. It expects a user ID and a \`UserProfileDTO\` object...
|
|
|
|
|
</example>
|
|
|
|
|
@@ -1229,6 +1235,7 @@ When asked to refactor code, follow this specialized sequence to ensure safety a
|
|
|
|
|
- **Security First:** Always apply security best practices. Never introduce code that exposes, logs, or commits secrets, API keys, or other sensitive information.
|
|
|
|
|
|
|
|
|
|
## Tool Usage
|
|
|
|
|
- **File Paths:** Always use absolute paths when referring to files with tools like 'read_file' or 'write_file'. Relative paths are not supported. You must provide an absolute path.
|
|
|
|
|
- **Parallelism:** Execute multiple independent tool calls in parallel when feasible (i.e. searching the codebase).
|
|
|
|
|
- **Command Execution:** Use the 'run_shell_command' tool for running shell commands, remembering the safety rule to explain modifying commands first.
|
|
|
|
|
- **Background Processes:** Use background processes (via \`&\`) for commands that are unlikely to stop on their own, e.g. \`node server.js &\`. If unsure, ask the user.
|
|
|
|
|
@@ -1273,11 +1280,11 @@ user: Refactor the auth logic in src/auth.py to use the requests library instead
|
|
|
|
|
model: Okay, I can refactor 'src/auth.py'.
|
|
|
|
|
First, I'll analyze the code and check for a test safety net before planning any changes.
|
|
|
|
|
[tool_call: glob for path 'tests/test_auth.py']
|
|
|
|
|
[tool_call: read_file for path 'tests/test_auth.py']
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/tests/test_auth.py']
|
|
|
|
|
(After analysis)
|
|
|
|
|
Great, 'tests/test_auth.py' exists and covers the core authentication logic. With this safety net in place, I can safely plan the refactoring.
|
|
|
|
|
I'll also confirm 'requests' is a dependency.
|
|
|
|
|
[tool_call: read_file for path 'requirements.txt']
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/requirements.txt']
|
|
|
|
|
(After analysis)
|
|
|
|
|
Looks good, 'requests' is available.
|
|
|
|
|
|
|
|
|
|
@@ -1307,7 +1314,7 @@ model: I can run \`rm -rf ./temp\`. This will permanently delete the directory a
|
|
|
|
|
user: Write tests for someFile.ts
|
|
|
|
|
model:
|
|
|
|
|
Okay, I can write those tests. First, I'll read \`someFile.ts\` to understand its functionality.
|
|
|
|
|
[tool_call: read_file to read /path/to/someFile.ts or use glob to find \`someFile.ts\` if its location is unknown]
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/someFile.ts' or use glob to find \`someFile.ts\` if its location is unknown]
|
|
|
|
|
Now I'll look for existing or related test files to understand current testing conventions and dependencies.
|
|
|
|
|
[tool_call: read_many_files for paths ['**/*.test.ts', 'src/**/*.spec.ts'] assuming someFile.ts is in the src directory]
|
|
|
|
|
(After reviewing existing tests and the file content)
|
|
|
|
|
@@ -1323,7 +1330,7 @@ I'm not immediately sure how user profile information is updated. I'll search th
|
|
|
|
|
[tool_call: search_file_content for pattern 'UserProfile|updateProfile|editUser']
|
|
|
|
|
(After reviewing search results, assuming a relevant file like '/path/to/UserProfileService.java' was found)
|
|
|
|
|
Okay, \`/path/to/UserProfileService.java\` seems like the most relevant file. I'll read its content to understand how updates are handled.
|
|
|
|
|
[tool_call: read_file to read /path/to/UserProfileService.java]
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/UserProfileService.java']
|
|
|
|
|
(After reading the file)
|
|
|
|
|
It appears the \`updateUserProfile\` method in \`UserProfileService.java\` is responsible for this. It expects a user ID and a \`UserProfileDTO\` object...
|
|
|
|
|
</example>
|
|
|
|
|
@@ -1418,6 +1425,7 @@ When asked to refactor code, follow this specialized sequence to ensure safety a
|
|
|
|
|
- **Security First:** Always apply security best practices. Never introduce code that exposes, logs, or commits secrets, API keys, or other sensitive information.
|
|
|
|
|
|
|
|
|
|
## Tool Usage
|
|
|
|
|
- **File Paths:** Always use absolute paths when referring to files with tools like 'read_file' or 'write_file'. Relative paths are not supported. You must provide an absolute path.
|
|
|
|
|
- **Parallelism:** Execute multiple independent tool calls in parallel when feasible (i.e. searching the codebase).
|
|
|
|
|
- **Command Execution:** Use the 'run_shell_command' tool for running shell commands, remembering the safety rule to explain modifying commands first.
|
|
|
|
|
- **Background Processes:** Use background processes (via \`&\`) for commands that are unlikely to stop on their own, e.g. \`node server.js &\`. If unsure, ask the user.
|
|
|
|
|
@@ -1462,11 +1470,11 @@ user: Refactor the auth logic in src/auth.py to use the requests library instead
|
|
|
|
|
model: Okay, I can refactor 'src/auth.py'.
|
|
|
|
|
First, I'll analyze the code and check for a test safety net before planning any changes.
|
|
|
|
|
[tool_call: glob for path 'tests/test_auth.py']
|
|
|
|
|
[tool_call: read_file for path 'tests/test_auth.py']
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/tests/test_auth.py']
|
|
|
|
|
(After analysis)
|
|
|
|
|
Great, 'tests/test_auth.py' exists and covers the core authentication logic. With this safety net in place, I can safely plan the refactoring.
|
|
|
|
|
I'll also confirm 'requests' is a dependency.
|
|
|
|
|
[tool_call: read_file for path 'requirements.txt']
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/requirements.txt']
|
|
|
|
|
(After analysis)
|
|
|
|
|
Looks good, 'requests' is available.
|
|
|
|
|
|
|
|
|
|
@@ -1496,7 +1504,7 @@ model: I can run \`rm -rf ./temp\`. This will permanently delete the directory a
|
|
|
|
|
user: Write tests for someFile.ts
|
|
|
|
|
model:
|
|
|
|
|
Okay, I can write those tests. First, I'll read \`someFile.ts\` to understand its functionality.
|
|
|
|
|
[tool_call: read_file to read /path/to/someFile.ts or use glob to find \`someFile.ts\` if its location is unknown]
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/someFile.ts' or use glob to find \`someFile.ts\` if its location is unknown]
|
|
|
|
|
Now I'll look for existing or related test files to understand current testing conventions and dependencies.
|
|
|
|
|
[tool_call: read_many_files for paths ['**/*.test.ts', 'src/**/*.spec.ts'] assuming someFile.ts is in the src directory]
|
|
|
|
|
(After reviewing existing tests and the file content)
|
|
|
|
|
@@ -1512,7 +1520,7 @@ I'm not immediately sure how user profile information is updated. I'll search th
|
|
|
|
|
[tool_call: search_file_content for pattern 'UserProfile|updateProfile|editUser']
|
|
|
|
|
(After reviewing search results, assuming a relevant file like '/path/to/UserProfileService.java' was found)
|
|
|
|
|
Okay, \`/path/to/UserProfileService.java\` seems like the most relevant file. I'll read its content to understand how updates are handled.
|
|
|
|
|
[tool_call: read_file to read /path/to/UserProfileService.java]
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/UserProfileService.java']
|
|
|
|
|
(After reading the file)
|
|
|
|
|
It appears the \`updateUserProfile\` method in \`UserProfileService.java\` is responsible for this. It expects a user ID and a \`UserProfileDTO\` object...
|
|
|
|
|
</example>
|
|
|
|
|
@@ -1607,6 +1615,7 @@ When asked to refactor code, follow this specialized sequence to ensure safety a
|
|
|
|
|
- **Security First:** Always apply security best practices. Never introduce code that exposes, logs, or commits secrets, API keys, or other sensitive information.
|
|
|
|
|
|
|
|
|
|
## Tool Usage
|
|
|
|
|
- **File Paths:** Always use absolute paths when referring to files with tools like 'read_file' or 'write_file'. Relative paths are not supported. You must provide an absolute path.
|
|
|
|
|
- **Parallelism:** Execute multiple independent tool calls in parallel when feasible (i.e. searching the codebase).
|
|
|
|
|
- **Command Execution:** Use the 'run_shell_command' tool for running shell commands, remembering the safety rule to explain modifying commands first.
|
|
|
|
|
- **Background Processes:** Use background processes (via \`&\`) for commands that are unlikely to stop on their own, e.g. \`node server.js &\`. If unsure, ask the user.
|
|
|
|
|
@@ -1651,11 +1660,11 @@ user: Refactor the auth logic in src/auth.py to use the requests library instead
|
|
|
|
|
model: Okay, I can refactor 'src/auth.py'.
|
|
|
|
|
First, I'll analyze the code and check for a test safety net before planning any changes.
|
|
|
|
|
[tool_call: glob for path 'tests/test_auth.py']
|
|
|
|
|
[tool_call: read_file for path 'tests/test_auth.py']
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/tests/test_auth.py']
|
|
|
|
|
(After analysis)
|
|
|
|
|
Great, 'tests/test_auth.py' exists and covers the core authentication logic. With this safety net in place, I can safely plan the refactoring.
|
|
|
|
|
I'll also confirm 'requests' is a dependency.
|
|
|
|
|
[tool_call: read_file for path 'requirements.txt']
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/requirements.txt']
|
|
|
|
|
(After analysis)
|
|
|
|
|
Looks good, 'requests' is available.
|
|
|
|
|
|
|
|
|
|
@@ -1685,7 +1694,7 @@ model: I can run \`rm -rf ./temp\`. This will permanently delete the directory a
|
|
|
|
|
user: Write tests for someFile.ts
|
|
|
|
|
model:
|
|
|
|
|
Okay, I can write those tests. First, I'll read \`someFile.ts\` to understand its functionality.
|
|
|
|
|
[tool_call: read_file to read /path/to/someFile.ts or use glob to find \`someFile.ts\` if its location is unknown]
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/someFile.ts' or use glob to find \`someFile.ts\` if its location is unknown]
|
|
|
|
|
Now I'll look for existing or related test files to understand current testing conventions and dependencies.
|
|
|
|
|
[tool_call: read_many_files for paths ['**/*.test.ts', 'src/**/*.spec.ts'] assuming someFile.ts is in the src directory]
|
|
|
|
|
(After reviewing existing tests and the file content)
|
|
|
|
|
@@ -1701,7 +1710,7 @@ I'm not immediately sure how user profile information is updated. I'll search th
|
|
|
|
|
[tool_call: search_file_content for pattern 'UserProfile|updateProfile|editUser']
|
|
|
|
|
(After reviewing search results, assuming a relevant file like '/path/to/UserProfileService.java' was found)
|
|
|
|
|
Okay, \`/path/to/UserProfileService.java\` seems like the most relevant file. I'll read its content to understand how updates are handled.
|
|
|
|
|
[tool_call: read_file to read /path/to/UserProfileService.java]
|
|
|
|
|
[tool_call: read_file for absolute_path '/path/to/UserProfileService.java']
|
|
|
|
|
(After reading the file)
|
|
|
|
|
It appears the \`updateUserProfile\` method in \`UserProfileService.java\` is responsible for this. It expects a user ID and a \`UserProfileDTO\` object...
|
|
|
|
|
</example>
|
|
|
|
|
|