agentleFS
stablebaselinestablebaseline/claude-code/skills/sb-manage-images/SKILL.md

sb-manage-images

Skill1 starsChanged 40 days agoApache-2.0View on GitHub

Upload, insert, update, or delete images in a Stable Baseline document using the upload-session flow. Use when user wants to manage images, add screenshots, or run sb-manage-images.

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 1 is distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

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

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

    If you don't know the documentId: use listWorkspaces, then listProjects, then listDocuments or getProjectHierarchy to find it.

    line 11
  2. Very specific:

    Call getDocument to get the current versionTimestamp and line numbers.

    line 17
  3. Very specific:

    Call insertImageInDocument with one of:

    line 29
  4. Very specific:

    Call getDocument to find the IMAGE_OMITTED marker and note the imageId.

    line 36
  5. Very specific:

    Call updateImageInDocument with the imageId, documentVersionTimestamp, and fields to change: alt, caption, nlDescription, width, height, …

    line 37
  6. Very specific:

    Call deleteImageInDocument with the imageId.

    line 44
  7. Very specific:

    Delete the existing image (deleteImageInDocument).

    line 49
  8. Very specific:

    NEVER hand-edit IMAGE_OMITTED markers in CDMD.

    line 54
  9. Very specific:

    ALWAYS use getDocument before any operation to get the current versionTimestamp.

    line 55
  10. Distinctive:

    If an operation fails due to versionTimestamp mismatch, re-read the document and retry.

    line 56
  11. Very specific:

    Write descriptive nlDescription values: they power semantic search.

    line 57

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

Stable Baseline: Manage Images

Manage images in a Stable Baseline document using MCP tools.

If you don't know the documentId: use listWorkspaces, then listProjects, then listDocuments or getProjectHierarchy to find it. Or read .sb/config.json for cached IDs.

Supported formats: PNG, JPEG, GIF, WebP, SVG (max 10MB).

Inserting a new image (recommended flow)

  1. Call getDocument to get the current versionTimestamp and line numbers.
  2. Upload-session flow (best practice: avoids base64 issues): a. Call createImageUploadSession with { documentId, fileName, mimeType }. It returns uploadUrl and assetUrl. b. PUT the raw file bytes to uploadUrl with header Content-Type: <mimeType>. The URL is single-use and expires in 5 minutes. c. Call insertImageInDocument with imageUrl set to the assetUrl from step (a). Include: documentVersionTimestamp, nlDescription, caption, afterLine. The tool will finalize the already-uploaded file without re-uploading.
  3. Alternative: direct insert (for small images or URLs):
    • Call insertImageInDocument with one of:
      • imageUrl: a public URL to fetch from
      • imageBase64: base64-encoded image data
    • Include: documentVersionTimestamp, nlDescription, caption, afterLine.

Updating image metadata

  • Call getDocument to find the IMAGE_OMITTED marker and note the imageId.
  • Call updateImageInDocument with the imageId, documentVersionTimestamp, and fields to change: alt, caption, nlDescription, width, height, align.
  • This does NOT replace the image file: to swap the image, delete and re-insert.

Deleting an image

  • Call getDocument to find the IMAGE_OMITTED marker and note the imageId.
  • Call deleteImageInDocument with the imageId.
  • This removes the marker, database record, and storage file.

Replacing an image

  1. Delete the existing image (deleteImageInDocument).
  2. Re-read the document (getDocument) to get the updated versionTimestamp and line numbers.
  3. Insert the new image at the desired position using the upload-session flow above.

Hard rules:

  • NEVER hand-edit IMAGE_OMITTED markers in CDMD.
  • ALWAYS use getDocument before any operation to get the current versionTimestamp.
  • If an operation fails due to versionTimestamp mismatch, re-read the document and retry.
  • Write descriptive nlDescription values: they power semantic search.

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.