← 返回 Skills 市场
lm203688

China Dev Environment

作者 lm203688 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
46
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install china-dev-environment
功能描述
Configure development environments for Chinese developers. Teach AI agents how to set up mirrors, proxies, and alternative services for npm/pip/Docker/GitHub...
使用说明 (SKILL.md)

China Dev Environment - 中国开发者环境配置专家

You are an expert at configuring development environments that work reliably in China. You know every mirror, proxy, and alternative service that keeps Chinese developers productive behind the Great Firewall.

Core Philosophy

A developer in China who can't npm install is a developer who can't work. Your job is to make every package manager, every registry, every cloud service work smoothly — without VPN if possible, with minimal VPN if not.

Registry Mirrors

npm (Node.js)

# Set China npm mirror (淘宝镜像)
npm config set registry https://registry.npmmirror.com

# Or use nrm to switch between mirrors
npm install -g nrm
nrm use taobao

# Verify
npm config get registry
# Should show: https://registry.npmmirror.com/

# For specific packages not on mirror
npm install package-name --registry=https://registry.npmjs.org

pip (Python)

# Set Tsinghua PyPI mirror (most reliable)
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip config set global.trusted-host pypi.tuna.tsinghua.edu.cn

# Alternative mirrors
# Aliyun: https://mirrors.aliyun.com/pypi/simple/
# Douban: https://pypi.doubanio.com/simple/
# USTC: https://pypi.mirrors.ustc.edu.cn/simple/

# Temporary use
pip install package -i https://pypi.tuna.tsinghua.edu.cn/simple

Docker

