ai_qc/backend/visual_qc_apps/amazon_required_elements/app.py
nickviljoen 24df09aa9f Add Amazon and Boots clients with Amazon ASD 2025 QC profile
Add Boots client with static_general profile and Amazon client with
6 new brand-specific QC checks based on ASD 2025 design guidelines:
amazon_required_elements, amazon_logo_country, amazon_typography,
amazon_headline_layout, amazon_margins, and amazon_box_placement.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 11:52:03 +02:00

73 lines
3.5 KiB
Python

import os
import sys
# Add parent directory to path to import shared modules
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from visual_qc_apps.flask_app_template import FlaskAppTemplate
class AmazonRequiredElementsApp(FlaskAppTemplate):
"""
Amazon ASD 2025 - Required Elements Check
Verifies all mandatory layout elements are present in the design.
"""
def __init__(self):
prompt = """You are performing a visual quality-control check on an Amazon ASD 2025 (Amazon Sale Day) marketing asset. Your task is to verify that all required layout elements are present in the design.
AMAZON ASD 2025 REQUIRED ELEMENTS:
Every standard Amazon ASD layout must contain ALL of the following elements:
1. HEADLINE - The main promotional text (e.g. "Epic deals", sale messaging). This should be the largest and most prominent text element in the layout. It is always left-aligned.
2. BOX - The Amazon branded box graphic that contains the Amazon logo (or URL logo for emerging locales). This is a distinctive cardboard box shape with tape on top. In some display formats, a Paper Bag may be used instead of the Box.
3. SUBHEAD - Secondary text below or near the headline providing additional context (e.g. discount percentage, "Save up to XX%"). Smaller than the headline but larger than the date.
4. DATE - The sale dates/timing information. Should always be smaller than the subhead and come after the subhead in reading order.
5. LEGAL LINE - Small disclaimer/legal text, typically at the bottom of the layout. Should be at minimum 10pt size with reduced opacity (white at 50% opacity).
EXCEPTIONS FOR SMALL FORMATS:
- For very small formats (typically below 60 pixels in height), the layout may be reduced to just the essential elements: Headline and Box/logo only. This is acceptable.
- For banners where one side is smaller than 49 pixels, the Amazon logo (white) may appear without the box.
ADDITIONAL ELEMENTS (not required for pass/fail but note if present):
- CTA (Call-to-Action) button - Used in digital display formats only. White button with Squid Ink (dark) text.
- ASINs (product images) - Used in HPTO layouts only.
STEPS TO EVALUATE:
1. Scan the entire layout and identify each element present
2. Determine if this is a standard format or a small format (based on apparent dimensions)
3. For standard formats: verify ALL 5 required elements are present
4. For small formats: verify at minimum the Headline and Box/logo are present
5. Note any elements that appear to be missing or unclear
DECISION CRITERIA:
- PASS: All 5 required elements are clearly identifiable in a standard format, OR Headline + Box/logo present in a small format
- FAIL: Any required element is missing for the format type
YOUR OUTPUT:
Format your response as JSON:
{
"element_check": "Pass" or "Fail",
"format_type": "standard" or "small",
"elements_found": {
"headline": true or false,
"box_or_logo": true or false,
"subhead": true or false,
"date": true or false,
"legal_line": true or false
},
"missing_elements": ["list of missing required elements, empty array if none"],
"additional_elements_found": ["CTA", "ASINs", etc. - list any additional elements spotted"],
"explanation": "Detailed description of what was found and any concerns",
"recommendations": ["List specific recommendations if applicable, else an empty array"]
}"""
super().__init__(__name__, prompt)
# Run the app if executed directly
if __name__ == "__main__":
app_instance = AmazonRequiredElementsApp()
app_instance.run()