Skip to content

Dotfiles overhaul: infrastructure, tooling, performance, and modernization#2

Merged
STiXzoOR merged 15 commits into
mainfrom
claude/update-claude-md-01G3uzxeg4drpHcZTZbJ5bBw
Feb 25, 2026
Merged

Dotfiles overhaul: infrastructure, tooling, performance, and modernization#2
STiXzoOR merged 15 commits into
mainfrom
claude/update-claude-md-01G3uzxeg4drpHcZTZbJ5bBw

Conversation

@STiXzoOR
Copy link
Copy Markdown
Owner

@STiXzoOR STiXzoOR commented Dec 17, 2025

Summary

Complete overhaul of the dotfiles repository adding development infrastructure, optimizing shell performance, modernizing macOS defaults for Sonoma/Sequoia, and performing a comprehensive audit across security, correctness, and maintainability.

71 files changed, 6039 insertions, 580 deletions across 12 commits.

New Infrastructure

Development Tooling

  • Test suite (dotfiles test) — 113 tests covering syntax validation, cache generation, functions, aliases, environment, Prezto config, security fixes, performance optimizations, config modernization, and dead code cleanup
  • Doctor command (dotfiles doctor) — Health checks for symlinks, submodules, shell config, Homebrew, caches, tools, Node.js, git, SSH; auto-fix with --fix
  • Shell profiler (dotfiles profiler) — Measures startup time, shows file-by-file breakdown, compares with/without caches
  • Cheatsheet generator (dotfiles cheatsheet) — Extracts and displays all aliases and functions with search
  • Secrets manager (dotfiles secrets) — macOS Keychain-backed secret storage with export/import
  • Setup wizard (dotfiles setup) — Interactive TUI for bootstrapping new machines
  • Brewfile — Consolidated all brew/cask/mas packages into single brew bundle manifest

CI/CD & Git Hooks

  • GitHub Actions — Syntax validation, shellcheck linting, test suite, Brewfile validation (Homebrew action pinned to SHA)
  • Pre-commit hooks — Bash/zsh syntax, shellcheck, secret detection; properly skip zsh scripts from bash checks
  • Machine profiles — Work/personal configurations with default.zshprofile.zshlocal.zsh loading order

Neovim Configuration

  • Modern setup with lazy.nvim package manager
  • Catppuccin colorscheme, Telescope, nvim-tree, Treesitter, LSP with Mason, nvim-cmp, git integration, lualine/bufferline

Shell Performance Optimization

Startup time reduced to 67ms (excellent):

  • Remove double compinit call (Prezto handles it)
  • Cache expensive eval outputs: fnm, zoxide, thefuck, fzf, brew shellenv, dircolors, npm completion
  • Filter path_helper subprocess from brew shellenv cache
  • Replace $(command -v) subprocess checks with zsh $commands[] hash lookups
  • Use typeset -U for PATH deduplication (no awk subprocess)
  • Reduce syntax highlighters from 6 to 3
  • Fix fpath order, remove redundant sourcing

Security Hardening

  • Fix unsafe git unstage alias (removed --hard flag)
  • Fix printf %q injection safety in dotfiles-secrets
  • Fix unsafe sh -c "$DOTFILES_IDE" → direct execution
  • Replace curl+sudo get-pip.py with python3 -m ensurepip
  • Add SSH config backup before overwrite
  • Migrate ssh-add -K--apple-use-keychain
  • Quote all variables in function files for injection safety

macOS Defaults Modernization (Research-Backed)

All changes backed by deep research into Sonoma (14) and Sequoia (15) compatibility:

Removed (broken/obsolete)

  • nvram SystemAudioVolume/StartupMute — no-op on Apple Silicon
  • askForPassword/askForPasswordDelay — broken since macOS 10.13
  • _FXShowPosixPathInTitle — broken on Sequoia (Finder title bar redesign)
  • expose-animation-duration — unreliable since Sierra
  • Simulator (Watch).app symlink — removed in Xcode 9
  • defaults-messages.sh (entire file) — messageshelper domain no longer honored
  • ConfigDataInstall — deprecated since Catalina
  • ShowSidebarInTopSites — Top Sites replaced by Start Page in Big Sur
  • IncludeInternalDebugMenu — non-functional since Safari 15+
  • DisableReplyAnimations/DisableSendAnimations — broken since High Sierra
  • systemsetup -setwakeonmodem — obsolete (no modem hardware)
  • Deprecated macOS defaults: SMS, battery %, BezelServices, AppleFontSmoothing, QLEnableTextSelection, EmptyTrashSecurely, IDEIndexDisable

