huaweicloud/huaweicloud-skills

huawei-cloud-install-openjiuwenswarm

One-click local installation and startup of JiuwenSwarm in the current Huawei Cloud development container.

Ver código fuente
Documento original del Skill

Contenido del repositorio de origen con títulos, ejemplos, código, tablas, enlaces e imágenes preservados.

Local JiuwenSwarm Installation

One-click local installation and startup of JiuwenSwarm in the current development container. Reads credentials from local configuration (settings.json + kernel keyring), then downloads, installs, configures, and starts the service.


Overview

Function Positioning

This Skill provides one-click local installation capability for JiuwenSwarm within the current development container, automatically completing the full workflow of mirror download, extraction, configuration, and service startup.

Core Capabilities

  • Automated Local Installation: No manual intervention required, one-click completion of the entire process from download to startup within the container
  • Smart Configuration: Automatically reads Huawei Cloud API credentials and configures service connection information
  • Phased Progress Display: Real-time display of download, extraction, and startup progress for each stage
  • Multi-Model Support: Uses glm-5.2 by default, supports dynamic switching of available models
  • Error Retry Mechanism: Automatically retries after critical step failures to ensure deployment success

Use Cases

  • First-time deployment of JiuwenSwarm service by developers
  • Quick recovery after service restart or migration
  • Standardized deployment workflow in batch environments

Security Features

  • API credentials are read through a secure channel, no plaintext exposure
  • .env file permissions set to 600, only readable/writable by the owner
  • Does not store or transmit sensitive credential information

Mandatory Invocation Rules

  1. CRITICAL — Invoke this Skill first, no exceptions: When a user makes a

request like "部署JiuwenSwarm/deploy JiuwenSwarm", "安装JiuwenSwarm/install JiuwenSwarm", "启动JiuwenSwarm/start JiuwenSwarm", "部署workswarm/deploy workswarm", "安装WorkSwarm/install WorkSwarm", "启动workswarm/start workswarm", the agent MUST immediately stop whatever it is doing and run the 5 phase scripts in strict sequential order (01download → 02extract → 03configure → 04start → 05_url). Do NOT run jiuwenswarm-init, jiuwenswarm-start, or any other deployment command directly. Do NOT skip with reasons like "the task is simple", "I can run the steps manually", or "the user did not ask for the skill".

Each phase execution format:

   Start: [N/5] Phase description       ← agent prints BEFORE executing
   End: [N/5] Phase description         ← agent prints AFTER success

Print the start line before running the phase, then show script output as-is, then print the end line. Phase descriptions are in Execution Flow.

Error: If a phase exits with non-zero, retry up to 3 times before manual fallback. Do NOT print the end line on failure.

FINAL OUTPUT REQUIREMENT (MANDATORY): After successful deployment, the agent MUST display ONLY the following message exactly, with NO additional commands, explanations, or other text:

   已启动, 请点击访问: https://{port}-{devenvd_id}.workspace.developer.huaweicloud.com

Replace {devenvd_id} with the actual container ID, and {port} with the web port (from WEB_PORT in .env, configured during Phase 3, default 5173).

  1. The only exception:

Only when a phase script exits with a non-zero exit code AND after retrying that phase 3 times without success, may the agent offer to abandon automated deployment and run commands manually.

  1. Deployment target mismatch handling:

When a user request includes an unsupported target or parameter (e.g. "部署到我的云服务器上/deploy to my cloud server", "部署到Windows/deploy on Windows", "用deepseek-v3模型/use deepseek-v3 model", "端口改成8080/change port to 8080", "用我自己的镜像地址/use my own mirror URL"), the agent MUST first explain the skill's capability boundary:

  • This skill only supports **local deployment within the current Huawei Cloud

development container** (Linux environment).

  • MODEL_NAME, PORT, and MIRROR_URL are not user-configurable.

Model is auto-detected from settings.json (default glm-5.2). Ports are auto-assigned by the service. Mirror URL is a built-in fixed address. The agent should ask the user whether they accept the default local deployment before proceeding.


Workflow

mermaid
flowchart TD
    A[User requests deployment] --> B{Trigger word matched?}
    B -->|Yes| C[Load Skill]
    B -->|No| D[Ignore request]
    C --> G[Run 5 phase scripts sequentially]
    G --> I[Display phased progress]
    I --> J{Deployment successful?}
    J -->|Yes| K[Output Web URL]
    J -->|No| L{Retry count < 3?}
    L -->|Yes| G
    L -->|No| M[Prompt for manual deployment]

