Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

kysely-converter

БесплатноБез исполняемых скриптовНе проверен

Convert raw SQL into type-safe Kysely TypeScript, write Kysely queries from requirements without source SQL, modify or refactor existing Kysely code, and…

buYoungот buYoung★ 21 звезда на GitHub19 установок в других каталогах

Об этом скилле

Kysely Query Workflow

Translate query intent into Kysely code using the project's schema types, dialect, and installed API. Source SQL is optional. Keep SQL semantics and the application's result contract visible throughout the task.

1. Classify the request

  • Convert SQL: identify input parameters, clauses, and expected output columns before mapping methods.
  • Write a query: derive tables, relationships, filtering, cardinality, ordering, and desired result shape from requirements; ask for missing schema or business rules that determine the query.
  • Modify or refactor: identify the intended behavior change, or preserve behavior for a refactor. Read the existing builder, helpers, execution site, and result consumer.
  • Diagnose types: obtain the exact error, failing expression, relevant table types, and expected result. Follow the diagnostic order below rather than guessing a replacement type.

2. Establish project context and version

Inspect the relevant project package manifest, installed Kysely package metadata when available, lockfile resolution, TypeScript version, database dialect/server version, driver, schema types, and nearby query code. A dependency range is not an exact installed version. Account for workspace-specific resolutions and plugins that transform queries or results.

Use the user's requested version together with installation and lock information. If they conflict, ask which version to target before choosing APIs. If no version can be confirmed, explicitly state “Assuming Kysely 0.29.9” and proceed with that baseline; do not present it as the installed version. Missing dialect, schema, or return requirements still need clarification when they affect correctness.

For 0.29.x, read the version reference before selecting APIs. For another version, verify relevant APIs against that version's official release notes and tagged source/declarations. Do not apply the 0.29 reference as proof of compatibility with older or later versions, or silently upgrade the project.

3. Select references

Read only the topics required by the request, alongside the applicable version reference.

Need Reference
Selection, aliases, joins, subqueries, CTEs, aggregation, pagination, conditional selection SELECT
Schema read/write types, inserted values, conflict handling, insertion results INSERT
Assignments, update joins, affected rows, update results UPDATE
Delete predicates, USING/JOIN, deletion results DELETE
Boolean grouping, NULL, BETWEEN, values versus references, raw predicates Operators
Ranking, value/aggregate windows, frames, top-N-per-group Window functions
Runtime requirements, changed/removed APIs, patch differences Kysely 0.29

For type errors, start with the shared type contract, then read SELECT for scope/result inference and the reference for the failing operation.

4. Convert, write, modify, or diagnose

Preserve query meaning

For SQL conversion, map clauses without changing boolean parentheses, NULL/three-valued logic, join kind or predicate placement (ON versus WHERE), duplicate rows, grouping, ordering, pagination, selected columns, or aliases. Preserve UNION versus UNION ALL and COUNT(*) versus COUNT(column). Do not add DISTINCT, filters, limits, or an arbitrary ordering to conceal uncertain semantics. Explain nondeterministic source pagination or representative-row selection.

For a new query, settle those same choices from the requirements. Prefer expression-builder callbacks for scoped references and dedicated methods for supported syntax. Bind data values; use a sql fragment when the target API cannot express the required syntax. Check database support separately from Kysely method availability.

When modifying code, follow the query through helpers to execution and result use. Retain the intended result shape (array, first row, optional row, or mutation metadata), transaction instance, plugins, and execution options unless the requested change requires otherwise. A builder-returning helper should remain a builder-returning helper when the request only changes its query.

Diagnose type errors in order

  1. Schema types: compare table/column names and read/insert/update types, including Generated, ColumnType, Insertable, and Updateable. Check driver-returned numeric, date, and JSON values separately.
  2. Reference scope: check tables and aliases visible at the failing callback, correlated subqueries, CTE outputs, and outer-join nullability. Prefer callback-local eb.fn when function arguments need the current query scope.
  3. Expression types: distinguish values from references; check scalar sub
Полный SKILL.md на GitHub

Установить kysely-converter в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

LICENSEreferences/delete.mdreferences/insert.mdreferences/kysely-0.29.mdreferences/operators.mdreferences/select.mdreferences/update.mdreferences/window_function.md

FAQ

Что делает скилл kysely-converter?

Convert raw SQL into type-safe Kysely TypeScript, write Kysely queries from requirements without source SQL, modify or refactor existing Kysely code, and diagnose Kysely type errors. Use for SELECT, INSERT, UPDATE, DELETE, joins, CTEs, expressions, and window functions with version-aware SQL dialect handling. Excludes migration operations and work on other query builders.

Как установить скилл kysely-converter?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл kysely-converter запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

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

Сравнить kysely-converter с