---
name: magpiemill
description: Generate production images and short videos directly inside Claude Code, Cursor, or Codex using the Magpie Mill lightweight AI creative kit (Qwen Image 3.0/2.0, Seedream 5.5/5.0, Wan 2.7/2.6, Seedance 2.0 Fast) with permanent R2 CDN URLs and cost-safe credit workflows.
---

# Magpie Mill Agent Skill

Use the connected `magpiemill` remote MCP server (`https://magpiemill.com/mcp`) to generate images, edit existing screenshots, and synthesize short videos without leaving your coding session.

## Core Rules (Cost & Quality Guardrails)

1. **Always inspect models and balance before expensive jobs**:
   - Call `list_models` when unsure of exact credit costs, supported resolutions, or presets.
   - Call `get_balance` before starting multi-asset batches or 720p/1080p video renders.
2. **Draft cheap, finalize once**:
   - For low-cost motion workflows, prefer **Image → Video (`first_frame_url`)**: generate a 6–7 credit still frame first (`generate_image`), confirm framing, then pass its permanent CDN URL into `generate_video(model="wan2.6-i2v-flash", first_frame_url=...)` (30 credits for 5s 720p silent; 2× with `generate_audio=true`).
   - Use `wan2.7-t2v` (105 credits / 5s 720p) or `doubao-seedance-2-0-fast` (65 credits / 5s 480p) only after validating the concept, and keep `doubao-seedance-2-0-fast` at `480p` or `720p` (1080p is unsupported on `fast`).
3. **Use built-in presets to avoid prompt lottery**:
   - `generate_image` accepts `preset`:
     - `saas_hero` (16:9 hero visual with negative space for headlines)
     - `og_card_1200x630` (Open Graph share banner)
     - `app_icon_square` (1:1 emblem/avatar)
     - `product_mockup` (4:3 commercial desk shot)
   - `generate_video` accepts `camera_preset`:
     - `product_orbit` (smooth 360° studio dolly orbit)
     - `crash_zoom_hook` (fast 2s punch-in hook for short-form clips)
     - `ui_motion_hover` (subtle breathing parallax for web hero cards)
     - `handheld_ugc` (authentic smartphone handheld realism)
4. **Poll async video cleanly**:
   - `generate_video` returns a `job_id` immediately so the MCP call never times out.
   - Poll `get_task_status(job_id)` every 10–15 seconds until `status` is `succeeded` or `failed`.
   - Failed generations refund 100% of held credits automatically, and token-billed clips reconcile unused credits automatically.
5. **Embed or download permanent URLs**:
   - Every returned asset URL lives on permanent Cloudflare R2 CDN and can be placed directly in `README.md`, `<img src="...">`, or downloaded into `public/` using the returned `download_cmd`.

## Model Selection Guide

| Need | Recommended Model | Est. Cost |
|---|---|---|
| Flagship typography, lighting & 2K detail | `qwen-image-3.0` | 10 cr (1K) · 16 cr (2K) |
| Fast web/UI artwork & bilingual text (~9s) | `qwen-image-2.0` | 7 credits / image |
| Photorealistic product & marketing shots | `doubao-seedream-5-5` | 6 cr (≤1.5K) · 10 cr (2K) |
| Studio precision layout & multi-image composition | `doubao-seedream-5-0` | 10 cr (≤1.5K) · 20 cr (2K) |
| Restyle / edit an existing screenshot or photo | `edit_image` + `qwen-image-2.0` | 7 credits / edit |
| Animate an approved hero image cheaply | `wan2.6-i2v-flash` (`first_frame_url`) | 30 cr (5s 720p silent) · 2× audio |
| Flagship text-to-video clip | `wan2.7-t2v` | 105 cr (5s 720p) · 175 cr (5s 1080p) |
| Complex physical motion & camera dynamics | `doubao-seedance-2-0-fast` | 65 cr (5s 480p) · 140 cr (5s 720p) |

## Prompt Writing Tips

- State **subject + setting + lighting + composition + negative space** in concise concrete English (avoid buzzwords like "8k masterpiece ultra hyper detailed").
- For `saas_hero`, explicitly specify background tone (e.g. "warm off-white #FAF9F5 paper backdrop") so generated art blends into the site CSS.
- For `generate_video`, describe **one clear subject motion and one camera move** over 5 seconds; avoid multi-scene cuts inside a single 5s clip.
