# Brewfile Organization Standards
## Rule
All Brewfiles MUST be organized into named sections with comment headers, declare taps explicitly, pin version-sensitive packages, and include purpose comments for non-obvious entries.
## Format
```ruby
# Brewfile — Organized in this order:
# ─── Taps ──────────────────────────────────────────
tap "homebrew/bundle"
tap "homebrew/services"
# ─── CLI Essentials ────────────────────────────────
brew "git" # Version control
brew "gh" # GitHub CLI
# ─── Development ───────────────────────────────────
brew "volta" # Node.js version manager
brew "python@3.12" # Pinned Python version
# ─── Databases ─────────────────────────────────────
brew "postgresql@16" # Pinned PostgreSQL version
brew "redis"
# ─── Applications ─────────────────────────────────
cask "visual-studio-code"
cask "iterm2"
# ─── Fonts ─────────────────────────────────────────
cask "font-fira-code-nerd-font"
```
## Requirements
1. **Section headers** with comment separators
2. **Taps first** — before any brew/cask entries
3. **Pin versions** for databases and runtimes: `postgresql@16` not `postgresql`
4. **Comments** on non-obvious packages
## Good
```ruby
tap "homebrew/services"
brew "postgresql@16" # Database — pinned for data compatibility
```
## Bad
```ruby
# No organization, no comments, no version pinning
brew "postgresql"
brew "git"
cask "chrome"
brew "redis"
tap "homebrew/services"
```