search-assets — скилл для Claude Code: что делает и как установить
Формирует точные поисковые запросы Lucene для ImageKit DAM. Помогает агенту находить файлы и папки по полям метаданных, тегам и свойствам без ручной фильтрации.
npx skills add imagekit-developer/skills --skill search-assets -a claude-codeЧто делает search-assets
Скилл учит агента вызывать метод search_media_library в ImageKit DAM с точными фильтрами searchQuery. Вместо выгрузки сотен файлов в память и последующей фильтрации кодом агент собирает запрос на синтаксисе Lucene под описание пользователя: бренд, регион, статус согласования или дату.
Перед сборкой условия агент проверяет структуру метаданных. Он вызывает list_custom_metadata_fields, чтобы сопоставить слова пользователя с реальными полями и значениями списков, и list_client_tags для проверки тегов. К поиску по имени файла через name HAS агент переходит только тогда, когда совпадений в метаданных и тегах нет.
Если в вызове задан searchQuery, отдельный параметр type игнорируется API ImageKit и поиск по умолчанию возвращает файлы. Чтобы найти папки, агенту необходимо явно прописывать type = "folder" прямо внутри строки запроса.
Какие задачи решает
- составить поисковый запрос searchQuery для ImageKit по обычному описанию
- найти медиафайлы по кастомным полям метаданных без угадывания схемы
- отфильтровать ассеты по тегам, типам файлов, размерам или длительности видео
- найти папки в DAM, когда параметр type игнорируется API
Примеры запросов агенту
- Найди в ImageKit все утверждённые баннеры для кампании EMEA за последнюю неделю
- Собери запрос search_media_library для видео в формате mp4 длительностью больше минуты
- Найди папку с логотипами в каталоге /products через Lucene searchQuery
Как установить search-assets
1Через Skills CLI (Vercel)
npx skills add imagekit-developer/skills --skill search-assets -a claude-code2Вручную: положить файлы
~/.claude/skills/search-assets/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/search-assets/
1Через Skills CLI (Vercel)
npx skills add imagekit-developer/skills --skill search-assets -a codex2Вручную: положить файлы
.agents/skills/search-assets/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add imagekit-developer/skills --skill search-assets -a cursor2Вручную: положить файлы
.cursor/skills/search-assets/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install imagekit-developer/skills search-assets2Вручную: положить файлы
.github/skills/search-assets/SKILL.md1Через Skills CLI (Vercel)
npx skills add imagekit-developer/skills --skill search-assets -a gemini-cli2Командой платформы
gemini skills install https://github.com/imagekit-developer/skills --path skills/search-assetsВручную: положить файлы
.devin/skills/search-assets/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add imagekit-developer/skills --skill search-assets -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о search-assets
Как установить search-assets в Claude Code?
Выполните команду npx skills add imagekit-developer/skills --skill search-assets -a claude-code. Также можно поместить файл вручную в ~/.claude/skills/search-assets/SKILL.md.
Что делает скилл search-assets?
Он даёт агенту правила составления запросов Lucene для медиатеки ImageKit DAM. Агент транслирует слова пользователя в точные фильтры по метаданным, тегам и свойствам файлов.
Почему поиск не находит папки при указании type?
Параметр инструмента type полностью игнорируется, когда задана строка searchQuery. Чтобы найти папки, условие type = "folder" нужно добавить прямо в searchQuery.
Исходный текст
SKILL.md · MIT
---
name: search-assets
description: "Lucene searchQuery cheatsheet for DAM search_media_library. Use when the user describes assets in everyday language (brand, campaign, region, status, colour, rating, SKU) or when building or debugging a search, filter, or list of ImageKit files and folders."
---
# `search_media_library` `searchQuery`
Call `search_media_library` on DAM with a tight filter. Do not fetch a broad page and filter in code.
## Discover fields before you guess
Accounts define arbitrary custom-metadata fields. The user will type normal words ("Nike", "summer campaign", "EMEA", "approved") that may be a **field name**, a **select option**, a **tag**, or only a **filename**. Never invent `"customMetadata.<name>"`.
For every descriptive word you might put on `name` or `tags`:
1. Call `list_custom_metadata_fields` once. Match the word against each field's `name`, `label`, and `schema.selectOptions` (case-insensitive). Use the field's `name` (not `label`) as `"customMetadata.<name>"`.
2. Call `list_client_tags` with that word as `label`. If tags come back, filter with `tags IN [...]` using the returned tag `name`s verbatim.
3. Only if neither call matches may you fall back to `name HAS "…"`. Literal filenames, extensions, and explicitly "named/called/titled X" go on `name` without this check.
A no-match is cheap: omit that custom-metadata clause rather than guessing a field. Skip filler words ("files", "show me", "assets").
Select types: `SingleSelect` → `=` / `IN`; `MultiSelect` → `IN` / `NOT IN`. Prefer a returned `selectOptions` value over the user's raw spelling. Text → `=` `:` `HAS`; Number/Date → `<` `<=` `>` `>=`; Boolean → `=` with unquoted `true`/`false`.
## Inputs
| Input | Use for |
|-------|---------|
| `searchQuery` | Lucene filter (below). |
| `path` | Folder scope, e.g. `/products`. |
| `type` | `file` / `file-version` / `folder` / `all`. Honored only when `searchQuery` is omitted. |
| `fileType` | `image` / `non-image` / `all`. |
| `sort` | `ASC_`/`DESC_` + `CREATED` (default `ASC_CREATED`), `UPDATED`, `NAME`, `SIZE`, `WIDTH`, `HEIGHT`, `DURATION`, `RELEVANCE`, `ORIGINAL_CREATION_DATE`. Pair `HAS` with `DESC_RELEVANCE`. `*_ORIGINAL_CREATION_DATE` orders by the reserved `_internal_original_created_datetime` field; files without a value fall back to upload time. |
| `limit` / `skip` | Page size (max 1000) and offset. Default page is 20. |
Put a simple folder scope in `path` and file vs non-image in `fileType`. Whenever `searchQuery` is set, put type in `searchQuery` (`type = "folder"`, or `(name HAS "logo") AND type = "folder"`). The `type` argument is ignored in that case and results default to files.
## Syntax
- **Operators:** `=` `:` `<` `<=` `>` `>=` `IN` `NOT IN` `NOT =` `HAS` `EXISTS` `NOT EXISTS`
- **Combine:** `AND`, `OR`. **Group:** `( ... )`
- **Quoting:** string values in `"double quotes"`; numbers and booleans (`true`/`false`) unquoted; `customMetadata` / `embeddedMetadata` field names must be quoted, e.g. `"customMetadata.brand"`.
- `:` = begins-with / within-subfolders. `=` = exact. `HAS` = case-insensitive full-text (tokenized).
## Fields
| Field | Operators | Value notes |
|-------|-----------|-------------|
| `name` | `=` `:` `IN` `NOT =` `NOT IN` `HAS` | `=` exact (case-sensitive), `:` begins-with, `HAS` case-insensitive full-text |
| `tags` | `IN` `NOT IN` `HAS` `EXISTS` `NOT EXISTS` | Matches both `tags` and `AITags` |
| `type` | `=` `IN` `NOT =` `NOT IN` | `"file"` \| `"file-version"` \| `"folder"` |
| `id` | `=` `IN` `NOT =` `NOT IN` | fileId or folderId |
| `createdAt` / `updatedAt` | `=` `<` `<=` `>` `>=` `IN` `NOT =` `NOT IN` | ISO 8601 or relative (`"1h"` `"2d"` `"3w"` `"4m"` `"1y"`) |
| `width` / `height` | `=` `<` `<=` `>` `>=` `IN` `NOT =` `NOT IN` | Pixels; images only |
| `size` | `=` `<` `<=` `>` `>=` `IN` `NOT =` `NOT IN` | Bytes (`1024`) or `"1mb"` / `"10kb"` |
| `videoDuration` | `=` `<` `<=` `>` `>=` `IN` `NOT =` `NOT IN` | Videos only. Quoted with unit: `"30sec"` `"1.5min"` `"2hr"` (or `s`/`m`/`h`); a bare number is seconds |
| `format` | `=` `IN` | `"jpg"` `"png"` `"webp"` `"gif"` `"svg"` `"avif"` `"pdf"` `"mp4"` … |
| `private` / `published` / `transparency` | `=` | Boolean, unquoted |
| `createdBy` | `=` `IN` `NOT =` `NOT IN` | Uploader email |
| `path` | `=` `:` `IN` `NOT =` `NOT IN` | `=` exact folder; `:` folder + subfolders |
| `"customMetadata.<field>"` | type-dependent | Quote the field name. Discover via `list_custom_metadata_fields`. The reserved `_internal_original_created_datetime` (Date, label "Original creation date") is listed with `reserved: true` only on accounts that enabled it |
| `"embeddedMetadata.<field>"` | type-dependent | From the file, not the DAM schema. `Keywords` uses `IN`/`EXISTS`; `DateTimeOriginal` uses date ops; `LocationTaken` supports geo (`"40,100 5km"`) |
## Examples
```text
name HAS "red dress"
name = "red-dress.jpg"
name : "red-dress"
createdAt > "7d" AND size > "2mb"
tags IN ["sale", "summer"]
tags NOT EXISTS
format IN ["jpg", "webp"]
path : "/sales-banner/"
"customMetadata.brand" = "nike"
"customMetadata.Region" IN ["EMEA"]
"customMetadata.rating" > 4.3
"embeddedMetadata.DateTimeOriginal" > "1y"
videoDuration > "1min" AND format = "mp4"
"customMetadata._internal_original_created_datetime" < "2021-01-01"
(size < "1mb" AND width > 500) OR (tags IN ["summer-sale", "banner"])
```
User says "Nike assets" → `list_custom_metadata_fields` finds `brand` / options including Nike → `"customMetadata.brand" = "Nike"`. Do not search `name HAS "Nike"` if a field or tag matched.
## Gotchas
- `name` `=` / `:` are case-sensitive; use `HAS` for case-insensitive matching.
- `tags` queries search both `tags` and `AITags`.
- `HAS` tokenizes on spaces/punctuation; the last token matches as a prefix. Pair with `sort: DESC_RELEVANCE`.
- Booleans (`private`, `published`, `transparency`) are unquoted; string values are quoted.
- `width` / `height` / `transparency` apply to images only; `videoDuration` applies to videos only. Units are `sec` / `min` / `hr`, not `minutes` / `hours`.
- Sort by `ASC_ORIGINAL_CREATION_DATE` / `DESC_ORIGINAL_CREATION_DATE` only when `list_custom_metadata_fields` returns `_internal_original_created_datetime`; otherwise use `*_CREATED`.
- `"customMetadata.<field>"` only matches fields defined on the account. Quote the whole token.
- The `type` tool argument is ignored whenever `searchQuery` is set. Put `type = "folder"` (or `type IN [...]`) in `searchQuery` instead.
© imagekit-developer · MIT · imagekit-developer/skills