feat: change prompt

This commit is contained in:
2025-01-24 02:47:27 +01:00
parent e36ad99dcb
commit 59540981ed
2 changed files with 48 additions and 46 deletions

View File

@@ -256,52 +256,54 @@ local M = {
["basic-prompt"] = [[
### Basic Prompt
1. **Analyze Required Files**:
- Identify the files that need to be modified or created based on the task requirements.
- Ensure all necessary files are included in the output YAML response.
1. **Analyze Required Files**
- Check the project structure (or any provided file list).
- If you identify a file reference or function you do not have, **produce a YAML snippet** requesting that files content in full. For example:
```yaml
project_name: my_project
files:
- path: "relative/path/to/needed_file"
```
- Do not proceed with final changes if you lack the necessary file contents.
- Always provide the entire file content when you do include a file.
2. **Request File Contents**:
- Provide a detailed description of the changes needed for each file, including any new content or modifications.
- Use clear and concise instructions to guide the implementation process.
2. **Request File Contents**
- For every file you need but dont have, provide a short YAML snippet (like above) to retrieve it.
- Ask any clarifying questions outside the YAML code block.
3. **Provide Output YAML**:
3. **Provide Output YAML**
- When you have all information, output the final YAML in this format:
```yaml
project_name: my_project
- Structure your changes using the following format:
```yaml
project_name: my_project
files:
- path: "src/main.py"
content: |
# Updated main function
def main():
print("Hello, World!")
files:
- file: src/main.py
content: |
# Updated main function
def main():
print("Hello, World!")
- path: "docs/README.md"
delete: true
```
- `project_name` must match the projects configured name.
- Each file item in `files` must have `path` and either `content` or `delete: true`.
- file: docs/README.md
delete: true
```
- Explanation of the Example:
- `project_name` specifies the project's name.
- The `files` section lists all affected files.
- `file: src/main.py` contains new content for modification.
- `file: docs/README.md` is marked for deletion with delete: true.
4. **Explain Changes**
- After the final YAML, add a brief explanation of the modifications (outside the YAML).
4. **Explain Changes**:
- Provide a brief explanation of the changes made below the YAML response.
- Highlight any key decisions or reasoning behind the modifications.
5. **Iterate as Needed**
- If further context or changes are required, repeat steps to request files or clarifications.
5. **Iterate as Needed**:
- If additional context or modifications are required, repeat the workflow steps to gather more information or make further changes.
6. **Important Notes**
- Never modify or delete a file you havent explicitly requested or received.
- Use comments in code only to clarify code logic, not to explain your thought process.
- Explanations go outside the YAML.
6. **Important Notes**:
- Avoid using comments in the code to explain your thought process. Comments should only clarify the code itself.
- You can explain your reasoning and decisions outside of the output YAML format.
- Do not modify or delete any files that have not been explicitly requested.
7. **Best Practices**:
- Ensure all file paths and content are accurate to prevent errors during implementation.
- Follow a logical structure for your changes to maintain readability and clarity.
- Use `output YAML` consistently throughout the process for better clarity and understanding.
7. **Best Practices**
- Keep file paths accurate to avoid mistakes during implementation.
- Maintain a clear, logical structure for your changes.
- Use the final YAML consistently for clarity.
]],
["secure-coding"] = [[
### Secure Coding Guidelines