Blog / Build with AI /
Building a Shopify helper tool with AI
Every store has a boring job that eats hours. Checking that product titles aren’t too long. Finding items with no description. Spotting products with no image or missing SEO fields. It’s not hard. It’s just repetitive, and repetitive is exactly where a small tool earns its keep.
I work in e-commerce at an electronics business, so this is the kind of task I see the shape of every day. Here’s how I’d go about building a small helper with AI, using one simple example you can follow along with.
The problem and the finished thing
Say you want to find products with SEO problems before they go live: a missing SEO description, an over-long SEO title, or a blank product title.
The finished thing in one line: a script that reads your Shopify product export and writes a new file listing every product with a problem and what the problem is.
No app. No server. No store access at all. Just a file in and a file out. That’s a good place to begin, and it keeps risk low because your store isn’t touched.
Why start with the export
Shopify lets you export products as a CSV. It contains columns such as Handle, Title, SEO Title and SEO Description. Because it’s a file on your computer, your script can’t break anything, and you can run it again as often as you like.
Starting here also avoids the hard parts, like API keys, permissions and rate limits, until you’ve proved the idea is useful. If you later want the tool to read the store directly, you can move to the Admin API. For ideas on that step, see building a Shopify app idea with AI: where it gets hard.
Step 1: Describe the tool properly
AI builds the wrong thing when you describe the wrong thing. Spend five minutes on a clear description. The approach in how to describe a tool to AI so it builds the right thing applies here.
A prompt that works:
I want a Python script that reads a Shopify product export CSV called products_export.csv. The columns I care about are Handle, Title, SEO Title and SEO Description. The file has several rows per product because of variants, and only the first row of each product has a Title. Skip rows where Title is empty. For each product, flag: (1) SEO Description missing, (2) SEO Title longer than 60 characters, (3) SEO Description longer than 160 characters. Write the results to problems.csv with columns Handle, Title, Problem. Use only the Python standard library. Keep it short and add a comment above each step.
Notice the details. It mentions the variant rows, which is exactly the sort of thing the AI wouldn’t know. It sets limits. It names the output. It restricts the tools so you don’t end up installing things you don’t need.
Step 2: Read what it gives you
Don’t run code you haven’t read. Ask for an explanation: “Explain this script line by line in plain English.” The habit is described in how to ask AI to explain code line by line.
For this tool, the heart of it looks something like this:
import csv
with open("products_export.csv", newline="", encoding="utf-8-sig") as f_in, \
open("problems.csv", "w", newline="", encoding="utf-8") as f_out:
reader = csv.DictReader(f_in)
writer = csv.writer(f_out)
writer.writerow(["Handle", "Title", "Problem"])
for row in reader:
title = row.get("Title", "").strip()
if not title:
continue # variant rows have no title
seo_title = row.get("SEO Title", "").strip()
seo_desc = row.get("SEO Description", "").strip()
if not seo_desc:
writer.writerow([row["Handle"], title, "Missing SEO description"])
elif len(seo_desc) > 160:
writer.writerow([row["Handle"], title, "SEO description too long"])
if len(seo_title) > 60:
writer.writerow([row["Handle"], title, "SEO title too long"])
Check three things. Does it skip the variant rows? Does it open the files with sensible encoding? Does it write somewhere that won’t overwrite your original? If any answer is no, ask for a fix.
Step 3: Test on a tiny file
Make a copy of the export with ten products. Put in obvious problems on purpose: one with no description, one with a very long title. Run the script and see whether it finds exactly what you planted.
This sounds fussy, but it’s the step that saves you. A tool that appears to work and silently misses half the problems is worse than no tool. I wrote more on this in testing AI-written code when you are not a developer.
Step 4: Run it on the real export
Now use the full file. Look at the output with a human eye. Open five flagged products in the store admin and check that the problem is real. Check five unflagged ones and make sure nothing is hiding.
Remember that character limits for SEO titles and descriptions are guidelines. Google measures display width, not characters, and may rewrite what it shows. Treat the flags as prompts to look, not orders to obey.
Step 5: Improve it a little at a time
Once the basic version works, small additions make it more useful.
- Add a check for duplicate SEO titles across products.
- Flag products with no image or very short descriptions.
- Sort the output by collection or product type.
- Count the problems at the end, so you can see progress over time.
Add one thing at a time and test each. Asking AI to rewrite the whole script for every change is how bugs appear. Iterating with AI: small changes beat big rewrites covers it.
What can go wrong
- Wrong assumptions about the file. Exports change over time and differ between stores. Check your own column names.
- Silent skipping. If a column is named slightly differently, your script may read blanks and flag everything. Test on a known sample.
- Sensitive data. A product export may include costs or notes. Before pasting data into an AI chat, remove anything private. Prefer to share a few dummy rows and column names instead of the full file. Keeping user data out of AI training is worth a read.
- Over-trusting the result. A tool that finds problems doesn’t decide which are worth fixing.
- Moving to live edits too soon. Writing changes back to the store is a different level of risk. Test on a development store and keep backups.
Where to go next
If this saves you time, the natural next steps are:
- Run it on a schedule, such as after each large catalogue update.
- Connect it to the store through the Admin API, read-only first.
- Wrap the results in a simple page or spreadsheet that others in your team can use.
- Only then consider tools that make changes, with a review step before anything goes live. Keeping a human in the loop with AI agents explains why.
Key takeaways
- Start with a file in and a file out. No store access means no store risk.
- Describe the tool in detail, including quirks like variant rows.
- Read the code, test it on a tiny sample with planted problems, then run it for real.
- Add features one at a time, and keep private data out of the chat.
FAQ
Do I need to know Python?
Not much, but you need to read what the AI wrote and test it. If you can follow the explanation line by line, you can manage a tool this small.
Can AI connect directly to my Shopify store?
It can help you write that code, but start read-only and test on a development store first.
Is this better than an app from the Shopify App Store?
For a very specific job, a small script can be quicker and cheaper. For anything customers or a team will depend on, a maintained app is often safer.
Related reading
What is the most boring repeated job in your store, and what would the input and output files be?