Use GitHub Copilot-style repository prompt assets (e.g. .github/agents, .github/prompts, .github/contexts, .github/plans) inside CodeCompanion.nvim.
This plugin automatically registers CodeCompanion slash commands that insert selected workspace files as hidden chat context (via chat:add_context(..., visible=false)), keeping your prompt clean while still giving the LLM the full content.
.github/agents/*.agent.md(YAML frontmatter stripped).github/prompts/*.prompt.md(YAML frontmatter stripped).github/contexts/*.md(excludesTEMPLATE.md).github/plans/*.md
Default slash commands:
/agent/prompt/context(Telescope multi-select supported)/plan
Copy/paste:
{
"felipehespanhol/codecompanion-copilot-workspace.nvim",
dependencies = { "olimorris/codecompanion.nvim" },
main = "codecompanion_copilot_workspace",
opts = {
-- optional; defaults shown
codecompanion = {
auto_register = true,
override = false,
source = "copilot_workspace",
},
},
}
Open a CodeCompanion chat buffer and type:
/agent→ pick a file from.github/agents/prompt→ pick a file from.github/prompts/context→ pick one or more files from.github/contexts/plan→ pick a file from.github/plans
If you use Telescope, /context supports multi-select:
<Tab>toggle selection<CR>confirm and add all selected
require("codecompanion_copilot_workspace").setup({
codecompanion = {
auto_register = true,
override = false,
source = "copilot_workspace",
},
kinds = {
agent = {
subdir = { ".github", "agents" },
suffix = ".agent.md",
strip_frontmatter = true,
multi = false,
excludes = {},
prompt_title = "Select agent",
},
prompt = {
subdir = { ".github", "prompts" },
suffix = ".prompt.md",
strip_frontmatter = true,
multi = false,
excludes = {},
prompt_title = "Select prompt",
},
context = {
subdir = { ".github", "contexts" },
suffix = ".md",
strip_frontmatter = false,
multi = true,
excludes = { ["TEMPLATE.md"] = true },
prompt_title = "Select context",
},
plan = {
subdir = { ".github", "plans" },
suffix = ".md",
strip_frontmatter = false,
multi = false,
excludes = {},
prompt_title = "Select plan",
},
},
})
On setup(), the plugin attempts to inject its slash commands into CodeCompanion's runtime config. If CodeCompanion isn't loaded yet, it waits for the User autocommand event CodeCompanionChatCreated and injects them then.