From f579c8989d40bd1c4ed14c006fe02ad6a5d70c62 Mon Sep 17 00:00:00 2001 From: Colin McNeil Date: Fri, 12 Jul 2024 13:06:48 -0400 Subject: [PATCH] Add prompts for basic git actions --- prompts/git_branches/010_system_prompt.md | 5 +++ prompts/git_branches/100_user_prompt.md | 3 ++ prompts/git_branches/README.md | 43 +++++++++++++++++++++++ prompts/git_files/010_system_prompt.md | 3 ++ prompts/git_files/100_user_prompt.md | 3 ++ prompts/git_files/README.md | 43 +++++++++++++++++++++++ 6 files changed, 100 insertions(+) create mode 100644 prompts/git_branches/010_system_prompt.md create mode 100644 prompts/git_branches/100_user_prompt.md create mode 100644 prompts/git_branches/README.md create mode 100644 prompts/git_files/010_system_prompt.md create mode 100644 prompts/git_files/100_user_prompt.md create mode 100644 prompts/git_files/README.md diff --git a/prompts/git_branches/010_system_prompt.md b/prompts/git_branches/010_system_prompt.md new file mode 100644 index 0000000..803d285 --- /dev/null +++ b/prompts/git_branches/010_system_prompt.md @@ -0,0 +1,5 @@ +You are an expert for managing git branches in a project. + +The only commands you deal with are `branch`, `checkout` or `merge`. + +`rebase` can rewrite history and therefore should not be used. \ No newline at end of file diff --git a/prompts/git_branches/100_user_prompt.md b/prompts/git_branches/100_user_prompt.md new file mode 100644 index 0000000..a49b410 --- /dev/null +++ b/prompts/git_branches/100_user_prompt.md @@ -0,0 +1,3 @@ +The user wants to complete the following task related to git branches: + +{{task}} diff --git a/prompts/git_branches/README.md b/prompts/git_branches/README.md new file mode 100644 index 0000000..8a36f1c --- /dev/null +++ b/prompts/git_branches/README.md @@ -0,0 +1,43 @@ +--- +model: gpt-4 +stream: true +functions: +- name: git + description: Run git branch-related commands against a project + parameters: + type: object + properties: + command: + type: string + description: The branch command. Either `branch`, `checkout` or `merge`. `rebase` can rewrite history and therefore should not be used. + args: + type: array + description: The arguments to pass into the git command + items: + type: string + description: An argument to the git command + container: + image: alpine/git:latest +--- + +# Background + +Branch management is a common use case of git, so this tool is used to execute branch and related commands (git checkout, git branch, git merge) + +## Running the tool + +```sh +DIR=$PWD +docker run --rm -it \ + -v /var/run/docker.sock:/var/run/docker.sock \ + --mount type=volume,source=docker-prompts,target=/prompts \ + --mount type=bind,source=$HOME/.openai-api-key,target=/root/.openai-api-key \ + --mount type=bind,source=/Users/slim/docker/labs-make-runbook/prompts,target=/my-prompts \ + --workdir /my-prompts \ + vonwig/prompts:latest run \ + $DIR \ + $USER \ + "$(uname -o)" \ + git_branches + # "github:docker/labs-make-runbook?ref=main&path=prompts/git_branches" +``` diff --git a/prompts/git_files/010_system_prompt.md b/prompts/git_files/010_system_prompt.md new file mode 100644 index 0000000..303735f --- /dev/null +++ b/prompts/git_files/010_system_prompt.md @@ -0,0 +1,3 @@ +You are an expert for managing files in a git project. + +Either `rm`, `add` or `mv`. \ No newline at end of file diff --git a/prompts/git_files/100_user_prompt.md b/prompts/git_files/100_user_prompt.md new file mode 100644 index 0000000..9b153b2 --- /dev/null +++ b/prompts/git_files/100_user_prompt.md @@ -0,0 +1,3 @@ +The user wants to complete the following task related to git files: + +{{task}} diff --git a/prompts/git_files/README.md b/prompts/git_files/README.md new file mode 100644 index 0000000..7501931 --- /dev/null +++ b/prompts/git_files/README.md @@ -0,0 +1,43 @@ +--- +model: gpt-4 +stream: true +functions: +- name: git + description: Run git file-related commands against a project + parameters: + type: object + properties: + command: + type: string + description: The branch command. Either `rm`, `mv` or `add`. + args: + type: array + description: The arguments to pass into the git command + items: + type: string + description: An argument to the git command + container: + image: alpine/git:latest +--- + +# Background + +File management is a common use case of git, so this tool is used to execute commands to manage the staged files in a git repo (git rm, git add, git mv) + +## Running the tool + +```sh +DIR=$PWD +docker run --rm -it \ + -v /var/run/docker.sock:/var/run/docker.sock \ + --mount type=volume,source=docker-prompts,target=/prompts \ + --mount type=bind,source=$HOME/.openai-api-key,target=/root/.openai-api-key \ + --mount type=bind,source=/Users/slim/docker/labs-make-runbook/prompts,target=/my-prompts \ + --workdir /my-prompts \ + vonwig/prompts:latest run \ + $DIR \ + $USER \ + "$(uname -o)" \ + git_files + # "github:docker/labs-make-runbook?ref=main&path=prompts/git_files" +```