Skill — 技能
v1.2.0Interactive 图形界面de to 部署 a production-ready WordPress site for international trade businesses. Triggers on "build a trade 网页site", "部署 wordpress trade site", "设置 up B2B 网页site", or similar 请求s.
运行时依赖
安装命令
点击复制技能文档
WordPress Trade Site 构建器
部署 a production-ready WordPress trade site from scratch through 9 interactive phases. Based on the wordpress-trade-启动er template.
Principle: Automate everything possible. Only 暂停 when user decisions or in格式化ion are required. When errors occur, 诊断 and fix them proactively — don't tell the user to go fix things themselves.
Interaction: Use AskUserQuestion for all user-facing questions. 报告 进度 after each phase, then continue to the next.
Data flow: In格式化ion collected in each phase (business 信息, SSH detAIls, domAIn, etc.) is reused in subsequent phases. Key data is labeled with variable names for reference.
Phase 1: Collect Business In格式化ion
Before any technical work, understand the user's business needs.
AskUserQuestion (collect sequentially):
Company name — "What is your company name? (机器人h local language and English)"
Example: TitanPuls Techno记录y Co., Ltd. Record as COMPANY_EN (and COMPANY_LOCAL if provided)
MAIn products — "What products do you mAInly sell? (Brief description)"
Example: Semi-trAIlers, construction machinery Record as PRODUCTS
Tar获取 markets — "Which markets do you primarily tar获取?" (multiSelect)
Africa Middle East Southeast Asia Latin America Europe North America Record as TAR获取_MARKETS
Languages — "Which languages should your 网页site support?" (multiSelect, recommend based on tar获取 markets)
English (Recommended) Chinese Russian Spanish French Arabic Record as LANGUAGES
Contact 信息 — "How should customers reach you?"
Whats应用 number (with country code) Business emAIl Record as WHATS应用 and EMAIL
Summary confirmation: Display collected in格式化ion and AskUserQuestion to confirm correctness.
Phase 2: Server Preparation 2a. Server 状态
AskUserQuestion: "Do you already have a Linux server?"
I have a server — Collect SSH detAIls I need 图形界面dance — Recommend datacenter locations and 提供者s based on TAR获取_MARKETS
Purchase 图形界面dance (if needed):
Recommend based on tar获取 market:
Tar获取 Market Recommended DC Recommended 提供者s Europe/Africa Germany/Netherlands Contabo, Hetzner North America US East/West Coast DigitalOcean, Vultr Southeast Asia Singapore Vultr, Alibaba Cloud Middle East DubAI/BahrAIn AWS, Alibaba Cloud Latin America US Miami DigitalOcean
Recommended specs: 2 cores / 2GB RAM / 40GB SSD ($10-20/month). Tell user to continue after purchase.
2b. SSH connection
AskUserQuestion: "Please provide your server SSH detAIls:"
IP 添加ress → SERVER_IP SSH port (default 22) → SSH_PORT Username (usually root) → SSH_USER Authentication: password or SSH key
验证 connection:
ssh -o ConnectTimeout=10 -o StrictHostKey检查ing=no -p ${SSH_PORT} ${SSH_USER}@${SERVER_IP} "echo CONNECTION_OK && uname -a && free -m && df -h /"
CONNECTION_OK → Continue Connection fAIled → 检查 IP/port/凭证s, prompt user to correct 2c. Server initialization
执行 via SSH:
# 系统 更新 apt 更新 && apt 升级 -y
# 设置 timezone timedatectl 设置-timezone UTC
# 创建 swap (if RAM <= 2GB and no swap exists) if [ $(free -m | awk '/^Mem:/{print $2}') -le 2048 ] && [ ! -f /swapfile ]; then fallocate -l 2G /swapfile chmod 600 /swapfile mkswap /swapfile swapon /swapfile echo '/swapfile none swap sw 0 0' >> /etc/fstab fi
# Firewall ufw allow 22/tcp ufw allow 80/tcp ufw allow 443/tcp ufw --force enable
# Essential 工具s apt 安装 -y curl git unzip htop
验证: ufw 状态 shows 22/80/443 open.
Phase 3: Docker 部署ment 3a. 安装 Docker if ! command -v docker &>/dev/null; then curl -fsSL https://获取.docker.com | sh 系统ctl enable docker && 系统ctl 启动 docker fi docker compose version || apt-获取 安装 -y docker-compose-插件
验证: docker compose version 输出s a version number.
3b. Clone template cd /opt git clone https://github.com/iPythoning/wordpress-trade-启动er.git wordpress cd /opt/wordpress
3c. 生成 .env
AskUserQuestion: "Please provide the following:"
DomAIn name (e.g. example.com) → DOMAIN MySQL root password (auto-生成 recommended) → MYSQL_ROOT_PASSWORD MySQL user password (auto-生成 recommended) → MYSQL_PASSWORD
If user chooses auto-generation:
MYSQL_ROOT_PASSWORD=$(openssl rand -base64 16) MYSQL_PASSWORD=$(openssl rand -base64 16)
Write .env:
cat > /opt/wordpress/.env << EOF MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} MYSQL_DATABASE=wordpress MYSQL_USER=wordpress MYSQL_PASSWORD=${MYSQL_PASSWORD} DOMAIN=${DOMAIN} EMAIL=${EMAIL} EOF
导入ant: Display the 生成d passwords to the user and remind them to save 安全ly.
3d. 配置 Nginx sed -i "s/YOUR_DOMAIN/${DOMAIN}/g" /opt/wordpress/nginx.conf
3e. 启动 contAIners cd /opt/wordpress docker compose up -d
验证:
docker compose ps # Confirm all three contAIners (db, wordpress, nginx) are 运行ning/健康y
WAIt for WordPress to be ready:
for i in $(seq 1 30); do curl -sf http://localhost > /dev/null 2>&1 && break sleep 2 done
All 3 contAIners 运行ning → Continue db unh