---
name: asset-generator
description: "Generate marketing/branding images through the full QA pipeline. Use for ANY request to create images for social posts, blog heroes, ad creative, campaign assets, or product branding. Automatically loads aesthetic profiles, style fragments, visual consistency anchors, batch generates, and runs 5-layer QA. No manual prompt assembly needed."
---

# Asset Generator Skill

**The single entry point for ALL marketing image generation.**

Every image for marketing, branding, social posts, blog content, or ad creative
must go through this pipeline — no exceptions, no direct nano-banana-pro calls.

---

## When to Use

Load this skill when the request involves:
- Social media posts (Instagram, LinkedIn, TikTok, Twitter, Facebook)
- Blog hero images
- Ad creative
- Campaign lead images
- Any branded product visual
- Any image that will be published or shared externally

---

## The Pipeline (What Happens Automatically)

```
Request → Brief → BriefValidator
  → Load aesthetic profile (agency/brand/aesthetic-profiles/<product>.md)
  → Load style fragment (skills/image-prompt-standards/styles/<style>.md)
  → Check visual consistency anchor (products/<slug>/marketing/approved/)
  → Compile structured prompt (6 named sections)
  → Batch generate 3 variants via nano-banana-pro
  → Pre-screen with Layer 1+2 → pick best candidate
  → Full 5-layer QA on winner
  → PASS → deliver
  → FAIL → smart critique-driven prompt mutation → retry (max 5)
  → 5 fails → ESCALATE to human
```

---

## CLI — How to Call It

```bash
# Full brief via flags
python3 /home/aria/projects/marketing-qa-reviewer/generate.py \
  --product <product> \
  --platform <platform> \
  --subject "<subject>" \
  --setting "<setting>" \
  --message "<key_message>" \
  --audience "<audience>" \
  [--cta "<cta>"] \
  [--output /path/to/output.png]

# Full brief via JSON file
python3 /home/aria/projects/marketing-qa-reviewer/generate.py --brief brief.json

# Dry-run (validate + compile only, no API calls)
python3 /home/aria/projects/marketing-qa-reviewer/generate.py --brief brief.json --dry-run
```

**Products:** Overture | Worklane | Clocklane | Vector | Alignly | Encore

**Platforms:** instagram_feed | instagram_stories | instagram_reels | linkedin | twitter | tiktok | facebook

---

## Brief Fields

| Field | Required | Description |
|-------|----------|-------------|
| product | ✅ | Which product this asset is for |
| platform | ✅ | Target platform (instagram_feed, linkedin, etc.) |
| subject | ✅ | What's in the image (people, object, scene) |
| setting | ✅ | Where it takes place (office, outdoor, abstract) |
| key_message | ✅ | The emotion/idea the image must convey |
| audience | ✅ | Who will see this (HR managers, CTOs, etc.) |
| cta | ❌ optional | Call to action context (improves platform fit scoring) |

---

## Output

On **PASS:**
```
✓ PASS — Product / Platform
   Image:    /path/to/final.png   ← ready to deliver
   QA score: 85/100
   Attempts: 2
```

On **ESCALATED** (5 attempts all failed):
```
✗ ESCALATED — Product / Platform
   Failure layer: Layer 3 (Aesthetic Quality)
   Critique: [specific QA failure reasons]
   → Human review required before delivery
```

---

## Brief Extraction from User Requests

When a user asks for a marketing image (e.g. "generate a post for Alignly about team growth for LinkedIn"), extract the brief:

```python
brief = {
    "product": "Alignly",
    "platform": "linkedin",
    "subject": "team members collaborating",   # infer from context
    "setting": "modern office space",           # infer from context
    "key_message": "teams grow stronger together",  # from the user's message
    "audience": "HR managers and people leaders",   # from product/platform context
    "cta": "",
}
```

When fields are ambiguous, use product defaults:
- **Alignly** → subject defaults to genuine human moment, setting to warm office
- **Vector** → subject defaults to team in action, setting to modern workspace
- **Overture** → subject defaults to executive at clean desk, setting to minimal office
- **Clocklane** → subject defaults to real worker, setting to authentic workplace
- **Worklane** → subject defaults to team in motion, setting to dynamic workspace
- **Encore** → subject defaults to professional in premium setting, setting to hospitality venue

---

## After Generation

1. If PASS → deliver the image at the returned path
2. Log to `products/<slug>/marketing/qa-log.md` (append entry)
3. On first pass for a product → it becomes the consistency anchor
4. Move to `products/<slug>/marketing/approved/` if it's a campaign-worthy asset

---

## Symphony API (Programmatic)

The generator is also exposed via the Symphony API for Studio use:

```
POST /api/aria/generate-asset
Body: { brief: {...} }
Response: { status, imagePath, imageUrl, qaScore, attempts, critique? }
```

See `/home/aria/projects/symph-agency/src/app/api/aria/generate-asset/route.ts`

---

## Integration Notes

- Generator uses the SAME aesthetic profiles as QA Reviewer → no divergence
- Style fragments are loaded from the workspace, not hardcoded
- Visual consistency is enforced automatically when approved assets exist
- Pass-rate data accumulates at `data/pass-rate-data.json` — the generator gets smarter over time
- Never call nano-banana-pro directly for marketing assets — always route through generate.py
