Skip to content

0x0funky/agent-sprite-forge / skills/generate2dmedia

generate2dmedia

Verified

The art-route layer of the Forge skills. route_media.py is the one command that generates an image or an image-to-video clip - through the paid API of any provider whose key is configured (OpenAI, Google Gemini, xAI, BytePlus ModelArk, fal.ai; the configured key is the owner's consent), else through the user's own signed-in Codex or Grok CLI - and prints one JSON line with the route, artifact, sha256 and cost estimate; with no route it answers no-route (codeart2d is then the last resort). Also the capability check (forge_doctor), API key configuration, the spend ledger, resume and Codex image adoption. Use when a Forge skill sends a generation here, for the capability check, or when the user asks about keys, routes or spend. Not for planning, processing or QA of sprites, video frames or maps (generate2dsprite, video2dsprite, generate2dmap) or for code-drawn art (codeart2d).

references/schemas/host.schema.json

View on GitHub
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/0x0funky/agent-sprite-forge/main/shared/schemas/host.schema.json",
  "title": "Agent Sprite Forge host contracts",
  "description": "What a host (such as Agent Game Forge) reads from the Forge without knowing every tool's files: the asset index of forge_index.py scan and the progress lines a tool appends to its --progress-file. Version 1; objects stay open.",
  "$defs": {
    "asset_index_v1": {
      "description": "forge_index.py scan <dir>: everything the Forge made under one folder. root is the scanned folder (absolute, POSIX); every other path is relative to it and stays inside it (indexPath: no '..' segment; a document path that leads outside is left out with a warning). masters come from master.json; sets from set_plan.json and set_state.json (read under the set's set_state.lock), per action with its status, take count, chosen take or window, the agent's accept, and the package of the chosen take (packageTake, packageTag) with its animation.json, poster, the package's reviewStatus and the verify result. When the recorded package holds another take or window than the chosen one (after a retake, or an accept of another take or window) package, packageTake, packageTag, manifest, poster, reviewStatus and verify are null and that package is previousPackage: never import it as the action's clip. fx come from fx.json, route A (pixelfx) or B (the image route); plates from plate.json; maps from map bundles (generate2dmap.map_bundle.v1 or v2). warnings name documents that could not be read, paths left out and a set lock that stayed held.",
      "type": "object",
      "required": ["schema", "tool", "createdAt", "root", "masters", "sets", "fx", "plates", "maps", "warnings"],
      "properties": {
        "schema": {
          "const": "forge.asset_index.v1"
        },
        "tool": {
          "$ref": "common.schema.json#/$defs/toolInfo"
        },
        "createdAt": {
          "$ref": "common.schema.json#/$defs/timestamp"
        },
        "root": {
          "type": "string",
          "minLength": 1
        },
        "masters": {
          "type": "array",
          "items": {
            "type": "object",
            "required": ["id", "name", "path", "metadata", "image", "class", "finish", "facing", "status"],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "name": {
                "type": "string",
                "minLength": 1
              },
              "path": {
                "$ref": "#/$defs/indexPath"
              },
              "metadata": {
                "$ref": "#/$defs/indexPath"
              },
              "image": {
                "$ref": "#/$defs/indexPath"
              },
              "cutout": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/indexPath"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "class": {
                "type": "string"
              },
              "finish": {
                "type": "string"
              },
              "facing": {
                "type": "string"
              },
              "route": {
                "type": ["string", "null"]
              },
              "status": {
                "const": "approved"
              }
            }
          }
        },
        "sets": {
          "type": "array",
          "items": {
            "type": "object",
            "required": ["id", "name", "path", "plan", "state", "finish", "status", "actions"],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "name": {
                "type": "string",
                "minLength": 1
              },
              "path": {
                "$ref": "#/$defs/indexPath"
              },
              "plan": {
                "$ref": "#/$defs/indexPath"
              },
              "state": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/indexPath"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "class": {
                "type": "string"
              },
              "finish": {
                "enum": ["hd", "pixel", "hibit"]
              },
              "targetHeight": {
                "type": ["integer", "null"]
              },
              "master": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/indexPath"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "status": {
                "enum": ["planned", "complete", "complete-with-warnings", "incomplete"]
              },
              "actions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": ["id", "action", "view", "kind", "status", "takes", "chosen", "accepted", "package", "packageTake", "packageTag", "manifest", "reviewStatus", "previousPackage"],
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1
                    },
                    "action": {
                      "type": "string",
                      "minLength": 1
                    },
                    "view": {
                      "type": "string",
                      "minLength": 1
                    },
                    "kind": {
                      "enum": ["loop", "oneshot"]
                    },
                    "status": {
                      "type": "string",
                      "minLength": 1
                    },
                    "takes": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "chosen": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": ["take"],
                          "properties": {
                            "take": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "window": {
                              "anyOf": [
                                {
                                  "type": "array",
                                  "items": {
                                    "type": "integer",
                                    "minimum": 0
                                  },
                                  "minItems": 2,
                                  "maxItems": 2
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "tag": {
                              "type": "string"
                            }
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "accepted": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": ["take"],
                          "properties": {
                            "take": {
                              "type": "integer",
                              "minimum": 1
                            },
                            "window": {
                              "anyOf": [
                                {
                                  "type": "array",
                                  "items": {
                                    "type": "integer",
                                    "minimum": 0
                                  },
                                  "minItems": 2,
                                  "maxItems": 2
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "at": {
                              "anyOf": [
                                {
                                  "$ref": "common.schema.json#/$defs/timestamp"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "package": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/indexPath"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "packageTake": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "packageTag": {
                      "type": ["string", "null"]
                    },
                    "manifest": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/indexPath"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "poster": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/indexPath"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "reviewStatus": {
                      "type": ["string", "null"]
                    },
                    "verify": {
                      "type": ["string", "null"]
                    },
                    "previousPackage": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/indexPath"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "if": {
                    "properties": {
                      "package": {
                        "type": "string"
                      }
                    },
                    "required": ["package"]
                  },
                  "then": {
                    "properties": {
                      "packageTake": {
                        "type": "integer"
                      },
                      "packageTag": {
                        "type": "string"
                      }
                    }
                  },
                  "else": {
                    "properties": {
                      "packageTake": {
                        "type": "null"
                      },
                      "packageTag": {
                        "type": "null"
                      },
                      "manifest": {
                        "type": "null"
                      },
                      "poster": {
                        "type": "null"
                      },
                      "reviewStatus": {
                        "type": "null"
                      },
                      "verify": {
                        "type": "null"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "fx": {
          "type": "array",
          "items": {
            "type": "object",
            "required": ["id", "name", "path", "metadata", "route", "routeName", "frames", "frameSize", "sheet", "status"],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "name": {
                "type": "string",
                "minLength": 1
              },
              "path": {
                "$ref": "#/$defs/indexPath"
              },
              "metadata": {
                "$ref": "#/$defs/indexPath"
              },
              "route": {
                "enum": ["A", "B"]
              },
              "routeName": {
                "enum": ["pixelfx", "image"]
              },
              "effect": {
                "type": ["string", "null"]
              },
              "frames": {
                "type": "integer",
                "minimum": 1
              },
              "frameSize": {
                "$ref": "common.schema.json#/$defs/size2"
              },
              "frameMs": {
                "type": ["number", "null"]
              },
              "loop": {
                "type": ["boolean", "null"]
              },
              "sheet": {
                "$ref": "#/$defs/indexPath"
              },
              "sheetJson": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/indexPath"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "preview": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/indexPath"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "credits": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/indexPath"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "status": {
                "$ref": "common.schema.json#/$defs/qaStatus"
              }
            }
          }
        },
        "plates": {
          "type": "array",
          "items": {
            "type": "object",
            "required": ["id", "name", "path", "metadata", "image", "size", "colors", "status"],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "name": {
                "type": "string",
                "minLength": 1
              },
              "path": {
                "$ref": "#/$defs/indexPath"
              },
              "metadata": {
                "$ref": "#/$defs/indexPath"
              },
              "image": {
                "$ref": "#/$defs/indexPath"
              },
              "preview": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/indexPath"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "palette": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/indexPath"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "size": {
                "$ref": "common.schema.json#/$defs/size2"
              },
              "colors": {
                "type": "integer",
                "minimum": 1
              },
              "status": {
                "$ref": "common.schema.json#/$defs/qaStatus"
              }
            }
          }
        },
        "maps": {
          "type": "array",
          "items": {
            "type": "object",
            "required": ["id", "name", "path", "schemaVersion"],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "name": {
                "type": "string",
                "minLength": 1
              },
              "path": {
                "$ref": "#/$defs/indexPath"
              },
              "schemaVersion": {
                "enum": ["generate2dmap.map_bundle.v1", "generate2dmap.map_bundle.v2"]
              },
              "world": {
                "anyOf": [
                  {
                    "type": "object"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "layers": {
                "type": "integer",
                "minimum": 0
              },
              "objects": {
                "type": "integer",
                "minimum": 0
              }
            }
          }
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "progress_line_v1": {
      "description": "One line of a --progress-file (forge_core.Progress; FORGE_PROGRESS_FILE when no flag is given): a stage change of one tool run, appended and flushed while it runs, never written to stdout. t is the UTC time; tool the CLI (master_still, sprite_set, finish_frames, engine_export); stage its stage name (start, prompt, take, job, generate, evaluate, post, load, palette, downscale, colour-lock, quantize, qa, finish, package, verify, residue, encode, decode, publish, done, error); done and total are counts within the stage or null; message is short ASCII text or null. The last line of a run is done or error.",
      "type": "object",
      "required": ["t", "tool", "stage", "done", "total", "message"],
      "properties": {
        "t": {
          "$ref": "common.schema.json#/$defs/timestamp"
        },
        "tool": {
          "type": "string",
          "minLength": 1
        },
        "stage": {
          "type": "string",
          "minLength": 1
        },
        "done": {
          "type": ["integer", "null"],
          "minimum": 0
        },
        "total": {
          "type": ["integer", "null"],
          "minimum": 0
        },
        "message": {
          "type": ["string", "null"]
        }
      }
    },
    "indexPath": {
      "description": "A path in the asset index: a common relPath relative to the index root that never leaves it (no '..' segment). forge_index.py resolves every document path and leaves out one that leads outside root (a '..' or a link); a host still checks containment before it reads a file.",
      "allOf": [
        {
          "$ref": "common.schema.json#/$defs/relPath"
        }
      ],
      "not": {
        "pattern": "(^|/)\\.\\.(/|$)"
      }
    }
  }
}
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall