/plugin marketplace add secondsky/sap-skills/plugin install sapui5@sap-skillsDefined in hooks/hooks.json
{
"PreToolUse": [
{
"hooks": [
{
"type": "prompt",
"prompt": "If writing SAPUI5 code, validate these best practices:\n\n1. **Async Loading**: Use sap.ui.define (not sap.ui.require or jQuery.sap)\n2. **XML Views**: Prefer XML views over JS/HTML views\n3. **Data Binding**: Use data binding to prevent XSS (avoid manual DOM manipulation)\n4. **Namespacing**: Proper namespace in manifest.json and Component.js\n5. **i18n**: All user-facing text in i18n.properties (no hardcoded strings)\n6. **CSP Compliance**: No eval(), inline scripts, or Function() constructor\n7. **Manifest-First**: Configuration in manifest.json (not in code)\n\nProvide brief recommendations if issues found. Ask user if they want to apply fixes.",
"timeout": 30
}
],
"matcher": "Write|Edit"
},
{
"hooks": [
{
"type": "prompt",
"prompt": "If deploying UI5 application, verify:\n\n1. **Build First**: Run ui5 build before deploy\n2. **Component Preload**: Enabled in ui5.yaml\n3. **Production Mode**: Source maps disabled, minification enabled\n4. **Cache Buster**: Enabled for production\n\nWarn user if production deployment without proper build configuration.",
"timeout": 15
}
],
"matcher": "Bash"
}
],
"PostToolUse": [
{
"hooks": [
{
"type": "prompt",
"prompt": "After writing SAPUI5 code, suggest improvements:\n\n1. **Performance**: Consider virtualization for long lists (sap.ui.table.Table instead of sap.m.List for >100 items)\n2. **Accessibility**: Use semantic controls (sap.m.semantic.*), ensure keyboard navigation\n3. **Security**: Validate XSS prevention via data binding, check for direct DOM manipulation\n4. **Testing**: Suggest QUnit for business logic, OPA5 for user journeys\n5. **Error Handling**: Use sap.ui.core.message.MessageManager for consistent error display\n\nProvide brief, actionable suggestions only. Ask user if they want detailed guidance.",
"timeout": 15
}
],
"matcher": "Write|Edit"
}
]
}{
"riskFlags": {
"touchesBash": true,
"matchAllTools": false,
"touchesFileWrites": true
},
"typeStats": {
"prompt": 3
},
"eventStats": {
"PreToolUse": 2,
"PostToolUse": 1
},
"originCounts": {
"absolutePaths": 0,
"pluginScripts": 0,
"projectScripts": 0
},
"timeoutStats": {
"commandsWithoutTimeout": 0
}
}