References in workflow #957
-
Hello @olimorris and community, I was thinking if prompt_library = {
["Generate a Commit Message And PR it"] = {
strategy = "workflow",
description = "Generate a commit message and submit a PR",
opts = {
index = 10,
is_default = true,
is_slash_cmd = true,
short_name = "commit-and-pr",
auto_submit = false,
},
references = {
{
type = "file",
path = {
".github/pull_request_template.md",
},
},
},
prompts = {
{
{
role = "user",
content = function()
return string.format(
[[You are an expert at following the Conventional Commit specification. Given the git diff listed below, please generate a commit message for me. It's important to generate a concise header commit message only, without any detailed description and without any specific scope:
\```diff
%s
\```
]],
vim.fn.system("git diff --no-ext-diff --staged")
)
end,
opts = {
contains_code = true,
auto_submit = true,
},
},
},
{
{
role = "user",
content = function()
return [[Give me the command to create a new PR using gh cli. The body of the PR should be filled up based on the changes in the diff and the provided template. Here more options that should be present in the command:
- base: main
- label: feature
- assignee: @me
- title: My PR title]]
end,
opts = {
contains_code = true,
auto_submit = false,
},
},
},
},
},
} I can see this is working except for the PR body that are being written randomly, not following the PR template provided in the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hey @andtankian! That seems strange because everything looks correct. Just quickly playing around with your code and I'm unsure what could be the issue. For the time being, this is one I have which is working: ["Docusaurus"] = {
strategy = "chat",
description = "Write documentation for me",
opts = {
index = 11,
is_slash_cmd = false,
auto_submit = false,
short_name = "docs",
},
references = {
{
type = "file",
path = {
"doc/.vitepress/config.mjs",
"lua/codecompanion/config.lua",
"README.md",
},
},
},
prompts = {
{
role = "user",
content = [[I'm rewriting the documentation for my plugin CodeCompanion.nvim, as I'm moving to a vitepress website. Can you help me rewrite it?
I'm sharing my vitepress config file so you have the context of how the documentation website is structured in the `sidebar` section of that file.
I'm also sharing my `config.lua` file which I'm mapping to the `configuration` section of the sidebar.
]],
},
},
}, |
Beta Was this translation helpful? Give feedback.
#969
This PR introduces a way to add references to workflows just like regular chat prompts, not it's working.