К основному содержанию
скилл CX Codex официальный · Anthropic

tres-import-contacts — скилл для Claude Code: установка и обзор

Скилл tres-import-contacts импортирует контакты и теги блокчейн-адресов в TRES Finance из файлов CSV или XLSX. Пригодится после разметки адресов во внешней таблице.

MIT ★ 4 931 обновлён 2026-10-24

Установить в Claude Code · Через маркетплейс плагинов Все способы и платформы ↓
/plugin marketplace add anthropics/claude-plugins-community
/plugin install tres-finance-plugin@claude-community
Открыть на GitHub

Что делает tres-import-contacts

Скилл загружает реестр контактов в адресную книгу TRES Finance через MCP-сервер user-tres-finance. Скрипт принимает файлы таблиц с колонками Contact Name, Contact Address и Contact Tag. Для формата XLSX в окружении требуется библиотека openpyxl==3.1.5. Файлы CSV читаются с кодировкой UTF-8 с BOM, поддерживая запятые и точки с запятой в роли разделителей.

Перед отправкой данных агент проверяет строки, пропуская пустые имена или адреса. Если один адрес записан несколько раз, берётся последняя строка. Начиная с 50 строк скилл выгружает существующую адресную книгу порциями по 500 записей, чтобы показать отличия новых контактов от обновлений.

Замена тегов перезаписывает старые метки целиком, а не добавляет к ним новые значения. Для партий до 20 контактов мутации GraphQL выполняются параллельно, а более крупные наборы отправляются пакетами по 10 вызовов.

Какие задачи решает

  • импортировать размеченные адреса кошельков в адресную книгу TRES Finance
  • отфильтровать дубликаты и пустые строки в выгрузках CSV или XLSX
  • обновить названия и теги существующих контактов пачками запросов

Примеры запросов агенту

  • Загрузи контакты в TRES из файла contacts.xlsx
  • Импортируй размеченную таблицу адресов wallets.csv в адресную книгу TRES Finance

Как установить tres-import-contacts

1Через маркетплейс плагинов

/plugin marketplace add anthropics/claude-plugins-community
/plugin install tres-finance-plugin@claude-community

Команда ставит плагин tres-finance-plugin целиком, со всеми его скиллами

2Через Skills CLI (Vercel)

npx skills add anthropics/claude-plugins-community --skill tres-import-contacts -a claude-code

3Вручную: положить файлы

~/.claude/skills/tres-import-contacts/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/tres-import-contacts/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о tres-import-contacts

Как установить tres-import-contacts в Claude Code?

Выполните обе команды маркетплейса по очереди: сначала /plugin marketplace add anthropics/claude-plugins-community, затем /plugin install tres-finance-plugin@claude-community.

Что делает скилл tres-import-contacts?

Он читает файлы CSV и XLSX с сопоставлением криптоадресов и имён, а затем сохраняет их в TRES Finance через MCP-сервер user-tres-finance.

Что происходит со старыми тегами контактов при повторном импорте?

Мутация setCustomAccountNameLabelTags полностью перезаписывает имеющиеся теги значениями из таблицы, не дописывая их к существующим.

Исходный текст

SKILL.md · MIT
---
name: tres-import-contacts
description: "Import contacts (address book entries) into TRES Finance from a CSV or XLSX file. Use this skill whenever the user wants to import, upload, or bulk-add contacts, address labels, or address book entries into TRES — whether from a file they filled in after using the export-3rd-party-contacts skill, or from any CSV/XLSX that maps addresses to names. Trigger phrases include: 'import contacts', 'upload contacts', 'add contacts from file', 'import address book', 'load contacts into TRES', 'bulk label addresses', 'import the contacts file', 'upload the filled contacts sheet'. Also trigger when the user says something like 'I filled in the contacts file, now import it' or 'here is my contacts spreadsheet, please upload it to TRES'. Do NOT trigger for exporting or extracting unidentified addresses — that's the export-3rd-party-contacts skill. Do NOT trigger for viewing or searching the existing address book."
---

