Token导航 LogoToken导航TokenDH.com
研究检索执行命令clawhub未标认证来源可访问clear审计提醒

china-mirror-resolver中国镜像解析器

Agent Skill

china-mirror-resolver 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

10,943

周安装

447

GitHub Stars

公开资料未说明

下载量

3,504
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:china-mirror-resolver(中国镜像解析器)
来源仓库:https://github.com/the-ladder-of-rrogress/china-mirror-resolver
安装命令:
openclaw skills install china-mirror-resolver
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install china-mirror-resolver

简介

china-mirror-resolver 用于自动发现、验证和配置各类开发工具的国内镜像源。

  • 适合在 OpenClaw 中需要加速依赖安装或优化网络环境时使用。
  • 通过 clawhub 安装,支持 pip/npm/yarn/pnpm/conda/Docker/Go 等主流工具。
  • 使用前需确认权限范围和维护状态,避免触发不必要的联网或命令执行。
  • 建议结合原始 README 核验具体配置方法和兼容性。

SKILL.md

name
china-mirror-resolver
description
>
version
2.1.0
license
MIT
homepage
https://github.com/The-Ladder-of-Rrogress/china-mirror-resolver
compatibility
>
metadata
author
community
category
devtools
region
china-mainland
last-verified
2026-03-08
clawdbot
emoji
🪞
files
["scripts/*", "references/*"]
allowed-tools
WebSearch WebFetch terminal file-read file-write

China Mirror Resolver

Mirror URLs break frequently. This skill teaches the agent a self-healing workflow: discover → validate → configure the best available source. A baseline table provides offline fallback; web search enables self-repair.

Execution Flow

User error / request
      │
      ▼
 1. Identify tool type (Section 1)
      │
      ▼
 2. Detect current source config
      │
      ▼
 3. Try ALL baseline sources for that tool (Section 2)
    Validate each with Section 4 thresholds (< 3s = good, 3–10s = acceptable)
      ├─ At least one source < 10s → pick fastest → go to step 6
      └─ All sources > 10s or failed ↓
      ▼
 4. [IF search capable] Search for latest sources (Section 3)
      ├─ Found candidates → go to step 5
      └─ No candidates found → report to user with baseline table as reference
    [IF no search] Report baseline failure to user, suggest manual URL
      │
      ▼
 5. Validate ALL candidates (Section 4), pick fastest passing one
      ├─ At least one passes → go to step 6
      └─ All fail → report failure to user, suggest checking network/proxy
      │
      ▼
 6. Backup original config → write new config → verify with test command
      │
      ▼
 7. Confirm result to user (show old source → new source, response time)
Graceful degradation: If the agent has no web search capability, skip step 4 and use only the baseline table. The skill remains functional with reduced self-healing ability.
Speed selection: When multiple sources pass validation, always select the one with the lowest response time. Test all candidates, not just the first.

1. Diagnostic Table

Match error keywords to identify the tool, then check current config:

Error keywordsToolDetect current source
pip / PyPI / setup.py / No matching distributionpippip config get global.index-url
npm ERR / FETCH_ERRORnpmnpm config get registry
yarn / ESOCKETTIMEDOUTyarnyarn config get registry (v1) / yarn config get npmRegistryServer (v2+)
pnpm / ERR_PNPMpnpmpnpm config get registry
conda / CondaHTTPError / PackagesNotFoundErrorcondaconda config --show channels
docker / pull / manifest / toomanyrequestsDockerLinux/macOS: `docker info \grep -A5 "Registry Mirrors"` / Win: Docker Desktop → Settings → Docker Engine
go: downloading / GOPROXY / dial tcpGogo env GOPROXY
cargo / crates.io / Blocking waitingRust (cargo)check ~/.cargo/config.toml (Linux/macOS) or %USERPROFILE%\.cargo\config.toml (Win)
rustup / could not downloadRust (rustup)echo $RUSTUP_DIST_SERVER / $env:RUSTUP_DIST_SERVER
maven / pom.xml / BUILD FAILURE / Could not resolveMavencheck ~/.m2/settings.xml or C:\Users\<user>\.m2\settings.xml
gradle / Could not resolve / build.gradleGradlecheck build.gradle / build.gradle.kts or ~/.gradle/init.gradle
brew / Homebrew / FetchingHomebrewecho $HOMEBREW_BOTTLE_DOMAIN
apt / dpkg / E: Failed to fetchapt (Debian/Ubuntu)check /etc/apt/sources.list
yum / dnf / Cannot find a valid baseurlyum/dnf (CentOS/RHEL/Fedora)check /etc/yum.repos.d/
git clone / github.com / RPC failedGitHub acceleratorN/A
huggingface / hf_hub / ConnectionErrorHugging Faceecho $HF_ENDPOINT / $env:HF_ENDPOINT

