The current version is #ident "@(#)$Format:LocalFoodAI_lanfr144:SKILL.md:%an:%ae:%ad:%cn:%ce:%cd:%H:%D:%N$"
name: sql-optimizer
When reviewing, optimizing, or generating SQL code (MySQL, Oracle, PostgreSQL), enforce these strict database guidelines:
EXPLAIN PLAN, tkprof).Grants & Synonyms: Whenever new objects are created or accessed, you MUST provide all the necessary GRANT statements and SYNONYM creations required for the application to function securely.
No Auto-Commit: Disable auto-commit. Explicitly manage transactions with COMMIT and ROLLBACK blocks.
") or back-quoted (`) to avoid collisions with reserved words. Warn if a name matches a V$RESERVED_WORDS in Oracle.V$RESERVED_WORDS).DBMS_METADATA and DBMS_METADATA_DIFF to calculate and apply exact differences.EXCEPTION blocks in PL/SQL) to capture, manage, and log database errors gracefully. Do not allow silent failures.Header Tag Requirement: Every source code, scripting, config, or text file (including ignored scratch files) must include the exact identity format at the top of the file:
i d e n t " @ ( # ) $ F o r m a t : { p r o j e c t _ n a m e } : { f i l e _ n a m e } : % a n : % a e : % a d : % c n : % c e : % c d : % H : % D : % N $ "
Note: In the template above, the character sequence has been intentionally formatted with spaces between each character (representing the sed transformation s/./& /g). This prevents Git's clean/smudge filters from matching, interpreting, and modifying this rule documentation file itself.
For tracked files, the Git smudge filter (ident-dynamic) will automatically expand the placeholder variables with real Git commit and author/committer data during checkouts. Untracked or ignored scratch files must still physically carry this header comment as a repository consistency requirement.
The comment syntax must match the file's language (e.g., # for Python/Shell/YAML/Markdown/Dockerfiles, -- for SQL, :: for Batch). For tracked files, the git smudge filter expands this dynamically. Ignore-listed/scratch files must carry the comment statically for structure.
Adapt the comment syntax (e.g., "//", "#", "--", "`", "!", "REM", "/* */") to the specific language. Exception: For executable scripts requiring a shebang (e.g., #!/bin/bashor#!/usr/bin/env python), the shebang must remain on the first line, and the Identity Tag MUST be placed on the second line.
To initialize a new file, place the clean version at the top of your file (legible examples are listed below in spaced-out format to prevent active smudge filter matching):
# i d e n t " @ ( # ) $ F o r m a t : G i t p r o j e c t n a m e : f i l e n a m e : % a n : % a e : % a d : % c n : % c e : % c d : % H : % D : % N $ "- - i d e n t " @ ( # ) $ F o r m a t : G i t p r o j e c t n a m e : f i l e n a m e : % a n : % a e : % a d : % c n : % c e : % c d : % H : % D : % N $ ": : i d e n t " @ ( # ) $ F o r m a t : G i t p r o j e c t n a m e : f i l e n a m e : % a n : % a e : % a d : % c n : % c e : % c d : % H : % D : % N $ "# i d e n t " @ ( # ) $ F o r m a t : G i t p r o j e c t n a m e : f i l e n a m e : % a n : % a e : % a d : % c n : % c e : % c d : % H : % D : % N $ "