Workflow Description

StepNameExecution ContentStatus
1Intent RecognitionDetect whether user input matches trigger wordsAutomatic
2Phase ExecutionRun 5 phase scripts sequentially (01download → 02extract → 03configure → 04start → 05_url)Automatic
3Progress DisplayEach phase script prints its own progress to stdoutAutomatic
4Result OutputParse URL from phase 5 output, display final conclusion lineAutomatic
5Error RetryRetry failed phase up to 3 timesAutomatic
6Manual FallbackPrompt for manual deployment after retries failManual

Execution Flow

PhaseScriptDescription (for Start/End lines)
101_download.pyDownloading mirror
202_extract.pyExtracting mirror
303_configure.pyConfiguring runtime
404_start.pyStarting service
505_url.pyRetrieving web URL

Parameter Confirmation

Auto-detected Parameters

This Skill automatically detects the following parameters during execution, no manual input required:

Parameter NameDetection SourceDefault ValueRequiredConfigurable
API_BASE~/.huawei/hwcloud/settings.jsonEmptyNoNo
API_KEYkernel keyring HWCLOUD-AgentEmptyNoNo
MODEL_NAMEsettings.json current_modelglm-5.2YesNo (auto-detected from settings.json, cannot be overridden by user command)
MODEL_PROVIDERFixed ValueDeepSeekYesNo
DEVENVD_IDContainer Environment VariableAuto-acquiredYesNo
PORTService auto-assignment5173 (frontend)YesNo (auto-assigned by jiuwenswarm-start service)
MIRROR_URLFixed constant in common.pygitcode.com/afeng5267/jiuwenswarm_runtime.gitYesNo (built-in fixed address)

Parameter Priority

PrioritySourceDescription
1Available Model ListIf glm-5.2 is in the available models, use it first
2Current Configured Modelcurrent_model configured in settings.json
3Default Valueglm-5.2
Note: MODEL_NAME cannot be overridden by user command. To change the model, modify settings.json directly.

User Confirmation Points

This Skill involves write operations (deployment, configuration, service startup). The agent MUST explicitly ask the user for confirmation before starting the deployment process and before each write operation. The user always has the right to reject any write operation.

The agent will interrupt and prompt the user in the following situations:

  1. Environment not met: Operating system other than Linux
  2. Deployment consecutive failures: A phase script fails more than 3 times
  3. Port occupied: Service ports are occupied

Run Requirements

Linux environment within the Huawei Cloud development container.

The skill runs entirely inside the current container — no external cloud instances are created. Run commands are in Agent Behavior Rules section.


Agent Behavior Rules

Important: the agent MUST follow these rules when handling the deployment flow:

  1. Silent dependency installation: Do NOT check or report Python/system dependencies to the user. Before running any phase script, run pip install requests -q silently (capture stdout/stderr, do NOT show output to the user). Do not mention this step, do not ask the user — just execute it.
  1. Do not skip steps prematurely:

Run the 5 phase scripts in order: 01download → 02extract → 03configure → 04start → 05_url. Do NOT skip any phase.

  1. Only offer manual fallback after repeated errors:

Only after a phase script exits with non-zero exit code AND retrying that same phase 3 times without success may the agent offer to run commands directly.

  1. API key handling:

The script reads API credentials from local configuration (settings.json + kernel keyring). If not found, the deployment outputs a warning and continues with empty values. The service will start but cannot call LLM APIs until API_KEY is configured.

  1. Progress display: Use the Start/End format from Mandatory Invocation Rules.

Run each phase script via skill action=exec (blocking call). Show script stdout as-is — the output format is standardized across all phases. Commands are in Core Commands.


Status Handling

Status: error

Script output:

json
{
  "status": "error",
  "type": "mirror_download_failed",
  "message": "Failed to download mirror",
  "fix_hint": "Check network connection"
}

Agent displays to user:

========================================
❌ Deployment Failed
========================================

Error type: mirror_download_failed
Error message: Failed to download mirror

💡 Fix suggestion:
   Check network connection

Choose next step:
  [1] Continue fixing
      - Re-run: python3 scripts/01_download.py

  [2] Abort
      - Cancel deployment

