Skip to content
Agentmart
Submit a tool

ghsync

Bulk clone and keep in sync every GitHub repo you can access across an org or personal account.

Skill by bjcoombs

IndexedApache-2.0★ 32
Write a review

Chalk Labs

Need help deploying ghsync?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/bjcoombs-ghsync

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Bulk clone and keep in sync every GitHub repo you can access across an org or personal account. For an org it unions the repos reachable through the teams you belong to with the org's repo list (so direct-collaborator and public repos count even with no team membership); for a personal account it uses the account's repo list. Deduplicates them, then clones new ones and fast-forward syncs existing ones (and their worktrees) into a consistent <repo>/<repo>-main + <repo>/worktree layout. The org defaults to the directory you run from, so dropping into ~/dev/github.com/<org> mirrors that org. TRIGGER when the user types /ghsync, wants to clone or sync all org repos or their own personal repos, asks to mirror everything they have access to, is onboarding into a new enterprise/org, or wants to refresh their local checkouts to latest.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Shell scripts

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/ghsync

What's inside

Skill name
ghsync
Description
Bulk clone and keep in sync every GitHub repo you can access across an org or personal account. For an org it unions the repos reachable through the teams you belong to with the org's repo list (so direct-collaborator and public repos count even with no team membership); for a personal account it uses the account's repo list. Deduplicates them, then clones new ones and fast-forward syncs existing ones (and their worktrees) into a consistent <repo>/<repo>-main + <repo>/worktree layout. The org defaults to the directory you run from, so dropping into ~/dev/github.com/<org> mirrors that org. TRIGGER when the user types /ghsync, wants to clone or sync all org repos or their own personal repos, asks to mirror everything they have access to, is onboarding into a new enterprise/org, or wants to refresh their local checkouts to latest.
License
Apache-2.0
Instructions
115 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts

Files (2)

  • SKILL.md
  • ghsync.sh · scripts/

SKILL.md (first lines)

# ghsync: mirror and sync every repo you can access

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**.

- **First run** — clones every accessible repo into a worktree-friendly layout.
- **Every run after** — fast-forward updates repos already on their default
  branch, updates their worktrees, and clones anything new. It never clobbers
  local work: repos with uncommitted changes or on a non-default branch are
  fetched but not pulled, and reported in the summary.

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).

## How to run it

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:

```bash
# 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/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
bash "${CLAUDE_SKILL_DIR}/scripts/ghsync.sh" --org meridianhub --root ~/dev/github.com/meridianhub
```

## What to do when invoked

1. **Confirm the target.** Run with `--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.
2. **Dry run on first use against a new org** (`--dry-run`) to preview clones
   and updates without touching disk.
3. **Run the real sync.** Stream the output; the run ends with a summary
   (up-to-date / updated / failed / uncommitted / branch issues / worktrees).
4. **Surface the exceptions.** Call out anything under *Failed*, *Uncommitted
   changes*, or *Not on default branch* — these are the repos the user may need
   to deal with manually.

## Flags

| 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 |
| `--porcelain` | Machine-readable repo list: one name per line to stdout, all chatter to stderr; implies `--list-repos`. Consumed by downstream tooling such as `/ghreport`. |
| `--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 |

## Layout produced

```
<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.

## Sync safety rules

- Repos with **uncommitted changes** are fetched but not pulled (reported under
  *Uncommitted changes*).
- Repos **not on their default branch** are fetched but not pulled (reported
  under *Not on default branch*).
- Updates are **fast-forward only** (`git pull --ff-only`) — no merge commits,
  no rebases, never a force.
- Worktrees on the default branch with no local changes are fast-forwarded too.
- A repo that exists locally without the `<repo>-main` structure is flagged
  (*Wrong structure*) rather than touched.

## Requirements & configuration

- **`gh` and `jq`** on `PATH`, and `gh auth status` must be authenticated. The
  script checks both up front.
- **GitHub Enterprise:** `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.
- **Access model:** for an **organization**, repos are discovered by unioning
  two sources and deduplicating: the **teams you belong to** (`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.
- **Blacklist:** export `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.
- **Archived repos** are skipped from cloning and cached to
  `<root>/.gh_archived_repos` for reference.

From bjcoombs/ai-native-toolkit, Apache-2.0.

More from bjcoombs/ai-native-toolkit

Signals

Stars
32
Forks
5
Open issues
7
Last commit (this folder)
Sep 19, 2026 (1 month ago)
Last release
Oct 11, 2026 (19 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from bjcoombs

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get ghsync running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying ghsync?

CallGet help
Cite this page

ghsync skill. Agent Mart. https://agentmart.dev/skills/bjcoombs-ghsync (last updated 2026-10-24)