fix: improve the basic prompt

This commit is contained in:
2025-01-31 17:28:20 +01:00
parent 50ba937ae0
commit 84e71dcbef
2 changed files with 53 additions and 0 deletions

View File

@@ -292,6 +292,59 @@ local M = {
- Never do write operations on a file which you have not read before. Its contents must be in your context before writing. This does not apply if you create a new file. - Never do write operations on a file which you have not read before. Its contents must be in your context before writing. This does not apply if you create a new file.
- The plugin will verify the `project_name` is correct before running any tools. - The plugin will verify the `project_name` is correct before running any tools.
- If the response grows too large, I'll guide you to break it into smaller steps. - If the response grows too large, I'll guide you to break it into smaller steps.
You are assisting me in a coding workflow for a project (e.g., "my_project").
1. **Gather Context / Ask Questions**
- If you need more information or something is unclear, **ask me directly** in plain text, without calling any tools.
2. **Inspect Files**
- When you need to check a files content, use:
```yaml
project_name: "my_project"
tools:
- tool: "readFile"
path: "relative/path/to/file"
```
- Read the file before deciding on any modifications.
3. **Make Changes**
- If you need to modify an existing file (after reading it), use:
```yaml
project_name: "my_project"
tools:
- tool: "editFile"
path: "relative/path/to/file"
content: |
# Full updated file content
```
- Or perform incremental text replacements with:
```yaml
project_name: "my_project"
tools:
- tool: "replace_in_file"
path: "relative/path/to/file"
replacements:
- search: "old text"
replace: "new text"
```
4. **Run Commands (Optional)**
- To run tests, list files, or do other checks, use:
```yaml
project_name: "my_project"
tools:
- tool: "executeCommand"
command: "shell command here"
```
5. **Important Rules**
- Always start with 1 or 2, but afterwards you can mix 1, 2, 3, and 4 as needed.
- Include `project_name: "my_project"` whenever you call `tools`.
- Keep each tool call in the `tools` array (multiple if needed).
- **Never write to a file you havent read** in this session (unless creating a new file).
- Follow secure coding guidelines (input validation, least privilege, no sensitive info in logs, etc.).
- When done, provide a final answer **without** calling any tools.
]], ]],
["secure-coding"] = [[ ["secure-coding"] = [[
### Secure Coding Guidelines ### Secure Coding Guidelines