implement-connector
БесплатноБез исполняемых скриптовНе проверенSingle step only: implement the connector in Python when the API doc already exists. Do NOT use for full connector creation — use the create-connector agent…
Об этом скилле
Implement the Connector
Goal
Implement the Python connector for {{source_name}} that conforms exactly to the LakeflowConnect interface defined in
lakeflow_connect.py. The implementation should be based on the source API documentation in src/databricks/labs/community_connector/sources/{source_name}/{source_name}_api_doc.md produced by the research-source-api skill.
CRITICAL REQUIREMENT: Refer to src/databricks/labs/community_connector/sources/example/example.py for concrete examples of different patterns. You should follow the patterns demonstrated in the example connector.
File Organization
For simple connectors, keeping everything in a single {source_name}.py file is perfectly fine. If the main file grows beyond 1000 lines, split it into multiple files for better maintainability.
Implementation Requirements
- Schema: In
get_table_schema, preferStructTypeoverMapTypeto enforce explicit typing. Avoid flattening nested fields. PreferLongTypeoverIntegerTypeto avoid overflow. Do not convert the JSON into dictionaries based on the schema before returning inread_table; return the raw parsed JSON and let the framework handle type coercion. - Metadata: If
ingestion_typereturned fromread_table_metadataiscdcorcdc_with_deletes, bothprimary_keysandcursor_fieldare required. - Deletes: If
ingestion_typeiscdc_with_deletes, you must implementread_table_deletes(). This method should return records with at minimum the primary key fields and cursor field populated. - Data Processing: If a StructType field is absent in the response, assign
Noneas the default value instead of an empty dictionary{}. - Table Options: Do not include parameters required by individual tables in the global connection options; rely on
table_optionsinstead. - API Usage: If a data source provides both a list API and a get API for the same object, always use the list API. Only call the get API for individual entries if explicitly requested. For child objects that require a parent identifier, list the parent objects first, then list child objects for each parent, and combine the results.
Incremental read_table with offsets
For incremental ingestion of tables (cdc and append_only), the framework calls read_table repeatedly within a single trigger run. Each call produces one microbatch. A trigger run stops when the returned end_offset equals start_offset.
This termination condition is critical for Trigger AvailableNow. The connector runs under Trigger.AvailableNow, which issues microbatches until the source reports "no more data available" — signalled by read_table returning end_offset == start_offset. If the connector keeps advancing the offset (e.g. by chasing continuously-arriving new data), the trigger never terminates and the pipeline hangs. Every incremental connector must guarantee this condition is reached — see Guaranteeing Termination below.
Admission Control: max_records_per_batch
Every incremental table must support a max_records_per_batch table option. This caps how many records a single read_table call returns to the framework, giving Spark a bounded microbatch to process. Without it, a single call could return millions of rows and overwhelm the Spark driver.
This is orthogonal to the query-scoping strategies below. Regardless of whether you use a sliding window, a server-side limit, or neither, you must still respect max_records_per_batch by stopping record accumulation once the count is reached.
Exception — best-effort enforcement: When the API does not support ascending sort and a sliding time-window is used (see below), max_records_per_batch becomes best-effort. The window must be drained completely to avoid skipping or duplicating records, so the actual batch size is governed by window_seconds rather than a strict record count.
Ascending Sort Order Requirement
When a connector stops mid-way (due to max_records_per_batch or page limits), it checkpoints the max cursor value and resumes with since=<that value>. This only works if the API returns records sorted ascending by the cursor field. With descending order the max cursor comes from the first record, so since never advances — creating an infinite loop of re-fetching the same data.
When the API does not support ascending sort, use one of:
- Sliding time-window (Strategy A below): Query with both
sinceanduntilso sort order within the window doesn't matter — the cursor advances to the window end regardless. In this modemax_records_per_batchis best-effort since the entire window must be drained. - Full read per batch: Read all available data in a single batch and use the current time as the
sincefilter for the next call. This avoids the sort-order problem entirely but only works for sma
Установить implement-connector в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл implement-connector?
Single step only: implement the connector in Python when the API doc already exists. Do NOT use for full connector creation — use the create-connector agent instead.
Как установить скилл implement-connector?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл implement-connector запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic