From 329f7fa9d64b96b13d2a82853253ba6dccfd9645 Mon Sep 17 00:00:00 2001 From: mrT23 Date: Sun, 21 Jan 2024 17:06:25 +0200 Subject: [PATCH 1/3] feat: Add custom suggestions tool to README.md --- README.md | 8 ++--- docs/CUSTOM_SUGGESTIONS.md | 62 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 5 deletions(-) create mode 100644 docs/CUSTOM_SUGGESTIONS.md diff --git a/README.md b/README.md index b6c95af2..e95bdab1 100644 --- a/README.md +++ b/README.md @@ -32,11 +32,8 @@ Making pull requests less painful with an AI agent - [Why use PR-Agent?](#why-use-pr-agent) ## News and Updates -### Jan 18, 2024 -We are very happy to share our new paper: -**"Code Generation with AlphaCodium: From Prompt Engineering to Flow Engineering".** - -Go checkout our official implementation [here](https://github.com/Codium-ai/AlphaCodium) +### Jan 21, 2024 +- 💎 Custom suggestions - A new tool, `/custom_suggestions`, was added to PR-Agent Pro. The tool will only propose suggestion that follow specific guidelines defined by a prompt given by the user. See [here](https://github.com/Codium-ai/pr-agent/blob/main/docs/CUSTOM_SUGGESTIONS.md) for more details. ### Jan 17, 2024 - 💎 Inline file summary - The `describe` tool has a new option `--pr_description.inline_file_summary`, which allows to add a summary of each file changes to the Diffview page. See [here](https://github.com/Codium-ai/pr-agent/blob/main/docs/DESCRIBE.md#inline-file-summary-) @@ -164,6 +161,7 @@ See the [Tools Guide](./docs/TOOLS_GUIDE.md) for a detailed description of the d | | ⮑ [Inline file summary](https://github.com/Codium-ai/pr-agent/blob/main/docs/DESCRIBE.md#inline-file-summary-) 💎 | :white_check_mark: | :white_check_mark: | :white_check_mark: | | | Improve | :white_check_mark: | :white_check_mark: | :white_check_mark: | | | ⮑ Extended | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| | [Custom_suggestions](https://github.com/Codium-ai/pr-agent/blob/main/docs/CUSTOM_SUGGESTIONS.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | | | Reflect and Review | :white_check_mark: | :white_check_mark: | :white_check_mark: | | | Update CHANGELOG.md | :white_check_mark: | :white_check_mark: | :white_check_mark: | | | Find Similar Issue | :white_check_mark: | | | diff --git a/docs/CUSTOM_SUGGESTIONS.md b/docs/CUSTOM_SUGGESTIONS.md new file mode 100644 index 00000000..6b2f6403 --- /dev/null +++ b/docs/CUSTOM_SUGGESTIONS.md @@ -0,0 +1,62 @@ +# Custom Suggestions Tool + +## Table of Contents +- [Overview](#overview) +- [Example usage](#example-usage) +- [Configuration options](#configuration-options) + + +## Overview +The `custom_suggestions` tool scans the PR code changes, and automatically generates custom suggestions for improving the PR code. +It shares similarities with the `imrpove` tool, but with one main difference: the `custom_suggestions` tool will only propose suggestion that follow specific guidelines defined by the prompt in: `pr_custom_suggestions.prompt` configuration. + +The tool can be triggered [automatically](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#github-app-automatic-tools) every time a new PR is opened, or can be invoked manually by commenting on a PR. + +When commenting, use the following template: + +``` +/custom_suggestions --pr_custom_suggestions.prompt="The suggestions should focus only on the following:\n-...\n-...\n-..." +``` + +With a [configuration file](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#working-with-github-app), use the following template: + +``` +[pr_custom_suggestions] +prompt="""\ +The suggestions should focus only on the following: +-... +-... +-... +""" +``` +Using a configuration file is recommended, since it allows to use multi-line instructions. + +Don't forget - with this tool, you are the prompter. Be specific, clear, and concise in the instructions. Specify relevant aspects that you want the model to focus on. \ +You might benefit from several trial-and-error iterations, until you get the correct prompt for your use case. + +## Example usage + +Here is an example for a possible prompt: +``` +[pr_custom_suggestions] +prompt="""\ +The suggestions should focus only on the following: +- look for edge cases when implementing a new function +- make sure every variable has a meaningful name +- make sure the code is efficient +""" +``` + +The instructions above are just an example. We want to emphasize that the prompt should be specific and clear, and be tailored to the needs of your project. + +Results obtained with the prompt above: +___ + +___ + +___ + +## Configuration options +`prompt`: the prompt for the tool. Should be a multi-line string. +`num_code_suggestions`: number of code suggestions provided by the 'custom_suggestions' tool. Default is 4. +`enable_help_text`: if set to true, the tool will display a help text in the comment. Default is true. \ No newline at end of file From 27aafb06cb50b26c2ce5f3119ba11b8c7e932389 Mon Sep 17 00:00:00 2001 From: mrT23 Date: Sun, 21 Jan 2024 17:10:23 +0200 Subject: [PATCH 2/3] feat: Add custom suggestions tool to README.md --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e95bdab1..7e7008d5 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,8 @@ Making pull requests less painful with an AI agent ## News and Updates ### Jan 21, 2024 -- 💎 Custom suggestions - A new tool, `/custom_suggestions`, was added to PR-Agent Pro. The tool will only propose suggestion that follow specific guidelines defined by a prompt given by the user. See [here](https://github.com/Codium-ai/pr-agent/blob/main/docs/CUSTOM_SUGGESTIONS.md) for more details. +- 💎 Custom suggestions - A new tool, `/custom_suggestions`, was added to PR-Agent Pro. The tool will propose only suggestion that follow specific guidelines defined by the user. +See [here](https://github.com/Codium-ai/pr-agent/blob/main/docs/CUSTOM_SUGGESTIONS.md) for more details. ### Jan 17, 2024 - 💎 Inline file summary - The `describe` tool has a new option `--pr_description.inline_file_summary`, which allows to add a summary of each file changes to the Diffview page. See [here](https://github.com/Codium-ai/pr-agent/blob/main/docs/DESCRIBE.md#inline-file-summary-) @@ -72,6 +73,8 @@ CodiumAI PR-Agent is an open-source tool to help efficiently review and handle p ‣ **Generate Custom Labels 💎 ([`/generate_labels`](./docs/GENERATE_CUSTOM_LABELS.md))**: Automatically suggests custom labels based on the PR code changes. \ ‣ **Analyze 💎 ([`/analyze`](./docs/Analyze.md))**: Automatically analyzes the PR, and presents changes walkthrough for each component. +\ +‣ **Custom Suggestions 💎 ([`/custom_suggestions`](./docs/CUSTOM_SUGGESTIONS.md))**: Automatically generates custom suggestions for improving the PR code, based on specific guidelines defined by the user. See the [Installation Guide](./INSTALL.md) for instructions on installing and running the tool on different git platforms. @@ -161,7 +164,7 @@ See the [Tools Guide](./docs/TOOLS_GUIDE.md) for a detailed description of the d | | ⮑ [Inline file summary](https://github.com/Codium-ai/pr-agent/blob/main/docs/DESCRIBE.md#inline-file-summary-) 💎 | :white_check_mark: | :white_check_mark: | :white_check_mark: | | | Improve | :white_check_mark: | :white_check_mark: | :white_check_mark: | | | ⮑ Extended | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| | [Custom_suggestions](https://github.com/Codium-ai/pr-agent/blob/main/docs/CUSTOM_SUGGESTIONS.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| | [Custom Suggestions](https://github.com/Codium-ai/pr-agent/blob/main/docs/CUSTOM_SUGGESTIONS.md) 💎 | :white_check_mark: | :white_check_mark: | :white_check_mark: | | | Reflect and Review | :white_check_mark: | :white_check_mark: | :white_check_mark: | | | Update CHANGELOG.md | :white_check_mark: | :white_check_mark: | :white_check_mark: | | | Find Similar Issue | :white_check_mark: | | | From 78d886459a905abb392077b9e158728c94fd11b5 Mon Sep 17 00:00:00 2001 From: mrT23 Date: Sun, 21 Jan 2024 17:15:34 +0200 Subject: [PATCH 3/3] feat: Add custom suggestions tool to README.md --- docs/CUSTOM_SUGGESTIONS.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/CUSTOM_SUGGESTIONS.md b/docs/CUSTOM_SUGGESTIONS.md index 6b2f6403..e6756b42 100644 --- a/docs/CUSTOM_SUGGESTIONS.md +++ b/docs/CUSTOM_SUGGESTIONS.md @@ -8,7 +8,7 @@ ## Overview The `custom_suggestions` tool scans the PR code changes, and automatically generates custom suggestions for improving the PR code. -It shares similarities with the `imrpove` tool, but with one main difference: the `custom_suggestions` tool will only propose suggestion that follow specific guidelines defined by the prompt in: `pr_custom_suggestions.prompt` configuration. +It shares similarities with the `improve` tool, but with one main difference: the `custom_suggestions` tool will only propose suggestion that follow specific guidelines defined by the prompt in: `pr_custom_suggestions.prompt` configuration. The tool can be triggered [automatically](https://github.com/Codium-ai/pr-agent/blob/main/Usage.md#github-app-automatic-tools) every time a new PR is opened, or can be invoked manually by commenting on a PR. @@ -57,6 +57,9 @@ ___ ___ ## Configuration options + `prompt`: the prompt for the tool. Should be a multi-line string. + `num_code_suggestions`: number of code suggestions provided by the 'custom_suggestions' tool. Default is 4. + `enable_help_text`: if set to true, the tool will display a help text in the comment. Default is true. \ No newline at end of file