Add Custom Code Rules
What are Custom Code Rules?
Creating a Custom Code Rule
3
5
Configure rule details
Use Alpine base images in Docker containersNon-Alpine base images increase container size and attack surfaceReplace your base image with an Alpine Linux variant. For example, change 'FROM node:18' to 'FROM node:18-alpine'. You may need to adjust package installation commands from apt-get to apk.
Writing effective Custom Rules
Be specific and clear
Use proper error handlingAll API endpoints must wrap database calls in try-catch blocks and return
standardized error responses with status codesFocus on patterns, not style
Common Custom Rule examples
Security rules
Architecture rules
API standards
Testing requirements
Documentation standards
Last updated
Was this helpful?