Migrated

  • Wake-on-LAN: systemsetupsudo pmset -a womp 0
  • AppleKeyboardUIMode: value 32 (Sonoma/Sequoia)
  • spctl --master-disable: version-guarded for macOS 15+ (requires manual confirmation on Sequoia)

Added

  • Safari Full Disk Access check (sandboxed since Catalina — warns if writes will be silently ignored)
  • Quick Note (value 14) to hot corners reference
  • Existence check before Simulator.app symlink
  • Consistent 2>/dev/null || true on systemsetup commands

Fixed

  • 4 missing ok calls (3 in hot corners, 1 in Safari backspace setting)
  • Stale section headers ("Dock & Dashboard" → "Dock", "TextEdit and Disk Utility" → "TextEdit")
  • Duplicate Activity Monitor comment

Git & Neovim Updates

  • Git: add zdiff3, histogram, autoSetupRemote, branch sort, column UI, hooksPath, autocorrect=20; fix ksdiff PATH lookup, fix unstage alias
  • Neovim: migrate tsserver→ts_ls, vim.loop→vim.uv, which-key v3 API, trouble v3 API; update diagnostic.jump; remove duplicate options

Other Fixes

  • Restore Powerlevel10k as active prompt (keep Starship config dormant for future use)
  • Restore homebrew Prezto module and .bindings sourcing (keybindings were not loading)
  • Fix LESS_TERMCAP_md undefined ${yellow} variable → ANSI escape
  • Fix curlhammer() calling undefined bot function → echo
  • Guard $HOME/.local/bin/env sourcing for fresh machines
  • Update Nord theme URLs (arcticicestudio → nordtheme)
  • Update stevenblack-hosts submodule, remove unused zsh-autocomplete
  • Remove deprecated cask-fonts tap and duplicate Brewfile entries
  • Remove .huskyrc (migrated to config/husky)
  • Fix bin/dotfiles command dispatch for pass-through commands
  • Rename fd()finddir() to avoid shadowing fd binary
  • Remove dead aliases/functions (lwp-request, vtop, json, ncd, transfer, notioff/notion)
  • Replace egrepgrep -E, backticks → $(), expr → arithmetic

Test Plan

  • All 113 tests pass (./bin/dotfiles test --verbose)
  • Shell startup time: 67ms (excellent)
  • Pre-commit hooks pass (bash syntax, zsh syntax, shellcheck, secrets)
  • Shellcheck clean on all bash scripts
  • Verify Powerlevel10k prompt renders correctly after exec $SHELL
  • Verify key bindings work (arrow keys for history search, option+arrows for word nav)
  • Run ./bin/dotfiles configure --defaults on a test machine to verify macOS defaults

🤖 Generated with Claude Code

