The bundled openai-image-gen skill accepted an arbitrary --count and,
for GPT image models, turned it directly into that many sequential
calls to the OpenAI Images API with no upper bound. A bad prompt,
mistaken slash command, or automation bug could trigger a large batch
of paid image generations causing unexpected spend.
Add a hard MAX_COUNT = 16 limit with clear error messages for
out-of-range values (< 1 or > 16). Document the limit in SKILL.md.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Summary
MAX_COUNT = 16limit to theopenai-image-genskill's--countargument1–16range with clear error messages before any API calls are madeSKILL.mdProblem
The bundled
openai-image-genskill accepted an arbitrary--countand, for GPT image models, turned it directly into that many sequential calls to the OpenAI Images API with no upper bound. Onlydall-e-3had a guard (capped at 1). A bad prompt, mistaken slash command, or automation bug could trigger a large batch of paid image generations causing unexpected spend.Changes
skills/openai-image-gen/scripts/gen.py: AddedMAX_COUNT = 16constant and validation that exits early with an error if--count < 1or--count > MAX_COUNTskills/openai-image-gen/SKILL.md: Added note documenting the count cap under "Other Notable Differences"Test plan
pnpm build)models-configtest)pi-tool-definition-adapter.ts) — not introduced by this change🤖 Generated with Claude Code
Summary by cubic
Caps the
openai-image-gen--countat 16 to prevent runaway API spend. Validates counts are 1–16 before any API calls with clear errors, and documents the limit inSKILL.md.Written for commit c0497cf. Summary will update on new commits.