> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.ubuyfirst.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Building Your AI Analysis

## Create and refine prompts, display templates, and custom columns

Table Of Contents

* [Create and refine prompts, display templates, and custom columns](#0-toc-title)
* [What You’re Creating](#1-toc-title)
* [Before You Start](#2-toc-title)
* [Step 1: Set Up Your AI Project](#3-toc-title)
* [Option A: ChatGPT (Easiest)](#4-toc-title)
* [Option B: Claude](#5-toc-title)
* [Option C: Gemini](#6-toc-title)
* [What’s in the Knowledge Files?](#7-toc-title)
* [Step 2: Generate Your First Prompt & Template](#8-toc-title)
* [Start the Conversation](#9-toc-title)
* [Describe Your Mental Process](#10-toc-title)
* [Example Conversation](#11-toc-title)
* [What Your AI Assistant Will Do](#12-toc-title)
* [Step 3: Load Into SKU Manager](#13-toc-title)
* [Save the Prompt](#14-toc-title)
* [Save the Display Template](#15-toc-title)
* [Step 4: Create Your Filter (in uBuyFirst)](#16-toc-title)
* [Step 5: Test It](#17-toc-title)
* [Improving Your Prompt Over Time](#18-toc-title)
* [When AI Gets Something Wrong](#19-toc-title)
* [Adding Features Later](#20-toc-title)
* [Quick Reference](#21-toc-title)
* [Adding Custom Columns (Optional)](#22-toc-title)
* [Why Use Both?](#23-toc-title)
* [How to Add Columns](#24-toc-title)
* [Columns Enable Additional Filters](#25-toc-title)
* [Include Reasoning in Your Prompts](#26-toc-title)
* [What Good Output Looks Like](#27-toc-title)
* [Tips for Success](#28-toc-title)

---
## What You’re Creating

You’ll be building two components **outside of uBuyFirst** using an AI assistant, then bringing them back into the application:

| Component | What It Does | Where It Lives in SKU Manager |
| --- | --- | --- |
| Prompt | Instructions telling the AI how to analyze listings | AI Prompt tab |
| Display Template | HTML that formats results in External Panel | AI Display Template tab |

The prompt outputs JSON data → The template displays it visually.

Once set up, your AI project becomes your ongoing workspace — you’ll come back here to make enhancements, add features, and fix issues using feedback traces.

---
## Before You Start

☑️ **SKU Manager configured** — Python installed, API key set up, Fields to Send profile created (see Quick Start Guide)

☑️ **AI assistant account** — Pick one:

* **ChatGPT** — We have a Custom GPT with documentation already loaded ([link from support])
* **Claude** — Free at [claude.ai](https://claude.ai/), Pro recommended
* **Gemini** — Free at [aistudio.google.com](https://aistudio.google.com/)

☑️ **Know your products** — What you’re searching for, what qualifies, what disqualifies

---
## Step 1: Set Up Your AI Project

_~10 minutes, one-time setup_

### Option A: ChatGPT (Easiest)

We have a **Custom GPT** with all documentation pre-loaded.

1. Get the link from support

2. Open the Custom GPT

3. Skip to Step 2 — you’re ready to go

**Model recommendation:** Use GPT-5.2 or 5.1 with **Thinking** or **Pro** mode enabled for complex prompts.

---
### Option B: Claude

**Create the Project:**

1. Go to [claude.ai](https://claude.ai/)

2. Click **“Projects”** in the left sidebar

3. Click **“Create Project”**

4. Name it: `SKU Manager - Prompt Builder`

**Add Knowledge Files:**

1. Get the SKU Manager Project Package (link from support or Google Drive)

2. Click **“Add to Project Knowledge”** (or the + icon)

3. Upload ALL files from the package

📸 _[Screenshot: Claude project with knowledge files uploaded]_

**Add Project Instructions:**

1. Find the `Project-Instructions` file in the package

2. Copy the entire contents

3. In Claude, click **gear icon** (Settings) → **Project Instructions**

4. Paste and save

**Model recommendation:** Use **Claude 4.5 Sonnet** with **Extended Thinking** enabled when building prompts.

---
### Option C: Gemini
1. Go to [aistudio.google.com](https://aistudio.google.com/)

2. Create a new project

3. Upload all files from the SKU Manager Project Package

4. Add the project instructions to the **Instructions** field

**Model recommendation:** Use **Gemini Pro** (thinks longer) for advanced prompt building.

---
### What’s in the Knowledge Files?

The files teach your AI assistant about:

* **How prompts and display templates connect** — field names, JSON structure, what needs to match
* **Fields to Send** — what data comes from eBay listings
* **Custom AI Columns** — optional grid columns for quick decisions
* **Working examples** — reference implementations to learn from
* **The Feedback/Trace system** — how to take your feedback and make targeted fixes

This means your AI assistant can:

* Create new prompts from scratch
* Build matching display templates
* Come back later and make modifications based on your feedback
* Know whether a change needs the prompt, the template, or both

_Note: These files may be updated over time as features evolve._

---
## Step 2: Generate Your First Prompt & Template

_~30-60 minutes_

### Start the Conversation

In your AI project, start a **new chat**. The goal is to describe what you’re looking for in natural language — like you’re explaining your buying process to someone.

**Start simple:**

```
I want to create a new prompt and display template.

I search for [SEARCH TERM] and see [TYPES OF PRODUCTS] in the results.

When I'm going through listings, here's what I'm looking for:
- [What makes something a yes]
- [What makes something a no]
- [Things I can only tell from pictures]
- [Things I need to read in the description]

```
### Describe Your Mental Process

Think about how YOU decide whether a listing qualifies. Tell the AI assistant:

* **Product identification** — “I’m looking for [specific brand/model], not [other things that show up]”
* **Condition requirements** — “It needs to be [sealed/working/no damage]”
* **Visual inspection** — “From pictures, I’m checking for [cracks/missing parts/box damage]”
* **Description details** — “In the description, I look for [keywords/red flags]”
* **Different tiers** — “I’ll pay $X for [condition A] but only $Y for [condition B]”

### Example Conversation

**For Test Strips:**

```
I want to create a prompt and display template.

I search for "OneTouch Ultra test strips" and I'm trying to buy sealed, 
undamaged boxes with good expiration dates.

When I look at listings, I check:
- Is it actually OneTouch Ultra (not Verio or other models)?
- Is the box sealed? Any tears or damage I can see in photos?
- What's the expiration date? I need at least 6 months out.
- How many boxes are they selling? I want the per-box price.

From pictures, I'm looking at box condition and trying to read expiration 
dates if they're visible. Some sellers don't show everything clearly.

Let's start simple — just help me identify the right products and flag 
any obvious damage.

```
### What Your AI Assistant Will Do

Based on your description, it will:

1. Ask clarifying questions if needed

2. Generate a **prompt** with proper JSON structure

3. Generate a matching **display template**

4. Make sure field names align between both

**Your initial goal isn’t perfection** — it’s getting the full round-trip working. You can refine it after you see real results.

---
## Step 3: Load Into SKU Manager

_~5 minutes_

### Save the Prompt
1. Copy the prompt your AI assistant generated

2. In uBuyFirst, go to **Data tab > Get Data** (External Data panel)

3. Click **“AI Prompt”** tab

4. Click **“Add”** to create new profile

5. Name it clearly: `[Product]_Prompt_v1`

6. Paste the prompt

7. Click **Save**

📸 _[Screenshot: AI Prompt tab with prompt pasted]_

### Save the Display Template
1. Copy the HTML template

2. Go to **“AI Display Template”** tab

3. Click **“Add”** to create new profile

4. Name it: `[Product]_Template_v1`

5. Paste the template

6. Check the preview — you should see the layout structure

7. Click **Save**

📸 _[Screenshot: AI Display Template tab with preview]_

---
## Step 4: Create Your Filter (in uBuyFirst)

_~5 minutes_

**This is what triggers your AI to run.** You set this up in uBuyFirst, not in your AI project.

1. Close External Data panel

2. Go to **Home > Filters**

3. Click **“New Filter”**

4. Configure:

* **Type**: Select **AI** ✅
* **Name**: Something clear like `AI - [Product] Analysis`
* **AI Prompt**: Select your prompt profile
* **AI Display Template**: Select your template profile
* **AI Fields to Send**: Select your fields profile
* **Condition**: What triggers it
* For all results: `Title is not blank`
* For specific items: `Alias contains "[keyword]"` or `Title contains "[model]"`

5. **Type**: Select **AI** ✅

6. **Name**: Something clear like `AI - [Product] Analysis`

7. **AI Prompt**: Select your prompt profile

8. **AI Display Template**: Select your template profile

9. **AI Fields to Send**: Select your fields profile

10. **Condition**: What triggers it

* For all results: `Title is not blank`
* For specific items: `Alias contains "[keyword]"` or `Title contains "[model]"`

11. For all results: `Title is not blank`

12. For specific items: `Alias contains "[keyword]"` or `Title contains "[model]"`

13. Make sure **Enabled** is checked ✅

14. Click **Save**

📸 _[Screenshot: Filter configuration with AI type selected]_

---
## Step 5: Test It1. Return to **Data > Get Data** (External Data panel)

2. Click **“Stop Script”** then **“Start Script”** to refresh

3. Run a search that matches your filter condition

4. Click on a listing

**Working?** You should see your formatted analysis in the External Panel.

**Not Working?** Check:

* Filter enabled?
* Filter condition matches your search?
* Field names in template match prompt output? (case-sensitive!)
* API key configured and billing active?

---
## Improving Your Prompt Over Time
### When AI Gets Something Wrong

Use the **Feedback/Trace System** in SKU Manager:

1. **In the External Panel**, click **Submit Feedback** on the problem listing

2. A popup appears — **describe the issue in natural language**

* “This should have been flagged as damaged”
* “It missed that this is a lot of 3”
* “The model identification was wrong — it’s actually an X not a Y”

3. “This should have been flagged as damaged”

4. “It missed that this is a lot of 3”

5. “The model identification was wrong — it’s actually an X not a Y”

6. Click Submit — this saves everything:

* Your prompt and settings
* The listing data and pictures
* All field data that was sent
* Your feedback notes

7. Your prompt and settings

8. The listing data and pictures

9. All field data that was sent

10. Your feedback notes

11. **Go back to your AI project** and start a new chat:```
I have feedback on my [PRODUCT] prompt. The AI got something wrong.

[Paste the contents of the feedback/trace files]

Here's what happened: [your notes]

```1. Your AI assistant will:

* Diagnose what went wrong
* Show you a BEFORE/AFTER comparison
* Output an updated prompt or template (or both)

2. Diagnose what went wrong

3. Show you a BEFORE/AFTER comparison

4. Output an updated prompt or template (or both)

5. **Apply the fix** in SKU Manager and re-test with the same listing
### Adding Features Later

Once basics work, go back to your AI project:

```
My [PRODUCT] prompt is working. Now I want to add:
- [New feature, e.g., price calculations]
- [New feature, e.g., custom columns for the grid]

```

Your AI assistant knows what changes need the prompt, the template, or both.

---
## Quick Reference

| What You Want | Where to Go |
| --- | --- |
| Create/edit prompt | Your AI project (ChatGPT/Claude/Gemini) |
| Load prompt into app | SKU Manager > AI Prompt tab |
| Load template into app | SKU Manager > AI Display Template tab |
| Set when AI runs | uBuyFirst > Home > Filters |
| Report issues/feedback | External Panel > Submit Feedback button |

---
## Adding Custom Columns (Optional)

Custom columns let you see key AI decisions **in your results grid** — without opening the External Panel for each listing.

### Why Use Both?

| Where It Shows | What It’s For |
| --- | --- |
| Display Template | Detailed analysis in External Panel — full reasoning, all the data |
| Custom Columns | Quick decisions in results grid — “Can Return: Yes”, “Buy: No” |

Many users include the same key values in **both** places:

* Columns for quick scanning and filtering
* Template for the full picture when you click in

### How to Add Columns
1. **In uBuyFirst**, go to **AI Columns** tab and create your column profile

2. Define the exact column names (e.g., `Can Return`, `Original Owner`, `Buy Decision`)

3. **Go back to your AI project** and say:```
I want to add custom columns to my prompt. 
Here are the exact column names I created:
- Can Return (values: Yes / No)
- Original Owner (values: Yes / No)  
- Buy Decision (values: Buy / Research / Pass)

Update my prompt to output these columns.

```

**Important:** You must tell your AI assistant the **exact column names** — it can’t read them from a screenshot. The names in your prompt must match exactly what you created in uBuyFirst.

### Columns Enable Additional Filters

Once you have AI columns, you can create **additional filter actions** based on the results:

* Highlight rows where `AI Can Return = Yes`
* Remove/hide rows where `AI Buy Decision = Pass`
* Color-code based on confidence levels

This lets AI do the first pass so you focus on what matters.

---
## Include Reasoning in Your Prompts

When building prompts, ask your AI assistant to include **reasoning and source attribution** in the output. These sections explain back — in natural language — how and why the AI arrived at its analysis.

This helps you:

* Understand WHY the AI made a specific decision
* Identify which field values may have caused an unexpected analysis or conflict
* Debug issues faster when you submit feedback traces
* See exactly which fields and photos informed each conclusion

### What Good Output Looks Like

**Detailed Reasoning** (natural language explanation):

```
The phone is identified as an iPhone 15, 256GB, Factory Unlocked based 
on the title, description, and model fields. Return eligibility is 'Yes' 
as the seller has a 'Returns accepted / 30 day' policy and the device 
is fully functional, despite cosmetic flaws which are disclosed. The 
'Original Owner' status is 'No' — the seller is a registered business 
with high feedback (2098) and professional product photos, strongly 
indicating a reseller rather than an individual.

```

**Source Attribution** (field-by-field citations):

```
Model, Storage, Carrier: Title, Model field, Description, Network field.
Defects: Description, Photos 2-4.
Can Return: Returns field, Description.
Original Owner: SellerName, SellerBusiness, FeedbackScore, Photos.

```

When you submit feedback traces, this information helps you (and your AI assistant) pinpoint exactly what data caused the issue and where to fix it in the prompt.

**Ask your prompt builder:**

```
Include a detailed reasoning section that explains in natural language 
how you arrived at each major conclusion. Also include source attribution 
showing which fields and photos informed each decision.

```
---
## Tips for Success1. **Start simple** — Get basic identification working before adding price calculations or columns

2. **Describe your thinking** — The more you explain your mental process, the better the prompt

3. **Pictures matter** — Tell the AI what you look for in photos (damage, labels, condition)

4. **Test with real listings** — See how it performs before tweaking

5. **Use feedback traces** — Don’t guess at what went wrong; capture the actual data

6. **Include reasoning** — Makes debugging much easier when something’s off

7. **Version your work** — Save as v1, v2, etc. before making big changes
---

**Questions?** Live Support at [ubuyfirst.com](https://ubuyfirst.com/) or email su*****@*******st.com

_For the full AI Columns setup walkthrough, see the complete SKU Manager Setup Guide._