/ai-native-toolkit:reposyncfrom ai-native-toolkit
Bulk clones and keeps in sync every repo a user can access on GitHub or GitLab. Discovers repos via org teams, personal accounts, or GitLab groups, then clones new repos and fast-forward syncs existing ones into a worktree layout.
Ships in ai-native-toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
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,
personal account, or a GitLab host (gitlab.com or self-managed) with
--provider gitlab; see GitLab below. On GitHub: 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. Claude Code writes this skill's directory into the script paths below when it loads the skill, so each path is already absolute:
# 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 "${CLAUDE_SKILL_DIR}/scripts/reposync.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 "${CLAUDE_SKILL_DIR}/scripts/reposync.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 |
|---|---|
--provider github|gitlab | Which host type to sync (default: github) |
--root DIR | Directory to clone into; an explicit --root must already exist, in every mode (GitHub default: current directory; GitLab default: ~/dev/<host> with any :port dropped, created on the first real sync) |
--list-repos | List the deduplicated accessible repos and exit |
--porcelain | Machine-readable repo list: one path per line to stdout (GitHub: the repo name; GitLab: path_with_namespace), all chatter to stderr; implies --list-repos. Consumed by /repostate and by --from-list. |
--dry-run | Show what would be cloned/updated without making changes. On GitLab it creates no directory and writes no .gh_archived_repos; on GitHub it still refreshes .gh_archived_repos in the root |
--limit N | Process only the first N repos (useful for a quick test) |
--quiet | Suppress per-repository chatter, including the Cloning / Cloned lines; keep failures and the final summary |
--porcelain-json | Like --porcelain, but one JSON object per line: path, default_branch, last_activity_at, head_committed_at, archived, forked_from (path or null), mirror and head_sha. Reads each default-branch head (one API call per repository). See Active repositories and metadata |
--active-since DURATION | Keep only repositories with a default-branch commit inside the window (90d, 2w, 6mo, 1y). With --dry-run, prints qualifying and total counts per group. See Active repositories and metadata |
--partial | Shorthand for --filter blob:none |
--filter SPEC | New clones only: pass --filter=SPEC to git clone (after -- on gh repo clone). blob:none keeps full history and fetches file contents only for the checkout. See Analysis-only mirrors |
--shallow-since DATE | New clones only: pass --shallow-since=DATE to git clone, cutting history before DATE (single-branch). See Analysis-only mirrors |
--org NAME | GitHub only. Org or personal account to sync (default: basename of --root / cwd) |
--list-teams | GitHub only. List your teams in the org (with repo counts) and exit; orgs only |
--host HOST | GitLab only. Host to sync (default: gitlab.com); https:// and a trailing / are accepted, and so is a web port (host:8443) |
--group PATH | GitLab only. Sync one group and its subgroups instead of every group you belong to. Covers every project the group shows you, including when you belong only to a subgroup of it (projects directly in the group and in sibling subgroups count). If the group itself cannot be read, the run syncs your subgroups under it and prints one stderr warning naming them and what was skipped; with no subgroup of yours under it, the run syncs the projects under it you were added to directly, with one stderr warning; it fails only when nothing under the group is reachable. Direct memberships and starred projects outside the group are left out |
--include-starred | GitLab only. Also sync the projects you have starred (projects?starred=true), deduplicated with the rest; off by default. Cannot be combined with --from-list |
--from-list FILE | GitLab only. Sync the paths in FILE (the --porcelain format; blank lines and # comments ignored) with no discovery and no glab |
A flag that belongs to the other provider is rejected with an error, not ignored.
# Every project in every group you belong to on gitlab.com, into ~/dev/gitlab.com/
bash "${CLAUDE_SKILL_DIR}/scripts/reposync.sh" --provider gitlab --list-repos
bash "${CLAUDE_SKILL_DIR}/scripts/reposync.sh" --provider gitlab
# One group subtree on a self-managed host, into ~/dev/gitlab.example.com/
bash "${CLAUDE_SKILL_DIR}/scripts/reposync.sh" --provider gitlab --host gitlab.example.com --group platform/infra
glab api --paginate: the groups you belong to
(groups?min_access_level=10), each group's descendant_groups, each
group's projects and projects/shared, and the projects you are a
member of (projects?membership=true), which reaches a project you were
added to directly in a group you do not belong to or in another user's
namespace. --include-starred adds projects?starred=true. Dedupe is on
path_with_namespace, so a project reachable directly and through
sharing, shared into two groups, or listed by a group and by your
memberships, is cloned once. A failed membership or starred listing is
one stderr warning; the group listings still stand.path_with_namespace, so
nested subgroups become nested directories and a shared project from
another namespace sits under that namespace, not under the group it was
shared into: ~/dev/<host>/<group>/<subgroup>/<repo>/<repo>-main plus a
sibling worktree/.https://<host>/<path>.git, or
git@<host>:<path>.git with REPOSYNC_GIT_PROTOCOL=ssh. For HTTPS on a
private project, let glab auth login set up git credentials. A port on
--host is the web and API port: it stays in the HTTPS URL and is dropped
from the SSH URL. Set a non-standard SSH port for the host in
~/.ssh/config.~/dev/<host>, with any port dropped, so
--host gitlab.example.com:8443 syncs into ~/dev/gitlab.example.com/.
Two instances on one host name but different ports would share that
root: give one an explicit --root.--list-repos, --porcelain, --dry-run) create no
directory and write no .gh_archived_repos, so the list can be produced
on a machine that will never hold the checkouts. An explicit --root
must still exist.lib/gitlab/path_regex.rb): a segment
starts with a letter, digit, _ or . (so grp/.dotfiles syncs), then
letters, digits, _, - and .. Segments . and .., any segment
ending in .git or .atom, and .git in any case are skipped with a
warning. So is a first segment, in any case, that names one of reposync's
own root entries (.gh_archived_repos, or .gh_sync_tmp, which older
versions delete on every run); deeper segments may use those names.glab and
jq are installed and that glab auth status --hostname <host> passes. A
failure prints one line naming the host and the check (installed,
authentication or reachability) and exits non-zero. It does not retry, and
it never tunnels or works around network controls.Discovery needs the GitLab API; cloning needs only git. When the two are reachable from different places, split the run:
# 1. Where the API answers: save the project list.
bash "${CLAUDE_SKILL_DIR}/scripts/reposync.sh" --provider gitlab --host gitlab.example.com --porcelain > projects.txt
# 2. Where git reaches the host: clone and sync from the list. No glab needed.
bash "${CLAUDE_SKILL_DIR}/scripts/reposync.sh" --provider gitlab --host gitlab.example.com --from-list projects.txt
Step 2 builds the same layout as a discovery run and makes no API call.
Edit the list to drop projects; --limit applies to it too.
For a fleet measurement across hundreds of repositories, --active-since
drops the dormant ones and --porcelain-json hands each repository's
metadata to the next tool, so it does not have to call the API again:
bash "${CLAUDE_SKILL_DIR}/scripts/reposync.sh" --provider gitlab --host gitlab.example.com --porcelain-json --active-since 6mo > projects.jsonl
bash "${CLAUDE_SKILL_DIR}/scripts/reposync.sh" --org my-org --dry-run --active-since 90d
pushed_at moves for a
push to any branch, and GitLab's last_activity_at moves for issue and
merge request activity too. A repository whose activity date is older
than the window is dropped without another call; every other one is
confirmed with the committed date of its default branch's head commit,
one API call each. A repository whose head cannot be read is dropped
with a warning on stderr.Nd, Nw, Nmo (30 days) or Ny (365 days),
counted back from now.--dry-run --active-since prints the qualifying and total counts per
GitLab group, where a project counts in each group whose listing
returned it (its own group and any group it is shared into); a project
found only through your memberships or stars counts under its own
namespace. On GitHub,
where teams overlap, it prints one count for the whole org or account.
These lines print under --quiet too.--porcelain-json fields. last_activity_at is GitHub's pushed_at
or GitLab's last_activity_at. forked_from is the parent's path
(owner/name on GitHub) or null. mirror is true or false, or
null when the token cannot read it (GitLab shows it only to some
roles); null never means "not a mirror". head_sha and
head_committed_at are null when the head could not be read.--porcelain is unchanged: one path per line, no extra API
calls, so /repostate and --from-list keep working. Neither new flag
works with --from-list, which makes no API call to read metadata from.For a root that is cloned to be scanned once (for example by /assess)
rather than worked in, --partial and --shallow-since cut clone time
and disk:
bash "${CLAUDE_SKILL_DIR}/scripts/reposync.sh" --org my-org --partial
bash "${CLAUDE_SKILL_DIR}/scripts/reposync.sh" --org my-org --shallow-since 2025-01-01
blob:none clone has every commit and tree, so git log --name-only and
churn and staleness scans match a full clone. Any git command that reads
file contents from history fetches the missing blobs lazily from the
remote, one round trip at a time: git log -M rename detection,
--numstat, and git blame in the /assess scans all do. Expect those
scans to be slow and to need network access.--shallow-since drops history before DATE, which changes churn and
staleness results. The clone is single-branch, so a worktree added
later for another branch never sees that branch move. A repository with no commits after DATE may come back
with its full history instead.git config remote.origin.partialclonefilter and
git rev-parse --is-shallow-repository.<root>/<path>/ # GitHub: the repo name; GitLab: path_with_namespace
├── <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.glab and jq on PATH, and glab auth status --hostname <host> must pass (--from-list needs only git and jq).jq
separately (winget install jqlang.jq); Git Bash does not include it.
Installs and PATH notes: the Windows setup guide.
timeout is part of Git Bash.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.REPOSYNC_BLACKLIST="repo-a repo-b" to skip oversized or
problematic repos. Entries are repository paths (group/sub/repo on
GitLab).GHSYNC_BLACKLIST and GHSYNC_GIT_PROTOCOL, the
names before the rename to reposync, are still read when the REPOSYNC_
variable is unset, with a deprecation warning on stderr.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.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub bjcoombs/ai-native-toolkit --plugin ai-native-toolkit21 skills in this plugin
/6hatsSix Thinking Hats Analysis/ab-equivalenceCompare two versions of an LLM-directed document - an original (teacher) and a candidate (student) - across a transfer set and return a per-case behavioural-equivalence verdict plus an efficiency signal. A transform-agnostic library capability other skills compose to gate a transform on behavioural sameness. TRIGGER when asked to A/B test two versions of a prompt / instruction / skill, to check whether a rewritten or compressed document still behaves the same as the original, to validate behavioural equivalence between two document versions, to gate a transform on no-regression, or when a skill needs the run-the-runner-on-both-versions-and-judge-equivalence capability./assessAssess a codebase's readiness for AI agent contributors against its maturity model of practices and autonomy Steps, and generate a complexity hotspot SVG treemap (size = LOC, hue = cyclomatic complexity, saturation = recent git churn). TRIGGER when the user types /assess, asks for an AI-readiness review, wants a complexity heatmap or hotspot map, asks 'how complex is this code?', wants migration risk triage, or asks for a codebase snapshot/report. Produces an MD report + SVG that can be opened as a PR in the target repo./assess-findingsRenders the /assess report from the deterministic run-context.json and the practice scorecard - the scorecard, the verbatim cross-practice findings, the findings where the repository says one thing and does another, and the mandatory Top 3 Actions. TRIGGER when the /assess orchestrator reaches the report-writing step; not a standalone user command./assess-followupThe /assess end-of-run offers - open a PR with the report, track the Top 3 Actions in the user's issue tracker, freeze the assessment into a CI gate, and file tool feedback. TRIGGER when the /assess orchestrator reaches the end-of-run offers; not a standalone user command./deslopDetect and remove the telltale signs of AI-generated 'slop' from any written text - articles, reports, emails, essays, bios, marketing copy, documentation, encyclopedia entries, or anything meant to read as if a thoughtful human wrote it. Apply silently as a quality gate before finalizing substantial prose, and explicitly when asked to clean a draft. TRIGGER when the user says 'make this sound less like AI', 'remove the AI tells', 'de-slop this', 'check if this reads as AI-written', 'make it sound human', 'edit out the ChatGPT voice', or critiques a draft as generic, puffy, or robotic, or asks for plain-language English for second-language readers or machine translation ('/deslop --plain'). Based on Wikipedia's 'Signs of AI writing' field guide.Other plugins' skills for the same job