cloudinary-next — скилл для Claude Code: Cloudinary в Next.js
Помогает агенту писать, чинить и проверять код Next.js с Cloudinary: картинки, видео, загрузки, OG-карточки. Полезен, когда надо разобраться с границей сервер/клиент и подписями загрузок.
npx skills add cloudinary-devs/skills --skill cloudinary-next -a claude-codeЧто делает cloudinary-next
Скилл включается, когда в проекте на Next.js есть next-cloudinary или Node SDK v2. Агент сначала определяет задачу: отрендерить трансформированную картинку в JSX, собрать URL строкой, встроить видеоплеер, загрузить файл из браузера или с сервера, удалить ассет, сделать оверлей или социальную карточку. Дальше подгружает только нужный файл справки, а не весь набор.
Внутри жёсткие правила, которые агент применяет до любой подробной справки. Компоненты и хелперы URL берутся из next-cloudinary: CldImage, CldVideoPlayer, CldUploadWidget, CldUploadButton, CldOgImage, getCldImageUrl, getCldOgImageUrl, getCldVideoUrl. Node SDK v2 (import { v2 as cloudinary } from 'cloudinary') идёт только на сервере. CLOUDINARY_API_SECRET в браузер не попадает, и NEXT_PUBLIC_CLOUDINARY_API_SECRET создавать нельзя. Виджеты загрузки и плеер живут за 'use client', а Server Actions и route handlers с импортом cloudinary должны идти на Node.js runtime.
Есть отдельные файлы под подписанные загрузки, удаление ассетов, оверлеи, адаптивные картинки, типизацию и разбор частых ошибок. При удалении нужен public ID, а не delivery URL; для видео и raw-ассетов добавляется resource_type. Если деталь зависит от версии, скилл велит сверяться с официальной документацией, а не с памятью модели. Это заметно снижает шанс получить выдуманное имя пропа.
Какие задачи решает
- отрендерить трансформированную картинку Cloudinary в JSX
- собрать URL картинки или видео строкой
- настроить подписанную загрузку через App Router
- удалить ассет по public ID с инвалидацией кэша
- починить ошибки импорта и границы сервер/клиент
Примеры запросов агенту
- Добавь CldImage на страницу товара с адаптивными размерами и кропом 4:3
- Сделай route handler для подписанной загрузки в App Router
- Проверь этот компонент: не утекает ли CLOUDINARY_API_SECRET в клиент
Как установить cloudinary-next
1Через Skills CLI (Vercel)
npx skills add cloudinary-devs/skills --skill cloudinary-next -a claude-code2Вручную: положить файлы
~/.claude/skills/cloudinary-next/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/cloudinary-next/
1Через Skills CLI (Vercel)
npx skills add cloudinary-devs/skills --skill cloudinary-next -a codex2Вручную: положить файлы
.agents/skills/cloudinary-next/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add cloudinary-devs/skills --skill cloudinary-next -a cursor2Вручную: положить файлы
.cursor/skills/cloudinary-next/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install cloudinary-devs/skills cloudinary-next2Вручную: положить файлы
.github/skills/cloudinary-next/SKILL.md1Через Skills CLI (Vercel)
npx skills add cloudinary-devs/skills --skill cloudinary-next -a gemini-cli2Командой платформы
gemini skills install https://github.com/cloudinary-devs/skills --path skills/frameworks/cloudinary-nextВручную: положить файлы
.devin/skills/cloudinary-next/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add cloudinary-devs/skills --skill cloudinary-next -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Из того же набора4
Похожие
Рядом в теме «Фронтенд и UI»
Всё по теме «Фронтенд и UI» →Вопросы о cloudinary-next
Как установить cloudinary-next в Claude?
Выполните npx skills add cloudinary-devs/skills --skill cloudinary-next -a claude-code. Скилл окажется в ~/.claude/skills/cloudinary-next/SKILL.md.
Что делает cloudinary-next?
Ведёт агента по коду Next.js с Cloudinary: выбор компонента или хелпера, трансформации, загрузки, удаление, оверлеи и OG-картинки. Отдельно разбирает ошибки и проверяет готовую реализацию.
Какие правила скилл требует соблюдать?
Секрет CLOUDINARY_API_SECRET не выходит в браузер, виджеты и плеер идут за 'use client', а код с Node SDK v2 работает на Node.js runtime. Удаление делается по public ID, а не по delivery URL.
Исходный текст
SKILL.md · MIT
---
name: cloudinary-next
description: Guidance for building, debugging, and reviewing next.js apps that use cloudinary through next-cloudinary and the cloudinary node sdk v2. Use for tasks involving CldImage, CldVideoPlayer, CldUploadWidget, CldUploadButton, CldOgImage, GetCldImageUrl, GetCldOgImageUrl, GetCldVideoUrl, signed uploads, server uploads, deletes, transformations, responsive images, overlays, social cards, environment variables, and common Cloudinary errors.
license: MIT
metadata:
author: cloudinary
version: '1.0.0'
---
# Cloudinary Next
## Purpose
Use this skill to help developers build, debug, or review Next.js projects that integrate Cloudinary through `next-cloudinary` and, for server-only operations, the Cloudinary Node SDK v2.
This skill is organized for progressive loading. Do not load every reference file by default. Start with the workflow below, then load only the reference files needed for the user's task.
## Core workflow
1. Classify the user's goal before writing code:
- render a transformed Cloudinary image in JSX
- generate a Cloudinary URL string
- embed a video player
- upload from the browser
- perform a signed upload
- upload from the server
- delete an asset
- build an overlay or text overlay
- generate an OG/social image
- fix TypeScript, environment, import, runtime, or upload errors
- review an existing implementation
2. Load the relevant reference file from the map below.
3. Apply the non-negotiable rules in this `SKILL.md` before using any detailed reference.
4. For code review or debugging, load `references/troubleshooting.md` plus the task-specific reference.
5. When a detail is version-sensitive or not covered here, consult the official documentation linked in `references/official-docs.md` and prefer official prop names and event names over memory.
## Non-negotiable rules
- Use `next-cloudinary` for Next.js components and URL helpers: `CldImage`, `CldVideoPlayer`, `CldUploadWidget`, `CldUploadButton`, `CldOgImage`, `getCldImageUrl`, `getCldOgImageUrl`, and `getCldVideoUrl`.
- Use the Cloudinary Node SDK v2 only for server-side operations: `import { v2 as cloudinary } from 'cloudinary'`.
- Never expose `CLOUDINARY_API_SECRET` to the browser. Never create `NEXT_PUBLIC_CLOUDINARY_API_SECRET`.
- Put upload widgets, video player UI, and any component with React event handlers behind a Client Component boundary with `'use client'`.
- `CldImage` may be used from a Server Component for static rendering, but if you add client-only props such as `onLoad` or local state, move it into a Client Component.
- Do not import `cloudinary` in Client Components or Edge runtime code. Server Actions and route handlers that import `cloudinary` must run on the Node.js runtime.
- Use documented `next-cloudinary` prop names and shapes. Do not infer prop names from Cloudinary URL transformation parameters.
- Use `onSuccess` for upload widget success handling. Do not use deprecated upload callback names unless the installed version explicitly documents them.
- For deletes, pass a public ID, not a delivery URL. Pass `resource_type` when deleting videos or raw assets, and use `invalidate: true` when CDN cache invalidation is desired.
## Reference map
Load the smallest useful set of references:
- `references/official-docs.md` — official documentation links and the global prop-name rule.
- `references/api-decision-tree.md` — choose the correct Cloudinary API/component/helper for a user goal.
- `references/project-setup.md` — install packages, configure Next.js image domains, configure upload presets, and create starter setup files.
- `references/environment.md` — environment variables and TypeScript process env typing.
- `references/imports.md` — correct import paths and server/client boundaries.
- `references/cldimage.md` — `CldImage`, sample assets, and `getCldImageUrl` usage.
- `references/cldimage-transformations.md` — transformation props, generative editing, optimization, raw transformations, and crop traps.
- `references/responsive-images.md` — responsive image sizing and `sizes` guidance.
- `references/video-player.md` — `CldVideoPlayer`, required CSS, and client-only player setup.
- `references/upload-widget.md` — browser uploads, upload widget/button usage, events, and signed-vs-unsigned tradeoffs.
- `references/signed-uploads.md` — App Router signature endpoint pattern.
- `references/server-upload-delete.md` — Server Action and route-handler upload/delete patterns with the Node SDK v2.
- `references/overlays.md` — image overlays and text overlay prop shapes.
- `references/og-images.md` — App Router and Pages Router OG/social card patterns.
- `references/typescript.md` — upload result narrowing, server upload result types, refs, and avoiding `any`.
- `references/troubleshooting.md` — common error messages and fixes.
- `references/quick-checklist.md` — final code-review checklist and best practices.
## Output expectations
When generating code, include the file path, the complete relevant code block, and a short note about where the code runs: Client Component, Server Component, Server Action, or route handler.
When reviewing code, report issues in this order: secret exposure, server/client boundary mistakes, import/runtime mistakes, incorrect component/helper choice, incorrect prop/event names, missing TypeScript narrowing, and missing cache invalidation or resource type handling.
When using reusable templates, copy from `assets/app-router-signature-route.ts`, `assets/server-action-upload.ts`, or `assets/server-action-delete.ts` and adapt names, folders, and return values to the user's project.
© cloudinary · MIT · cloudinary-devs/skills