Claude-skill-registry 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 components, path organization, type definitions, and Sentry integration.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/cloudinary-media" ~/.claude/skills/majiayu000-claude-skill-registry-cloudinary-media && rm -rf "$T"
manifest:
skills/data/cloudinary-media/SKILL.mdsource content
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
orCldUploadWidgetCloudinaryService - Using
component fromCldImage
for image displaynext-cloudinary - Generating optimized URLs with
functionscloudinary.utils - 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
type or related interfacesCloudinaryPhoto - Using
orCloudinaryPathBuilder
constantsCLOUDINARY_PATHS - 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
- Detect Cloudinary work (file path contains
, imports fromcloudinary
, or uses cloudinary utilities)next-cloudinary - Load
references/Cloudinary-Media-Conventions.md - Generate/modify code following all conventions
- Scan for violations of media patterns
- Auto-fix all violations (no permission needed)
- Report fixes applied
Key Patterns
Image Display
- Use
fromCldImage
for all Cloudinary imagesnext-cloudinary - Pass
topublicId
prop (not full URL)src - Always include
,alt
,crop
,gravity
propsquality={'auto'} - Use
prop for responsive images withsizesfill - Extract publicId using
when neededextractPublicIdFromCloudinaryUrl()
URL Generation
- Use
for OG images (1200x630)generateOpenGraphImageUrl() - Use
for Twitter cards (800x418)generateTwitterCardImageUrl() - Use
for platform-specific dimensionsgenerateSocialImageUrl() - Use
to get file extensionsextractFormatFromCloudinaryUrl() - All utilities include Sentry error logging with fallbacks
Upload Service
- Use
static methods for server-side operationsCloudinaryService - Use
for batch deletion with URL contextdeletePhotosByUrls() - Use
to move temp uploads to permanent locationsmovePhotosToPermFolder() - Use
for programmatic URL generationgetOptimizedUrl() - All service methods use circuit breakers and retry logic
Path Organization
- Use
for base folder namesCLOUDINARY_PATHS.FOLDERS - Use
functions for dynamic paths:CloudinaryPathBuilderbobbleheadPath(userId, collectionId, bobbleheadId)collectionCoverPath(userId, collectionId)profilePath(userId)tempPath(userId)
- Never hardcode folder paths directly
Type Definitions
- Use
interface for photo dataCloudinaryPhoto - Use
to convert upload resultstransformCloudinaryResult() - Use
for tracking upload progressPhotoUploadState - Use
for individual file trackingFileUploadProgress - Use type guards
andisPersistedPhoto()isTempPhoto()
Upload Components
- Use
component for photo managementCloudinaryPhotoUpload - Configure
with proper options and signature endpointCldUploadWidget - 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
for service-level errorscreateServiceError - Track upload failures with
propertyuploadError
References
- Complete Cloudinary media conventionsreferences/Cloudinary-Media-Conventions.md