This is a personal dotfiles project using modern Bash scripts to automate the setup and configuration of a development environment on UNIX-like systems. The project emphasizes simplicity, clarity, and long-term maintainability.
- Use modern Bash (v5+) features when helpful, but keep scripts readable and portable across common Linux/macOS environments.
- Follow a minimalist approach — avoid unnecessary complexity or dependencies.
- Write modular scripts that can be reused, extended, or run independently.
- Ensure all scripts behave consistently and predictably across systems.
This context is intended to guide AI agents when generating or editing shell scripts within this project. All code suggestions should:
- Use idiomatic, modern Bash
- Favor clarity over cleverness
- Assume common tools are available (
bash,grep,awk,sed,curl, etc.) - Prompt for
sudopassword once at the beginning if required - Scripts should log errors but continue execution; do not use
set -eor force early termination unless absolutely necessary
- Keep shared dotfiles and install steps under
shared/. - Keep platform-specific dotfiles and install steps under
macos/,ubuntu/, andfedora/. - Each package directory should contain stowable files at its root and optional install assets under
install/. - When an
install/directory exists, prefer the pairinstall.sh+Brewfile. bootstrap.shinstalls top-level packages fromBrewfile, then runs everyinstall.shfound undershared/and the current platform directory, then stows packages.
macosis selected onuname -s = Darwin.ubuntuis selected for Linux distros with/etc/os-releaseID=ubuntuorID=debian.fedorais selected for Linux distros with/etc/os-releaseID=fedora.- Linux platforms should share Homebrew path setup through
/home/linuxbrew/.linuxbrew/bin/brew shellenv.
- Decide whether the package belongs in
shared/or an OS-specific directory. - Create
<scope>/<package>/for stow-managed files. - If package installation is needed, add
<scope>/<package>/install/install.shand<scope>/<package>/install/Brewfile. - Keep
install.shsmall and consistent with the existing pattern:- resolve
THIS_DIR - run
brew bundle --verbose --file="$THIS_DIR/Brewfile"
- resolve
- In each
Brewfile, list only the directly needed packages; Homebrew resolves transitive dependencies automatically. - In each
Brewfile, usebrew 'name'for Homebrew formulae andcask 'name'for Homebrew casks. - Verify the exact package token and type before adding it:
brew info --formula <name>for formulaebrew info --cask <name>for casks
- Prepare
install.shandBrewfile, but leave actual installation verification to the user. Agents should not treat package installation or runtime login/setup as completed unless the user confirms it. - Keep
shared/packages Linux-safe. Do not add macOS GUI app casks undershared/; reserve those formacos/packages. Binary casks are acceptable inshared/only when they are verified to work in the Linux Homebrew environment. - Avoid changing unrelated package directories while adding a new platform.
- Update
.configto map the distro's/etc/os-releaseIDto aBREW_OSdirectory name. - Update
restow-only.shwith the same distro detection rules. - Update
bootstrap.shprerequisites for the distro if package manager setup differs. - Add the matching top-level directory (for example
fedora/) with at leastbase/install/. - Update
README.mdwhen supported platforms change.