agent/pull-dev-repos/SKILL.md
name: pull-dev-repos description: >- Pull/update all git repos under ~/dev (fast-forward only); optionally only third-party repos not owned by you. Use when the user wants to sync, update, or pull all their local dev repos at once.
pull-dev-repos
Fast-forward every git repo under a root dir (default ~/dev) in one pass,
skipping anything that isn't safe to touch. Built to be adapted — change the
root, the owner filter, or the pull strategy via flags, not by editing the loop.
When to use this
- "pull all my repos", "update everything in ~/dev", "sync my local repos".
- "only pull the ones that aren't mine" →
--others.
Command
~/.claude/skills/pull-dev-repos/pull-repos.sh [options]
Common forms:
pull-repos.sh # ff-only pull every repo under ~/dev
pull-repos.sh --others # only repos whose owner != $PULL_REPOS_OWNER
pull-repos.sh --only someowner # only one owner
pull-repos.sh --exclude foo # everything except owner foo
pull-repos.sh --dry-run # show would-update / behind counts, change nothing
pull-repos.sh --root ~/web --depth 2 # different root, scan 2 levels deep
How it decides
- Owner is parsed from
origin(works for bothgit@host:owner/repo.gitandhttps://host/owner/repo.git).--othersis shorthand for--exclude "$PULL_REPOS_OWNER"; matching is case-insensitive. - A repo is skipped (not failed) when it is dirty, on a detached HEAD, has
no upstream tracking branch, or has no
origin. It is never force-touched. - Pulls are
--ff-onlyby default, so a diverged branch reports a failure instead of creating a merge commit. Use--no-ff-onlyto allow merge pulls.
Gotchas
--depthisfind -maxdepth; the default1only sees repos that are direct children of the root. Nested repos (e.g.~/web/app/.git) need--depth 2+.- Override the root without a flag via
PULL_REPOS_ROOT=/path. - Only working clones with an
originare pulled; a tool installed via a package manager (even if also cloned for hacking) is otherwise untouched.
Adapting it
The per-repo decision block is linear and commented; add a new skip reason or a
new filter mode beside the existing exclude/only cases. Keep the contract:
read state, skip anything unsafe, report every repo, fast-forward only unless
told otherwise.
