/agent-sprite-forge:generate2dmediafrom Agent Sprite Forge
Generates images and image-to-video clips via configured API providers (OpenAI, Google Gemini, xAI, BytePlus ModelArk, fal.ai) or local CLI tools (Codex, Antigravity, Grok). Also manages API keys, spend ledger, and route capability checks.
Ships in Agent Sprite Forge. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
The route layer. It makes raw media; the owning skill plans the asset before and checks it after.
forge_doctor.py).providers.order goes first). Images: OpenAI (gpt-image-2.5-sunburst), Google Gemini (gemini-3.1-flash-image; --tier hero takes gemini-3-pro-image for hero masters), xAI (grok-imagine-image-2.0), BytePlus ModelArk (Seedream 5.0), fal.ai (reference edits). Video: xAI (grok-imagine-video-1.5; --tier draft takes 1.5 Lite), BytePlus ModelArk (Seedance 2.0), fal.ai (Kling v3, Veo 3.1, Luma, MiniMax, Wan, Vidu, LTX). A configured key is the owner's consent: no per-call question.image_gen, Grok's native tools), otherwise the user's signed-in CLI: Codex (local CLI) image_gen with references attached, then Antigravity (local CLI, agy and its image generator, references named by path; open agy once to sign in), then Grok (local CLI) one-shot image or edit; video Grok (local CLI) in ACP mode. An installed CLI is used as is; its first successful run records the VERIFIED proof.route_media.py prints no-route (exit 3).Always name the route that ran ("OpenAI API", "Google Gemini API", "xAI API", "BytePlus ModelArk API", "fal.ai API", "Codex (local CLI)", "Antigravity (local CLI)", "Grok (local CLI)"). Details: route-media.md.
Run python "<skill-dir>/scripts/forge_doctor.py" --host-tools <tools> --save <output>/doctor.json, where <tools> lists the media tools in your own tool list (image_gen, image_edit, image_to_video) or none. Its ROUTES block shows which API keys are configured (yes or no, never a key), the local readiness of each CLI and the resolved order (routeOrder). If encoding.stdout fails, set PYTHONUTF8=1.
route_media.py)| Need | Command |
|---|---|
| Which route would run | python "<skill-dir>/scripts/route_media.py" resolve --kind image (or video; --references N) |
| One image, still or edit | python "<skill-dir>/scripts/route_media.py" image --prompt-file <txt> --reference <png> --size 1024x1024 --out-dir <new> (--reference repeatable, in the order the prompt names them) |
| Animate an approved still | python "<skill-dir>/scripts/route_media.py" video --prompt-file <txt> --reference <still.png> --last-frame <still.png> --duration 6 --resolution 720p --out-dir <new> |
| A route or model of the user's choice | add --route api, local, openai, gemini, xai, byteplus, fal, fal:<endpoint-id>, codex-cli, antigravity-cli, grok-cli or grok-acp; --model <id>, --tier draft or hero, --provider-option [PROVIDER:]KEY=VALUE |
| The plan and estimate first | add --dry-run (no key is used, nothing is sent or written) |
Success prints one ASCII JSON line and exits 0: {"status":"ok","route":"api:openai","artifact":"<out-dir>/generated.png","sha256":...,"estimateUsd":...} plus model, job and, for video, lastFrameUsed, durationRequested and durationUsed (a length is snapped to the nearest one the model renders; Grok (local CLI) renders 6 or 10 s and never pins a last frame) and crop when the frames were padded to 16:9 for a model without 1:1. Every clip is published without audio. No route prints {"status":"no-route","fallback":"codeart2d"} and exits 3. A failure prints one error: <route>: <code>: <message> line and exits 1. A route whose account cannot serve the request (no credit, no access, not signed in) passes it to the next route; a refusal such as moderation stops. Write prompts yourself into UTF-8 files; local routes take the size and every instruction from the prompt.
Each provider reads only its own key: OPENAI_API_KEY, GOOGLE_API_KEY or GEMINI_API_KEY (GOOGLE_API_KEY wins), XAI_API_KEY, ARK_API_KEY (BytePlus ModelArk) and FAL_KEY (fal.ai), from the environment or from the user config file, never from a project: %APPDATA%\agent-sprite-forge\config.json on Windows, ~/.config/agent-sprite-forge/config.json elsewhere ($XDG_CONFIG_HOME when set), as {"OPENAI_API_KEY": "...", "FAL_KEY": "..."} with optional "models" and "providers": {"order": [...]}. Never print, log, commit or paste a key, and never put one in a prompt. A Codex, Antigravity or Grok sign-in is never an API key. The Antigravity agent's model is FORGE_AGY_MODEL or "models": {"antigravity-cli": "<id>"} (unset: agy's own default).
Every call, paid or local, is a line in <project>/.forge/ledger.jsonl with its estimate (estimateUsd is null when no verified price exists; say "price unknown"). There is no cap by default; --budget-usd, --max-calls, FORGE_MAX_PAID_REQUESTS and FORGE_SESSION_IMAGES / FORGE_SESSION_VIDEOS set one when the user asks. python "<skill-dir>/scripts/media_ledger.py" summary shows spend; media_ledger.py settle <id> --status ... closes an unknown outcome.
| Need | Command |
|---|---|
One API request by hand (dry run until --execute) | generate_media.py image or video with --provider, --model, --prompt-file, --out-dir (api-usage.md) |
| Poll or download a video or fal.ai job without paying again | generate_media.py resume --job <out>/job.json |
| One local CLI run by hand | cli_media.py image --route codex-cli --prompt-file <txt> --output-dir <new> --execute (cli-routes.md) |
| A local run timed out or was interrupted | cli_media.py resume --run <id>, then --adopt (never reruns the CLI) |
| Codex made an image that is not in the project | cli_media.py adopt --codex-thread <thread-id> --output-dir <new> |
| Many jobs | generate_media.py batch or cli_media.py batch |
| Verify a local route ahead of time (optional) | forge_doctor.py --verify-route <route> --execute (one quota call) |
| List everything the Forge made under a folder (for a host) | forge_index.py scan <dir>: one forge.asset_index.v1 JSON line (references/schemas/host.schema.json); an action's package is the chosen take's, an earlier one is previousPackage |
image_gen is your own tool: with no configured key use it and adopt the result (cli_media.py adopt); scripts reach Codex (local CLI) through route_media.py. This skill is explicit-only in Codex.route_media.py takes the API or the local CLIs. <skill-dir> is ${CLAUDE_SKILL_DIR}; look at results with Read.grok executable is the "Grok (local CLI)" route for other hosts. Every grok child runs with HOME and USERPROFILE on an empty folder the Forge owns (%LOCALAPPDATA%\agent-sprite-forge\grok-home; FORGE_GROK_ISOLATED_HOME overrides it), GROK_HOME on the real ~/.grok and GIT_CONFIG_GLOBAL on the real ~/.gitconfig, so it never loads the user's Claude Code plugins, MCP servers or skills. Agent setups: agent-profiles/README.md.Run each tool as one line from the user's project root: python "<skill-dir>/scripts/<tool>.py" .... Outputs go to a new --out-dir inside the project. Results are raw media: hand them to the owning skill for identity, size, alpha, motion and seam checks. Keep prompts, input hashes, job ids and result hashes; report the model requested and the model returned separately. Providers: provider-survey.md (last verified 2026-10-06, with the shutdown dates); capabilities: references/capabilities.json (python "<skill-dir>/scripts/media_providers.py" list); prices: references/prices.json; data contracts: references/schemas/media.schema.json.
agents/openai.yaml (opens in a new tab)references/agent-profiles/README.md (opens in a new tab)references/agent-profiles/video-agent.md (opens in a new tab)references/api-usage.md (opens in a new tab)references/capabilities.json (opens in a new tab)references/cli-routes.md (opens in a new tab)references/prices.json (opens in a new tab)references/provider-survey.md (opens in a new tab)references/route-media.md (opens in a new tab)references/schemas/common.schema.json (opens in a new tab)references/schemas/host.schema.json (opens in a new tab)references/schemas/media.schema.json (opens in a new tab)scripts/cli_media.py (opens in a new tab)scripts/forge_doctor.py (opens in a new tab)scripts/forge_index.py (opens in a new tab)scripts/generate_media.py (opens in a new tab)scripts/media_config.py (opens in a new tab)scripts/media_ledger.py (opens in a new tab)scripts/media_mp4.py (opens in a new tab)scripts/media_providers.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub 0x0funky/agent-sprite-forge --plugin agent-sprite-forge5 skills in this plugin
/codeart2dExplicit-only last resort. Draws game art from code, with no image model - pixel sprites from a PixelSpec, flat vector props, UI and icons from portable SVG, rigged characters with planted feet, FX with a JS runtime, seam-proven autotiles, playable top-down layouts with collision, stylized parallax and ambient plate motion - palette-exact, with QA and review sheets. Use only when the user explicitly asks for code-drawn art, or when generate2dmedia route_media.py finds no image or video route (no-route, exit 3). Never the default - image generation (generate2dsprite, generate2dmap, video2dsprite) comes first for characters, props, maps and FX. Not for painterly, detailed or likeness art, HD-2D plates or realistic fire, smoke or water. Always disclose the result as code-drawn./generate2dmapPlan and build 2D game maps and scenes - top-down and side-scrolling levels, tilemaps, prop packs, parallax backgrounds and HD-2D battle or story plates - with collision, navigation and reachability checks, environment motion, a playable HTML preview and export to Tiled, Godot 4 or LDtk. Map art (terrain, tiles, props, plates, parallax layers) is image generation by default, through generate2dmedia route_media.py (the API when a key is configured, else the local Codex, Antigravity or Grok CLI); map data (layout, collision, exits, spawns) is written as data. Use for any map, level, room, scene, background, terrain or prop-kit request. Not for characters, creatures, items or FX (generate2dsprite), character animation (video2dsprite), code-drawn tiles or maps (codeart2d, only on request) or calling an image or video API by itself (generate2dmedia).Other plugins' skills for the same job