Custom Prompt Templates

🀯 Sick of typing out long prompts every time? 😩 Bito's got your back! Now, create custom prompt templates for all your frequently used prompts and save yourself some stress.

With "Create Prompt Template," you can create and save custom prompt templates for use in your IDE. By defining a custom template with a template name and prompt, Bito can execute the prompt as is on the selected code. With this feature, you can save time and streamline your workflow by quickly executing frequently used prompts without inputting them manually each time.

The custom prompt templates feature and standard prompt templates are located below the chatbox.

Here is a quick overview of the Custom Prompt Templates in Bito

Creating a Custom Prompt Template

  1. Open Bito Plugin in your IDE

  2. Below the chatbox, click on "New Template".

  1. Enter the "Template Name" and "Prompt" for your custom template. You can use {{%code%}} as a macro to insert the selected code in your prompt. If this macro is not used, Bito will insert the selected code at the end of your prompt. Next, select the "Output Format". You currently have two options:

    1. Display in Bito panel (Default)

    2. Output in diff view

  1. Click on "Create Template" to save your new custom template. All custom templates will appear below the chatbox alongside standard templates. You can create up to four custom templates.

Tips: Creating a good AI prompt is an iterative process. We recommend you iterate various options and check the output to ensure your satisfaction. Here are some helpful hints:

  1. Add instruction in the template to enclose any code output in triple backticks (```). This will ensure that the code is formatted in a code block in the output.

  2. Write clear and specific instructions. If you want output in a specific format, ask to structure the output in that format.

  3. Specify the steps to complete the task. A clearly defined set of steps allows the model to think and work out a solution before generating the output.

  4. Custom templates require selecting code in IDE. Bito replaces all instances of the {{%code%}} in the template with the selected code. If no {{%code%}} macro is found, the selected code is appended to the end of the code.

Example 1: OWASP Security Issue

Your task is to analyze the code given below: {{%code%}}. The code needs to be analyzed for the top 10 security vulnerabilities defined by OWASP. If no vulnerability is found, the output should be "No Issue Found". If any issue is found, identify all instances of the code. The output should include a list of all issues and the fixed code in the following format. The code should be enclosed in the three backticks.

Issues: List of Issues

Code: Fixed code enclosed in three back ticks

Editing or Deleting a Custom Template

You can edit or remove the templates anytime by clicking on the three dots over the template that you want to edit or remove. Note that you can edit or remove the standard templates provided by Bito.

Using a Custom Template

  1. Select any code that you want to execute the prompt.

  2. Run the Custom Template by clicking it in the Bito Templates panel or from the IDE context menu.

  3. Bito starts generating output

Here’s an example of how to execute prompts using your custom templates.

Let’s say you want to create a custom template to add a comment describing the logic behind the code. Here's how you can do it:

  1. Below the chatbox, click on "New template".

  2. Enter a name for your custom template, e.g. "Add Comment"

  3. In the "Prompt" field, enter the following: "Please add a comment describing the logic behind the code. " and then click on "Create Template" to save your new custom template

  1. Now, select the code to which you want to comment and click on the "Add Comment" template.

  1. Bito adds the selected code at the end of the prompt and executes it via Bito AI.


Check out PromptHub to learn about how to create high-quality prompts and a collection of prompts created by the Bito team that are optimized to work with Custom Prompt Templates.

Last updated


Bito Inc. (c) 2024