用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/yulonglin/dotfiles --skill mv-repo命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | mv-repo |
| description | Move a repo to a new directory. Handles venv, Claude Code project state, path references, and tmux sessions. |
Move one or more repos to a new parent directory, updating all path-dependent state.
Usage: /mv-repo <source>... <dest-dir>
Examples:
/mv-repo nudge bots/ — move nudge into bots//mv-repo nudge ambassador swordsmith bots/ — move multiple reposmv <source>... <dest>/
For each moved repo that has a .venv/:
.venvuv sync in the new locationpyproject.toml, skip (venv was manual — warn user)Rename directories in ~/.claude/projects/ that match the old path encoding.
Path encoding: absolute path with / replaced by -, leading -. Example:
/home/yulong/code/nudge → -home-yulong-code-nudge/home/yulong/code/bots/nudge → -home-yulong-code-bots-nudgeInclude worktree variants (dirs matching ${old_encoded}--*).
# For each repo, rename matching project dirs
# Strip trailing slash to avoid encoding artifacts
old_abs_path="${old_abs_path%/}"
new_abs_path="${new_abs_path%/}"
old_encoded="$(echo "$old_abs_path" | tr '/' '-')"
new_encoded="$(echo "$new_abs_path" | tr '/' '-')"
# Match exact dir and worktree variants (--*), not unrelated repos
for dir in ~/.claude/projects/${old_encoded} ~/.claude/projects/${old_encoded}--*; do
[ -d "$dir" ] || continue
new_dir="${dir/$old_encoded/$new_encoded}"
mv "$dir" "$new_dir"
done
Moving a repo breaks git worktree references in two places:
A. Main repo's worktree registry (.git/worktrees/*/gitdir):
git -C <new-path> worktree list
For each worktree:
git worktree prune removes it.claude/settings.json changes → safe to pruneB. Claude Code worktrees (.claude/worktrees/*/):
These moved with the repo but contain .git files (not directories) with absolute gitdir: paths pointing to the old location:
# .claude/worktrees/auto-heal/.git contains:
gitdir: /old/path/.git/worktrees/auto-heal
Fix both directions (use -F for fixed-string matching — paths contain . which is regex):
old_path="/old/path"
new_path="/new/path"
# Fix .claude/worktrees/*/.git → points to main repo's .git/worktrees/
for gitfile in <new-path>/.claude/worktrees/*/.git; do
[ -f "$gitfile" ] || continue
sd -F "$old_path" "$new_path" "$gitfile"
done
# Fix .git/worktrees/*/gitdir → points back to .claude/worktrees/
for gitdir_file in <new-path>/.git/worktrees/*/gitdir; do
[ -f "$gitdir_file" ] || continue
sd -F "$old_path" "$new_path" "$gitdir_file"
done
# Check for absolute commondir paths (should be relative, but verify)
for f in <new-path>/.git/worktrees/*/commondir; do
[ -f "$f" ] || continue
grep -q "^/" "$f" && echo "WARNING: absolute commondir in $f — fix manually"
done
If worktrees have no meaningful changes (just settings.json), it's simpler to mv .claude/worktrees .claude/worktrees.bak and let them be recreated. *.bak is globally gitignored.
C. hooksPath in .git/config (and worktree configs):
Use git config to scope the fix to hooksPath only (avoid corrupting remote URLs or other config):
# Main repo
hooks_path=$(git -C <new-path> config core.hooksPath 2>/dev/null)
if [[ "$hooks_path" == *"$old_path"* ]]; then
git -C <new-path> config core.hooksPath "${hooks_path/$old_path/$new_path}"
fi
# Worktree-level configs may also override hooksPath
for wt_config in <new-path>/.git/worktrees/*/config; do
[ -f "$wt_config" ] || continue
grep -qF "$old_path" "$wt_config" && sd -F "$old_path" "$new_path" "$wt_config"
done
Search for old paths across common locations:
~/code/ (all repos — CLAUDE.md, specs, scripts, configs)~/.claude/ (rules, docs, settings)rg --no-ignore -l "$old_path_pattern" ~/code/ ~/.claude/ 2>/dev/null
For each match:
tmp/, archive/, .git/, node_modules/ matches — these are throwawayCheck for tmux sessions named after the repo:
tmux ls 2>/dev/null | grep -i "<repo-name>"
If found, send cd to the new path:
tmux send-keys -t <session> "cd <new-path>" Enter
After completing all automated steps, remind the user about:
crontab -l | grep <old-path> — update manually with crontab -eSpawn a detached tmux session running Claude Code in a chosen directory, seeded with an initial prompt, optionally reachable by Remote Control.
A human-facing index of every skill and agent in this repo, grouped by category, with a one-line trigger for each. Use only when the user explicitly asks "what skills do I have", "what can you do", "is there a skill for X", or invokes `/catalog` directly — never fires on its own.
House plot styling — pastel matplotlib defaults + annotation helpers. Use when making publication-quality figures, when the user asks to "style my plots", "use house style", "use pastelplot/anthroplot", or when generating any matplotlib figure for reports, papers, or decks.