跳到正文
cccskills
免费在 GitHub 公开

sync-repos

Smart sync of all Egregore repos (memory + managed repos + current repo) — fetches first, only pulls if behind. Use for /sync-repos or 'sync all repos'.

中文简介正在准备中。当前显示原文说明。

egregore-labs/egregore星标 293(GitHub 293 + cccskills 0)

实测评分 未实测

查看安装方法

包含的文件(1)

  • SKILL.md3.0 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Smart sync of all Egregore repos. Fetches first, only pulls if behind.

When to invoke

User says: "/sync-repos", "sync all repos", "sync everything", "get every repo up to date"

Execution boundary

This is deterministic multi-repository sync. Run it inline with bounded parallel fetches; do not spend a Loom/model-routing call or delegate it to another agent.

Repos to sync

  • ../{memory_dir} — shared knowledge (derived from memory_repo in egregore.json)
  • Any repos listed in the repos array in egregore.json (as sibling directories ../{repo})
  • Current repo (egregore-core)

Read egregore.json first to get the dynamic list:

# Memory repo directory
bash bin/config-get.sh memory_dir

# Managed repos
bash bin/config-get.sh repos

Use the first command’s printed value as {memory_dir} and each line from the second as a managed {repo} name; for each value, quote it in single quotes when you use it in a command, and write any single quote inside the value as '\''. If a command prints nothing, it contributes no repo to sync.

Execution

For each repo, run these commands:

# 1. Fetch (always)
git -C /path/to/repo fetch origin --quiet

# 2. Compare local vs remote
git -C /path/to/repo rev-parse HEAD
git -C /path/to/repo rev-parse origin/main

Use the printed revisions as {local_sha} and {remote_sha}. If they differ, pull and then count commits behind:

# 3. Only pull if different
git -C /path/to/repo pull origin main --quiet
# Count commits behind
git -C /path/to/repo rev-list HEAD..origin/main --count

Use the printed count as {behind} for the output. If the revisions match, report the repo as up to date and skip the pull and count.

For the current repo (egregore-core): sync the develop branch instead of main:

# Update local develop ref without switching branches (safe for concurrent sessions)
git fetch origin develop:develop --quiet
# If on dev/* branch, rebase onto develop
git branch --show-current

Use the printed value as {branch}. If it starts with dev/, rebase onto develop:

git rebase develop --quiet

If the rebase fails, run git rebase --abort, then git merge develop -m 'Sync with develop'. Continue to the merge only if the abort succeeds:

git rebase --abort
git merge develop -m 'Sync with develop'

For any other branch, skip the rebase and merge.

Use absolute paths with git -C to avoid permission prompts.

Output format

Syncing Egregore repos...

  {memory-dir}       ↓ 3 commits → pulled
  {repo-1}           ✓ up to date
  {repo-2}           ✓ up to date
  egregore-core      ↓ 1 commit → pulled

Rules

  • Use git -C /absolute/path — no cd commands
  • Fetch ALL repos first (parallel if possible), then compare/pull
  • Show commit count when pulling
  • Skip repos that don't exist (no error)

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

activity

免费

Explicit Activity card only. Use when the user names /activity or directly asks to show, open, or render the Activity dashboard/card. Never use it to answer or synthesize what the team is focused on, busy with, prioritizing, or doing; analytical organizational questions use Search/Runtime QMD.

中文简介正在准备中。当前显示原文说明。

egregore-labs/egregore2932026年10月17日 更新

announce

免费

Draft, preview, and explicitly send an Egregore group announcement. Use for /announce, telling the team something, or notifying everyone—not a direct message or structured handoff.

中文简介正在准备中。当前显示原文说明。

egregore-labs/egregore2932026年10月17日 更新

archive

免费

Capture an effective prompting or steering technique as a reusable canonical pattern. Use when a prompt chain worked especially well; use /reflect for insight about the work and /note for a private thought.

中文简介正在准备中。当前显示原文说明。

egregore-labs/egregore2932026年10月17日 更新

branch

免费

Create a working branch from what you are about to work on. Use for /branch, or any request to start a new branch before making changes.

中文简介正在准备中。当前显示原文说明。

egregore-labs/egregore2932026年10月17日 更新

checkup

免费

Run diagnostics on an Egregore environment and render a health report, repairing safe local Runtime problems when possible. Use for /checkup, a health check, or when something is broken and the root cause is unclear.

中文简介正在准备中。当前显示原文说明。

egregore-labs/egregore2932026年10月17日 更新

commit

免费

Stage changes and create a commit with a properly formatted message. Use for /commit, or saving work locally — not sharing it (/push) or opening a pull request (/pr).

中文简介正在准备中。当前显示原文说明。

egregore-labs/egregore2932026年10月17日 更新

查看 egregore-labs 的全部技能

报告此技能的问题