← Back to Skills Marketplace
loredunk

china-mirror-skills

by gavinC · GitHub ↗ · v1.0.0
cross-platform ✓ Security Clean
270
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install china-mirror-skills
Description
Main entry point for configuring and diagnosing all development tools in China's network environment. Detects installed tools (pip/uv/poetry, npm/yarn/pnpm,...
README (SKILL.md)

Bootstrap China Network Environment

One-stop configuration and diagnostics for all development tools in China. Diagnose first, then apply fixes.

All setup scripts are bundled under this skill's scripts/ directory as resources — they are not loaded into context but invoked via bash.

Steps

1. Determine SKILL_DIR

All script paths are relative to this skill's directory:

SKILL_DIR="\x3Cabsolute path to skills/bootstrap-china-network>"

Use the directory where this SKILL.md resides.

2. Diagnose (if user wants diagnostics or troubleshooting)

If the user wants to diagnose their environment, check what's configured, or understand why things are slow:

bash "$SKILL_DIR/scripts/diagnose.sh"

This will:

  • Collect system info and detect proxy conflicts
  • Scan installed development tools and their mirror configurations
  • Test connectivity to official sources and Chinese mirrors (with timing)
  • Output structured recommendations (HIGH/MEDIUM/LOW priority)

After diagnostics, review the recommendations and offer to apply fixes for unconfigured tools.

3. Quick environment scan (for direct configuration)

# Detect installed tools
for tool in pip uv npm yarn pnpm docker cargo go conda flutter brew; do
  which $tool 2>/dev/null && echo "✓ $tool" || true
done

# Check proxy conflicts
[[ -n "$HTTP_PROXY$HTTPS_PROXY$http_proxy$https_proxy" ]] && echo "⚠️ Proxy detected"

4. Check for proxy conflicts

If HTTP_PROXY or HTTPS_PROXY is set, warn the user:

Proxy environment variables are set. In China, using a VPN/proxy alongside mirrors can cause conflicts. Consider: unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY

5. Apply mirror configurations

For each detected tool, run the corresponding script. Ask the user for preferences or use sensible defaults:

Tool Script (relative to SKILL_DIR) Default Mirror
pip/uv/poetry scripts/python/setup.sh tuna
npm/yarn/pnpm scripts/node/setup.sh npmmirror
APT (Ubuntu/Debian) sudo scripts/apt/setup.sh tuna
Docker CE + Hub sudo scripts/docker/setup.sh tuna
Homebrew scripts/homebrew/setup.sh tuna
Conda/Anaconda scripts/conda/setup.sh tuna
Cargo/Rust scripts/rust/setup.sh ustc
Go modules scripts/go/setup.sh goproxy
Flutter/Dart scripts/flutter/setup.sh tuna
GitHub Releases/Clone scripts/github/setup.sh tuna (支持 --proxy-clone 全局加速 clone)

All scripts support these flags:

  • -m / --mirror \x3Cname> — choose mirror source
  • -f / --force — force overwrite
  • -d / --dry-run — preview changes without applying
  • -y / --yes — skip confirmation prompts

Run scripts for detected tools. Each script is idempotent — safe to run multiple times.

Example:

bash "$SKILL_DIR/scripts/python/setup.sh" --mirror tuna
bash "$SKILL_DIR/scripts/node/setup.sh" --mirror npmmirror
sudo bash "$SKILL_DIR/scripts/apt/setup.sh" --mirror tuna

6. Verify configurations

After applying, run a quick verification for each configured tool:

pip config get global.index-url 2>/dev/null
npm config get registry 2>/dev/null
go env GOPROXY 2>/dev/null
cat ~/.cargo/config.toml 2>/dev/null | grep index

7. Provide summary

Report:

  • What was configured (tool -> mirror URL)
  • Any warnings (proxy conflicts, permission issues, tool not found)
  • How to restore: bash "$SKILL_DIR/scripts/restore_config.sh" --tool \x3Cname> --latest

Dry Run

If the user wants to preview changes first, add --dry-run to each script:

bash "$SKILL_DIR/scripts/python/setup.sh" --dry-run
bash "$SKILL_DIR/scripts/node/setup.sh" --dry-run

Backup & Restore

Backups are stored in ~/.china-mirror-backup/.

# Backup all tool configs
bash "$SKILL_DIR/scripts/backup_config.sh" --all

# Backup specific tool
bash "$SKILL_DIR/scripts/backup_config.sh" --tool pip

# Restore latest backup for a tool
bash "$SKILL_DIR/scripts/restore_config.sh" --tool pip --latest

# List all backups
bash "$SKILL_DIR/scripts/restore_config.sh" --list
Usage Guidance
This skill appears to do what it says: detect tools, run diagnostics, and change mirror settings. Before running it, review the scripts and run in dry-run mode where available. Expect the following: (1) Some scripts need sudo and will modify system files (/etc/apt, /etc/docker, /etc/yum.repos.d, shell profiles) — only proceed if you trust the changes. (2) The tool will create backups under ~/.china-mirror-backup; verify those backups before restoring. (3) Diagnostics perform outbound network tests (pypi, npm registry, goproxy, USTC, and an optional IP lookup endpoint), which may expose your IP/timing data to those services. (4) Use --dry-run and inspect generated config snippets, and avoid piping remote install scripts into sh unless you trust the source. If you want greater assurance, run each setup script manually rather than allowing an automated agent to execute them with sudo.
Capability Analysis
Type: OpenClaw Skill Name: china-mirror-skills Version: 1.0.0 The skill bundle is a comprehensive and well-structured utility designed to configure Chinese mirrors for a wide range of development tools (Python, Node.js, Docker, APT, Rust, Go, etc.). It includes a diagnostic script (diagnose.sh) to audit the environment, a dedicated backup and restore system (backup_config.sh, restore_config.sh) to protect user configurations, and utility functions in common.sh. While the scripts perform high-privilege actions such as modifying system-level configuration files and shell profiles, these operations are transparently documented, include dry-run options, and are strictly aligned with the stated purpose of improving network performance for developers in China. No evidence of malicious intent, data exfiltration, or unauthorized persistence was found.
Capability Assessment
Purpose & Capability
Name/description ask to detect installed dev tools and apply mirror configs; included scripts enumerate and configure pip/uv/poetry, npm/node, apt, docker, go, conda, cargo, rust, homebrew, flutter, GitHub, etc. Requested actions (backups, config writes, apt/yum changes, shell-profile edits) align with this purpose and are not extraneous.
Instruction Scope
SKILL.md instructs invoking bundled bash scripts to diagnose and apply mirror settings. The scripts perform system scans, read/write user and system config files, run network connectivity tests against official and mirror endpoints, and may suggest unsetting proxy variables. This is within scope, but the diagnostic actions include outbound network calls (curl/wget) to public endpoints for timing/IP info.
Install Mechanism
This is an instruction-only skill (no install spec). Scripts are bundled in the resource directory and invoked locally; there are no remote package installs by the skill itself. Some scripts will download GPG keys or call apt/yum/curl during execution, which is expected for configuring package repos.
Credentials
The skill requires no environment credentials or special env variables. It does inspect proxy-related environment variables (HTTP_PROXY, HTTPS_PROXY, etc.) and will append to shell profiles and create backups in ~/.china-mirror-backup. System-level changes (e.g., /etc/apt, /etc/docker) require sudo/root; this is proportional to the stated functionality but important to note for privileges and privacy (network checks contact external services, and some suggestions print curl | sh commands).
Persistence & Privilege
Skill is not forced-always and allows user invocation/autonomous invocation by default (platform normal). The scripts modify user shell profiles and system package config files and write backups under the user's home; some operations need sudo. The skill does not attempt to modify other skills or global agent configs.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install china-mirror-skills
  3. After installation, invoke the skill by name or use /china-mirror-skills
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
用于解决中国内网络,需要外网环境下fetch/pull/install/update等问题。
Metadata
Slug china-mirror-skills
Version 1.0.0
License
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is china-mirror-skills?

Main entry point for configuring and diagnosing all development tools in China's network environment. Detects installed tools (pip/uv/poetry, npm/yarn/pnpm,... It is an AI Agent Skill for Claude Code / OpenClaw, with 270 downloads so far.

How do I install china-mirror-skills?

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

Is china-mirror-skills free?

Yes, china-mirror-skills is completely free (open-source). You can download, install and use it at no cost.

Which platforms does china-mirror-skills support?

china-mirror-skills is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created china-mirror-skills?

It is built and maintained by gavinC (@loredunk); the current version is v1.0.0.

💬 Comments