# TRES Finance — Import Contacts from CSV/XLSX

## Goal

Read a user-provided CSV or XLSX file containing address-to-name mappings and import them as contacts into the TRES address book. This is the second half of the contacts workflow: the user previously exported unidentified addresses (via the export skill), filled in names and tags, and now wants to push those labels back into TRES.

## MCP Server

All GraphQL calls use the **user-tres-finance** MCP server (`execute` tool).

## Expected File Format

The file should have these columns (header names are matched case-insensitively):

| Contact Name | Contact Address | Contact Tag |
|---|---|---|
| Binance Hot Wallet | 0xABC... | Exchange |
| Vendor X | 0xDEF... | Vendor |

- **Contact Name** — the label to assign to the address (required for import; rows without a name are skipped)
- **Contact Address** — the blockchain address (required)
- **Contact Tag** — optional tag(s) for the contact. Multiple tags can be separated by commas (e.g. `Exchange, Custodian`)

The column order doesn't matter — the skill matches by header name. The file may contain additional columns (like the "Address details" enrichment columns from the export skill) — those are ignored.

## Workflow

### Step 1 — Authenticate

Call `get_viewer` (no arguments) to confirm the session is active and note the organization name.

### Step 2 — Read and parse the file

The user will provide a CSV or XLSX file. Detect the format from the file extension.

**For XLSX files:**
Use Python with `openpyxl==3.1.5`. If not installed, stop and display:
> "openpyxl is not installed. Please run: `python3 -m venv .venv && .venv/bin/pip install openpyxl==3.1.5`"

- If the workbook has multiple sheets, look for one named "Contacts" (case-insensitive). If not found, use the first sheet.
- Read the header row to find the column indices for "Contact Name", "Contact Address", and "Contact Tag" (match case-insensitively, trim whitespace).
- Read all data rows.
- Filter out trailing empty rows — openpyxl sometimes reads extra `None` rows at the bottom of the sheet. Skip any row where all cells are `None` or empty strings.

**For CSV files:**
Use Python's built-in `csv` module.

- Open the file with `encoding='utf-8-sig'` to handle the BOM (byte-order mark) that Excel adds when saving CSVs. Without this, the first header may appear as `\ufeffContact Name` and won't match.
- Try comma delimiter first. If the header row doesn't contain the expected columns, retry with semicolon delimiter (common in European-locale Excel exports).
- Read the header row to find column indices, same matching logic as above.
- Read all data rows.

### Step 3 — Validate and filter

For each row:

1. **Skip if Contact Name is blank or missing** — the user hasn't identified this address yet, so there's nothing to import.
2. **Skip if Contact Address is blank or missing** — can't label an address that doesn't exist.
3. **Trim whitespace** from name, address, and tag values.
4. **Parse tags**: if Contact Tag contains commas, split into multiple tags. Trim each tag. Remove empty strings.
5. **Deduplicate by address** (case-insensitive): if the same address appears multiple times, keep the last occurrence (the user likely corrected it). Warn about duplicates.

After filtering, report to the user:
- Total rows in the file
- Rows skipped (blank name)
- Rows to import
- Any duplicates found

Then show a preview table of the first 10 rows that will be imported (address, name, tags) and ask the user to confirm before proceeding.

### Step 4 — Check existing contacts (only for imports with 50+ rows)

For small imports (<50 rows), skip this step and go straight to importing — fetching the entire address book for a handful of contacts adds unnecessary delay.

For larger imports, fetch the current address book to identify which addresses already have labels. This helps the user understand what will be created vs. updated.

```graphql
query AddressBook($limit: Int, $offset: Int) {
  customAccountNameLabel(limit: $limit, offset: $offset) {
    results {
      originalIdentifier
      labelValue
      tags
    }
    totalCount
  }
}
```

