/github-gitlab-mirror
Audits or synchronizes the authoritative GitHub main branch to the internal GitLab mirror without importing GitLab-only history back into GitHub. Use when checking GitHub/GitLab consistency, updating the internal mirror, or resolving a divergence between the two remotes.
$ npx -y skills add AgentsMesh/AgentsMesh --skill github-gitlab-mirror --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/github-gitlab-mirror
Context preview
The summary Claude sees to decide when to auto-load this skill.
Audits or synchronizes the authoritative GitHub main branch to the internal GitLab mirror without importing GitLab-only history back into GitHub. Use when checking GitHub/GitLab consistency, updating the internal mirror, or resolving a divergence between the two remotes.
SKILL.md
github-gitlab-mirror.SKILL.mdname: github-gitlab-mirror
description: >-
Audits or synchronizes the authoritative GitHub main branch to the internal
GitLab mirror without importing GitLab-only history back into GitHub. Use
when checking GitHub/GitLab consistency, updating the internal mirror, or
resolving a divergence between the two remotes.
GitHub to GitLab Mirror
GitHub `main` is the single source of truth. GitLab exists to build and deploy the same commit internally.
Safety Rules
- Discover both remotes from their URLs; do not assume they are named `origin`
and `gitlab`.
- Never merge, cherry-pick, or push GitLab-only commits into GitHub.
- A fast-forward update to GitLab may proceed after verification.
- Rewriting a divergent GitLab branch requires explicit user authorization and
an exact `--force-with-lease` expectation.
- Do not change the local branch or working tree to mirror remote refs.
Status
1. Fetch both authoritative refs:
git remote -v
git fetch <github-remote> main
git fetch <gitlab-remote> main
2. Record both SHAs and show commits unique to either side:
git rev-parse <github-remote>/main
git rev-parse <gitlab-remote>/main
git log --oneline <gitlab-remote>/main..<github-remote>/main
git log --oneline <github-remote>/main..<gitlab-remote>/main
3. Classify the relationship:
- Equal: already mirrored.
- GitLab is an ancestor of GitHub: safe fast-forward.
- GitHub is an ancestor of GitLab: GitLab contains mirror-only commits.
- Neither is an ancestor: the remotes diverged.
Synchronize
For a verified fast-forward:
git push <gitlab-remote> <github-remote>/main:refs/heads/main
For a GitLab-ahead or divergent branch, stop and display the GitLab-only commits. An explicit request to restore GitLab as the GitHub mirror authorizes discarding those mirror-only commits. Use the previously fetched GitLab SHA as the lease:
git push \
--force-with-lease=refs/heads/main:<expected-gitlab-sha> \
<gitlab-remote> \
<github-remote>/main:refs/heads/main
If the lease fails, fetch and reassess instead of weakening the protection.
Verify
Fetch both remotes again and require exact SHA equality from fresh refs:
git fetch <github-remote> main
git fetch <gitlab-remote> main
test "$(git rev-parse <github-remote>/main)" = \
"$(git rev-parse <gitlab-remote>/main)"
If GitHub advanced during the synchronization, return to the Status phase and mirror the new SHA. Do not claim success until one fresh fetch of both remotes observes equality.
Report both final SHAs and whether the GitLab build/deploy pipeline was triggered. Do not describe the mirror as synchronized until the SHAs match. The scheduled mirror job in `.gitlab-ci.yml` is the automation reference.
Read more
name: github-gitlab-mirror description: >- Audits or synchronizes the authoritative GitHub main branch to the internal GitLab mirror without importing GitLab-only history back into GitHub. Use when checking GitHub/GitLab consistency, updating the internal mirror, or resolving a divergence between the two remotes.
GitHub to GitLab Mirror
GitHub `main` is the single source of truth. GitLab exists to build and deploy the same commit internally.
Safety Rules
- Discover both remotes from their URLs; do not assume they are named `origin`
and `gitlab`.
- Never merge, cherry-pick, or push GitLab-only commits into GitHub.
- A fast-forward update to GitLab may proceed after verification.
- Rewriting a divergent GitLab branch requires explicit user authorization and
an exact `--force-with-lease` expectation.
- Do not change the local branch or working tree to mirror remote refs.
Status
1. Fetch both authoritative refs:
git remote -v git fetch <github-remote> main git fetch <gitlab-remote> main
2. Record both SHAs and show commits unique to either side:
git rev-parse <github-remote>/main git rev-parse <gitlab-remote>/main git log --oneline <gitlab-remote>/main..<github-remote>/main git log --oneline <github-remote>/main..<gitlab-remote>/main
3. Classify the relationship:
- Equal: already mirrored.
- GitLab is an ancestor of GitHub: safe fast-forward.
- GitHub is an ancestor of GitLab: GitLab contains mirror-only commits.
- Neither is an ancestor: the remotes diverged.
Synchronize
For a verified fast-forward:
git push <gitlab-remote> <github-remote>/main:refs/heads/main
For a GitLab-ahead or divergent branch, stop and display the GitLab-only commits. An explicit request to restore GitLab as the GitHub mirror authorizes discarding those mirror-only commits. Use the previously fetched GitLab SHA as the lease:
git push \ --force-with-lease=refs/heads/main:<expected-gitlab-sha> \ <gitlab-remote> \ <github-remote>/main:refs/heads/main
If the lease fails, fetch and reassess instead of weakening the protection.
Verify
Fetch both remotes again and require exact SHA equality from fresh refs:
git fetch <github-remote> main git fetch <gitlab-remote> main test "$(git rev-parse <github-remote>/main)" = \ "$(git rev-parse <gitlab-remote>/main)"
If GitHub advanced during the synchronization, return to the Status phase and mirror the new SHA. Do not claim success until one fresh fetch of both remotes observes equality.
Report both final SHAs and whether the GitLab build/deploy pipeline was triggered. Do not describe the mirror as synchronized until the SHAs match. The scheduled mirror job in `.gitlab-ci.yml` is the automation reference.
The AI Agent Workforce Platform. Run a hundred AI coding agents across your own machines — schedule, isolate, and steer them all from one console.
Repo: AgentsMesh/AgentsMesh
Other skills on agentsmesh.
- /arch-check
架构与实现审查 —— 基于「概念建模 → 职责划分 → 机制/策略分离 → 因果与不变量 → 属性建模 → 模块化 → SOLID → GRASP → YAGNI」的全维度审查,带置信度门控与假阳性抑制(对抗"过度工程建议"这类 AI slop)。触发于:要求 review/审查架构、检查目录结构/依赖关系/职责划分、重构前评估、技术债盘点、判断是否过度设计,或问「这个设计合理吗 / 该怎么拆 / 有没有循环依赖 / 这个改动架构上 OK 吗」。一律按最高强度审查。用法:`arch-check [范围]
Open skill - /e2e
Selects and runs the appropriate AgentsMesh end-to-end suite for Web, Desktop, MCP, or iOS, including worktree-specific environment setup and browser-level verification. Use when a change needs E2E coverage, a user asks to execute or diagnose an E2E test, or a cross-service
Open skill - /gh-merge
Completes the AgentsMesh GitHub pull-request workflow: commits scoped changes, rebases on the authoritative GitHub branch, opens or reuses a PR, monitors required checks, fixes failures, and merges only after verification. Use when the user asks to merge, submit, or land
Open skill - /worktree
Creates or reuses an isolated AgentsMesh Git worktree from a verified base branch, preserves existing changes, and optionally starts the worktree-scoped development environment. Use when the user asks for a new worktree or isolated work for a feature, fix, investigation, or
Open skill

