← Files SQL CopilotARCHIVED FILE

skills/safe-sql-writes/SKILL.md

1.6 KB · Nov 30, 2026 · 06:40 UTC

↓ Download file

See the change to this file →

---
name: safe-sql-writes
description: Review and generate carefully scoped UPDATE, DELETE, INSERT and MERGE operations.
---

# Safe Sql Writes

**Trigger:** Review and generate carefully scoped UPDATE, DELETE, INSERT and MERGE operations.

## Workflow
1. Classify target, environment, authorization, row-scope and reversibility before any write guidance.
2. Produce a READ-ONLY preview of the exact target row set and affected row counts; include duplicate-match checks for UPDATE FROM/MERGE.
3. Explicitly separate read-only preview queries from potentially mutating SQL with an unmistakable warning heading.
4. Recommend transaction/backup/snapshot/restore strategies only when they actually apply to the dialect and operation.
5. For remote execution, require appropriate user authorization, least privileges and confirmations; do not execute directly through unspecified tools.

## Critical standard
Never present broad unqualified destructive SQL as harmless. Match preview predicates to the proposed write.

## Evidence and execution
Only say "executed", "passed", "observed", "optimized" or "deployed" when a connected tool returned evidence for that claim. An SQL draft, a textual review, or local fixture proof alone is not production validation. Never ask the user to paste passwords or raw confidential records.

## Supporting references
- Read `../../references/safe-write-checklist.md` when relevant.
- Read `../../references/original/sql_write_change_playbook.md` when relevant.
- Read `../../references/dialects.md` when relevant.

## Return
Scope statement, preview SQL, validation gates and separate optional write SQL.

SHA-256: 83f726f78562bca2f9008ace9f72a85f52e9c818d41b776e494343d860c7a8f1