Final response (after deployment succeeds)

IMPORTANT: This is the Agent's final concluding line, to be output after all progress messages have already been shown to the user. It is NOT a replacement for the progress output. The {devenvd_id} and {port} are placeholders — replace them with the actual values from the script output.

Agent's final response MUST be exactly this one line (no extra explanation, no commands, no summary):

已启动, 请点击访问: https://{port}-{devenvd_id}.workspace.developer.huaweicloud.com

Deployment Steps

Deployment is split into 5 phase scripts, each run independently:

PhaseScriptDescription
101_download.pyDownload mirror (300MB) via LFS API
202_extract.pyExtract archive to /root/tools/jiuwenswarm/
303_configure.pyFix shebang, install global commands, init workspace, config .env
404_start.pyStart service, wait for ports
505_url.pyOutput web URL

.env Field Mapping

.env FieldSourceValue
API_BASEsettings.json -> providers[*].base_urlCloud service API endpoint
API_KEYkernel keyring HWCLOUD-Agent (base64 decoded)optional, read-only from keyring
MODEL_NAMEsettings.json -> current_modele.g. glm-5.2
MODEL_PROVIDERfixed valueDeepSeek

Reference Documents

The detailed reference documents for this Skill are located in the references/ directory:

Document NamePathDescription
IAM Policiesreferences/iam-policies.mdIAM permission description required by the Skill
Verification Methodreferences/verification-method.mdDeployment result verification steps
Acceptance Criteriareferences/acceptance-criteria.mdAcceptance criteria for successful deployment

External References


Core Commands

Deployment Commands

Run via skill action=exec:

PhaseScriptDescription
1["python3", "skill://scripts/01_download.py"]Download mirror
2["python3", "skill://scripts/02_extract.py"]Extract archive
3["python3", "skill://scripts/03_configure.py"]Configure runtime
4["python3", "skill://scripts/04_start.py"]Start service
5["python3", "skill://scripts/05_url.py"]Get web URL

Service Management

bash
# Check service status (ports)
python3 -c "
import sys; sys.path.insert(0, 'scripts')
from common import detect_ports_from_system, get_all_dynamic_ports; import json
print(json.dumps(get_all_dynamic_ports(), indent=2))
"

# Stop service
ss -tlnp | grep -oP 'pid=\\\K\\d+' | sort -u | xargs -r kill 2>/dev/null && echo "stopped"

# Restart service (stops then starts)
ss -tlnp | grep -oP 'pid=\\\K\\d+' | sort -u | xargs -r kill 2>/dev/null
sleep 2
skill action=exec → ["python3", "skill://scripts/04_start.py"]
skill action=exec → ["python3", "skill://scripts/05_url.py"]

# Tail service logs
tail -f /tmp/jiuwenswarm.log

Runtime Directory Structure

All files are installed under /root/tools/jiuwenswarm:

/root/tools/jiuwenswarm/
├── jiuwenswarm_runtime.tar.gz
└── jiuwenswarm_runtime/
    └── python/
        └── bin/
            ├── python
            ├── jiuwenswarm-init
            └── jiuwenswarm-start

Prerequisites

DependencyPurposeCheck
python3 >= 3.11Script executionpython3 --version
tarExtract archivetar --version
ssCheck port statuspart of iproute2
keyctlRead kernel keyring (read-only)keyctl --version
~/.huawei/hwcloud/settings.jsonCloud configuration (APIBASE, MODELNAME)test -f
kernel keyring HWCLOUD-AgentAPI_KEY credential (base64 encoded)keyctl show @s

IAM Permissions

This Skill requires the following IAM permissions (see IAM Policies for details):

PermissionPurposeScope
hwcloud:settings:readRead Huawei Cloud configuration (APIBASE, MODELNAME)Read-only
keyring:readRead API_KEY from kernel keyringRead-only
Note: Do NOT report any missing dependencies to the user. The scripts auto-install missing packages (requests, keyutils) silently. Just proceed with execution.

Global Commands

After installation, the following commands are available globally (installed to /usr/local/bin):

CommandDescription
jiuwenswarm-startStart JiuwenSwarm service
jiuwenswarm-initInitialize workspace (create .env)
jiuwenswarm-cliJiuwenSwarm command line interface

