From 4d06ceb223fc99453c8314dc1f3ff96585beac60 Mon Sep 17 00:00:00 2001 From: Julian Lechner Date: Thu, 24 Sep 2026 19:11:04 +0200 Subject: [PATCH] docs(skill): clarify SQL skill triggers --- shared/skills/implementation/sql-write/SKILL.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/shared/skills/implementation/sql-write/SKILL.md b/shared/skills/implementation/sql-write/SKILL.md index 5ad09ef..86c7530 100644 --- a/shared/skills/implementation/sql-write/SKILL.md +++ b/shared/skills/implementation/sql-write/SKILL.md @@ -1,12 +1,19 @@ --- name: sql-write -description: Implement a focused SQL change safely. +description: Use when writing or modifying SQL queries, schema, database migrations, or data updates; account for dialect, compatibility, authorization, and data safety. --- # SQL Write -Understand the schema and affected data before writing SQL. +Use when writing or changing SQL statements, schema definitions, or database migrations. -Use the smallest complete change, preserve data safety, and run relevant verification. +## Workflow -Do not execute destructive operations without explicit authorization. +1. Identify the database engine and version, target schema, affected callers, and expected data shape. Inspect existing migrations and SQL style first. +2. Parameterize values and validate any dynamic identifiers against an allowlist. Preserve tenant boundaries and authorization filters in every query path. +3. For schema changes, consider existing rows, nullability, defaults, constraints, indexes, and deployment order. Prefer additive, backward-compatible steps when old and new application versions may overlap. +4. Use transactions and explicit rollback or recovery steps where supported and appropriate. Estimate affected rows before broad updates or deletes. +5. Do not execute destructive or production SQL without explicit authorization. A request to write SQL does not authorize running it against live data. +6. Verify syntax and behavior against the intended engine, then inspect query results, migration ordering, and relevant application tests. + +Report the database dialect, files or migration changed, verification, and any operational prerequisite.