Thanks for your interest in contributing! This document provides guidelines for contributing to this project.
- Bug reports: Found something broken? Open an issue
- Feature requests: Have an idea? Open an issue to discuss
- Documentation: Improve docs, fix typos, add examples
- Code: Fix bugs, add features, improve existing code
- macOS, Linux, or Windows with WSL
- Git
- Chezmoi installed
- ShellCheck for linting
-
Fork and clone the repository:
git clone https://github.com/YOUR_USERNAME/dotfiles.git cd dotfiles -
Run the build script to validate:
./build.sh
-
Test specific components:
./build.sh lint # Lint shell scripts ./build.sh syntax # Check bash syntax ./build.sh validate # Validate Chezmoi templates ./build.sh cli # Test dotfiles CLI
Before submitting a PR:
-
Run the full build:
./build.sh all
-
Test bootstrap in dry-run mode:
./tools/bootstrap.sh --dry-run
-
Test on a fresh environment (optional but recommended):
# Using a VM or container docker run -it ubuntu:latest bash # Then run your bootstrap
- Use
#!/bin/bashor#!/usr/bin/env bash - Follow Google's Shell Style Guide
- Use
set -efor scripts that should fail on errors - Use kebab-case for file names:
install-tools.sh - Use snake_case for function names:
install_packages() - Add ShellCheck directives when needed:
# shellcheck disable=SC2034
| Type | Convention | Example |
|---|---|---|
| Scripts | kebab-case | install-tools.sh |
| Functions | snake_case | install_packages() |
| Variables | UPPER_SNAKE | DOTFILES_DIR |
| Local vars | lower_snake | local config_file |
- Use Markdown for all documentation
- Keep lines under 100 characters when possible
- Use code blocks with language hints:
```bash - Update CHANGELOG.md for notable changes
-
Create a branch from
main:git checkout -b feature/your-feature-name
-
Make your changes and commit with clear messages:
git commit -m "feat: add new feature X" -
Update documentation if needed (README, CLAUDE.md, docs/)
-
Update CHANGELOG.md under
[Unreleased] -
Run the build to ensure everything passes:
./build.sh
Follow Conventional Commits:
feat:New featurefix:Bug fixdocs:Documentation onlystyle:Formatting, no code changerefactor:Code change that neither fixes a bug nor adds a featuretest:Adding or updating testschore:Maintenance tasks
Examples:
feat: add Brave browser extension sync
fix: correct Homebrew path detection on Intel Macs
docs: update README with Windows instructions
refactor: extract common functions to lib/common.sh
- Code follows the style guidelines
- Self-review completed
- Documentation updated (if applicable)
- CHANGELOG.md updated
- Build passes locally (
./build.sh) - Tested on target platform(s)
dotfiles/
├── home/ # Chezmoi-managed dotfiles
│ ├── dot_config/ # ~/.config files
│ └── private_dot_ssh/ # SSH config templates
├── tools/ # Management scripts
│ ├── dotfiles # CLI tool
│ ├── bootstrap.sh # One-line installer
│ └── os_installers/ # Platform-specific installers
├── cron/ # Scheduled tasks
├── docs/ # Documentation
└── .github/ # CI and templates
| File | Purpose |
|---|---|
tools/bootstrap.sh |
Entry point for new installs |
tools/dotfiles |
CLI wrapper for common tasks |
tools/doctor.sh |
Health check script |
Brewfile |
Homebrew packages |
CLAUDE.md |
AI assistant context |
- Add to
Brewfile(macOS) and/ortools/os_installers/apt.sh(Linux) - Update documentation if the tool needs configuration
- Add to doctor.sh if it should be validated
-
Create the template in
home/with Chezmoi naming:dot_prefix for dotfiles.tmplsuffix for templatesprivate_prefix for sensitive files
-
Use Go templating for machine-specific config:
{{ if eq .chezmoi.os "darwin" }} # macOS specific {{ end }}
- Add function in
tools/dotfiles:cmd_yourcommand() - Add to the case statement in
main() - Add to help text
- Document in
docs/commands/
- Open an issue for questions
- Check existing issues and docs first
- Be respectful and constructive
Thank you for contributing!