happycode-imagegen
Installation
SKILL.md
HappyCode Image Gen
Use only the HappyCode clients in <SKILL_DIR>/scripts; do not call the built-in image_gen tool or another provider. Run the client directly after reading this file. Do not inspect other skill files, read config.json, run tests, probe the API, or perform setup unless the client returns CONFIG_REQUIRED. The clients own authentication, request defaults, proxying, timeout, downloads, PNG validation, and output creation.
Decide And Prompt
- Treat a request without an input image as generation. Treat a requested change to an existing image as an edit; ask for a target only when none is available.
- Identify each supplied image as an edit target, reference, mask, or supporting input. Pass every relevant non-mask image with repeated
--image; use--maskonly for a supplied mask. - Ask another question only when a missing detail makes execution impossible.
- Pass the user's request verbatim as the
--promptargument, except for the batch transformation below. Do not translate, paraphrase, expand, censor, or add style, content, negative, or preservation instructions. Resolve pronouns only when selecting inputs. - Shell-quote every dynamic argument so the client receives the exact prompt and paths as argument values.
Track Edit Inputs
- Internally remember the input target for every successful
SAVEDpath; a text-only generation has no input. Do not print or persist this bookkeeping. - For a normal follow-up, edit the latest successful result.
- If the user rejects the latest result, apply the correction to its remembered input target instead of the rejected image. If it had no input, generate again without
--image. Preserve all other explicit requirements. - For a batch, keep each saved path associated with its
BATCH_RESULTindex. Resolve ordinal references such as "the second image" by that index; ask which image only when a follow-up does not identify one of multiple results.