Agent skill
dotfiles
Dotfile management with stow, chezmoi, or git bare repo for configuration sync across machines. Use when user asks to "manage dotfiles", "sync configs", "setup dotfiles", "backup shell config", or organize configuration files.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/dotfiles
SKILL.md
Dotfiles
Manage and sync configuration files across machines.
GNU Stow (Simple)
Setup
# Install
brew install stow # macOS
apt install stow # Ubuntu
# Create dotfiles directory
mkdir -p ~/dotfiles
cd ~/dotfiles
Structure
~/dotfiles/
├── zsh/
│ └── .zshrc
├── git/
│ └── .gitconfig
├── nvim/
│ └── .config/
│ └── nvim/
│ └── init.lua
└── tmux/
└── .tmux.conf
Usage
cd ~/dotfiles
# Symlink one package
stow zsh
# Symlink all
stow */
# Unlink
stow -D zsh
# Restow (update)
stow -R zsh
# Target different directory
stow -t ~ zsh
Chezmoi (Advanced)
Setup
# Install
brew install chezmoi # or sh -c "$(curl -fsLS get.chezmoi.io)"
# Initialize
chezmoi init
# Or from existing repo
chezmoi init https://github.com/user/dotfiles.git
Basic Usage
# Add file
chezmoi add ~/.zshrc
chezmoi add ~/.config/nvim/init.lua
# Edit
chezmoi edit ~/.zshrc
# See changes
chezmoi diff
# Apply changes
chezmoi apply
# Update from repo
chezmoi update
Templates
# ~/.local/share/chezmoi/dot_gitconfig.tmpl
[user]
name = {{ .name }}
email = {{ .email }}
# ~/.config/chezmoi/chezmoi.toml
[data]
name = "John Doe"
email = "[email protected]"
Secrets
# Use 1Password
{{ onepasswordRead "op://Personal/GitHub/token" }}
# Use pass
{{ pass "github/token" }}
# Prompt for value
{{ promptString "Enter API key" }}
Git Bare Repo
Setup
# Initialize
git init --bare $HOME/.dotfiles
# Alias
alias dotfiles='git --git-dir=$HOME/.dotfiles --work-tree=$HOME'
# Ignore untracked
dotfiles config --local status.showUntrackedFiles no
Usage
# Add files
dotfiles add ~/.zshrc
dotfiles commit -m "Add zshrc"
dotfiles push
# Clone to new machine
git clone --bare [email protected]:user/dotfiles.git $HOME/.dotfiles
alias dotfiles='git --git-dir=$HOME/.dotfiles --work-tree=$HOME'
dotfiles checkout
Shell Config
# Add to ~/.zshrc or ~/.bashrc
alias dotfiles='git --git-dir=$HOME/.dotfiles --work-tree=$HOME'
Common Dotfiles
Essential Files
~/.zshrc or ~/.bashrc # Shell config
~/.gitconfig # Git config
~/.ssh/config # SSH config
~/.tmux.conf # Tmux config
~/.config/nvim/ # Neovim config
~/.config/starship.toml # Starship prompt
.gitconfig
[user]
name = Your Name
email = [email protected]
[alias]
co = checkout
br = branch
ci = commit
st = status
lg = log --oneline --graph
[core]
editor = nvim
[init]
defaultBranch = main
[pull]
rebase = true
.zshrc Essentials
# History
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
setopt SHARE_HISTORY
# Aliases
alias ll='ls -la'
alias g='git'
alias dc='docker compose'
# Path
export PATH="$HOME/.local/bin:$PATH"
# Editor
export EDITOR='nvim'
Bootstrap Script
#!/bin/bash
# bootstrap.sh
set -e
# Install dependencies
if [[ "$OSTYPE" == "darwin"* ]]; then
brew install stow git neovim
fi
# Clone dotfiles
git clone https://github.com/user/dotfiles.git ~/dotfiles
# Stow all
cd ~/dotfiles
for dir in */; do
stow "$dir"
done
echo "Dotfiles installed!"
Best Practices
- Version control: Always use git
- README: Document setup steps
- Modular: Separate by application
- Secrets: Never commit secrets; use templates or secret managers
- Bootstrap: Create setup script for new machines
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?