Skip to content

D3 Design Centre — Phase 6 Loop Spec (§4.11.4 Compliant)

1. Goal

Every 18h, autonomously research trends → generate design → remove background → quality check → resize → upload to Printify → publish to Etsy + eBay. Zero human touch.

Product focus: Print-on-demand apparel (t-shirts, tank tops) via Printify → Etsy + eBay.


2. Context (Data Sources)

Source What How Freshness
Trend research Season themes, trending topics Gemini Flash prompt + deterministic fallback Per cycle
Gemini Image AI-generated PNG designs gemini-2.5-flash-image API, 1024×1024 Real-time
rembg Background removal (local, free) rembg Python package, preserves size Real-time
PIL Resize to 4500×5400 (t-shirt print size) Bicubic upscaling from 1024×1024 Real-time
Printify API Upload image, create product, publish printify_upload.py — REST API with retry Real-time
Etsy API Listing creation Via Printify publish (linked account) Real-time
eBay API Listing creation Via Printify publish (linked account) Real-time

Critical rule: NEVER use remove.bg API (downsizes to 500×500). Always use rembg (local, preserves 1024×1024).


3. Evaluation (Verifier)

Verifier: verify_design.py (deterministic) + Claude (Tier-A) on escalation.

Checkable success conditions:

  1. Image ≥ 1000 px width and height
  2. File size > 50 KB
  3. MIME type = PNG (magic bytes check)
  4. Background removed (transparent PNG)
  5. Resize to 4500×5400 preserves aspect ratio
  6. Printify returns image_id and product_id
  7. Etsy/eBay publish returns success (no duplicate errors)

Fail-first: If ANY check fails → image deleted, cycle counts as failure, NO Printify API call.


4. Agent (Generator)

Generator: DesignAgent (autonomous_core/agents/d3_design/)

Pipeline:

  1. _orient() — trend research → SEO brief
  2. _generate_prompt() — NO product names in prompts ("t-shirt", "hat" banned)
  3. gemini-2.5-flash-image — generate 1024×1024 PNG
  4. rembg — remove background (NOT remove.bg API!)
  5. verify_design() — all checks must pass
  6. PIL.resize() — 4500×5400 for t-shirts
  7. Printify upload → create product (12 variants: White/Black/Navy/Sport Grey)
  8. Publish to Etsy + eBay (per-platform anti-duplicate)
  9. Update product_registry.json

Season logic:

  • Summer (Jun–Aug): t-shirt + tank top
  • Winter (Dec–Feb): hoodie + sweatshirt
  • Transition months: mixed

5. Harness

Trigger: Cron every 18h (d3_design_schedule.json)

Stop conditions:

  • 3 consecutive cycle failures → Telegram alert to Kris, loop halts
  • Printify API rate limit → exponential backoff, max 3 retries
  • Gemini image generation fails → skip cycle, try next theme
  • Registry shows >20 unpublished designs → pause generation, focus on publishing backlog

DeepSeek tripwire number:

  • N/A — D3 uses Gemini for images, not DeepSeek. Documented per §4.11.4.
  • 3 consecutive failures (any stage) → pause + alert
  • >5% image generation failure rate in rolling 10 cycles → review prompts

6. Memory (Persisted Across Cycles)

What Where TTL
Product registry output/product_registry.json Permanent
Published designs Printify dashboard (source of truth) Permanent
Generated images output/designs/ 30 days (cleaned by cron)
Prompt learning autonomous_core/agents/d3_design_v6/memory/prompt_learning.json Continuous
Cost log output/cost_log.json 90 days

7. Human Checkpoint

  • Before new season: Kris approves season product mix (t-shirt vs hoodie)
  • After 3 consecutive failures: Auto-pause + alert Kris
  • Weekly: Check Etsy/eBay for rejected listings (bad titles, policy violations)
  • Known issue (fixed 2026-08-01): sanitize_etsy_title() now strips [, ], & from Etsy titles. Commit e45c983.

Known Issues

  1. rembg not installed: Design uploads fallback to "no background removal" warning. Install rembg in workspace venv before next cycle.
  2. Tank top blueprint: Need GET /v1/catalog/blueprints to find Bella+Canvas 3480 for summer products.