> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usetusk.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Code Reviews

> Submit a PR review for Tusk to iterate on its changes

## Overview

Tusk may need guidance on the code it generates every now and then. You can provide feedback to Tusk by submitting a review on the pull request (PR) that it generates. Tusk will take your code review, regenerate code to address your feedback, and then make another commit with the relevant changes.

This guide will walk you through how to submit a code review and the tips and tricks around providing feedback to Tusk.

***

## Submitting a Code Review

As an engineer, you should review Tusk’s PR as if you’re reviewing a co-worker’s PR. Make sure the code works by testing changes before merging. See the steps below for requesting changes from Tusk:

1. After Tusk creates a pull request (PR), you will see a note on the PR body that you can submit a review on the PR for Tusk to address.

<img className="block" src="https://mintcdn.com/tusk/g9ARE0f2IAwondFu/images/code-review-1.png?fit=max&auto=format&n=g9ARE0f2IAwondFu&q=85&s=bf49e8694d4a287f31a1fa53d6519324" alt="Code Review 1" width="1844" height="950" data-path="images/code-review-1.png" />

2. Go to **Files changed**.

3. **Optional but recommended**: Click on the '+' icon by the line number that you want to give feedback on.

4. Add your feedback in the text editor that shows up. We recommend using in-line comments if you’re providing targeted feedback regarding the diff.

<img className="block" src="https://mintcdn.com/tusk/g9ARE0f2IAwondFu/images/code-review-2.png?fit=max&auto=format&n=g9ARE0f2IAwondFu&q=85&s=96db58d5759a5695e7ad52ef93ae319d" alt="Code Review 2" width="2160" height="704" data-path="images/code-review-2.png" />

5. Click **Start a review**. You should see that the comment is added to your ongoing review.

<img className="block" src="https://mintcdn.com/tusk/g9ARE0f2IAwondFu/images/code-review-3.png?fit=max&auto=format&n=g9ARE0f2IAwondFu&q=85&s=0a6d2947a1f0983004a8c044b350e3be" alt="Code Review 3" width="2142" height="618" data-path="images/code-review-3.png" />

6. Click **Finish your review** or **Review changes** (if you haven’t added in-line comments) at the top right of the page.

7. Add any general review comments and choose **Request changes**.

<img className="block" src="https://mintcdn.com/tusk/g9ARE0f2IAwondFu/images/code-review-4.png?fit=max&auto=format&n=g9ARE0f2IAwondFu&q=85&s=160666d988a5019926990ea132f194da" alt="Code Review 4" width="1388" height="1130" data-path="images/code-review-4.png" />

8. Click **Submit review**.

9. Your review will be added as a comment on the PR. Tusk will comment saying that it is addressing your review.

<img className="block" src="https://mintcdn.com/tusk/g9ARE0f2IAwondFu/images/code-review-5.png?fit=max&auto=format&n=g9ARE0f2IAwondFu&q=85&s=5a53cc775f48ccbd8798156114a60c4f" alt="Code Review 5" width="1860" height="1586" data-path="images/code-review-5.png" />

10. If you click to view activity logs, you will be redirected to the Activity Log for the given task. You can see how Tusk is addressing your feedback here.

<img className="block" src="https://mintcdn.com/tusk/g9ARE0f2IAwondFu/images/code-review-6.png?fit=max&auto=format&n=g9ARE0f2IAwondFu&q=85&s=bc2295949860d39bdf4eff9e36d5e6e2" alt="Code Review 6" width="1528" height="1198" data-path="images/code-review-6.png" />

11. Once completed, Tusk will make another commit (starting with `fix:`) and comment on the PR to say that it has addressed your review.

<img className="block" src="https://mintcdn.com/tusk/g9ARE0f2IAwondFu/images/code-review-7.png?fit=max&auto=format&n=g9ARE0f2IAwondFu&q=85&s=c768da539e1bc7c215cf9c7305509ec3" alt="Code Review 7" width="1920" height="720" data-path="images/code-review-7.png" />

## Tips & Tricks

<ul>
  <li>
    If you want to make a targeted change to a chunk of code, leave an **in-line
    review comment** instead of adding the comment in the general review body.
  </li>

  <li>
    Use **markdown syntax** when referencing code snippets that you want to change or
    use.
  </li>

  <li>
    Add **images** to the review description itself (attachments not supported yet) to provide Tusk visual input on styling issues.
  </li>

  <li>
    If the approach that Tusk has taken is obviously incorrect, **close the PR with a guiding comment**
    instead of providing a code review. This will help improve Tusk’s future PRs
    while saving you time.
  </li>

  <li>
    If you’d like to retry generating the PR with a different Jira/Linear/Notion
    issue description, you can update the external issue description and then
    click **Retry generation** in Tusk. This will auto-fetch the latest
    description to use as context.
  </li>
</ul>

<img className="block h-64" src="https://mintcdn.com/tusk/g9ARE0f2IAwondFu/images/code-review-8.png?fit=max&auto=format&n=g9ARE0f2IAwondFu&q=85&s=ae4a1f6287d67bc7a350018d4e53b53c" alt="Code Review 8" width="846" height="468" data-path="images/code-review-8.png" />
