Complete restructure from patterns/examples/reference to technology-focused directories: • Created technology-specific directories with comprehensive documentation: - /tdarr/ - Transcoding automation with gaming-aware scheduling - /docker/ - Container management with GPU acceleration patterns - /vm-management/ - Virtual machine automation and cloud-init - /networking/ - SSH infrastructure, reverse proxy, and security - /monitoring/ - System health checks and Discord notifications - /databases/ - Database patterns and troubleshooting - /development/ - Programming language patterns (bash, nodejs, python, vuejs) • Enhanced CLAUDE.md with intelligent context loading: - Technology-first loading rules for automatic context provision - Troubleshooting keyword triggers for emergency scenarios - Documentation maintenance protocols with automated reminders - Context window management for optimal documentation updates • Preserved valuable content from .claude/tmp/: - SSH security improvements and server inventory - Tdarr CIFS troubleshooting and Docker iptables solutions - Operational scripts with proper technology classification • Benefits achieved: - Self-contained technology directories with complete context - Automatic loading of relevant documentation based on keywords - Emergency-ready troubleshooting with comprehensive guides - Scalable structure for future technology additions - Eliminated context bloat through targeted loading 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
32 lines
1021 B
Markdown
32 lines
1021 B
Markdown
# Bash Scripting Patterns
|
|
|
|
## Script Structure
|
|
- Use proper shebang (`#!/bin/bash`)
|
|
- Set error handling (`set -euo pipefail`)
|
|
- Include help/usage functions
|
|
- Implement proper argument parsing
|
|
|
|
## Best Practices
|
|
- **Input validation** before processing
|
|
- **Logging and error messages** to stderr
|
|
- **Exit codes** for script status
|
|
- **Function-based organization** for reusability
|
|
|
|
## Common Patterns
|
|
- **Service management** with systemd integration
|
|
- **Backup scripts** with rotation and compression
|
|
- **Deployment automation** with rollback capabilities
|
|
- **System monitoring** with alerting
|
|
|
|
## Security Considerations
|
|
- Avoid hardcoded credentials
|
|
- Use proper file permissions
|
|
- Sanitize user inputs
|
|
- Quote variables to prevent word splitting
|
|
|
|
## Related Documentation
|
|
- Examples: `/examples/bash/service-management.md`
|
|
- Examples: `/examples/bash/backup-scripts.md`
|
|
- Examples: `/examples/bash/deployment-automation.md`
|
|
- Reference: `/reference/bash/troubleshooting.md`
|
|
- Reference: `/reference/bash/security.md` |