abap-cds-model-check
Optional intended usage such as analytical, transactional, reuse, value-help, or extraction
Validates SQLScript code for syntax, patterns, and best practices with auto-fix capability
$ npx -y skills add secondsky/sap-skills --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
/sqlscript-validateContext preview
What this command does when you run it.
Validates SQLScript code for syntax, patterns, and best practices with auto-fix capability
name: sqlscript-validate description: Validates SQLScript code for syntax, patterns, and best practices with auto-fix capability allowed-tools: - Read - Grep argument-hint: "<file_path|--all> [--fix]"
Return syntax, security, performance, and style findings with file references and suggested fixes. Default to read-only validation; use `--fix` only when explicitly requested and exact files are confirmed.
Validate SQLScript code for syntax errors, pattern violations, and best practices. Reports issues and offers to auto-fix common problems.
/sqlscript-validate [file_path] /sqlscript-validate [file_path] --fix /sqlscript-validate --all
1. **Read the specified file(s)** 2. **Parse SQLScript structure** 3. **Run validation checks** in order:
4. **Categorize findings** by severity 5. **Report issues** with line numbers 6. **Offer auto-fixes** for applicable issues
The following issues can be auto-fixed:
| Issue | Auto-Fix Action | |-------|-----------------| | Missing EXIT HANDLER | Add generic exception handler | | Unclosed cursor | Add CLOSE statement in finally block | | Missing semicolon | Add semicolon at statement end | | SELECT * in procedure | Cannot auto-fix (requires column selection) | | Hardcoded schema | Replace with parameter or DEFAULT SCHEMA | | Missing LANGUAGE SQLSCRIPT | Add the clause |
## SQLScript Validation Report **File**: [filename] **Lines**: [count] **Status**: [PASS/FAIL] ### Critical Issues (X found) 1. [Line X]: [Issue description] **Current**: `[code snippet]` **Fix**: `[corrected code]` **Auto-fix available**: Yes/No ### Warnings (X found) [Similar format] ### Suggestions (X found) [Similar format] ### Summary - Critical: X - Warnings: X - Suggestions: X ### Auto-Fix Available Would you like me to automatically fix the X issues that have auto-fix available?
/sqlscript-validate src/procedures/get_orders.sql
/sqlscript-validate src/procedures/get_orders.sql --fix
/sqlscript-validate --all
When this command is invoked:
1. If a file path is provided, read that file 2. If `--all` is specified, find all `.sql` files and `.abap` files containing AMDP 3. For each file:
4. Present findings in the format above 5. If `--fix` is specified or user confirms, apply auto-fixes 6. After fixes, re-validate to confirm resolution
-- BAD: No error handling
CREATE PROCEDURE test()
AS
BEGIN
INSERT INTO table VALUES (1);
END;
-- GOOD: Has error handling
CREATE PROCEDURE test()
AS
BEGIN
DECLARE EXIT HANDLER FOR SQLEXCEPTION
SELECT ::SQL_ERROR_CODE, ::SQL_ERROR_MESSAGE FROM DUMMY;
INSERT INTO table VALUES (1);
END;-- BAD: Cursor not closed OPEN cur; FETCH cur INTO var; -- Missing: CLOSE cur; -- GOOD: Cursor properly closed OPEN cur; FETCH cur INTO var; CLOSE cur;
-- BAD: Hardcoded schema SELECT * FROM "MYSCHEMA"."MYTABLE"; -- GOOD: Use DEFAULT SCHEMA or parameter SELECT * FROM "MYTABLE"; -- With DEFAULT SCHEMA clause
40 SAP development plugins with evidence-tracked verification SAP development plugins for AI coding assistants, with public-source or package-registry verification tracked where available.
Repo: secondsky/sap-skills
Optional intended usage such as analytical, transactional, reuse, value-help, or extraction
Optional target ABAP platform or SAP BTP ABAP Environment release
Optional runtime or scenario name, such as orchestration, serving, training, or batch
Optional scenario lens such as extension, integration, analytics, or AI