# Configure Docker mirror (daemon.json)
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json \x3C\x3C 'EOF'
{
  "registry-mirrors": [
    "https://docker.1ms.run",
    "https://docker.xuanyuan.me",
    "https://docker.m.daocloud.io"
  ]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker

# Pull image through mirror
docker pull nginx  # Will use mirror automatically

# For images not on mirror, use proxy
# docker pull --platform linux/amd64 nginx

Maven (Java)

\x3C!-- settings.xml mirror configuration -->
\x3Cmirrors>
  \x3Cmirror>
    \x3Cid>aliyun\x3C/id>
    \x3CmirrorOf>central\x3C/mirrorOf>
    \x3Curl>https://maven.aliyun.com/repository/central\x3C/url>
  \x3C/mirror>
\x3C/mirrors>

Go

# Set Go module proxy
go env -w GOPROXY=https://goproxy.cn,direct
go env -w GONOSUMCHECK=gitlab.company.com

# Alternative: https://goproxy.io

Rust / Cargo

# ~/.cargo/config.toml
[source.crates-io]
replace-with = "ustc"

[source.ustc]
registry = "sparse+https://mirrors.ustc.edu.cn/crates.io-index/"

GitHub Acceleration

Method 1: Mirror Sites

# Clone via mirror
git clone https://ghproxy.com/https://github.com/user/repo.git
git clone https://mirror.ghproxy.com/https://github.com/user/repo.git

# Or set URL rewrite
git config --global url."https://ghproxy.com/https://github.com/".insteadOf "https://github.com/"

Method 2: SSH with Proxy

# ~/.ssh/config
Host github.com
  HostName github.com
  User git
  ProxyCommand nc -X 5 -x 127.0.0.1:1080 %h %p

Method 3: Gitee Import

# Import to Gitee first, then clone from Gitee
# https://gitee.com/projects/import/url

Method 4: GitHub Codespaces

# Use GitHub Codespaces (works from China)
gh codespace create -r owner/repo
gh codespace ssh

Google API Replacements

Google Service China Replacement Setup
Google Fonts fonts.font.im Replace fonts.googleapis.comfonts.font.im
Google Analytics Baidu Tongji hm.baidu.com/hm.js?xxx
Google Maps Amap/Gaode webapi.amap.com/maps?v=2.0
reCAPTCHA Tencent Captcha captcha.tencentcloudapi.com
Firebase Tencent CloudBase tcb-api.tencentcloudapi.com
Google Search Baidu SEO Submit at ziyuan.baidu.com
Google Cloud Storage COS/OSS Use Tencent/Alibaba SDK
Gmail SMTP Aliyun DirectMail dm.aliyuncs.com

Workflow 1: New Project Bootstrap (China Edition)

#!/bin/bash
# china-project-init.sh — Bootstrap a new project that works in China

echo "🔧 Setting up China-friendly dev environment..."

# 1. Configure package managers
npm config set registry https://registry.npmmirror.com
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
go env -w GOPROXY=https://goproxy.cn,direct

# 2. Create .npmrc for project
cat > .npmrc \x3C\x3C 'EOF'
registry=https://registry.npmmirror.com
# For packages that fail on mirror, fallback to official
# package-name:registry=https://registry.npmjs.org
EOF

# 3. Create .pip.conf for project
mkdir -p ~/.pip
cat > ~/.pip/pip.conf \x3C\x3C 'EOF'
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
trusted-host = pypi.tuna.tsinghua.edu.cn
EOF

# 4. Docker mirror (if Docker installed)
if command -v docker &> /dev/null; then
  sudo mkdir -p /etc/docker
  sudo tee /etc/docker/daemon.json \x3C\x3C 'DOCKER'
{
  "registry-mirrors": ["https://docker.1ms.run"]
}
DOCKER
  sudo systemctl restart docker
fi

# 5. Git config for GitHub acceleration
git config --global url."https://ghproxy.com/https://github.com/".insteadOf "https://github.com/"

echo "✅ China dev environment configured!"

Workflow 2: Fix Broken Dependencies

When npm install or pip install fails in China:

# npm: Clear cache and retry with mirror
npm cache clean --force
rm -rf node_modules package-lock.json
npm install --registry=https://registry.npmmirror.com

# pip: Clear cache and retry
pip cache purge
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

# Docker: Pull with explicit mirror
docker pull registry.npmmirror.com/library/nginx:latest
docker tag registry.npmmirror.com/library/nginx:latest nginx:latest

# Go: Clear module cache
go clean -modcache
GOPROXY=https://goproxy.cn,direct go mod download

Workflow 3: CI/CD Pipeline (China)

# GitHub Actions with China mirrors
name: CI China
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      # Use China npm mirror
      - run: npm config set registry https://registry.npmmirror.com
      
      # Use China pip mirror
      - run: pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
      
      - run: npm ci
      - run: npm test
      
      # Deploy to China cloud
      - run: npx tccli scf UpdateFunctionCode ...

Safety Rules

  1. Never commit proxy credentials — use environment variables
  2. Mirror reliability — npmmirror.com is backed by Alibaba, most reliable
  3. Security — official mirrors are safe; unknown mirrors may inject code
  4. Sync delay — mirrors may lag by minutes to hours; for latest packages, use official registry
  5. Binary packages — native modules (node-gyp) may still fail; prebuild binaries often unavailable on mirrors
  6. Test without VPN — always verify your setup works without VPN, as most Chinese devs don't have one

Quick Reference

Tool Mirror Official
npm npmmirror.com npmjs.org
pip pypi.tuna.tsinghua.edu.cn pypi.org
Docker docker.1ms.run hub.docker.com
Maven maven.aliyun.com repo1.maven.org
Go goproxy.cn proxy.golang.org
Rust mirrors.ustc.edu.cn crates.io
GitHub ghproxy.com github.com
安全使用建议
Install only if you want an agent to provide China-focused development setup advice. Before running its examples, prefer project-local config where possible, confirm any sudo Docker daemon edits or global Git/npm/pip/Go settings, and back up lockfiles before deleting dependency folders or caches.
能力评估
Purpose & Capability
The artifact's guidance on npm, pip, Docker, Maven, Go, Rust, GitHub acceleration, and China service replacements matches the stated purpose of configuring development environments in China.
Instruction Scope
Most instructions are scoped to development tooling, but some recipes use global configuration and dependency cleanup commands that can affect future sessions or dependency resolution.
Install Mechanism
The package contains a single non-executable SKILL.md file with no bundled scripts, dependencies, or hidden install-time behavior.
Credentials
Using third-party mirrors and registry rewrites is purpose-aligned, but it changes where packages and source code are fetched from and should be chosen deliberately.
Persistence & Privilege
The bootstrap example includes persistent npm, pip, Go, Git, and Docker daemon changes, including sudo writes to /etc/docker and a Docker restart; these are disclosed in the commands but not strongly warned about.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install china-dev-environment
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /china-dev-environment 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: 3 workflows (new project bootstrap China edition, fix broken dependencies, CI/CD pipeline for China) + complete mirror reference for npm/pip/Docker/Maven/Go/Rust + Google API replacement table + GitHub acceleration methods
元数据
Slug china-dev-environment
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

China Dev Environment 是什么?

Configure development environments for Chinese developers. Teach AI agents how to set up mirrors, proxies, and alternative services for npm/pip/Docker/GitHub... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 46 次。

如何安装 China Dev Environment?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install china-dev-environment」即可一键安装,无需额外配置。

China Dev Environment 是免费的吗?

是的,China Dev Environment 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

China Dev Environment 支持哪些平台?

China Dev Environment 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 China Dev Environment?

由 lm203688(@lm203688)开发并维护,当前版本 v1.0.0。

💬 留言讨论