2. Baseline Sources

High-stability institutional mirrors. Try these first. If all fail or are too slow (> 10s), proceed to Section 3 (search). Agents without search capability stop here.

pip

ProviderURL
Tsinghua TUNAhttps://pypi.tuna.tsinghua.edu.cn/simple
Aliyunhttps://mirrors.aliyun.com/pypi/simple/
USTChttps://pypi.mirrors.ustc.edu.cn/simple/
Tencenthttps://mirrors.cloud.tencent.com/pypi/simple/

npm / yarn / pnpm

ProviderURL
npmmirrorhttps://registry.npmmirror.com
Huaweihttps://repo.huaweicloud.com/repository/npm/

conda

ProviderURL
Tsinghua TUNAhttps://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
USTChttps://mirrors.ustc.edu.cn/anaconda/pkgs/main
Aliyunhttps://mirrors.aliyun.com/anaconda/pkgs/main

Docker

ProviderURL
1ms.runhttps://docker.1ms.run
xuanyuan.mehttps://docker.xuanyuan.me
DaoCloudhttps://docker.m.daocloud.io
linkedbushttps://docker.linkedbus.com

Go

ProviderURL
goproxy.cnhttps://goproxy.cn
goproxy.iohttps://goproxy.io

Rust

Providercargo registryrustup server
USTCsparse+https://mirrors.ustc.edu.cn/crates.io-index/https://mirrors.ustc.edu.cn/rustup
Tsinghua TUNAsparse+https://mirrors.tuna.tsinghua.edu.cn/crates.io-index/https://mirrors.tuna.tsinghua.edu.cn/rustup
RsProxy.cnsparse+https://rsproxy.cn/crates.io-index/https://rsproxy.cn/rustup

Maven / Gradle

ProviderURL
Aliyun Publichttps://maven.aliyun.com/repository/public
Aliyun Googlehttps://maven.aliyun.com/repository/google
Huaweihttps://repo.huaweicloud.com/repository/maven

Homebrew (macOS / Linuxbrew)

ProviderHOMEBREW_BOTTLE_DOMAIN
Tsinghua TUNAhttps://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles
USTChttps://mirrors.ustc.edu.cn/homebrew-bottles

apt (Debian / Ubuntu)

ProviderBase URL
Tsinghua TUNAhttps://mirrors.tuna.tsinghua.edu.cn
Aliyunhttps://mirrors.aliyun.com
USTChttps://mirrors.ustc.edu.cn

yum / dnf (CentOS / RHEL / Fedora)

ProviderBase URL
Tsinghua TUNAhttps://mirrors.tuna.tsinghua.edu.cn
Aliyunhttps://mirrors.aliyun.com
USTChttps://mirrors.ustc.edu.cn

GitHub Accelerator

ProviderPrefix URL
ghfast.tophttps://ghfast.top/
gh-proxy.comhttps://gh-proxy.com/
ghp.cihttps://ghp.ci/

Hugging Face

ProviderHF_ENDPOINT
hf-mirror.comhttps://hf-mirror.com

3. Search Strategy

Capability gate: This section requires web search. If the agent lacks search capability, skip to Section 5 using only baseline sources.

3.1 Search Query Templates

Replace <YEAR> with current year. Use the agent's available search mechanism. Provide both Chinese and English queries for better coverage:

ToolChinese queryEnglish query
pippip 国内镜像源 <YEAR> 可用pip china mirror source <YEAR> working
npmnpm 国内镜像 registry <YEAR>npm china registry mirror <YEAR>
condaconda 国内镜像源 channels <YEAR>conda china mirror channel <YEAR>
Dockerdocker 镜像加速源 <YEAR> 可用docker registry mirror china <YEAR> working
GoGOPROXY 国内代理 <YEAR>GOPROXY china proxy <YEAR>
Rustcargo crates 国内镜像 <YEAR>cargo crates china mirror <YEAR>
Mavenmaven 国内镜像 仓库地址 <YEAR>maven china mirror repository <YEAR>
Homebrewhomebrew 国内镜像 <YEAR>homebrew china mirror <YEAR>
aptubuntu apt 国内源 <YEAR>ubuntu apt china mirror <YEAR>
yum/dnfcentos yum 国内镜像源 <YEAR>centos yum china mirror <YEAR>
GitHubgithub 加速 代理 镜像站 <YEAR>github proxy accelerator china <YEAR>
HuggingFacehuggingface 国内镜像 下载加速 <YEAR>huggingface china mirror download <YEAR>

3.2 Source Credibility

