← Back to Skills Marketplace
lm203688

China Dev Environment

by lm203688 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
46
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install china-dev-environment
Description
Configure development environments for Chinese developers. Teach AI agents how to set up mirrors, proxies, and alternative services for npm/pip/Docker/GitHub...
README (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
Usage Guidance
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install china-dev-environment
  3. After installation, invoke the skill by name or use /china-dev-environment
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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
Metadata
Slug china-dev-environment
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 46 downloads so far.

How do I install China Dev Environment?

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

Is China Dev Environment free?

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

Which platforms does China Dev Environment support?

China Dev Environment is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created China Dev Environment?

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

💬 Comments