# Cursor Rules for Bash Scripts
## Rule 1: Update README.md
- **Files**: [README.md]
- **Update File**: bash/README.md
- **Message**: "Update README.md in simplest format with table of latest script with .sh extension, no more information"
## Rule 2: Script Header Documentation
- **Files**: [**/*.sh]
- **Message**: "Every bash script must include a header with:
- Script purpose
- Usage instructions
- Author information with this format [Muhammad Ardivan] ([muhammad.a.s.nugroho@gdplabs.id])
- Dependencies
- Date created/modified with current date in this format DD-MM-YYYY"
## Rule 3: Error Handling
- **Files**: [**/*.sh]
- **Message**: "Implement proper error handling:
- Use set -e for exit on error
- Use set -u for undefined variables
- Include trap commands for cleanup"
## Rule 3: Script Permissions
- **Files**: [**/*.sh]
- **Message**: "Ensure correct script permissions:
- Execute permission (chmod +x) for runnable scripts
- Document any special permission requirements"
## Rule 4: Code Style
- **Files**: [**/*.sh]
- **Message**: "Follow bash scripting best practices:
- Use shellcheck for linting
- Use meaningful variable names
- Add comments for complex logic
- Use functions for reusable code"
## Rule 5: Environment Variables
- **Files**: [**/*.sh]
- **Message**: "Document and validate environment variables:
- List required environment variables
- Provide example .env file if needed
- Validate variables at script start
python
shell
First Time Repository
Python
Languages:
Python: 14.7KB
Shell: 5.7KB
Created: 12/1/2024
Updated: 12/2/2024