# Templates

Templates help you improve your code quality instantly with AI-powered analysis. Get automated suggestions for performance optimization, security fixes, style improvements, and code cleanup without leaving your editor. Each template provides actionable feedback and ready-to-use code improvements that you can review and apply with a single click.

## Available templates

1. **Performance Check:** Optimize code performance and efficiency
2. **Security Check:** Identify and fix security vulnerabilities
3. **Style Check:** Apply coding style and formatting standards
4. **Improve Readability:** Enhance code clarity and organization
5. **Clean Code:** Remove debugging and logging statements

<figure><img src="/files/wRCVT2drevDp2ihvKPua" alt=""><figcaption><p>Templates menu in Bito Panel</p></figcaption></figure>

## How to use templates

### Prerequisites

Select the code you want to analyze in your editor before using any template.

### Method 1: Click Templates button

1. Select code in your editor
2. Click the **Templates** button at the bottom of the Bito extension panel

<figure><img src="/files/W8iwrnQVgt1aQAZUOJix" alt=""><figcaption></figcaption></figure>

3. Choose the desired template from the dropdown menu

<figure><img src="/files/MXJA6sxz15hGe6vljipe" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Quick navigation:** Use arrow keys, Tab, or Shift+Tab to navigate the template menu
{% endhint %}

### Method 2: Open context menu

1. Select code in your editor
2. Right-click in the editor window
3. Hover over "Bito AI" in the context menu
4. Select the desired template from the submenu

<figure><img src="/files/BDsZgD3v7hHhOs8BfDMj" alt=""><figcaption></figcaption></figure>

### Method 3: Using slash `/` command in Bito chat box

1. Select code in your editor
2. Type `/` at the start of the Bito chat box
3. Choose the desired template from the dropdown menu

<figure><img src="/files/uf67FYMoDLxdV7xczyva" alt=""><figcaption></figcaption></figure>

4. Type some text after the slash `/` to filter templates by name

<figure><img src="/files/xBqeFHoaMSkMWDWpt8hj" alt=""><figcaption></figcaption></figure>

### Method 4: Command Palette (VS Code)

1. Select code in your editor
2. Go to View → Command Palette (or press Ctrl+Shift+P / Cmd+Shift+P)
3. Type "bito" to see available templates
4. Select the desired template from the list

<figure><img src="/files/wx4LncbSg0fMy1m2SBuZ" alt=""><figcaption></figcaption></figure>

## Applying code suggestions

When templates provide code improvements, you'll see an **Apply** button above the suggested code snippet.

1. Click the **Apply** button to open the diff view

<figure><img src="/files/5xWLig3F2dFsGZcKMFhH" alt="" width="402"><figcaption></figcaption></figure>

2. Review the changes highlighted in the diff:
   * Red lines show code to be removed
   * Green lines show code to be added
3. Choose your action:
   * **Accept** - Apply the suggested changes to your code
   * **Undo** - Reject the changes and keep your original code

<figure><img src="/files/Itk4ucRkLN9K3ru5o6oS" alt=""><figcaption></figcaption></figure>

## Tips

* Select meaningful code blocks for better analysis results
* Templates work best with complete functions or logical code segments
* Review suggested changes before applying them to your codebase
* Verify that the changes don't break existing functionality
* Use multiple templates on the same code for comprehensive analysis
* Use the diff view to understand exactly what changes will be made


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bito.ai/ai-code-reviews-in-ide/templates.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
