← Back to Skills Marketplace
duanc-chao

Clone master

by wow · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
183
Downloads
0
Stars
1
Active Installs
1
Versions
Install in OpenClaw
/install clone
Description
Guide agents to clone GitHub repositories using git clone with SSH or HTTPS authentication, handle branches, submodules, shallow clones, and keep repos updat...
README (SKILL.md)

技能名称:GitHub 仓库克隆与同步专家

技能描述

本技能指导 Agent 熟练掌握使用 Git 工具从 GitHub 获取代码仓库的全过程。它不仅涵盖了基础的 git clone 命令,还深入到了认证配置(SSH vs HTTPS)、分支管理、子模块处理以及增量更新等高级场景。Agent 将能够根据用户的网络环境和权限需求,选择最优的克隆策略,确保代码完整、安全地同步到本地环境。

核心指令集

1. 环境预检与配置

在执行克隆之前,Agent 必须确保本地环境已准备好。

  • Git 安装检查: 运行 git --version。如果未安装,需引导用户前往 Git 官网或包管理器进行安装。
  • 身份认证配置: 这是克隆私有仓库或进行推送的前提。
    • SSH 方式(推荐): 指导生成 SSH 密钥 (ssh-keygen) 并添加到 GitHub 账户。使用 [email protected]:username/repo.git 格式。
    • HTTPS 方式: 使用 https://github.com/username/repo.git 格式。需提醒用户配置凭据管理器或使用 Personal Access Token (PAT) 代替密码。

2. 基础克隆操作

指导用户执行标准的仓库下载。

  • 标准克隆: 使用 git clone \x3Crepository_url>。这会将远程仓库的所有文件、提交历史和分支信息下载到当前目录下的一个同名文件夹中。
  • 指定目录名: 如果用户希望自定义文件夹名称,使用 git clone \x3Crepository_url> \x3Cdirectory_name>

3. 高级克隆策略

针对不同的开发需求,Agent 需掌握特定的克隆参数。

  • 浅克隆: 对于大型仓库或只需最新代码的场景,使用 git clone --depth 1 \x3Crepository_url>。这仅下载最新的提交记录,极大节省时间和带宽。
  • 特定分支克隆: 若只需特定分支(如 develop),使用 git clone -b \x3Cbranch_name> \x3Crepository_url>
  • 包含子模块: 许多项目依赖子模块。必须使用 git clone --recursive \x3Crepository_url>。如果已克隆但未初始化子模块,需执行 git submodule update --init --recursive

4. 仓库同步与更新

克隆只是开始,Agent 需指导如何保持本地代码与远程同步。

  • 拉取更新: 在已克隆的目录中,运行 git pull origin \x3Cbranch_name> 获取并合并远程变更。
  • 变基同步: 为了保持提交历史整洁,推荐使用 git pull --rebase

5. 故障排查与安全

  • 权限被拒绝: 检查 SSH 密钥是否正确添加到 ssh-agent,或 HTTPS 密码是否为 Token。
  • 连接超时: 可能是网络问题,建议检查代理设置或尝试切换 DNS。
  • 证书验证失败: 在企业环境中常见,通常涉及自签名证书,需谨慎处理 http.sslVerify 配置。

常见问题排查

"Permission denied (publickey)"

  • 诊断: 本地没有配置 SSH 密钥,或者公钥未添加到 GitHub 账户。
  • 解决: 运行 cat ~/.ssh/id_rsa.pub 查看公钥。如果没有,生成一个新的。将公钥内容复制到 GitHub 的 "SSH and GPG keys" 设置中。

"fatal: destination path '...' already exists and is not an empty directory"

  • 诊断: 尝试克隆到一个已经存在且非空的文件夹。
  • 解决: 要么删除该文件夹,要么在 git clone 命令后指定一个新的、不存在的文件夹名称。

克隆速度极慢

  • 诊断: 仓库体积过大或网络连接不佳。
  • 解决: 建议使用浅克隆 (--depth 1) 仅获取最新代码。如果是网络波动,建议配置全局代理 (git config --global http.proxy ...)。