Prioritize results in this order:

  1. Official mirror site docs (mirrors.tuna.tsinghua.edu.cn/help, developer.aliyun.com/mirror)
  2. Mirror provider's own site/README (goproxy.cn, npmmirror.com)
  3. Recent posts (< 3 months) from reputable tech communities
  4. GitHub repos with > 100 stars that aggregate mirror lists

Reject: undated articles, posts > 6 months old, zero-reply forum threads, unverifiable personal blogs.

3.3 Candidate Extraction Rules

Extracted URLs must:

  • Use HTTPS protocol
  • Belong to known institutions (.edu.cn, major cloud vendors, well-known OSS orgs) OR be cross-referenced in 2+ independent articles
  • Come from articles published within the last 6 months
Security warning: Never use mirror sources from unknown individuals or unverifiable personal servers. Malicious mirrors can inject tampered packages. Especially for Docker and pip, only use sources from recognized institutions.

4. Validation

Every candidate must pass validation before being written to config.

4.1 Universal HTTP Check

# Linux / macOS
start=$(date +%s%N 2>/dev/null || perl -MTime::HiRes=time -e 'printf "%d\
",time()*1e9')
code=$(curl -o /dev/null -s -w "%{http_code}" --max-time 10 "<URL>")
end=$(date +%s%N 2>/dev/null || perl -MTime::HiRes=time -e 'printf "%d\
",time()*1e9')
echo "HTTP $code | $(( (end - start) / 1000000 ))ms"
# Windows PowerShell
$sw = [System.Diagnostics.Stopwatch]::StartNew()
try { $r = Invoke-WebRequest -Uri "<URL>" -TimeoutSec 10 -UseBasicParsing -ErrorAction Stop
  $sw.Stop(); "OK: HTTP $($r.StatusCode) | $($sw.ElapsedMilliseconds)ms"
} catch { $sw.Stop(); "FAIL: $_" }

4.2 Tool-Specific Validation

ToolCommand / CheckSuccess Criteria
pippip install --dry-run requests -i <URL> --trusted-host <HOST>Would install or already satisfied
npmnpm view lodash version --registry <URL>Returns version number
yarn v1yarn info lodash version --registry <URL>Returns version number
pnpmpnpm view lodash version --registry <URL>Returns version number
condaconda search numpy -c <URL> --override-channelsReturns package list
DockerHTTP GET <URL>/v2/HTTP 401 (auth required = service alive)
GoHTTP GET <URL>/github.com/gin-gonic/gin/@v/listReturns version list
RustHTTP GET the sparse index URLHTTP 200
MavenHTTP GET <URL>/org/apache/commons/commons-lang3/maven-metadata.xmlReturns XML content
HuggingFaceHTTP GET <URL>/api/models?limit=1Returns JSON

4.3 Acceptance Criteria

Response TimeRatingAction
< 3000msExcellentUse this source
3000–10000msAcceptableUse if no faster alternative found
> 10000ms or timeoutUnusableTry next candidate

Selection rule: Test ALL available candidates (baseline + search-discovered), then select the one with the lowest response time that passes validation.

4.4 Batch Validation Scripts

Pre-built scripts in scripts/:

  • scripts/validate.sh — Linux / macOS (bash). Supports --json flag for machine-readable output.
  • scripts/validate.ps1 — Windows (PowerShell)
bash scripts/validate.sh              # test all, colored output
bash scripts/validate.sh pip           # test pip only
bash scripts/validate.sh all --json    # machine-readable JSON output

4.5 Security Notes on Validation

trusted-host warning: Using --trusted-host with pip disables SSL certificate verification for that host. This is a security trade-off. Only use it when the mirror is a known institution (e.g., .edu.cn, major cloud vendor) and the connection is within a trusted network. Prefer mirrors that have valid SSL certificates and do not require trusted-host.

5. Configuration

Core Principles

  1. Backup first — Always backup the original config file before modifying
  2. Merge, don't overwrite — For JSON configs (Docker daemon.json), read existing content and merge new fields. Never blindly overwrite the entire file
  3. Permanent config — Write to config files, not just CLI flags
  4. Verify after write — Run a test command to confirm the new source works
Detailed configuration templates for each tool are in references/config-templates.md. Below is a quick reference of the key commands.

Quick Reference

pip: pip config set global.index-url <URL>

npm: npm config set registry <URL>

yarn v1: yarn config set registry <URL>

yarn v2+: yarn config set npmRegistryServer <URL>

pnpm: pnpm config set registry <URL>

conda: conda config --add channels <URL> && conda config --set show_channel_urls yes

Docker: Read existing daemon.json, add/update registry-mirrors array, write back, restart Docker. See references/config-templates.md for merge logic.

Go: go env -w GOPROXY=<URL>,direct && go env -w GOSUMDB=sum.golang.google.cn

