/plugin marketplace add secondsky/sap-skills/plugin install sap-datasphere@sap-skillsDefined in hooks/hooks.json
{
"PreToolUse": [
{
"hooks": [
{
"type": "prompt",
"prompt": "If writing SQL or SQLScript for SAP Datasphere (views, procedures, or data models), validate the following best practices BEFORE the write:\n\n1. **No hardcoded schema names** - Schema names should not be embedded in SQL; use DEFAULT SCHEMA or space context\n2. **Proper semantic annotations** - Check that views intended for analytics have appropriate semantic usage comments (Fact, Dimension, Relational Dataset)\n3. **Association naming conventions** - Foreign key columns should follow pattern: <ENTITY>_ID for clear association mapping\n4. **Data access control consideration** - If sensitive data (employee, financial, customer), note that Data Access Controls may be needed\n5. **Column naming** - Use UPPER_SNAKE_CASE for technical names, provide readable business names in aliases\n6. **Null handling** - Use COALESCE or NULLIF for measure calculations to prevent null propagation\n7. **Date handling** - Use explicit CAST for date conversions, avoid implicit type conversions\n\nIf any issues found, provide brief recommendations. If code looks good, silently approve.",
"timeout": 30
}
],
"matcher": "Write|Edit"
}
],
"PostToolUse": [
{
"hooks": [
{
"type": "prompt",
"prompt": "If SAP Datasphere SQL, view definition, or data model code was just written, provide helpful suggestions for the user to consider:\n\n1. **View Persistence** - For views with complex joins or large result sets, consider enabling view persistence with snapshot or real-time refresh\n2. **Partition Strategy** - For fact tables with >1M rows, suggest time-based or range partitioning\n3. **Statistics** - Remind to enable automatic statistics collection for tables used in complex queries\n4. **Index Candidates** - If WHERE clauses filter on specific columns frequently, note potential index candidates\n5. **Lineage Documentation** - Suggest documenting source-to-target lineage in view comments\n6. **Testing** - Recommend using Data Preview to validate transformations before deployment\n\nKeep suggestions brief and actionable. Only mention applicable suggestions.",
"timeout": 15
}
],
"matcher": "Write|Edit"
}
]
}{
"riskFlags": {
"touchesBash": false,
"matchAllTools": false,
"touchesFileWrites": true
},
"typeStats": {
"prompt": 2
},
"eventStats": {
"PreToolUse": 1,
"PostToolUse": 1
},
"originCounts": {
"absolutePaths": 0,
"pluginScripts": 0,
"projectScripts": 0
},
"timeoutStats": {
"commandsWithoutTimeout": 0
}
}