بنقرة واحدة
zshrc-cleanup
Clean up .zshrc when third-party tools modify it, moving additions into the modular .zsh.d/ structure
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Clean up .zshrc when third-party tools modify it, moving additions into the modular .zsh.d/ structure
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | zshrc-cleanup |
| description | Clean up .zshrc when third-party tools modify it, moving additions into the modular .zsh.d/ structure |
This skill detects and refactors third-party additions to .zshrc, moving them into the modular .zsh.d/ structure.
The dotfiles repo uses a modular zsh configuration:
.zshrc contains ONLY a 6-line loader that sources all .zsh.d/*.zsh files.zsh.d/ contains numbered modular files (e.g., 00_checks.zsh, 35_path.zsh, 70_bun.zsh)Third-party tools frequently append to .zshrc directly (e.g., # Added by Antigravity). This breaks the modular pattern.
if [ -d ~/.zsh.d ]; then
for component in ~/.zsh.d/*.zsh; do
[ -x $component ] && . $component
done
unset component
fi
Anything after line 6 is a third-party addition that must be moved.
Read ~/.zshrc (or /Users/kimjoar/dev/dotfiles/.zshrc in the dotfiles repo).
If the file has only 6 lines (the loader block), report "No cleanup needed" and stop.
For lines 7+, identify each tool addition:
# Added by ToolName comments to identify the toolFor each tool addition, check if it belongs in an existing .zsh.d/ file:
Same ecosystem examples:
42_nvm.zsh50_pyenv.zsh90_rbenv.zsh60_rust.zsh85_go.zshIf it fits an existing file: Append the content to that file.
If it's a new tool: Create a new file in the 70-89 range (where tools like bun, husky, tana live). Use the next available number.
File naming convention: lowercase, underscores for spaces (e.g., 76_antigravity.zsh)
Keep the content minimal - just what's needed for the tool to work. Include the original comment if present.
Run chmod +x on any new or modified file.
This is required - the loader uses [ -x $component ] to check executability before sourcing. Non-executable files are skipped.
Replace .zshrc with the clean 6-line loader:
if [ -d ~/.zsh.d ]; then
for component in ~/.zsh.d/*.zsh; do
[ -x $component ] && . $component
done
unset component
fi
.zshrc is exactly 6 lines.zsh.d/ file exists and is executableBefore:
# .zshrc has 10 lines - loader + "# Added by Antigravity" + PATH export
Actions:
76_antigravity.zsh (next available in 70-89)chmod +x .zsh.d/76_antigravity.zsh.zshrc to 6-line loaderAfter:
# .zshrc is clean (6 lines)
# .zsh.d/76_antigravity.zsh contains the Antigravity config and is executable