Rust (cargo): Write [source.crates-io] + [source.mirror] to ~/.cargo/config.toml

Rust (rustup): Set RUSTUP_DIST_SERVER and RUSTUP_UPDATE_ROOT env vars

Maven: Add <mirror> block to ~/.m2/settings.xml

Gradle (Groovy): Add maven { url '<URL>' } to repositories block

Gradle (Kotlin): Add maven(url = "<URL>") to repositories block

Homebrew: Set HOMEBREW_BREW_GIT_REMOTE, HOMEBREW_CORE_GIT_REMOTE, HOMEBREW_BOTTLE_DOMAIN env vars

apt: Replace archive.ubuntu.com with mirror host in /etc/apt/sources.list, then sudo apt update

yum/dnf: Backup /etc/yum.repos.d/, replace baseurl in repo files, then sudo yum makecache

GitHub: Prepend accelerator prefix: git clone <PREFIX>https://github.com/<owner>/<repo>.git

HuggingFace: Set HF_ENDPOINT=<URL> env var


6. Restore Official Sources

ToolRestore Command
pippip config unset global.index-url
npmnpm config set registry https://registry.npmjs.org
yarn v1yarn config set registry https://registry.yarnpkg.com
yarn v2+yarn config set npmRegistryServer https://registry.yarnpkg.com
pnpmpnpm config set registry https://registry.npmjs.org
condaconda config --remove-key channels
Gogo env -w GOPROXY=https://proxy.golang.org,direct
DockerRemove registry-mirrors from daemon.json (keep other fields), restart
Rust (cargo)Remove [source.*] sections from config.toml
Rust (rustup)unset RUSTUP_DIST_SERVER RUSTUP_UPDATE_ROOT
MavenRemove <mirror> block from settings.xml
Homebrewunset HOMEBREW_BREW_GIT_REMOTE HOMEBREW_CORE_GIT_REMOTE HOMEBREW_BOTTLE_DOMAIN
aptRestore /etc/apt/sources.list from backup, sudo apt update
yum/dnfRestore /etc/yum.repos.d/ from backup, sudo yum makecache
HuggingFaceunset HF_ENDPOINT

7. Notes

  • Docker & GitHub accelerators have the highest churn rate — always validate before configuring
  • If the user has an enterprise Nexus/Artifactory, prefer that over public mirrors
  • WSL 1 and WSL 2 have different network stacks; WSL 2 has its own IP and needs separate Docker/apt config
  • If HTTP_PROXY / HTTPS_PROXY env vars are set, some tools may bypass mirrors and go through the proxy instead
  • On ARM architectures (Apple Silicon, ARM Linux), verify that the mirror hosts packages for your architecture
  • When multiple Python/Node versions coexist (pyenv, nvm, conda envs), config may need to target specific environments rather than global settings
  • Use scripts/validate.sh or scripts/validate.ps1 for periodic health checks

8. Known Unstable Sources

This section is informational. Always validate before use rather than relying solely on this list, which may itself become outdated.
SourceStatus (2026-03)Notes
pypi.douban.com (pip)DeadConnection reset
ghproxy.cc (GitHub)DeadSSL certificate untrusted
mirrors.aliyun.com/goproxy/ (Go)UnstableHomepage 404, module downloads intermittent

9. Cross-Agent Adaptation

Capability Requirements

CapabilityRequired?Used inIf absent
Terminal/shellRequiredSteps 2, 4, 5, 6Cannot function
File read/writeRequiredSteps 5, 6Cannot write config
Web searchOptionalStep 4Use baseline table only (Section 2)
Web fetchOptionalStep 4Use curl / Invoke-WebRequest via terminal

Platform Adaptation

Claude Code / StepFun: Native support. Place folder in ~/.claude/skills/ or ~/.stepfun/skills/.

Cursor: Create .cursor/rules/china-mirror-resolver.mdc with this content:

---
description: Resolve slow package downloads in China by switching to domestic mirrors. Triggers on: timeout, mirror, 换源, 镜像源, 下载慢
globs:
alwaysApply: false
---

[Paste the content of this SKILL.md here, excluding the YAML frontmatter]

Windsurf: Create .windsurf/rules/china-mirror-resolver.md with this content:

---
trigger: auto
---

[Paste the content of this SKILL.md here, excluding the YAML frontmatter]

Generic LLM (no skill system): Include Section 2 (baseline table) and Section 5 (config quick reference) in the system prompt. Skip Section 3 (search) if the LLM has no search tool.

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

91.59%
按下载量换算3,209

安全审计

VirusTotal

可疑

ClawScan

可疑

Static analysis

未展示

权限和风险

执行命令

安装流程涉及命令执行,可能通过 openclaw skills install china-mirror-resolver 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills