nvim: Add prompts to codecompanion plugin

This commit is contained in:
Marty Oehme 2025-11-26 18:37:10 +01:00
parent 054cbd9ff5
commit 63c4952118
Signed by: Marty
GPG key ID: 4E535BC19C61886E

View file

@ -195,12 +195,49 @@ return {
callback = "mcphub.extensions.codecompanion",
opts = {
show_results_in_chat = true,
make_vars = true,
make_slash_commands = true,
make_tools = true, -- Make individual tools (@server__tool) and server groups (@server) from MCP servers
make_vars = true, -- Make individual resources into #variables
make_slash_commands = true, -- Make individual prompts into /slash commands
show_server_tools_in_chat = true, -- Show individual tools in chat completion (when make_tools=true)
add_mcp_prefix_to_tool_names = false, -- Add mcp__ prefix (e.g `@mcp__github`, `@mcp__neovim__list_issues`)
show_result_in_chat = true, -- Show tool results directly in chat buffer
},
},
},
prompt_library = {
["DevOps strategy"] = {
strategy = "chat",
description = "Senior devops engineer explains high-level solutions.",
opts = { short_name = "devops" },
prompts = {
{
role = "system",
content = "You are a Senior DevOps engineer working at a professional company. Your role is to provide scalable, efficient, and automated solutions for software deployment, infrastructure management, and CI/CD pipelines. First problem is: Creating an MVP quickly, suggest the best DevOps practices, including infrastructure setup, deployment strategies, automation tools, and cost-effective scaling solutions. Reply in English using professional tone for everyone.",
},
},
},
["Code Reviewer Chat"] = {
strategy = "chat",
description = "Get your code reviewed by an 'experienced' developer.",
opts = { short_name = "review" },
prompts = {
{
role = "system",
content = "I want you to act as a Code reviewer who is experienced developer in the given code language. I will provide you with the code block or methods or code file along with the code language name, and I would like you to review the code and share the feedback, suggestions and alternative recommended approaches. Please write explanations behind the feedback or suggestions or alternative approaches.",
},
},
},
["HackerNews Review"] = {
strategy = "chat",
description = "Get your code reviewed by a jaded hackernews commenter.",
opts = { short_name = "hackernews" },
prompts = {
{
role = "system",
content = "I want you to act as a Code reviewer who is experienced developer in the given code language. I will provide you with the code block or methods or code file along with the code language name, and I would like you to review the code and share the feedback, suggestions and alternative recommended approaches as if you had read it on hackernews. Please be concise and do not give extraneous positives unless they truly are warranted. Provide explanations behind the feedback or suggestions or alternative approaches, in the succinct manner of hackernews comments.",
},
},
},
["Smart Paste"] = {
strategy = "inline",
description = "Paste code smartly",