Paginate through all results (500 at a time). Build a lookup dictionary keyed by `originalIdentifier.lower()`.

Compare against the import list and report:
- **New contacts** — addresses not in the current address book
- **Updates** — addresses that already exist but will get a new name or tags

**Important**: `setCustomAccountNameLabelTags` is a **replace** operation, not append. If a contact currently has tags `["Exchange", "Custodian"]` and the import file has `["Vendor"]`, the old tags will be overwritten. Warn the user about this for any contacts being updated that already have tags.

Present this breakdown to the user before proceeding. If there are updates, list a few examples showing old name → new name so the user can sanity-check.

### Step 5 — Import contacts

For each validated row, make two API calls:

**5a. Set the contact name:**

```graphql
mutation SetContactName($identifier: String, $labelValue: String) {
  setCustomAccountName(identifier: $identifier, labelValue: $labelValue) {
    accountTxsSummary {
      accountIdentifier
      displayName
    }
  }
}
```

Variables:
```json
{
  "identifier": "<the address>",
  "labelValue": "<the contact name>"
}
```

**5b. Set tags (only if the row has tags):**

```graphql
mutation SetContactTags($identifier: String!, $tags: [String]!) {
  setCustomAccountNameLabelTags(identifier: $identifier, tags: $tags) {
    accountTxsSummary {
      accountIdentifier
      displayName
    }
  }
}
```

Variables:
```json
{
  "identifier": "<the address>",
  "tags": ["Exchange", "Custodian"]
}
```

**Batching strategy:** The API doesn't have a bulk endpoint. For small imports (<20 contacts), fire all name mutations in parallel, then all tag mutations in parallel — this is fast and safe. For larger imports, process in batches of 10 parallel calls to avoid overwhelming the API, and show progress to the user every 25 contacts (e.g. "Imported 25/142...").

**Error handling:** If a mutation fails for a specific address, log the error and continue with the next row. Don't stop the entire import. Collect all failures for the summary.

### Step 6 — Summary

After all mutations complete, present a summary:

- Total contacts imported successfully (name set)
- Total contacts with tags set
- Any failures (list the address and error message)

If there were failures, suggest the user can retry by running the skill again with the same file — already-imported contacts will just be updated (the mutation is idempotent for names).

## Edge Cases

