Skip to main content

Command Palette

Search for a command to run...

Use Gemini Code Assist as a PR Reviewer

Creating Shopify Theme with AI - #3

Published
β€’4 min read
Use Gemini Code Assist as a PR Reviewer

TL;DR

Gemini Code Assist is a GitHub app that auto-reviews your PRs. It catches real issues (typos, accessibility, naming). You often need /gemini review more than once β€” it does not catch everything in a single pass. Treat suggestions as hypotheses: test before you merge.

Intro πŸ€–

Reviewing AI-generated code is tedious. When Cursor writes 300 lines across 8 files, you either review it properly (slow) or trust it (risky).

Gemini Code Assist is the free option I tried β€” here's what it catches and where it falls short.

Gemini Code Assist

While I was researching Gemini, I found a GitHub app: Gemini Code Assist.

Setup is straightforward. See: https://developers.google.com/gemini-code-assist/docs/set-up-code-assist-github

After I connected it to my repo, it runs automatically on new pull requests.

What Gemini catches well βœ…

Once it was live, the practical value showed up quickly.

Code quality

  • Typos in variable names and string literals

  • Missing or undefined variables in Liquid templates

  • Inconsistent naming across files

For example, I added some styles

    height: 100%;
    width: 100%;

The review:

Your stylesheet is already using modern CSS logical properties like inline-size and block-size in other places. For consistency, it would be best to use them here as well instead of the physical properties height and width.

Readability

  • Restructuring overly nested Liquid logic

  • More descriptive variable names

Accessibility

  • Missing alt attributes on images

  • Semantic HTML (for example, correct heading hierarchy)

These catches alone make it worthwhile.

Limitations You Should Know ⚠️

No tool is perfect. Gemini as a PR reviewer has a few friction points worth naming clearly.

It does not review everything in one pass

The biggest pain point for me: Gemini does not always list all issues in the first review.

For example, I got feedback about a CSS class name. I fixed it, then commented /gemini review to run it again. A few minutes later, I got more comments on other lines.

In practice, I trigger several reviews with /gemini review to collect most of the feedback.

Not always right

AI makes mistakes β€” that is common knowledge, and keep it in mind. Treat every suggestion as a hypothesis, not a final answer. Read it, understand it, then test it β€” especially when it changes logic, not only style.

Situation: richtext field and a suggestion I applied

For example, when I was implementing a richtext field in the section, I got a review message:

For richtext fields, a simple != blank check might not be sufficient. If a user clears the text in the editor, it can leave behind empty HTML tags like

, which would pass the blank check and render an empty element, potentially causing unwanted layout spacing. It's more robust to strip HTML tags and whitespace before checking if the content is blank.

{% if section.settings.paragraph | strip_html | strip != blank %}
  {{ section.settings.paragraph }}
{% endif %}

I used this suggested code. What I didn't know was that it would be a syntax error. (my liquid knowledge is limited...) I also forgot to run theme check somehow.

What went wrong

Later I checked the website; the change wasn't there. I checked the Shopify log and realized that the change caused a syntax error. Luckily the error was caught by Shopify's theme deployment system, so the change wasn't released.

In Liquid, filters (|) cannot be used directly inside {% if %} conditions. You need to assign the filtered value to a variable, then use it in the condition.

The Fix

{%- assign stripped_paragraph = section.settings.paragraph | strip_html | strip -%}
{% if stripped_paragraph != blank %}
  {{ stripped_paragraph }}
{% endif %}

Test every suggestion before merging β€” even the ones that look obviously right.

Hard to dismiss or ignore comments

I might be missing a feature, but I have not found a clean way to mark a comment as β€œintentionally ignored.” After I resolve a thread and push, Gemini often raises the same suggestion again on the next review.

Note: While writing this, I saw the @gemini-code-assist mention in the marketplace docs. I will try that next time to see if it reduces repeated comments.

So Is It Worth It? πŸ€”

Gemini as a PR reviewer is a useful first pass for Shopify theme work. It catches small, high-impact problems that are easy to skip β€” especially accessibility and readability, where a normal linter helps less.

Repeated comments and multi-pass reviews add steps. But if you expect an automated first reviewer β€” not a replacement for you or your team β€” it is worth installing and trying. πŸ˜‰πŸ‘‰ Gemini Code Assist on GitHub Marketplace.