本文へ移動
cccskills
無料GitHub で公開

github-mirror

自动寻找当前网络环境下最快的 GitHub 代理镜像,用于克隆仓库、下载文件或获取 Release 资产。当需要从 github.com 下载任何内容时使用本 skill——包括 git clone、wget/curl 下载、Release 资产获取等。

インストール方法を見る

含まれるファイル(4)

  • SKILL.md4.8 KB
  • .gitignore85 B
  • README.md1.5 KB
  • scripts/mirror-scout.py26.0 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

GitHub 镜像加速 — 自动寻找并使用最快的 GitHub 代理

当需要从 GitHub 下载代码时,直连可能很慢或被阻断。本 skill 自动寻找当前网络环境下最快的 GitHub 代理镜像,然后使用它完成下载。

使用场景

以下任何涉及从 GitHub 下载的操作均应使用本 skill:

  • git clone GitHub 仓库
  • wget/curl 下载 github.com 或 raw.githubusercontent.com 的文件
  • 下载 Release 资产(tarball、二进制文件)
  • 获取 GitHub 仓库中的原始文件
  • 任何缓慢或超时的 GitHub API 下载

工作流程

第一步:检查缓存,直接使用已知镜像

先读取缓存文件 {skill_dir}/scripts/mirrors-github.txt:

cat {skill_dir}/scripts/mirrors-github.txt
  • 如果文件存在且有内容:取第一行作为 BEST_MIRROR,直接跳到第三步使用它。无需测速,无需爬取。
  • 如果文件不存在或为空:进入第二步,运行完整的测速流程来填充缓存。

第二步(仅在缓存不可用时):运行 Mirror Scout 测速

运行 mirror-scout 工具对可用的 GitHub 代理镜像进行测速排名:

python3 {skill_dir}/scripts/mirror-scout.py --github --no-scrape --top 5

默认加 --no-scrape 跳过网页爬取以节省时间,仅测试内置可靠镜像和缓存中的镜像。

如果缓存为空且 --no-scrape 没有找到可用镜像,去掉该参数进行完整爬取:

python3 {skill_dir}/scripts/mirror-scout.py --github --top 5

该工具会:

  1. 从 mirrors-github.txt 加载已知镜像
  2. (可选)从内置来源爬取更多候选镜像
  3. 通过每个镜像下载测试文件并测量实际速度
  4. 按下载速度排名并展示前 5 个
  5. 将结果保存回 mirrors-github.txt,下次直接使用缓存

第二步附:解析输出并选择最佳镜像

输出会展示排名结果,类似:

=== Ranking by download speed  ===
Rank  Speed          Latency      Mirror
1     12.34 MiB/s    0.234s       https://ghfast.top
2      8.21 MiB/s    0.512s       https://ghproxy.link

选择排名第 1 的镜像(速度最快)。

第三步:使用最佳镜像进行下载

git clone:

# 原始命令:git clone https://github.com/user/repo.git
git clone https://BEST_MIRROR/https://github.com/user/repo.git

wget/curl 原始文件:

# 原始命令:wget https://raw.githubusercontent.com/user/repo/main/file.txt
wget https://BEST_MIRROR/https://raw.githubusercontent.com/user/repo/main/file.txt

Release 资产:

# 原始命令:wget https://github.com/user/repo/releases/download/v1.0/file.tar.gz
wget https://BEST_MIRROR/https://github.com/user/repo/releases/download/v1.0/file.tar.gz

规律: 在完整的 https://github.com/... 或 https://raw.githubusercontent.com/... URL 前面加上 BEST_MIRROR/ 即可。

参数说明

参数默认值说明
--githubFalse启用 GitHub 镜像模式(必须)
--no-scrapeFalse跳过网页爬取,仅测试已知镜像
--top N0(全部)仅展示前 N 个结果
--mirror URL—手动添加待测镜像(可重复使用)
--timeout N10下载超时(秒)
--connect-timeout N3连接超时(秒)
--workers N8并发测试线程数
--max-mb N1每个镜像最大测试下载量(MB)
--source URL内置额外爬取的来源页面(可重复使用)

错误处理

  • 如果缓存中的镜像下载失败:尝试缓存文件中的下一个镜像(第二行、第三行……)。
  • 如果所有缓存镜像都失败:运行完整测速重新筛选:
    python3 {skill_dir}/scripts/mirror-scout.py --github --top 5
    
  • 如果仍无可用镜像,手动添加后重新测速:
    python3 {skill_dir}/scripts/mirror-scout.py --github --mirror https://ghproxy.net --mirror https://mirror.ghproxy.com --top 5
    
  • 测速结果会自动保存到 mirrors-github.txt,后续使用无需重复测速。

依赖

本工具需要 Python 3.6+ 和 requests 库。如未安装,先执行:

pip install requests

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

生成图文并茂的分析报告/实验报告/质检报告(固定模版)。当用户要求"生成报告/总结报告/实验报告/质检报告/QC报告",或分析流程收尾需要交付报告时使用。报告必须基于真实分析输出,包含固定章节结构、关键指标表格和真实结果图。

日本語の概要は準備中です。原文の説明を表示しています。

peacezha/HPClaw32026年10月10日 更新

Predicts ADMET properties using ADMETlab 3.0 (119 endpoints with uncertainty), ADMET-AI, DeepChem MolNet, and chemprop D-MPNN with explicit handling of OECD QSAR principles, applicability domain assessment, calibration, hERG/CYP/AMES gold-standard endpoints, and PAINS / Lipinski / Ro5 / Veber / BBB druglikeness filters. Use when filtering compounds for drug-likeness, prioritizing leads by predicted safety, or building an in-house ADMET QSAR model.

日本語の概要は準備中です。原文の説明を表示しています。

peacezha/HPClaw32026年10月10日 更新

Trim PCR primers from aligned reads in amplicon-panel BAMs using samtools ampliconclip. Use when processing SARS-CoV-2 ARTIC, hereditary cancer panels, ctDNA hot-spot panels, or any amplicon assay where primer-derived bases would falsely confirm reference at primer footprints.

日本語の概要は準備中です。原文の説明を表示しています。

peacezha/HPClaw32026年10月10日 更新

Filter alignments by flags, mapping quality, and regions using samtools view and pysam. Use when extracting specific reads, removing low-quality alignments, or subsetting to target regions.

日本語の概要は準備中です。原文の説明を表示しています。

peacezha/HPClaw32026年10月10日 更新

Create and use BAI/CSI indices for BAM/CRAM files using samtools and pysam. Use when enabling random access to alignment files or fetching specific genomic regions.

日本語の概要は準備中です。原文の説明を表示しています。

peacezha/HPClaw32026年10月10日 更新

Read, write, and convert multiple sequence alignment files using Biopython Bio.AlignIO. Supports Clustal, PHYLIP, Stockholm, FASTA, Nexus, and other alignment formats for phylogenetics and conservation analysis. Use when reading, writing, or converting alignment file formats.

日本語の概要は準備中です。原文の説明を表示しています。

peacezha/HPClaw32026年10月10日 更新

peacezha のスキルをすべて見る

このスキルの問題を報告する