Imported from Thundernirmal/zsh (
AGENTS.md). Install upstream withnpx skills add Thundernirmal/zsh. Copyright stays with the author.
AGENTS.md
Repo Shape
- This repo is a shared Zsh config, not an app/workspace: there is no package manager, lockfile, or root-level test runner config. CI automation exists via GitHub Actions in
.github/workflows/checks.yml. init.zshis the executable source of truth. It sets shell options, then sources modules in this order:10-history.zsh,20-aliases.zsh,25-theme.zsh,30-zoxide.zsh,40-fzf.zsh,50-completion.zsh,55-ui-helpers.zsh,60-functions.zsh, optional62-cgm.zsh,65-help.zsh,66-compdefs.zsh,70-globals.zsh,80-tips.zsh.functions/ztheme,functions/_fbr_format_entry,lib/functions-*.zsh,lib/command-registry.zsh,lib/ui-width-data.zsh,lib/theme-*.zsh,lib/help-catalogue.zsh, andlib/tips-catalogue.zshare trusted repo-local lazy helpers. Normal startup registers fixed loaders and lightweight color stubs; general commands, package workflows, command-only rendering, catalogues, fbr formatting, palette, validation, and conversion code are parsed on first use.lib/upkg-registry.zshis a trusted lightweight registry sourced during startup by60-functions.zshand reused by66-compdefs.zshwhencompdefis available.- The module files are the source of truth for behavior.
README.mdandGUIDE.mdmust be kept in sync with them at all times.
Documentation Ownership
README.mdis the short entrypoint: purpose, five-minute setup, requirements summary, and links. Do not turn it into a second command reference.GUIDE.mdis the complete user reference. Keep detailed behavior, examples, dependency notes, safety boundaries, and gotchas there.65-help.zshregisters the fixedzhelploader;lib/command-registry.zshkeeps shared help/completion records terse: one clear summary, usage, editable example, dependency label, and live availability.80-tips.zshregisters the fixedtipsloader;lib/tips-catalogue.zshcontains short, actionable reminders. Add tips only for user-facing actions that users can perform. Do not use tips for implementation notes, release history, or long edge-case explanations.- Keep current behavior in
GUIDE.md. Completed specs and audits are retained in Git history; remove stale documents and their links instead of maintaining duplicate historical status notes. - Link between surfaces instead of copying long explanations. When behavior changes, update each affected surface at its intended level of detail.
Edit Rules
- Keep external tool integrations guarded and preserve clean fallbacks. This repo is meant to stay portable across machines with different tool sets.
- Which guard to use depends on when it runs:
- Startup-time guards (top level of a module, evaluated on every shell start) use
(( $+commands[tool] )). Acommand -vmiss walks the wholePATH, which dominates startup time on longPATHs such as WSL2 setups that inherit Windows entries. - Guards inside function bodies keep
command -v ... >/dev/null 2>&1.$commandsis a cached hash, so it can go stale mid-session and it defeats thePATH-stubbed fake binaries inscripts/test-upkg.zsh.
- Startup-time guards (top level of a module, evaluated on every shell start) use
40-fzf.zshalso embedscommand -vinside the exportedFZF_*_OPTSpreview strings. Those run in a separate shell that fzf spawns, so they must staycommand -v.25-theme.zshis the single palette and glyph source of truth. Keep its startup path pure Zsh: no executable probes, terminal queries, filesystem theme discovery, downloaded palettes, arbitrary theme sourcing, oreval. Renderer and picker code consume semantic roles instead of palette-specific names or raw colors.60-functions.zshowns fixed lazy registration for the general command catalogue and the session-onlyzthemecommand.lib/functions-catalogue.zshowns the fixed domain loader;lib/functions-common.zsh,lib/functions-files.zsh,lib/functions-system.zsh,lib/functions-git.zsh,lib/functions-upkg.zsh,lib/functions-upkg-backends.zsh, andlib/functions-nix.zshown the implementations, andfunctions/zthemeowns its implementation. Theme export may print safe assignments but must not edit.zshrc; invalid settings and failed finder refreshes must remain atomic.30-zoxide.zshmay source generated integration only afterzsh -fnvalidation. Its persistent cache must remain executable-fingerprint-keyed, owner-only, non-symlinked, atomically published, and fixed beneath an absoluteXDG_CACHE_HOMEorHOME; a cache miss may fall back to a private temporary file but never to uncheckedeval.- Keep the private
functions/path idempotent and keep lazy helper sources fixed to the repository directory. Do not replace them with user-controlled discovery or runtime downloads. - IMPORTANT: whenever you change a user-facing alias, function, completion behavior, or workflow in this repo, update
80-tips.zsh,README.md, andGUIDE.mdin the same change so all documentation stays accurate and consistent. Keep each update within the ownership boundaries above; synchronization does not mean duplicating the same prose. - If you add or remove a shared external dependency, update
scripts/check-deps.shtoo. scripts/check-deps.shis POSIXsh, not Zsh. Keep it portable.40-fzf.zshshould stay safe in non-prompt startup paths. Keep thefzf --zshinit guarded sozsh -i -c ...does not hitcan't change option: zlewarnings.50-completion.zshonly tuneszstyles; it assumes the main~/.zshrc/ Oh My Zsh layer already rancompinit.- Keep
50-completion.zshlightweight. Heavy completion UI options were intentionally removed because they made completion lists noticeably slower. 80-tips.zshregisters the on-demandtipsshell function, andlib/tips-catalogue.zshdefines its first-use implementation and reminders. Keep both hook-free; prompt hooks were removed because they added latency for every command cycle.62-cgm.zshmust remain entirely optional.init.zshskips the whole module whensecret-toolis absent; when available, sourcing must not contact Secret Service or read the catalogue. Never add a plaintext secret fallback, reveal command,eval-based export, completion path that retrieves values, or secret-loading path that leaves Zshxtraceenabled.- Changes in
20-aliases.zshare high impact. Keep destructive file commands on their native semantics; do not imply safety through aliases whose flags later arguments can override.
Verification
Run zsh scripts/run-tests.zsh after edits. The runner is the executable source of truth for the ordered syntax checks, regression suites, and fixed-install-path smoke test used by CI.
- Optional environment check:
"$HOME/.config/zsh/scripts/check-deps.sh" scripts/check-deps.shexits nonzero only when required tools are missing (zsh,git,curl,ss,lsd,zoxide,fzf). Missing optional tools (bat,tree,fd/fdfind,jq,secret-tool,gdbus,nix, andnix-collect-garbagewhen Nix is installed) still exit0and only print hints.skills-lock.jsonrecords maintainer skill provenance only; it is not a runtime dependency or package-manager lockfile.
Manual QA Checklist
- When asked to prepare a full manual QA pass before a stable release, create
qa-features.csvat the repo root. - Keep the CSV local-only by listing
qa-features.csvin.gitignore; it is a working checklist and should not be pushed to GitHub. - Use these columns exactly:
cmd,expected behavior,Status. - Include only user-facing behavior that needs manual interactive QA, such as prompt startup, aliases, keybindings, completion, fzf pickers, guarded integrations, package-manager flows that should not be run automatically, rich/plain UI rendering, and other terminal ergonomics.
- Leave syntax checks, smoke tests, and scripted regression tests to the automated verification commands above instead of putting them in the manual CSV.
- Default
StatustoNot Runso the checklist can be filled during manual QA.
Automation Gotcha
- Aliases and functions in this repo are interactive shell features. Automation should call real binaries or explicitly source
init.zshinsidezsh -fc '...'; do not assume aliases likellor functions likeftexist in non-interactive shells. ~/.zshrcis intentionally outside this repo. If a change depends on OMZ plugins, Starship, or local PATH/completion wiring, document the repo side here but do not assume those user-level files are versioned with this project.