From env-checkup
Triple-check, back up, then optimize a machine's shell and developer dotfiles (zsh/bash/fish). This skill should be used when the user asks for an "env checkup", to "optimize my dotfiles", "audit/clean up my shell config", "fix my .zshrc/.zprofile", "speed up shell startup", "dedupe PATH", "extract secrets out of my shell config", or similar shell-environment maintenance. Enforces a mandatory backup before any edit and never prints secret values.
How this skill is triggered — by the user, by Claude, or both
Slash command
/env-checkup:env-checkupThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Audit and optimize a user's shell + developer dotfiles **safely**. Follow the five
Audit and optimize a user's shell + developer dotfiles safely. Follow the five steps in order. The backup is mandatory and must precede every edit.
mackup backup) only if its storage is mounted.cat token files, .npmrc auth lines, SSH keys,
or history files. When you must read a file that may contain secrets, redact values
(sed -E 's/(=")[^"]*(")/\1<redacted>\2/g') or check length/SET, never the value.grep proves it's
sourced nowhere. A tool's config stays only if the tool exists (command -v).<backup>/removed-orphans/.strict-ssl=false
in .npmrc, a deliberate JAVA_HOME). Report them; let the user decide.Run the bundled audit script — it does both, prints no secrets, and detects the shell:
bash "$CLAUDE_SKILL_DIR/scripts/audit.sh" # or the absolute path to scripts/audit.sh
It reports: shell + load order, which standard dotfiles exist, Mackup config and whether
its storage is mounted, tool existence (incl. git-lfs), stale .zcompdump*, a
load-order grep audit, orphan candidates, and a live PATH-duplicate/nvm/NODE_OPTIONS
measurement from a fresh login+interactive shell. Read each shell file in load order
(zsh: .zshenv → .zprofile → .zshrc → .zlogin) and specifically hunt for:
compinit — vendor snippets (Docker Desktop) append a second
autoload -Uz compinit; compinit. Collapse to one.fpath additions placed AFTER compinit — they must come before it.${ZDOTDIR} instead of ${ZDOTDIR:-$HOME}
(with ZDOTDIR unset it tests /.zcompdump, never matches → never rebuilds).
Note: the glob qualifier (#qN.mh+24) does expand inside [[ -n … ]] in zsh.NODE_OPTIONS). If the var is set
but not exported, export it. If it isn't defined anywhere, do NOT fabricate one..zprofile and .zshrc without a guard; guard a
genuine second load with command -v nvm >/dev/null ||. (Often there is no real
second load — confirm before "fixing".)nvm.sh/antigravity/orbstack raw PATH= prepends running
after a typeset -U path dedup. Measure: total vs unique..zenv, .node_path, .zshrc.pre-oh-my-zsh, stale
.bashrc/.profile with conflicting JAVA_HOME/SDK paths). Confirm with grep..zcompdump* caches.BK="$HOME/dotfiles-backup-$(date +%Y%m%d-%H%M%S)"; mkdir -p "$BK/removed-orphans"
for f in .zshrc .zshenv .zprofile .zlogin .bashrc .bash_profile .profile \
.gitconfig .npmrc .mackup.cfg .config/fish/config.fish; do
[ -e "$HOME/$f" ] && cp -p "$HOME/$f" "$BK/"; done
mkdir -p "$BK/zcompdump-cache"; cp -p "$HOME"/.zcompdump* "$BK/zcompdump-cache/" 2>/dev/null
# Mackup ONLY if storage mounted (audit reports this); else rely on local backup and say so.
command -v mackup >/dev/null && mackup backup --force
echo "$BK"
compinit; move all completion fpath=(…) additions above it.${ZDOTDIR:-$HOME}/.zcompdump.NODE_OPTIONS only if it already exists unexported.command -v nvm >/dev/null ||..zshrc: typeset -U path PATH; path=($path).nvm use drop the redundant symlink path:
path=(${path:#$NVM_DIR/current/bin}) (keep current/bin in .zshenv for
non-interactive shells — they never run .zshrc).<backup>/removed-orphans/; clear stale .zcompdump*.Move plaintext credential export lines out of .zshrc into ~/.zsh_secrets
(chmod 600), and source it: [[ -f "$HOME/.zsh_secrets" ]] && source "$HOME/.zsh_secrets".
Do the move with a script that never echoes values (awk by block marker, redirect into
the 600 file). ~/.zsh_secrets is naturally not Mackup-synced (the zsh app config
covers only .zshrc/.zshenv/.zprofile).
zsh -lic '
print "rc loaded ok"
print "PATH total=${#path} unique=$(printf "%s\n" $path | sort -u | wc -l)"
print "nvm entries=$(printf "%s\n" $path | grep -c "\.nvm")"
command -v node nvm starship >/dev/null && print "tools resolve"
[[ -n $NODE_OPTIONS ]] && print "NODE_OPTIONS exported"
'
git config --list >/dev/null && echo "gitconfig parses"
Prove: fresh login+interactive shell loads with no errors; node/nvm/starship resolve;
PATH total == unique; nvm appears once; .gitconfig parses. Report verification results.
Then report: backup location, issues found, exact fixes applied, what was left untouched intentionally (and why), and the verification results.
mv -i/cp -i/rm -i safety aliases silently turn a script mv into an
interactive prompt that defaults to "no" → your edit looks applied but isn't. Use
command mv -f (or cat tmp > file) for non-interactive overwrites in scripts, and
always re-grep the target to confirm the change landed.mackup backup before extracting secrets, the
storage copy still holds them — re-run mackup backup after the edit so storage gets
the clean file, and verify the storage copy has 0 secrets. Also: overwriting a
mackup-symlinked file with mv -f replaces the symlink with a regular file (breaks the
link) — check [ -L file ] first.echo "$SHELL"; adapt the same five steps (bash:
.bashrc/.bash_profile/.profile, bash -lic; fish: ~/.config/fish/config.fish,
fish -lc). If there's no nvm, skip the nvm items.Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub th0mps0nty/env-checkup