map — промпт для Claude Code: разбор ответов подписки
Промпт map для Claude Code описывает, как читать ответы инструмента подписки Persona. По примеру ответа он задаёт тип данных, поля и группировку записей.
MIT ★ 395 обновлён 2026-11-16
.claude/commands/map.mdЧто делает map
map помогает настроить разбор ответов инструмента, который Persona вызывает снова и снова, чтобы получать новые данные. По одному примеру промпт определяет, содержит ли ответ отдельные элементы или целостный снимок состояния, и задаёт, как показывать результат во входящих и базе знаний.
Для списка элементов он описывает пути к полям заголовка, идентификатора, даты, отправителя, текста, ссылки и переписки. Выборка может содержать не больше трёх элементов, а строка в ней обрезается до 120 символов. Текстовый ответ можно трактовать только как снимок состояния.
Установите файл .claude/commands/map.md. Итоговая заметка для пользователя пишется на его языке; в ней не должны появляться пути к полям или JSON.
Какие задачи решает
- различить список новых элементов и снимок состояния
- задать пути к полям ответа для каждой записи
- сгруппировать сообщения по источнику или переписке
- определить, как отличать изменённые элементы без постоянного ID
Примеры запросов агенту
- Настрой разбор ответов подписки по этому примеру: определи тип данных и поля каждой записи.
- Сгруппируй сообщения из этого источника по перепискам и подготовь заметку для пользователя.
- Разбери пример ответа как снимок состояния и укажи его заголовок.
Как установить map
Вручную: положить файлы
.claude/commands/map.mdКак использовать
Вставьте текст в начало диалога или в инструкции проекта
Вопросы о map
Как установить map в Claude Code?
Добавьте файл промпта по пути .claude/commands/map.md.
Что делает map?
Промпт задаёт правила чтения примера ответа инструмента подписки: тип данных, пути к полям и группировку элементов.
Как map обрабатывает короткий пример ответа?
В примере может быть до трёх элементов, а строки ограничены 120 символами. Для списка задаются поля записей; текстовый ответ трактуется только как снимок состояния.
Исходный текст
map.md · MIT
You set up a subscription: Persona will call one tool of an app's source again and again, with nobody watching, to bring in what is new. The tool and its arguments are chosen. From one sample of what it answers, say how to read every answer.
The sample is cut for you: a list keeps at most 3 entries and a string at most 120 characters. Real answers have more.
- mode: items when the answer lists things that arrive one by one (mail, messages, notices, events); snapshot when it is one state, kept whole each time it changes (a balance, a status, a page). A text answer can only be a snapshot.
- items_path, for items: where the list is, from the answer's root. $ when the answer itself is the list, $.items for its key items. Leave it out for a snapshot.
- fields: where each value is, relative to one item, such as $.subject, $.from.name or $.to[0]. A path is $ followed by .key or [index] steps; a key has letters, digits, _ and -, and does not start with a digit. No wildcards, filters or expressions. Leave out a field the items do not have.
- title, required for items: a short line that says what the item is.
- id: a value that is unique to the item and never changes, such as a message id. Without one, items are told apart by title, time and sender, and an edited item comes in again.
- time: when it was sent or made. due_date: only for something due by a date.
- sender; body, its text; link, a URL that opens it; thread, the conversation it belongs to when the items come from several (a mail thread, a forum topic).
- For a snapshot, only title may be given: the state's name, when the answer has one.
- kind: sub_mail for mail, sub_message for chat messages, sub_notice for notices, announcements and notifications, sub_deadline for things due by a date, sub_event for calendar events, sub_update for changes or a state, sub_digest for a periodic summary.
- group_by decides the rows in the user's Inbox and the chats in the knowledge base. source when the whole answer is one conversation, such as a group chat or a channel: it is one row, with the newest message on top. thread when each item stands on its own (articles, notifications, mail) or belongs to one of several conversations: one row per thread, and an item without a thread is a row of its own.
- note: one or two sentences in {{.Language}} for the user, saying what will be brought in and what each item's title shows. No paths, field names or JSON.
© nwverse · MIT · nwverse/persona