agentleFS
GuusLabGuusLab/nemi-plugin/skills/convert-and-edit/SKILL.md

convert-and-edit

Skill0 starsChanged 46 days agoMITView on GitHub

Convert files between formats, shrink them, and edit pictures in Nemi: resize, crop, square or round avatars, rotate, watermark, adjust, change background or hit a file size. Use when the user wants a file as another format (PDF, JPG, PNG, WebP, MP4, MP3 and more), smaller, compressed, or a picture changed in any way.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    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:

    When the edit depends on the current size (making it exactly 1080 wide, cropping the right third), call file_get with image_details true …

    line 29
  2. Very specific:

    Do not call file_convert after image_edit.

    line 43

≈ “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

Converting and editing in Nemi

Two tools, and picking the right one matters:

  • image_edit for anything about how a picture looks, and its output format in the same step.
  • file_convert for format changes of any other kind (documents, audio, video, HEIC, RAW, PSD) and for making non-image files smaller.

Results are saved beside the original (or in folder_id in the same workspace). The original is never changed.

Converting

  1. file_convert_formats with the file_id. It lists the formats this file can become and the settings each accepts, with allowed values and defaults. Always call it unless the request is a plain format change that obviously exists.
  2. file_convert with output_formats (extensions, e.g. ["pdf"], or several at once: ["mp4", "webm"]). Put settings in options (all formats) or options_per_format (one format, e.g. { "jpg": { "quality": "70", "width": "1600" } }). Keys and values must come from step 1.
  3. Reply with the names of the new files and their sizes.

Making a file smaller: convert it to its own format with a lower quality or size. A 40 MB video for WhatsApp becomes an mp4 with a lower resolution; a heavy PDF may accept a quality setting.

HEIC, RAW and PSD photos: convert to jpg or png first, then image_edit if more is needed.

Editing pictures

image_edit takes file_ids (up to 20; the same operations apply to each), an ordered list of operations, and output.

When the edit depends on the current size (making it exactly 1080 wide, cropping the right third), call file_get with image_details true first.

Operations, each { "op": ..., ... }:

  • resize { width, height, percent, fit, position, background, enlarge }. Give both edges for an exact size; fit cover (default when both given) crops to fill, contain pads with background, stretch distorts, inside and outside keep the ratio.
  • crop { aspect: "1:1" | "4:5" | "16:9", position } or { left, top, width, height }. position is centre, top, bottom, left, right, a corner, or smart to keep the subject.
  • rotate { degrees, background }, flip, mirror, trim { threshold } (cuts a plain border), pad { size or top/right/bottom/left, color }, round { radius }, circle.
  • grayscale, negate, normalize, tint { color }, sepia, blur { amount }, sharpen { amount }, brightness, saturation, contrast { value, 1 is unchanged }, hue { degrees }, gamma { value }, flatten { color } (fills transparency).
  • text { text, position, size, color, opacity }, watermark { text, position, opacity }.

Colours are hex (#ff7a4d) or white, black, transparent.

output: { format: jpg | png | webp | avif | gif | tiff, quality: 1-100, lossless, max_kb, keep_metadata }. Leave format out to keep the source format. max_kb lowers the quality until the file fits (jpg, webp, avif). An edit that needs transparency becomes a PNG.

Do not call file_convert after image_edit; the format is set in the same step.

Recipes

Requestoperationsoutput
Profile picturecrop aspect 1:1 position smart, resize 800 x 800, circlepng
Instagram portraitcrop aspect 4:5 position smart, resize 1080 x 1350jpg, quality 85
Website heroresize width 1920webp, quality 80
Under 500 KB for an emailresize width 2000 (if larger)jpg, max_kb 500
Watermark proofswatermark text "PROOF" position centre opacity 0.3keep
Scan cleanupgrayscale, normalize, sharpenpng
Logo on transparenttrimpng

Metadata (location, camera) is removed unless keep_metadata is true; mention it when the user shares photos publicly.

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.