agentleFS
weiweimhyweiweimhy/agent-skills/relay-imagegen/SKILL.md

relay-imagegen

Skill0 starsChanged 5 months agoMITView on GitHub

Generate or edit images through the OpenAI-compatible relay configured in Codex config/auth files. Use when the user explicitly asks for relay, proxy, custom-endpoint, or "中转站" image generation instead of the built-in image tool.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 4 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use scripts/relay_imagegen.py from this skill directory to run the bundled system ImageGen CLI through the user's configured relay.

    line 8
  2. Very specific:

    Read the active model provider from ${CODEX_HOME:-~/.codex}/config.toml.

    line 17
  3. Very specific:

    Read missing values from ${CODEX_HOME:-~/.codex}/auth.json.

    line 18
  4. Distinctive:

    Never print, copy, persist, or ask the user to paste resolved credentials.

    line 26
  5. Very specific:

    Use uv so no permanent Python package installation is required.

    line 30
  6. Distinctive:

    Before the first live request, verify credential resolution without revealing the resolved values:

    line 33
  7. Very specific:

    Do not assume a relay supports direct transparent output, even when the upstream CLI exposes --background transparent.

    line 61
  8. Distinctive:

    Run a local background-removal or cutout step to convert the result to RGBA.

    line 70
  9. Distinctive:

    After generation, inspect the image, save project assets inside the workspace, and report the output path and final prompt.

    line 75

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Relay ImageGen

Use scripts/relay_imagegen.py from this skill directory to run the bundled system ImageGen CLI through the user's configured relay. Do not use the built-in image generation tool when the request explicitly requires a relay.

Resolve the wrapper path relative to this loaded SKILL.md; do not assume the skill is installed under CODEX_HOME.

The wrapper resolves credentials at runtime in this order:

  1. Read the active model provider from ${CODEX_HOME:-~/.codex}/config.toml.
  2. Read missing values from ${CODEX_HOME:-~/.codex}/auth.json.
  3. Fail without making a request if either the base URL or token is missing.

Accept both base_url and openai_base_url in Codex config, including top-level values and active model_providers entries. If --check reports a missing base URL while config.toml contains openai_base_url, verify the wrapper's field resolution instead of asking the user to paste credentials.

Never print, copy, persist, or ask the user to paste resolved credentials.

Run

Use uv so no permanent Python package installation is required. Replace <skill-directory> with the directory containing this SKILL.md.

Before the first live request, verify credential resolution without revealing the resolved values:

uv run --with tomli python \
  "<skill-directory>/scripts/relay_imagegen.py" \
  --check

Generate an image with:

uv run --with openai --with tomli python \
  "<skill-directory>/scripts/relay_imagegen.py" \
  generate \
  --prompt "<prompt>" \
  --out "<workspace-output-path>"

Pass normal system ImageGen CLI arguments after the wrapper path. The default model is gpt-image-2; select another gpt-image-* model only when the user requests it or the relay requires it.

For edits, use the edit subcommand and pass --image. For multiple distinct prompts, use generate-batch.

Transparent Image Workflow

Do not assume a relay supports direct transparent output, even when the upstream CLI exposes --background transparent. Some relay/model combinations reject transparent backgrounds or render a checkerboard into the image.

For sticker-like transparent assets:

  1. Generate or edit an opaque PNG with the subject isolated on a plain white or solid-color background suitable for background removal. Do not request a checkerboard background.
  2. Run a local background-removal or cutout step to convert the result to RGBA. Edge-connected solid-background removal is sufficient for simple assets; use a stronger matting tool for complex hair, fur, edges, or shadows.
  3. Visually inspect the result and verify its alpha channel.

After generation, inspect the image, save project assets inside the workspace, and report the output path and final prompt. If network access is blocked, request the narrow approval needed to rerun the same command.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.