技能扩展建议

Fork 工作流

扩展技能以指导用户 Fork 仓库到自己的账户,然后克隆自己的 Fork,并配置上游远程仓库 (git remote add upstream) 以便同步原项目的更新。

GitHub CLI 集成

引入 gh 命令行工具,教导用户使用 gh repo clone \x3Crepo> 进行交互式克隆,这通常比原生 Git 更便捷,且自动处理认证。

镜像克隆

针对需要迁移整个仓库(包括所有引用和refs)的场景,指导使用 git clone --mirror,这通常用于备份或迁移到另一个 Git 服务器。

Usage Guidance
This is a straightforward, instruction-only guide for cloning and syncing GitHub repos. It does not request secrets or install software automatically, but it will instruct an agent (or you) to run git/ssh commands that read or write files (e.g., cloning into a directory, reading ~/.ssh/id_rsa.pub). Before following commands: (1) confirm any commands the agent proposes, especially those that delete or overwrite directories; (2) never paste or expose private keys or raw tokens—only add public keys to GitHub; (3) be aware that optional recommendations (installing gh, configuring proxies) require you to install/configure additional tools; and (4) if you allow autonomous agent actions, ensure you trust the agent to run filesystem-changing git commands.
Capability Analysis
Type: OpenClaw Skill Name: clone Version: 1.0.0 The skill bundle provides standard, educational instructions for an AI agent to assist users with Git operations, such as cloning repositories, managing authentication (SSH/HTTPS), and handling submodules. The content in SKILL.md is aligned with its stated purpose as a GitHub repository management guide and contains no evidence of malicious intent, data exfiltration, or unauthorized execution.
Capability Assessment
Purpose & Capability
The name and description promise guidance for cloning and syncing GitHub repos; the SKILL.md only contains git-related instructions (clone options, auth setup, submodules, sync, troubleshooting). No unrelated binaries, env vars, or credentials are requested.
Instruction Scope
Runtime instructions are limited to Git operations and related local diagnostics (e.g., checking git version, showing ~/.ssh/id_rsa.pub). Accessing the user's public SSH key or guiding them to generate a key is appropriate and necessary for SSH auth. There are no instructions to read unrelated files or to transmit data to unexpected endpoints.
Install Mechanism
There is no install spec and no code files; the skill is instruction-only, so nothing is downloaded or written to disk by the skill itself.
Credentials
The skill requests no environment variables or credentials. Suggested items (SSH keys, PATs, gh CLI) are relevant to GitHub auth and are presented as user-driven actions rather than implicit requirements.
Persistence & Privilege
The skill is not always-enabled and does not request elevated persistence. It does recommend running local git commands that will create/update files (normal for its purpose); autonomous invocation is allowed by platform default but not unusually privileged by the skill itself.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install clone
  3. After installation, invoke the skill by name or use /clone
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release: Comprehensive GitHub repository cloning and sync guide - Covers setup, authentication (SSH/HTTPS), and basic `git clone` operations. - Provides advanced cloning options: shallow clone, branch clone, submodule handling. - Details procedures for keeping local code in sync with remote repositories. - Includes troubleshooting tips for common issues like permission errors and slow cloning. - Suggests skill extensions for Fork workflow, GitHub CLI integration, and full repository mirroring.
Metadata
Slug clone
Version 1.0.0
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 1
Frequently Asked Questions

What is Clone master?

Guide agents to clone GitHub repositories using git clone with SSH or HTTPS authentication, handle branches, submodules, shallow clones, and keep repos updat... It is an AI Agent Skill for Claude Code / OpenClaw, with 183 downloads so far.

How do I install Clone master?

Run "/install clone" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Clone master free?

Yes, Clone master is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Clone master support?

Clone master is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Clone master?

It is built and maintained by wow (@duanc-chao); the current version is v1.0.0.

💬 Comments