agentleFS
AluxadsAluxads/claude-skills/image-process/SKILL.md

image-process

Skill0 starsChanged 38 days agoMITView on GitHub

One page image from a prompts doc slot to webp srcset, asset log row and paste ready snippet, with a hard render review stop before processing.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    Run from the project root.

    line 10
  2. Very specific:

    Write a prompts doc, default location docs/image-prompts-<page>.md:

    line 19
  3. Distinctive:

    Not for: writing prompts, wiring the image into a page.

    line 31
  4. Distinctive:

    Commit, push or deploy.

    line 68

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Image process

Run from the project root. Script: ~/.claude/skills/image-process/scripts/image-chain.mjs. Generation runs through a shell command you provide in IMAGE_GEN_CMD. Processing uses ffmpeg (libwebp, metadata stripped) and ffprobe.

Setup

  1. Install ffmpeg (includes ffprobe).
  2. Set the generation command. The script exports PROMPT (style block plus slot text), OUT (PNG path), PROMPT_FILE and SLOT before it runs:
    export IMAGE_GEN_CMD='openai images generate --prompt "$PROMPT" --out "$OUT"'
    Unset = the script stops with a clear error. --skip-generate <png> needs no command.
  3. Write a prompts doc, default location docs/image-prompts-<page>.md:
    ## Shared style block
    Flat studio photo, soft daylight, light grey backdrop, no text, no logos.
    
    ## 1. Hero
    A standing desk with a laptop and a notebook, seen from the front.

When to use

  • A page has an image slot and a prompts doc holds its final prompt as a ## N. section under a ## Shared style block.
  • A reviewed PNG already exists and only needs the processing half (--skip-generate <png>).
  • Not for: writing prompts, wiring the image into a page.

The two step run

  1. Generate, then stop:
    node ~/.claude/skills/image-process/scripts/image-chain.mjs --prompts docs/image-prompts-<page>.md --slot 1 --brand acme --basename acme-standing-desk-front --element hero --alt "Standing desk: laptop and notebook on a clean surface"
    Preflight runs, the PNG lands in tmp/img_processing/<basename>.png, the script prints REVIEW: <path> and exits 0.
  2. Open the PNG and review it yourself. Reject: subject cut by the frame, stray letters, logos, dark background, missing subject. One retry with a tightened prompt, then stop and report.
  3. Approved: rerun the same command with --approve. Generation is skipped because the PNG exists. The chain writes the webp set to public/images/, checks each file against the byte limit, moves the source to tmp/img_processing/done/, appends a row to docs/image-assets.md (wired: no) and prints the srcset object and the final alt.

Exit codes: 0 ok or stopped for review, 1 preflight or processing fail, 2 generation quota or limit (message printed verbatim; park and retry later).

Flags

flagmeaning
--prompts <doc>prompts doc, project relative
--slot <N>## N. section in the doc
--basename <name>must match ^<brand>-[a-z0-9-]+$
--brand <slug>basename prefix, default site
--element hero|inline|card|ogsize set 420/760/1120, 420/680/900, 320/480/640, 1200
--alt "<text>"alt text without the suffix
--alt-suffix <text>appended as | <text>, default none
--out-dir <dir>webp output, default public/images
--work-dir <dir>PNG drop zone, default tmp/img_processing
--asset-log <file>Markdown log, default docs/image-assets.md
--max-kb <N>byte limit per webp, default 120
--quality <N>webp quality, default 80
--style-ref <doc>optional: shared style block must equal the one in this doc
--allow-nodwith --style-ref, accept the reference plus appended sentences
--dry-runpreflight plus the generation settings, nothing generated
--skip-generate <png>use an existing PNG (copied to the drop zone name)
--approvecontinue past the review stop; needs the PNG present
--helpusage

What it never does

  • Wire an image into a page or edit source files.
  • Commit, push or deploy.
  • Invent or rewrite prompts; a missing slot section is a preflight fail.
  • Judge its own render: the review stop is unconditional without --approve.

Lessons

None yet. Add one dated line per lesson: - YYYY-MM-DD: <lesson>.

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.