Add image-gen-rules skill and enforce packaging fidelity + exact output size#1
Open
EclairAikome wants to merge 2 commits into
Open
Add image-gen-rules skill and enforce packaging fidelity + exact output size#1EclairAikome wants to merge 2 commits into
EclairAikome wants to merge 2 commits into
Conversation
- Strengthen the product-reference instruction in BOTH free-quota and API paths: require image-to-image / edit mode and forbid redrawing, re-typesetting, translating, or rearranging any text on the package, so generated packaging is taken from the original reference photo. - Normalize free-quota output to the exact target size: codex/image_gen ignores the requested dimensions, so center-crop the saved file to the target (e.g. 1088x1360) via sharp. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- scripts/SKILL.md: a skill capturing the workflow, style, HSA-compliance and codex/gpt-image pitfalls (auto-logo, gravity, picture-in-picture nesting, aspect-ratio/crop/stretch) learned while building the AminoVITAL carousel. - CLAUDE.md: mandatory clause requiring the skill be read/followed before running or reasoning about scripts/generate-image.mjs, binding the two. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hardening + knowledge-capture for the image generation pipeline, surfaced while producing the AminoVITAL "Pre / During / Post" carousel (content plan post #6). Three script fixes plus a new skill that binds the operating rules to the script.
Script changes (
scripts/generate-image.mjs)images.edit) paths to require image-to-image / edit mode and explicitly forbid redrawing, re-typesetting, translating, or rearranging any text/graphic on the package. Previously the model silently redrew packaging (wrong amino-acid mg figures, shuffled callouts).sharp(fit: cover, ratio-preserving, no distortion) to the exact target size (1088x1360) before saving. (Size normalization is free-quota only; API relies on OpenAI'ssizeparam.)New skill bound to the script
scripts/SKILL.md(image-gen-rules) — captures the workflow, style, HSA-compliance rules, and the recurring codex/gpt-image pitfalls learned over multiple sessions:CLAUDE.md— mandatory clause: the skill MUST be read/followed before running or reasoning aboutscripts/generate-image.mjs, binding the two together (loaded every session, so it is enforced project-wide).Notes for reviewer
scripts/generate-image.mjs,scripts/SKILL.md, andCLAUDE.md; unrelated uncommitted asset changes in the working tree are intentionally excluded.fit: cover(center crop) to avoid distortion; near-4:5 outputs are essentially lossless.🤖 Generated with Claude Code