updating files
This commit is contained in:
6
.gitignore
vendored
6
.gitignore
vendored
@@ -1,5 +1,7 @@
|
||||
|
||||
|
||||
# Codetyper.nvim - AI coding partner files
|
||||
*.coder.*
|
||||
.coder/
|
||||
|
||||
/@
|
||||
add gitignore for lua files
|
||||
/@
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
46
lua/codetyper/prompts/agent.lua
Normal file
46
lua/codetyper/prompts/agent.lua
Normal file
@@ -0,0 +1,46 @@
|
||||
---@mod codetyper.prompts.agent Agent prompts for Codetyper.nvim
|
||||
---
|
||||
--- System prompts for the agentic mode with tool use.
|
||||
|
||||
local M = {}
|
||||
|
||||
--- System prompt for agent mode
|
||||
M.system = [[You are an AI coding agent integrated into Neovim via Codetyper.nvim.
|
||||
You can read files, edit code, write new files, and run bash commands to help the user.
|
||||
|
||||
You have access to the following tools:
|
||||
- read_file: Read file contents
|
||||
- edit_file: Edit a file by finding and replacing specific content
|
||||
- write_file: Write or create a file
|
||||
- bash: Execute shell commands
|
||||
|
||||
GUIDELINES:
|
||||
1. Always read a file before editing it to understand its current state
|
||||
2. Use edit_file for targeted changes (find and replace specific content)
|
||||
3. Use write_file only for new files or complete rewrites
|
||||
4. Be conservative with bash commands - only run what's necessary
|
||||
5. After making changes, summarize what you did
|
||||
6. If a task requires multiple steps, think through the plan first
|
||||
|
||||
IMPORTANT:
|
||||
- Be precise with edit_file - the "find" content must match exactly
|
||||
- When editing, include enough context to make the match unique
|
||||
- Never delete files without explicit user confirmation
|
||||
- Always explain what you're doing and why
|
||||
]]
|
||||
|
||||
--- Tool usage instructions appended to system prompt
|
||||
M.tool_instructions = [[
|
||||
When you need to use a tool, output the tool call in a JSON block.
|
||||
After receiving the result, you can either call another tool or provide your final response.
|
||||
|
||||
SAFETY RULES:
|
||||
- Never run destructive bash commands (rm -rf, etc.) without confirmation
|
||||
- Always preserve existing functionality when editing
|
||||
- If unsure about a change, ask for clarification first
|
||||
]]
|
||||
|
||||
--- Prompt for when agent finishes
|
||||
M.completion = [[Based on the tool results above, please provide a summary of what was done and any next steps the user should take.]]
|
||||
|
||||
return M
|
||||
@@ -1,25 +0,0 @@
|
||||
# Create .coder/ folder if does not exist
|
||||
mkdir -p .coder
|
||||
# Create .coder/settings.json with default settings if it does not exist
|
||||
if [ ! -f .coder/settings.json ]; then
|
||||
cat <<EOL > .coder/settings.json
|
||||
{
|
||||
"editor.fontSize": 14,
|
||||
"editor.tabSize": 2,
|
||||
"files.autoSave": "afterDelay",
|
||||
"files.autoSaveDelay": 1000,
|
||||
"terminal.integrated.fontSize": 14,
|
||||
"workbench.colorTheme": "Default Dark+"
|
||||
}
|
||||
EOL
|
||||
fi
|
||||
|
||||
# Add the .coder/ folder to .gitignore if not already present
|
||||
if ! grep -q "^.coder/$" .gitignore; then
|
||||
echo ".coder/" >> .gitignore
|
||||
fi
|
||||
|
||||
# Add the ./**/*.coder.* files to .gitignore if not already present
|
||||
if ! grep -q "^.*/\.coder/.*$" .gitignore; then
|
||||
echo ".*/.coder/.*" >> .gitignore
|
||||
fi
|
||||
Reference in New Issue
Block a user