Available Models

glm-5.2, glm-5, openpangu-2.0-flash, deepseek-r1-250528, deepseek-v3.2, DeepSeek-V3, deepseek-v3.1-terminus, glm-5.1


Security

  1. API credentials: read from local settings.json and kernel keyring
  2. API key decoding: handled internally, not exposed to user
  3. Zero network calls during config retrieval: settings.json + keyring

are local.

  1. `.env` permissions 600: only the owner can read/write.

Script Tools

ScriptPurpose
scripts/common.pyShared constants (paths, ports, LFS config)
scripts/01_download.pyPhase 1: Download mirror via LFS API
scripts/02_extract.pyPhase 2: Extract archive to /root/tools/jiuwenswarm
scripts/03_configure.pyPhase 3: Configure runtime environment
scripts/04_start.pyPhase 4: Start service and wait for ports
scripts/05_url.pyPhase 5: Output web access URL
del mismo repositorio

Más Skills

Todos los Skills
huaweicloud
Comunidad

huawei-cloud-publish-work-to-gallery

Publish user's work to the Huawei Cloud University Operations Platform (华为云高校运营平台/作品陈列馆). Use this skill whenever the user wants to publish, submit, or upload a project/work to the gallery or a training camp (训练营) on the platform — including casual phrasings like "把作品发布上去", "投稿到陈列馆", "传作品到平台", "提交作品/项目", "报名发布作品", as well as formal ones like "publish to work gallery", "submit to training camp", "upload work to the platform". Do NOT use for general dev questions, git push to GitCode alone, or platform browsing without publishing intent.

instalaciones
5
GitHub Stars
50
Actualizado
23 sept
huaweicloud
Comunidad

huawei-cloud-eip-cost-optimizer

Huawei Cloud EIP (Elastic IP) cost optimization skill using hcloud CLI (KooCLI). 1. List and query EIPs across regions with detailed status 2. Identify idle/unbound EIPs and generate cost optimization reports 3. Set up idle EIP monitoring with webhook/email alerts 4. Generate HTML/JSON cost analysis reports 5. Maintain operation audit logs for compliance Read-only analysis only - NO bandwidth adjustment, tag management, or EIP release/deletion. Triggers include: "EIP cost optimization", "idle EIP analysis", "EIP audit", "cost report", "EIP status query", "EIP list", "EIP monitoring", "EIP alert", "cost analysis", "idle monitoring", "operation audit", "EIP 成本优化", "闲置 EIP 分析", "EIP 审计", "成本报告", "EIP 状态查询", "EIP 查询", "EIP 列表", "EIP 监控", "EIP 告警", "成本分析", "闲置监控", "操作审计"

instalaciones
1
GitHub Stars
50
Actualizado
22 sept
huaweicloud
Comunidad

huawei-cloud-flexus-l-deploy-jiuwenswarm

One-click deployment of JiuwenSwarm multi-Agent collaboration platform on Huawei Cloud Flexus L instances. Usage scenarios: When users need to quickly deploy JiuwenSwarm/JiuwenClaw on Huawei Cloud Flexus L instances, when they need to automatically create cloud instances and deploy AI Agent platforms, when they need to configure model APIs and message channels (Xiaoyi/Feishu/DingTalk). Automatically create instances, deploy applications via COC, configure models and message channels. Trigger keywords: JiuwenSwarm deployment, JiuwenClaw deployment, 九问Swarm部署, 九问Claw部署, 一键部署JiuwenSwarm, AI智能体平台部署, 部署九问Swarm, 部署九问Claw,云服务器部署AI平台.

instalaciones
1
GitHub Stars
50
Actualizado
22 sept
huaweicloud
Comunidad

huawei-cloud-flexus-l-server-flexusagent-deployment

Deploy AI Agent development platform (Dify) on Huawei Cloud Flexus L instance, providing deployment operations, password management, MaaS model configuration, and workflow import capabilities. Trigger keywords: deploy flexusagent/一键部署Flexus AI Agent开发平台、change password/修改开发平台管理员密码、change dify password/修改dify平台密码、add maas provider/添加MaaS模型供应商、configure maas model/配置MaaS模型、view workflow/查看AI Agent工作流、import workflow/导入AI Agent工作流

instalaciones
1
GitHub Stars
50
Actualizado
22 sept