- **File has no header row**: If the first row doesn't contain recognizable column names, tell the user the expected format and ask them to fix the file.
- **File has wrong columns**: If "Contact Address" column can't be found, the file isn't usable. Report which columns were found and what's expected.
- **Empty file**: If the file has headers but no data rows, tell the user.
- **All names blank**: If every row has a blank Contact Name, tell the user — they probably uploaded the unfilled template by mistake.
- **Very large files (>500 rows)**: Warn the user this will take a while and ask for confirmation.
- **Special characters in names**: Pass through as-is — TRES handles unicode in labels.
- **Mixed case addresses**: The `setCustomAccountName` mutation accepts addresses as-is. Don't normalize case — pass the original value from the file.
- **Tag with extra spaces**: `" Exchange , Custodian "` → trim to `["Exchange", "Custodian"]`.
- **Address not in any transaction**: The mutations work even for addresses that TRES has never seen in a transaction — they create the address book entry regardless.
- **Tags overwrite**: `setCustomAccountNameLabelTags` replaces existing tags entirely. If the user only wants to add tags, they would need to merge with existing tags first (the skill does not do this automatically — it's a replace operation). Flag this to the user when updating existing contacts that already have tags.
- **CSV BOM prefix**: Excel-saved CSVs include a UTF-8 BOM (`\ufeff`) that corrupts the first column header. Always open CSVs with `encoding='utf-8-sig'`.
- **Semicolon-delimited CSVs**: European Excel exports use `;` instead of `,`. If comma parsing doesn't find the expected headers, retry with semicolon.
- **Trailing empty rows in XLSX**: openpyxl reads empty rows at the end of the sheet. Skip rows where all values are `None` or empty.

© Nadav Gilliam · MIT · anthropics/claude-plugins-community

Похожие скиллы

Все скиллы по теме «Финансы и бизнес» →
csv-xlsx-import-export-wasp-drone Legion Code Inc. Субагент csv-xlsx-import-export-wasp-drone проектирует импорт и выгрузку таблиц CSV и XLSX в приложениях на React и Next.js. Защищает от инъекций формул и разбирает файлы потоком. CX Codex ★ 96звёзд репо paypal-import openaccountant Скилл paypal-import для Claude Code. Разбирает выгрузку транзакций PayPal и превращает её в проводки: платежи, комиссии, возвраты, конвертация валют. CX Codex +1 436установок stripe-import openaccountant Скилл stripe-import для Claude Code читает CSV-экспорт Stripe и разносит платежи, комиссии и возвраты отдельными строками для сверки с банковской выпиской. CX Codex +1 433установок report-pack официальный anthropics Скилл report-pack собирает регулярные сводки через report-builder, дополняет их контекстом из business-pulse и отдаёт таблицу XLSX с выжимкой. CX Codex +1 386установок minimax-xlsx MiniMax-AI Скилл minimax-xlsx для Claude Code: создаёт, читает, редактирует и проверяет Excel-файлы (.xlsx, .xlsm, .csv, .tsv). Обрабатывает табличные данные, финмодели и формулы без потери форматирования. CX Codex +1 3 900установок report-builder официальный anthropics Скилл report-builder превращает текстовый запрос в регулярный отчёт с расчётом метрик, выгрузкой в XLSX и краткой сводкой для чата. Сохраняет шаблон, чтобы не описывать правила заново. CX Codex +1 401установок

Из того же набора37

Весь набор →
tres-export-3rd-party-contacts Скилл tres-export-3rd-party-contacts собирает из TRES Finance неопознанные внешние адреса контрагентов и отдаёт XLSX с двумя вкладками: под импорт контактов и с данными по каждому адресу. CX Codex +1 ★ 4 931звёзд репо tres-ledger-link Скилл tres-ledger-link собирает ссылку на вкладку Transactions в дашборде TRES Finance с нужными фильтрами, чтобы отправить её клиенту или открыть самому. CX Codex +1 ★ 4 931звёзд репо tres-asc845-swap-reprice-skill Скилл tres-asc845-swap-reprice-skill пересчитывает стоимость входящих частей свопа по ASC 845, чтобы сумма по счёту клиринга сходилась к нулю. Пригодится при остатке после закрытия месяца. CX Codex +1 ★ 4 931звёзд репо tres-onboarding Скилл tres-onboarding проводит онбординг новой компании или счёта в TRES Finance по восьми шагам: кошельки, сбор данных, сверка балансов, кост-базис, контакты. CX Codex +1 ★ 4 931звёзд репо tres-report-advisor Скилл tres-report-advisor для Claude Code подбирает отчёты TRES Finance под вопрос или рабочую задачу. Срабатывает, когда нужно найти данные, выбрать отчёт или сравнить два отчёта. CX Codex +1 ★ 4 931звёзд репо tres-recon-gaps Скилл tres-recon-gaps вытаскивает расхождения сверки из TRES Finance через MCP, собирает HTML-дашборд с кнопками и закрывает гэпы, которые вы выберете. CX Codex +1 ★ 4 931звёзд репо tres-request-skill-update Скилл tres-request-skill-update собирает отзывы, баг-репорты и идеи для плагина TRES, отправляя структурированные данные через TRES MCP. CX Codex +1 ★ 4 931звёзд репо tres-rollup-review Скилл tres-rollup-review проверяет, какие субтранзакции реально охватит правило rollup в TRES Finance, и находит нулевой результат, пересечения и ошибки настройки. CX Codex +1 ★ 4 931звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой