Skip to content
cloudinary-media logo

Cloudinary Media Skill

cloudinary-media

Enforces project Cloudinary media conventions when working with image uploads, URL generation, transformations, social sharing images, and photo management components. This skill covers the complete media workflow including CloudinaryService operations, URL utilities, CldImage/CldUploadWidget com...

SKILL.md

Full skill instructions

Cloudinary Media Skill

Purpose

This skill enforces the project Cloudinary media conventions automatically during media-related development. It ensures consistent patterns for image uploads, URL transformations, social sharing images, photo management, error handling with Sentry, and proper type usage across the application.

Activation

This skill activates when:

  • Working with image uploads using CldUploadWidget or CloudinaryService
  • Using CldImage component from next-cloudinary for image display
  • Generating optimized URLs with cloudinary.utils functions
  • Creating social sharing images (OG, Twitter) for SEO metadata
  • Extracting publicIds or formats from Cloudinary URLs
  • Implementing photo galleries, avatars, or image displays
  • Working with CloudinaryPhoto type or related interfaces
  • Using CloudinaryPathBuilder or CLOUDINARY_PATHS constants
  • Implementing photo upload components with progress tracking
  • Working with files in src/​lib/​utils/​cloudinary.utils.ts
  • Working with files in src/​lib/​services/​cloudinary.service.ts
  • Working with files in src/​lib/​constants/​cloudinary-paths.ts
  • Working with files in src/​types/​cloudinary.types.ts
  • Working with files in src/​components/​ui/​cloudinary-*.tsx

Workflow

  1. Detect Cloudinary work (file path contains cloudinary, imports from next-cloudinary, or uses cloudinary utilities)
  2. Load references/​Cloudinary-Media-Conventions.md
  3. Generate/​modify code following all conventions
  4. Scan for violations of media patterns
  5. Auto-fix all violations (no permission needed)
  6. Report fixes applied

Key Patterns

Image Display

  • Use CldImage from next-cloudinary for all Cloudinary images
  • Pass publicId to src prop (not full URL)
  • Always include alt, crop, gravity, quality={'auto'} props
  • Use sizes prop for responsive images with fill
  • Extract publicId using extractPublicIdFromCloudinaryUrl() when needed

URL Generation

  • Use generateOpenGraphImageUrl() for OG images (1200x630)
  • Use generateTwitterCardImageUrl() for Twitter cards (800x418)
  • Use generateSocialImageUrl() for platform-specific dimensions
  • Use extractFormatFromCloudinaryUrl() to get file extensions
  • All utilities include Sentry error logging with fallbacks

Upload Service

  • Use CloudinaryService static methods for server-side operations
  • Use deletePhotosByUrls() for batch deletion with URL context
  • Use movePhotosToPermFolder() to move temp uploads to permanent locations
  • Use getOptimizedUrl() for programmatic URL generation
  • All service methods use circuit breakers and retry logic

Path Organization

  • Use CLOUDINARY_PATHS.FOLDERS for base folder names
  • Use CloudinaryPathBuilder functions for dynamic paths:
    • bobbleheadPath(userId, collectionId, bobbleheadId)
    • collectionCoverPath(userId, collectionId)
    • profilePath(userId)
    • tempPath(userId)
  • Never hardcode folder paths directly

Type Definitions

  • Use CloudinaryPhoto interface for photo data
  • Use transformCloudinaryResult() to convert upload results
  • Use PhotoUploadState for tracking upload progress
  • Use FileUploadProgress for individual file tracking
  • Use type guards isPersistedPhoto() and isTempPhoto()

Upload Components

  • Use CloudinaryPhotoUpload component for photo management
  • Configure CldUploadWidget with proper options and signature endpoint
  • Implement optimistic updates with blob URLs during upload
  • Handle upload errors with retry capability
  • Support bulk selection and deletion

Error Handling

  • All utilities log errors to Sentry with operation context
  • Return sensible fallbacks on error (default image, original URL)
  • Use createServiceError for service-level errors
  • Track upload failures with uploadError property

References

  • references/​Cloudinary-Media-Conventions.md - Complete Cloudinary media conventions

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View