From ai-native-toolkit
Bulk clones and keeps in sync every GitHub repo you can access across an org or personal account. Discovers repos via team membership and org lists, deduplicates, clones new ones, and fast-forward syncs existing ones.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ai-native-toolkit:ghsyncThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Onboarding into a new enterprise means finding and cloning dozens of repos by
Onboarding into a new enterprise means finding and cloning dozens of repos by hand, then drifting out of date. This skill does both halves: it discovers everything you can reach and keeps it in sync.
It is org-agnostic — point it at any GitHub org, GitHub Enterprise host, or personal account. The script detects the account type itself: for an organization it unions the teams you belong to with the org's repo list (so direct-collaborator and public repos are included even with no team membership); for a personal account it uses the account's repo list (private repos included when it's your own account).
The script lives next to this file. Resolve its directory the same way the
other skills do (works whether installed as a plugin or hand-placed under
~/.claude/skills/):
SKILL_DIR="${CLAUDE_PLUGIN_ROOT:+$CLAUDE_PLUGIN_ROOT/skills/ghsync}"
SKILL_DIR="${SKILL_DIR:-$(dirname "$(realpath ~/.claude/skills/ghsync/SKILL.md)")}"
# Org is derived from the directory you run in. To mirror the "meridianhub"
# org, run from a directory named meridianhub:
cd ~/dev/github.com/meridianhub
bash "$SKILL_DIR/scripts/ghsync.sh"
The org defaults to the basename of the directory you launch from. So
running inside ~/dev/github.com/meridianhub syncs the meridianhub org into
that directory. Override the org name or target directory explicitly when they
differ:
bash "$SKILL_DIR/scripts/ghsync.sh" --org meridianhub --root ~/dev/github.com/meridianhub
--list-repos first (or --list-teams
for an org) so the user sees which account and how many repos before any
cloning. This doubles as a check that the derived account name is correct.--dry-run) to preview clones
and updates without touching disk.| Flag | Effect |
|---|---|
--org NAME | Org or personal account to sync (default: basename of --root / cwd) |
--root DIR | Directory to clone into (default: current directory) |
--list-teams | List your teams in the org (with repo counts) and exit; orgs only |
--list-repos | List the deduplicated accessible repos and exit |
--dry-run | Show what would be cloned/updated without making changes |
--limit N | Process only the first N repos (useful for a quick test) |
--quiet | Suppress per-repository chatter; keep the final summary |
<root>/<repo>/
├── <repo>-main/ # default-branch checkout, kept clean and up to date
└── worktree/ # ready for `git worktree add ...`
This matches the worktree convention the rest of the toolkit assumes:
<repo>-main stays on the default branch and clean, and feature work happens in
sibling worktrees.
git pull --ff-only) — no merge commits,
no rebases, never a force.<repo>-main structure is flagged
(Wrong structure) rather than touched.gh and jq on PATH, and gh auth status must be authenticated. The
script checks both up front.gh uses its configured host. Target a GHE instance by
setting GH_HOST=github.example.com or running
gh auth login --hostname github.example.com first.gh api user/teams) and the org repo list (gh repo list <org>), which also
surfaces public repos and repos reachable via direct collaborator grants
outside any team. Team membership is not a precondition — a user on no
team still syncs every repo they can otherwise access. For a personal
account, repos come from gh repo list <account> (includes private repos
when authenticated as that account). Empty repos with no default branch are
skipped in both cases.GHSYNC_BLACKLIST="repo-a repo-b" to skip oversized or
problematic repos.timeout: optional but recommended (brew install coreutils) — caps each
repo at 5 minutes so one hung clone can't stall the run.<root>/.gh_archived_repos for reference.npx claudepluginhub bjcoombs/ai-native-toolkit --plugin ai-native-toolkitGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.