/datalens-skills:datalens-platformfrom datalens-skills
Handles storage and data-processing tasks in DataLens Platform: REST Catalog, data transfers, saved SQL queries, Spark jobs, Airflow orchestration, CloudEnv storage, and DLP access troubleshooting.
Ships in datalens-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
DataLens Platform (DLP) is an extension of DataLens for data storage and processing.
Before inspecting data or running a saved analysis, verify that SQL read access is enabled in the connection settings.
Use an existing DLP connection to an external database to inspect its tables,
columns, and data through SQL. This helps select the tables to load when configuring
data transfers, especially Copy transfers with incremental cursor columns
and optional initial values. Prefer an update timestamp such as update_dt after verifying
that it tracks relevant changes. If no update timestamp exists, consider a creation
timestamp such as create_dt or a monotonically increasing id for append-only data.
For a first load of the full history, leave initialState empty (unset).
Inspect the source to choose an explicit initial value only when a bounded
starting point is required.
There are two SQL execution paths for DLP Trino:
| Task | Execution path |
|---|---|
| Ad-hoc analytics with queries stored in DataLens | Save the SQL query and execute it through /rpc/runSqlQuery in the DataLens API. |
| Reliable ETL with SQL scripts versioned in Git | Get the cluster's coordinatorUrl through /rpc/getTrinoCluster and execute the SQL directly using the Trino client REST API. Authenticate with a Yandex Cloud IAM token in Authorization: Bearer <IAM_TOKEN>. |
For example, send this request over HTTPS, replacing the example Host with the
host from the selected cluster's coordinatorUrl and <IAM_TOKEN> with a valid
IAM token at runtime:
POST /v1/statement HTTP/1.1
Host: trino-5k28nxzm6b54o.proxy.lakehouse.yandexcloud.net
Authorization: Bearer <IAM_TOKEN>
Content-Type: text/plain; charset=utf-8
Accept: application/json
SELECT 1 AS ok
For direct execution, submit one SQL statement at a time to /v1/statement,
in script order. Follow nextUri until absent and check for errors before sending
the next statement or releasing dependent tasks. Prefer an existing Trino client
that implements this protocol when suitable.
Avoid unintended Cartesian products. When using CROSS JOIN, confirm that the
Cartesian product is intended and that the expected row count is appropriate;
a single-row aggregate is a valid case.
Always use TRUNCATE TABLE when the user requests a complete cleanup of a table's
rows. Preserve the table definition. Do not substitute an unconditional DELETE FROM
or a drop-and-recreate operation. If the selected engine or connector does not support
TRUNCATE, report that limitation and resolve the alternative with the user.
Make DAGs parallel. Run independent tasks in parallel and add edges only for actual data or operational dependencies. Control concurrency separately with DAG limits or pools; do not serialize unrelated tasks to limit load. Ensure the final success/checkpoint task waits for every required branch.
In DLP, Apache Airflow is the orchestrator, not an execution environment for arbitrary Python data-processing code. Use Spark to run Python code for ingestion, API calls, transformations and data checks. Use Airflow to schedule, launch and monitor those jobs, manage dependencies and coordinate retries; do not recommend executing the data-processing Python code inside Airflow tasks.
When the API has no dedicated method for obtaining an object's ID, inspect the
published searchObjects method and search by the known name and object type.
Verify the candidate's name, type and parent path/catalog before using its ID;
resolve ambiguous matches rather than choosing the first result.
Search results may store the resource ID inside asset.payload, not in the search
result's own ID. For REST Catalog namespaces, the verified pattern is
searchObjects({query: "source_", objectType: "rest-catalog-namespace", pageSize: 100}):
check the catalog in asset.path and extract JSON.parse(asset.payload).id.id.
Treat this payload path as type-specific; inspect the returned structure for other
object types. Keep only requested metadata, names, paths and identifiers in output,
not embeddings or unrelated payloads. Record confirmed IDs and the lookup method
using the project's existing memory mechanism, when available.
Use searchObjects to retrieve object metadata as well as IDs. Search results can
include descriptions, documentation, tags, terms, domains and service-specific metadata
inside asset.payload. Parse this JSON string before reading its fields.
For REST Catalog tables, search with objectType: "rest-catalog-table" and inspect
JSON.parse(asset.payload).schemaMetadata.fields: it can contain column names
(fieldPath), native data types (nativeDataType), nullability (nullable) and
column documentation. Preserve any indication that documentation was AI-generated.
Metadata availability and payload structure depend on the object type; report only
what the search actually returned.
Configure regular supplies exclusively through config.type.regular.tables. Include
one entry for every source table with tableNamespace, tableName and an explicit,
non-empty cursorColumn. Use a
change timestamp such as updated_at only after confirming that it is populated and
advances for every relevant update. Do not use created_at for mutable rows.
An empty regular.tables combined with the top-level config.tables list performs
repeated full copies and can append complete duplicates on every scheduled run.
Do not use the top-level table list as a substitute for incremental settings. When
editing an existing full-copy transfer, clear that list as required by the API and
read the configuration back to confirm every cursor and the intended schedule.
For a first load of the full history, leave initialState empty (unset), so copying
starts at the earliest available value. If an explicit starting point is required,
PostgreSQL regular transfers evaluate initialState as a SQL expression.
JSON string quotes alone do not quote a timestamp in SQL: include the SQL single quotes
inside the JSON string. For example, a table entry for a timestamp cursor is:
{
"tableNamespace": "public",
"tableName": "orders",
"cursorColumn": "updated_at",
"initialState": "'1970-01-01T00:00:00Z'"
}
The unquoted value "initialState": "1970-01-01T00:00:00Z" caused PostgreSQL error
42601 (trailing junk after numeric literal) while preparing the incremental state.
Use an expression compatible with the cursor column's source type; do not assume
other source connectors use the same format. Read the saved value back and verify a
successful run before considering a cursor-format correction complete.
Cleaning target tables does not prove that a transfer's stored cursor has reset: verify reset semantics, or recreate the transfer when authorized. Historical backfills with timestamps older than the current cursor need an explicit reload plan.
After the first load, verify that a run over unchanged sources adds no repeated full
copy, and that new or changed rows are captured. Do not report success from configuration
alone. Do not assume that deactivateDataTransfer disables a regular schedule: check
for subsequent automatic runs before clearing targets or claiming a persistent stop.
If a deletion target set is discovered through SDK/MCP/API calls rather than supplied as an explicit input list by the user, show the concrete objects (type, name and ID) and obtain confirmation before deleting them.
Use yc iam whoami when the task
requires the authenticated subject, or to diagnose identity, createdBy or refresh-token
errors.
For the identity used by DLP, pass the same explicit YC profile and environment as the DLP call.
Obtain the attached Airflow service account's IAM token inside a DAG task using
the IAM-token example: Prepare the DAG file and run the graph.
Do not copy the example's token logging into task code or return tokens through XCom.
For Python implementation, load datalens-sdk and use the references shipped with
the installed package: references/setup.md, references/sql-queries.md,
references/spark-applications.md, references/lakehouse-operations.md, and
references/cloud-environment-storage.md. Use those version-matched references
for executable recipes; this skill defines the orchestration requirements.
When setting up Airflow, a recommended deployment option is to bundle the DataLens SDK with the DAGs in the S3 location or Git repository that Airflow reads. Ensure the SDK and its dependencies are importable by the DAG parser and workers; uploading an uninstalled archive alone is insufficient. For managed dependency installation, use the cluster's Pip packages setting.
Use this path when the SQL is stored as a DataLens query. For SQL maintained in Git or executed without saving, follow SQL connections and execution above.
Fetch the saved query with client.get.sql_query(by_id=...) and execute it with
query.run(params=...), using its declared parameter names and types.
The return value is not proof of success: error, partial_success, and pending
are ordinary result statuses, not SDK exceptions. Require status == "success"
and no SqlQueryStatementError in results before allowing dependent tasks to run.
Propagate failed or partially successful runs as Airflow task failures, including
the run ID and relevant statement error codes. For pending, fail with an explicit
unfinished-execution message; do not report success or call run() again to poll.
The current SDK exposes no saved-query run-polling method. Verify remote execution
before retrying a request whose outcome is unknown.
SparkCluster.id), not its managed cloud
ID (SparkCluster.cluster_id). For a Python file already in CloudEnv storage,
form main_python_file_uri as dlp://<cloud_environment_id>/<object_key>,
for example dlp://<cloud_environment_id>/script.py. Use the selected CloudEnv's
ID and the uploaded file's actual object key. Pass this URI directly to
.pyspark(main_python_file_uri=...).client.create.spark_application(...).pyspark(...).build().
Save the operation ID for diagnosis. operation.wait() waits only for submission;
check the returned snapshot's .error even when .done is true.status through get/refresh() with a bounded
deadline. DONE permits dependent tasks; ERROR and CANCELLED fail the task.
Other states are unfinished and must not release dependents. There is no
SparkApplication.wait(); use the installed SDK references for these calls.Keep SDK clients and bound models inside the executing task. Return only small,
serializable ID/status values through XCom, or use do_xcom_push=False when no
output is needed; never return a bound LakehouseOperation or the full SQL result.
Use retries=0 for non-idempotent submissions unless duplicate execution is handled
explicitly. These checks must gate downstream tasks; successful submission alone
does not establish successful execution. Report DataLensAPIError.context.request_id
when handling an API failure.
Use CloudEnv storage for Spark job files. You may use CloudEnv storage for Airflow DAGs.
Access the selected CloudEnv's S3 storage through
the DLP API using the storage workflow of the selected
official execution skill (references/cloud-environment-storage.md in the SDK skill).
Discover existing DAG object paths before uploading; do not overwrite unrelated DAGs. Do not ask for or store the CloudEnv
S3 location in project memory. Artifact configuration may contain object paths required
for deployment; resolve the storage from the selected CloudEnv and API.
For DLP work requiring project state, follow the agent's memory mechanism and existing
project conventions. Read existing context and the user's current instructions first.
Record confirmed non-secret resource IDs and artifact paths through that mechanism.
A separate memory.md is optional; use it only when requested or already conventional
in the project, preserving confirmed values unless the user corrects them.
Ask only relevant unanswered questions below, using the user's language. Present them together as a short optional questionnaire (or group them within the input tool's limits). Say explicitly that the user may answer any subset or skip the entire questionnaire. Do not run this onboarding for documentation-only work.
| Context field | Question |
|---|---|
organization | Which DLP organization ID (org_id) should be used? Provide the ID; an organization name is not sufficient. |
data-processing code repository | Where is the data-processing code stored? Provide a repository or local path. |
Airflow scheduling repository, Airflow DAG folder | Only if the user selects Git instead of CloudEnv S3: which repository, branch and DAG folder should be used? |
repository access | If Git is selected, how should the repository be accessed? Provide the method and a non-secret reference such as an SSH key path, SSH alias or CLI profile. Do not send key contents or tokens. |
For declined, omitted or unanswered fields, leave UNKNOWN; do not invent answers or
fill them from defaults. Record an explicit skip separately from the field value so
future starts do not repeat a declined question. No response leaves the questionnaire
unanswered, not approved. Continue independent work while awaiting optional answers;
the questionnaire itself must not block the task. A skipped field may be requested
later only when a concrete operation requires it; explain why, and keep that dependent
operation pending until the fact is resolved.
The user can fill or correct project context at any time.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
6 skills in this plugin
/datalensStart here for Yandex DataLens and DataLens Platform (DLP) when the task has not yet settled on a tool, or when the question is about DataLens itself rather than about carrying something out in it: what DataLens is and what it can do; which installation is in play — Yandex Cloud, on-premise, or the internal Yandex Team one — and how they differ in hosts, auth, and capabilities; what a collection, workbook, connection, dataset, chart, or dashboard is and how they relate; and whether to reach for the MCP server, the Python SDK, the HTTP API, or the web UI. Use it to orient and to route to the skill that does the work. NOT for doing the work once the approach is chosen — that is `datalens-sdk` for Python and `datalens-html-pages` for standalone HTML reports — and not for interpreting what business metric values mean. For DLP storage and processing, load `datalens-platform`./datalens-html-pagesUse this skill to build, fix, or publish a standalone HTML page or report in DataLens. DataLens takes a whole self-contained HTML document — often an AI-generated report with tables, charts, and a CSV/download button — and renders it in a sandboxed, CSP-locked iframe, so normal web code silently breaks. Reach for it when generating such a page from scratch, and when one already in DataLens misbehaves: images, fonts, scripts, or CDN libraries blocked or throwing Content-Security-Policy errors; fetch/XHR/localStorage failing; charts blank; a download or Export button doing nothing; an upload rejected as too large or the wrong encoding; or the page needing to match the user's DataLens theme (light/dark) and language (ru/en); or embedding a Yandex map. Also covers which CDNs and hosts are allowed and making the page fully self-contained. Not for DataLens chart cells or HTML-markup table columns./datalens-onprem-installInstall, configure, troubleshoot, update, or remove the commercial DataLens On-premises distribution using current docs. Use for single-node K3s setup, sizing, interrupted installs, feature changes, Public API, service accounts, MCP, LDAP/OIDC, and backup or restore. Not for Yandex Cloud, Yandex Team, the Open Source edition, or building charts and dashboards./datalens-sdkUse this skill for any Yandex DataLens automation task through the Python package `datalens-sdk`. Trigger on: DataLens, datalens, даталенс, chart, чарт, график, dashboard, дашборд, dataset, датасет, connection, подключение, workbook, воркбук, collection, коллекция, wizard chart, QL chart, editor chart, BI automation, автоматизация DataLens, "create a dashboard", "построй дашборд", "создай чарт", "export dataset", or "clone dashboard"; entity ids such as dataset_id, chart_id, dashboard_id, or workbook_id; and requests to create, update, inspect, import, export, copy, or diagnose DataLens objects with code. NOT for: business questions about metric values; viewing or screenshotting the DataLens web UI; embedding or iframes; raw SQL/YQL analysis that does not manage DataLens entities; raw HTTP API calls; standalone HTML pages or reports, except publishing or managing them through this SDK./datalens-yc-rls-resolveUse this skill when a DataLens user on datalens.ru (Yandex Cloud) needs to resolve user, email, service-account, or Cloud Organization group names into RLSv2 subject IDs, fill the `rls2` field, or migrate a legacy `rls` configuration.npx claudepluginhub datalens-tech/datalens-skills --plugin datalens-skillsOther plugins' skills for the same job