This AGENTS.md defines rules and conventions for AI agents operating in this dotfiles repository. It is managed by chezmoi for cross-platform deployment (macOS, Arch Linux, CachyOS, Windows).
Note: The file at private_dot_config/private_opencode/GSD.md contains the core AI operating philosophy (Get Shit Done). This root-level file governs this repo specifically.
This repository uses chezmoi for cross-platform dotfile management with Go templates for OS-specific configuration.
dot_*.tmpl- Templated dotfiles (Go templates with OS/arch conditionals)dot_*- Plain dotfiles (copied as-is)private_dot_*- Files deployed with restricted permissionsrun_onchange_*- Scripts that run when their dependencies change.chezmoi.toml.tmpl- Interactive user configuration (prompted onchezmoi init).chezmoiexternal.toml- External dependencies.chezmoiignore- Platform-specific file exclusionsBrewfile- macOS Homebrew package manifestprivate_dot_config/private_opencode/- OpenCode AI agent config (our customizations)
dot_prefix -> deploys as.(e.g.,dot_zshrc.tmpl->~/.zshrc)private_prefix -> sets0700/0600permissions.tmplsuffix -> processed as Go template before deploymentrun_onchange_prefix -> script runs when hash in comment changes
- Apply changes:
chezmoi apply(renders templates and deploys) - Preview changes:
chezmoi diff(show what would change) - Dry run:
chezmoi apply --dry-run(simulate without applying) - Edit source:
chezmoi edit ~/.zshrc(opens template in editor) - Re-add from live:
chezmoi re-add(updates source from live files) - First-time setup:
chezmoi init <repo-url>(clones + prompts for config)
- Install dependencies:
brew bundle install --file=Brewfile - Update manifest:
brew bundle dump --file=Brewfile --force
When modifying .tmpl files, use chezmoi's Go template syntax:
{{ "{{" }} if eq .chezmoi.os "darwin" {{ "}}" }}
# macOS-only content
{{ "{{" }} else if eq .chezmoi.os "linux" {{ "}}" }}
# Linux-only content
{{ "{{" }} end {{ "}}" }}
Data is defined in .chezmoi.toml.tmpl and accessed as .variable_name:
{{ "{{" }} .git_name {{ "}}" }}
{{ "{{" }} .git_email {{ "}}" }}
{{ "{{" }} .ssh_keys {{ "}}" }}
Use - to trim whitespace around template actions:
{{ "{{" }}- if eq .chezmoi.os "darwin" {{ "}}" }}
Do not degrade startup time (currently sub-50ms).
- Use
_cache_evalfunction for slow init commands (brew,fzf,zoxide) - Lazy load where possible (e.g., NVM is lazy-loaded)
- Background slow operations with
&!(e.g., loading SSH keys)
- Keep the Powerlevel10k instant prompt block at the top of
.zshrc. - Group aliases under
# ===banner comments. - Add new plugins to
dot_zsh_plugins.txt, not the zshrc template. - Do not modify
dot_p10k.zshmanually (generated byp10k configure).
- Never write secrets. Use chezmoi's data system or secret manager integration.
- Use templates for OS differences. Don't use runtime
if [[ "$OSTYPE" ]]— use Go template{{ "{{" }} if eq .chezmoi.os {{ "}}" }}instead. - Test templates: Run
chezmoi execute-template < file.tmplto verify output. - Preview before apply: Always
chezmoi diffbeforechezmoi apply.
- Use Conventional Commits format (
feat:,fix:,chore:,docs:,refactor:). - Keep descriptions lowercase, no trailing period.
- Example:
feat: add windows powershell profile template