From 63c4952118aff52c17524aa6fbcaff4556b3b141 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 26 Nov 2025 18:37:10 +0100 Subject: [PATCH] nvim: Add prompts to codecompanion plugin --- nvim/.config/nvim/lua/modules/llm.lua | 41 +++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/nvim/.config/nvim/lua/modules/llm.lua b/nvim/.config/nvim/lua/modules/llm.lua index 292a4ac..0b7dc30 100644 --- a/nvim/.config/nvim/lua/modules/llm.lua +++ b/nvim/.config/nvim/lua/modules/llm.lua @@ -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",