@STiXzoOR STiXzoOR changed the title Enhances dotfiles with new features and optimizations Comprehensive dotfiles audit: security, performance, modernization Feb 25, 2026
@STiXzoOR STiXzoOR changed the title Comprehensive dotfiles audit: security, performance, modernization Dotfiles overhaul: infrastructure, tooling, performance, and modernization Feb 25, 2026
claude and others added 14 commits February 25, 2026 23:15
- Add missing bin scripts (is-executable, is-supported, plistbuddy)
- Add missing runcom files (.hushlogin, .huskyrc, .profile, .vim/)
- Expand config/ with all subdirectories (git, husky, prettier, starship, thefuck)
- Document system/ shell configuration files (.alias, .bindings, .fnm, etc.)
- Add completions/ and resources/ directories
- Add vscode/ to apps section
- Include unlink, open, and edit commands in development commands
- Clarify SSH key type (ed25519) and Vim plugin manager (Vundle)
Major performance improvements:
- Remove double compinit call (Prezto handles it)
- Cache expensive eval outputs: fnm, zoxide, thefuck, fzf, brew shellenv, dircolors, npm completion
- Fix fpath order (must come before compinit)
- Remove redundant fzf sourcing from .completion and .bindings
- Remove redundant git completion (Prezto's git module handles it)
- Use zsh native $+commands instead of subprocess checks in aliases
- Use typeset -U for PATH deduplication (no awk subprocess)
- Fix bash-specific ${!1} syntax to zsh ${(P)1} in get() function

Caches auto-regenerate when source files/binaries change.
Run fnm_refresh to manually refresh fnm cache after node version changes.
New test script (bin/dotfiles-test) validates:
- Syntax of all zsh/bash configuration files
- Cache generation for fnm, zoxide, thefuck, fzf, brew, dircolors, npm
- Core functions (prepend-path, get, dedup-pathvar)
- Alias definitions (basic, global, suffix, conditional)
- Environment variables (XDG dirs, EDITOR, LANG)
- File structure (required dirs and files)
- Prezto configuration
- Shell startup time (with performance benchmarking)

Usage:
  ./bin/dotfiles test              # Run all tests
  ./bin/dotfiles test --verbose    # Detailed output
  ./bin/dotfiles test --quick      # Skip slow tests

Integrated into main dotfiles command and documented in CLAUDE.md.
Major improvements to dotfiles infrastructure:

Brewfile:
- Consolidated all brew/cask/mas packages into single Brewfile
- Use `brew bundle install` for installation
- Legacy .list files still supported as fallback
- Organized by category with comments

CI/CD (GitHub Actions):
- Shell syntax validation (bash + zsh)
- Shellcheck linting
- Test suite execution
- Brewfile validation

Doctor command:
- Comprehensive health checks for dotfiles setup
- Validates symlinks, submodules, shell config
- Checks Homebrew, cache status, tools, Node.js
- Auto-fix mode with --fix flag

Machine Profiles:
- Support for work/personal machine configurations
- Profile loading: default.zsh -> profile.zsh -> local.zsh
- DOTFILES_PROFILE env var or hostname-based detection
- local.zsh gitignored for secrets

Pre-commit hooks:
- Bash/zsh syntax validation
- Shellcheck linting
- Secret detection
- Install with: dotfiles hooks

Documentation updated in CLAUDE.md.
New features:
- Shell startup profiler (dotfiles profiler) with detailed breakdown
- Aliases/functions cheatsheet generator (dotfiles cheatsheet)
- Interactive setup wizard (dotfiles setup) with visual TUI
- Secrets management using macOS Keychain (dotfiles secrets)
- Modern Neovim configuration with lazy.nvim

Neovim setup includes:
- Catppuccin colorscheme with alternatives (Nord, TokyoNight)
- Telescope fuzzy finder
- nvim-tree file explorer
- Treesitter syntax highlighting
- LSP with Mason for server management
- nvim-cmp autocompletion
- Git integration (gitsigns, fugitive, lazygit)
- Lualine statusline and bufferline

Updated CLAUDE.md with documentation for all new features.
- Add macOS requirement check at script start
- Remove IS_LINUX variable and related conditionals
- Simplify detect_system() and check_prerequisites()
- Update CLAUDE.md to reflect macOS-only support
Removed deprecated/legacy settings:
- System Preferences → System Settings (macOS Ventura+ compatibility)
- Sudden Motion Sensor (sms) - irrelevant for SSDs
- Battery percentage menubar setting - now in Control Center
- BezelServices keyboard backlight settings - deprecated
- AppleFontSmoothing subpixel rendering - deprecated on Retina
- QLEnableTextSelection - now default in Quick Look
- EmptyTrashSecurely - removed in El Capitan, ineffective on SSDs

Fixed performance issues:
- Removed NSDisableAutomaticTermination (prevented RAM reclamation)
- Removed contradictory IDEIndexDisable in Xcode defaults
- Consolidated duplicate concurrent compile tasks setting

All removed settings include explanatory comments for future reference.
- bin/dotfiles: Quote variables, use direct exit code checks
- scripts/echos.sh: Fix argument quoting in echo statements
- scripts/requirers.sh: Simplify PIPESTATUS patterns, use direct checks
- macos/defaults.sh: Replace unicode curly quotes with ASCII quotes
- Add SC2119 to ignored warnings (ok function is designed for optional args)
- Fix unicode quotes in macos/defaults-terminal.sh
In zsh, PATH is tied to the 'path' array. Use typeset -gU on the
lowercase array version to properly deduplicate path-like variables.
In CI environments, brew shellenv may return empty output if
HOMEBREW_PREFIX isn't properly set. Treat this as a skip rather
than a failure since the actual dotfiles work on properly
configured machines.
Audit and fix across 52 files covering security hardening, performance
optimization, macOS defaults modernization, shell config cleanup, and
Neovim/git configuration updates.

**Shell & Performance:**
- Replace subprocess checks with zsh $commands[] hash lookups
- Cache brew shellenv, filter out path_helper subprocess
- Fix variable quoting in all functions for injection safety
- Restore Powerlevel10k as active prompt (keep Starship config dormant)
- Restore homebrew Prezto module and .bindings sourcing
- Fix LESS_TERMCAP_md undefined variable, curlhammer() undefined bot
- Guard $HOME/.local/bin/env sourcing for fresh machines
- Reduce syntax highlighters from 6 to 3 for faster startup

**macOS Defaults (Sonoma/Sequoia research-backed):**
- Remove broken: nvram boot sound, askForPassword, _FXShowPosixPathInTitle,
  expose-animation-duration, Simulator (Watch) symlink, Messages defaults
- Migrate: wake-on-LAN to pmset, AppleKeyboardUIMode 3→2
- Version-guard spctl --master-disable for macOS 15+
- Add Safari Full Disk Access check (sandboxed since Catalina)
- Remove deprecated: ConfigDataInstall, ShowSidebarInTopSites,
  IncludeInternalDebugMenu, DisableReplyAnimations
- Fix missing ok calls in hot corners and Safari backspace setting
- Suppress systemsetup stderr errors, add || true consistently
- Update hot corners comment (remove Dashboard, add Quick Note)

**Security:**
- Fix unsafe git unstage alias (remove --hard)
- Fix printf %q injection safety in dotfiles-secrets
- Fix unsafe sh -c execution in dotfiles edit command
- Replace curl+sudo get-pip.py with python3 -m ensurepip
- Add SSH config backup, migrate ssh-add -K to --apple-use-keychain

**Git & Neovim:**
- Add zdiff3, histogram, autoSetupRemote, branch sort, column UI
- Fix ksdiff to use PATH lookup, set autocorrect=20, add hooksPath
- Migrate tsserver→ts_ls, vim.loop→vim.uv, which-key v3, trouble v3
- Remove duplicate Neovim options, update diagnostic.jump API

**Repo Maintenance:**
- Update Nord theme URLs from arcticicestudio to nordtheme
- Update stevenblack-hosts submodule, remove zsh-autocomplete
- Remove deprecated cask-fonts tap and duplicate Brewfile entries
- Extend test suite to 113 tests (security, performance, modernization)
- Harmonize shellcheck SC2119 exclusion across CI, hooks, and tests
- Fix pre-commit hook: skip zsh scripts from bash checks, exclude
  self and test files from secrets check
- Fix command dispatch for pass-through commands in bin/dotfiles
- Pin Homebrew CI action to SHA, expand shellcheck coverage

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rename CLAUDE.md to AGENTS.md (symlink CLAUDE.md → AGENTS.md) and split
the monolithic 477-line file into a 36-line root index with 8 topic files
under docs/agents/. Resolves duplicate entries, contradictory package
management guidance, and removes content the agent can discover itself.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@STiXzoOR STiXzoOR force-pushed the claude/update-claude-md-01G3uzxeg4drpHcZTZbJ5bBw branch from f351150 to 20df065 Compare February 25, 2026 21:16
- Replace &>> with >> 2>&1 in dotfiles-setup for bash compatibility (SC2004,
  SC2155, SC2024)
- Fix unbalanced regex quotes in dotfiles-cheatsheet causing zsh parse error
- Use full commit SHA for Homebrew/actions in CI workflow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@STiXzoOR STiXzoOR merged commit b4448c8 into main Feb 25, 2026
4 checks passed
@STiXzoOR STiXzoOR deleted the claude/update-claude-md-01G3uzxeg4drpHcZTZbJ5bBw branch February 25, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants