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 both git@host:owner/repo.git and https://host/owner/repo.git). --others is 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-only by default, so a diverged branch reports a failure instead of creating a merge commit. Use --no-ff-only to allow merge pulls.

Gotchas

  • --depth is find -maxdepth; the default 1 only 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 origin are 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.