fix: Move Quick Refactor agent to toml file

This commit is contained in:
Petr Mironychev
2026-06-29 00:27:01 +02:00
parent 755263c4de
commit e200278f9a
11 changed files with 120 additions and 48 deletions

View File

@@ -7,6 +7,7 @@
<file>claude_completion.toml</file>
<file>claude_compression.toml</file>
<file>claude_quick_refactor.toml</file>
<file>claude_quick_refactor_fast.toml</file>
<file>openai_base_chat.toml</file>
<file>openai_chat_completions.toml</file>
<file>openai_responses_base.toml</file>
@@ -19,6 +20,8 @@
<file>ollama_base_fim.toml</file>
<file>ollama_fim.toml</file>
<file>ollama_codellama_qml_fim.toml</file>
<file>ollama_quick_refactor.toml</file>
<file>ollama_compression.toml</file>
</qresource>
<qresource prefix="/roles">
<file alias="qt-cpp-developer.md">roles/qt-cpp-developer.md</file>
@@ -29,5 +32,6 @@
<qresource prefix="/tasks">
<file alias="chat-compressor.md">tasks/chat-compressor.md</file>
<file alias="code-completion.md">tasks/code-completion.md</file>
<file alias="quick-refactor.md">tasks/quick-refactor.md</file>
</qresource>
</RCC>

View File

@@ -2,12 +2,17 @@ schema_version = 1
extends = "Claude Base Chat"
name = "Claude Quick Refactor"
description = "Anthropic Claude — deterministic inline refactor. QuickRefactorHandler supplies the refactor system prompt; output is cleaned and inserted into the editor. No thinking; tools off."
description = "Anthropic Claude Sonnet — agentic inline refactor with extended thinking and tools (gathers context before editing). Static output rules from :/tasks/quick-refactor.md; QuickRefactorHandler injects the live editor context (file, code, cursor/selection)."
model = "claude-sonnet-4-6"
enable_tools = false
tags = ["refactor", "claude", "cloud"]
model = "claude-sonnet-4-6"
enable_tools = true
enable_thinking = true
tags = ["refactor", "claude", "cloud"]
system_prompt = """{{ read_file(":/tasks/quick-refactor.md") }}"""
[body]
max_tokens = 16000
temperature = 0.2
max_tokens = 16000
temperature = 1
thinking = { type = "adaptive", display = "summarized" }
output_config = { effort = "high" }

View File

@@ -0,0 +1,16 @@
schema_version = 1
extends = "Claude Base Chat"
name = "Claude Quick Refactor Fast"
description = "Anthropic Claude Haiku — fast single-shot inline refactor. Static output rules from :/tasks/quick-refactor.md; QuickRefactorHandler injects the live editor context (file, code, cursor/selection). No thinking; tools off."
model = "claude-haiku-4-5"
enable_tools = false
enable_thinking = false
tags = ["refactor", "claude", "cloud", "fast"]
system_prompt = """{{ read_file(":/tasks/quick-refactor.md") }}"""
[body]
max_tokens = 8000
temperature = 0.2

View File

@@ -28,4 +28,4 @@ messages = """
num_predict = 512
temperature = 0.2
keep_alive = "5m"
stop = ["</code_context>"]
stop = ["</code_context>"]

View File

@@ -16,8 +16,18 @@ file_patterns = ["*.qml"]
prompt = """{{ tojson("<SUF>" + ctx.suffix + "<PRE>" + ctx.prefix + "<MID>") }}"""
[body.options]
temperature = 0
top_p = 1
temperature = 0
top_p = 1
repeat_penalty = 1.05
num_predict = 500
stop = ["<SUF>", "<PRE>", "</PRE>", "</SUF>", "< EOT >", "\\end", "<MID>", "</MID>", "##"]
num_predict = 500
stop = [
"<SUF>",
"<PRE>",
"</PRE>",
"</SUF>",
"< EOT >",
"\\end",
"<MID>",
"</MID>",
"##",
]

View File

@@ -0,0 +1,17 @@
schema_version = 1
extends = "Ollama Base Chat"
name = "Ollama Chat Compression"
description = "Local Ollama conversation summarization (qwen2.5-coder). Carries the summary system prompt; no tools."
model = "qwen2.5-coder:7b"
enable_tools = false
tags = ["compression", "ollama", "local"]
system_prompt = """{{ read_file(":/tasks/chat-compressor.md") }}"""
[body.options]
num_predict = 2048
temperature = 0.3
num_ctx = 8192
keep_alive = "5m"

View File

@@ -8,6 +8,6 @@ model = "qwen2.5-coder:7b"
tags = ["completion", "ollama", "local", "fim"]
[body.options]
num_predict = 512
num_predict = 256
temperature = 0.2
keep_alive = "5m"

View File

@@ -0,0 +1,16 @@
schema_version = 1
extends = "Ollama Base Chat"
name = "Ollama Quick Refactor"
description = "Local Ollama deterministic inline refactor (qwen2.5-coder). Static output rules from :/tasks/quick-refactor.md; QuickRefactorHandler injects the live editor context. No tools."
model = "qwen2.5-coder:7b"
enable_tools = false
tags = ["refactor", "ollama", "local"]
system_prompt = """{{ read_file(":/tasks/quick-refactor.md") }}"""
[body.options]
num_predict = 2048
temperature = 0.2
keep_alive = "5m"

View File

@@ -0,0 +1,19 @@
# Output Requirements
## Formatting Rules:
- Output ONLY the code itself, without ANY explanations or descriptions
- Do NOT include markdown code blocks (no ```, no language tags)
- Do NOT add comments explaining what you changed
- Do NOT repeat existing code, be precise with context
- Do NOT send in answer <cursor> or </cursor> and other tags
- The output must be ready to insert directly into the editor as-is
## Indentation and Whitespace:
- Use the same indentation style (spaces or tabs) as the surrounding code
- Maintain consistent indentation for nested blocks
- Do NOT remove or reduce the base indentation level
## Code Style:
- Match the coding style of the surrounding code (naming, spacing, braces, etc.)
- Preserve the original code structure when possible
- Only change what is necessary to fulfill the user's request