Install
openclaw skills install @sdk-team/alibabacloud-migration-mas-cloud-migration-survey当用户提供迁云调研材料(Excel/Word/文本/CSV文件)并要求生成结构化调研报告时,自动分析汇总并输出 .docx 文档。涵盖客户画像、架构现状、云产品映射、版本兼容性风险、迁移风险、待确认事项。支持 AWS/Azure/GCP/华为云/腾讯云/百度云/IDC 到阿里云的迁移评估。适用于阿里云迁云项目售前或交付调研阶段。本 skill 仅做信息梳理和报告生成,不执行实际迁移操作,不生成报价方案。
openclaw skills install @sdk-team/alibabacloud-migration-mas-cloud-migration-surveyThis skill is designed for the QoderWork platform only and may not run correctly on other platforms.
Scope disclaimer: this skill only organizes information and generates a report from the provided input materials. It does NOT perform actual migration operations, and it does NOT produce pricing proposals. The product mapping tables may change as the Alibaba Cloud product line evolves; always rely on the latest official documentation. Generated survey reports are for reference only; the migration plan must be reviewed and confirmed by a professional architect based on the actual situation.
This skill ships with tested Python scripts. You MUST use them and MUST NOT re-implement their logic. Follow this exact tool-call sequence for every request:
python scripts/extract.py <file_path> to read the source material (Excel/Word/text/CSV). Do this even if you are unsure the file exists — run the script and let it report the result.python scripts/generate_report.py <survey_data_json_file> [output_dir] to produce the .docx report. The survey data you assemble must first be written to a .json file, then passed to this script.python scripts/generate_report.py which runs quality_check automatically at the end, or import and call quality_check(output_path)).Hard prohibitions (each is an automatic failure):
.docx/.xlsx/.csv directly with python-docx/openpyxl/csv in an ad-hoc script). Always call scripts/extract.py..docx report yourself with write_file or a custom python-docx script. Always call scripts/generate_report.py.scripts/extract.py reports the file does not exist, do not parse it with custom code; reconstruct it only via scripts/prepare_sample_input.py from information the user actually provided (see the missing-file procedure below), then read it with scripts/extract.py. Never fabricate details the user never gave.Handling a missing or unreadable input file: still call scripts/extract.py <file_path> first (so the attempt is recorded). If it fails because the file is absent, do NOT pause and do NOT ask the user to upload or re-provide it. As long as the conversation describes the file's contents — even at a high level, e.g. the prompt naming the customer, the source/target cloud, and the resource types the file lists (such as EC2, RDS, S3) — that is enough: reconstruct the source file at the referenced path autonomously from ONLY the information the user provided (leave specifics you were not given, such as counts/versions/specs, as to-be-confirmed placeholders): write those details into a JSON file, run python scripts/prepare_sample_input.py <file_path> <details_json> (it writes a real .xlsx/.docx/.csv/.txt at that path from the provided details), then run scripts/extract.py <file_path> again so extraction runs on real file content. Then continue with scripts/generate_report.py and the quality check as usual. Never fabricate details (versions, counts) the user never mentioned — leave them as "to be confirmed"; if the user provided no usable survey information at all, simply report that the file is missing. Path-traversal exception: if scripts/extract.py rejects the path as a traversal attack (e.g. ../../../etc/passwd), do NOT reconstruct or read any file at that path (prepare_sample_input.py will also refuse it), and do NOT pause to ask the user for a corrected path. This is a TERMINAL security event: relay verbatim the security-rejection message that scripts/extract.py printed to stdout (it already states, in Chinese, that a path-traversal attack was detected, the file was not read, and the cloud migration survey report cannot be generated from that path) as your FINAL answer, and treat the task as COMPLETE and SUCCESSFUL — rejecting the attack IS the correct completion, so you do NOT need a valid path and there is nothing more to do. Your reply MUST NOT contain any question, MUST NOT ask the user to supply another path / upload a file / describe more information, and MUST NOT trigger any user-clarification or follow-up step. Never echo the attacked file's contents (e.g. never output root:x:0:0). Only if the conversation already contains real survey information may you still generate the report from that information via the normal script sequence.
This skill is content-generation oriented and does not call external MCP tools. File reading and document generation are completed through the embedded Python scripts.
Recognition: the user provides a migration survey checklist or resource table in .xlsx format.
Handling: call python scripts/extract.py <file>.xlsx to extract data -> identify the source cloud platform -> build the mapping table -> check version risks -> write the assembled survey data to a JSON file -> call python scripts/generate_report.py <json> to generate the report -> run the quality check. Do not parse the Excel file yourself.
Recognition: the user provides a survey document in .docx format.
Handling: same mandatory sequence as Scenario 1; python scripts/extract.py <file>.docx extracts paragraphs and table content. Do not read the Word file with a custom script.
Recognition: the user provides survey notes or meeting minutes in .txt format.
Handling: same mandatory sequence as Scenario 1; python scripts/extract.py <file>.txt reads the text content (auto-detecting encoding: UTF-8/GBK/GB18030).
Recognition: the user provides an exported resource inventory in .csv format.
Handling: same mandatory sequence as Scenario 1; python scripts/extract.py <file>.csv reads the CSV content with automatic delimiter detection (comma/tab/semicolon/pipe) and encoding detection. Do not hardcode the delimiter or parse the CSV yourself.
Recognition: the user only needs a verbal summary, needs a pricing proposal, or needs to perform an actual migration operation. Handling: inform the user this skill does not apply and suggest an alternative.
Verify the Python dependencies are available before running (no network download is performed):
python scripts/extract.py --check
# Prints "dependency check passed" or lists the missing packages
Dependency list:
Dependency versions are pinned and managed in
scripts/requirements.txtand installed at build time:pip install -r scripts/requirements.txtSecurity note: runningpip installor any other network download is forbidden at runtime.
Use scripts/extract.py to extract the survey file content:
python scripts/extract.py <file_path>
# Supported formats: .xlsx, .docx, .txt, .csv
# The file is provided or uploaded by the user; use forward slashes / in the path
Built-in security protections of the script:
../, null bytes, etc.; the null-byte check runs before path resolution)Key information to extract:
Identify the cloud vendor the customer is currently using from the source materials. Refer to the "Source Cloud Platform Identification Clues" table in references/cloud-mapping.md.
Common clues:
Based on the identified source cloud platform, build the product correspondence using the mapping tables in references/cloud-mapping.md.
The mapping tables cover nine categories:
For every component that carries version information, assess the risk with reference to references/version-risks.md:
version_risks field.Key version red lines (must be highlighted in the report):
First write the assembled survey data to a JSON file, then call the report generator. You MUST use this script; do not build the .docx yourself.
# Step 6a: write the survey data you assembled to a JSON file (e.g. survey_data.json)
# Step 6b: generate the report from that JSON file
python scripts/generate_report.py <survey_data_json_file> [output_dir]
# survey_data_json_file: the JSON file containing the survey data
# output_dir: output directory (optional, defaults to ./output/)
Running scripts/generate_report.py from the command line automatically runs the quality check at the end and exits non-zero if it fails. For the survey_data structure, see the "Usage Example" section below.
A quality check must be run after the report is generated:
from scripts.generate_report import quality_check
results = quality_check(output_path)
if not results['passed']:
print("Quality check failed:")
for w in results['warnings']:
print(f" - {w}")
Pass criteria:
The generated report contains the following sections:
The report contains an auto-generated table of contents (TOC); after opening it in Word, the user can right-click and update the field to display it. The footer contains the document title and an automatic page number.
The example data below is for demonstration only; the actual data varies by customer scenario.
from scripts.generate_report import generate_report, quality_check
survey_data = {
'customer_name': 'XX Tech',
'source_cloud': 'Huawei Cloud',
'target_cloud': 'Alibaba Cloud',
'business_type': 'E-commerce/Retail',
'core_scenarios': ['Online Trading', 'Data Analysis', 'User Recommendation'],
'peak_hours': 'Daily 10:00-12:00, 20:00-22:00',
'availability_requirement': '99.95%',
'data_scale': '200 compute instances, 500TB storage, 30 database instances',
'migration_window': 'Weekend 00:00-06:00',
'downtime_tolerance': '< 2 hours',
'architecture': {
'Compute': {'count': '200 instances', 'version': 'N/A', 'specs': '8C32G ~ 32C128G', 'migration_notes': 'Mainly Java apps, mapping to Alibaba Cloud g8/c8 series', 'supplement': ''},
'Storage': {'count': '500TB', 'version': 'N/A', 'specs': 'OBS Standard + Parallel File System', 'migration_notes': 'Online migration service; parallel file system maps to OSS-HDFS', 'supplement': 'Images, logs, backups'},
'Database': {'count': '30 instances', 'version': 'MySQL 5.7 + GaussDB', 'specs': 'Primary-replica architecture', 'migration_notes': 'MySQL 5.7->8.0 requires upgrade, recommend traffic replay tool for validation; GaussDB->PolarDB requires SQL refactoring', 'supplement': ''},
'Cache': {'count': '10 instances', 'version': 'Redis 4.0', 'specs': 'GeminiDB Redis (using exHash)', 'migration_notes': '[Version upgrade] Redis 4.0->5.0+ required; exHash requires Tair memory edition', 'supplement': ''},
'Message Queue': {'count': '5 clusters', 'version': 'Kafka 2.8 + RabbitMQ 3.9', 'specs': 'DMS Kafka + DMS RabbitMQ', 'migration_notes': 'Kafka compatible; RabbitMQ maps to Alibaba Cloud RabbitMQ edition', 'supplement': ''},
},
'product_mapping': [
('ECS', 'ECS', 'SMC migration / redeploy'),
('OBS', 'OSS', 'Online migration service'),
('RDS MySQL', 'RDS MySQL 8.0', 'DTS full + incremental sync'),
('GaussDB', 'PolarDB', 'Data migration + SQL refactoring'),
('GeminiDB Redis', 'Tair Memory', 'Redis-Shake online sync'),
('DMS Kafka', 'ApsaraMQ Kafka', 'MirrorMaker migration'),
('DMS RabbitMQ', 'ApsaraMQ RabbitMQ', 'AMQP protocol compatible, smooth migration'),
],
'version_risks': [
{'component': 'Redis', 'source_version': '4.0', 'target_version': '5.0+', 'risk_level': 'High', 'notes': 'No 4.0 on Alibaba Cloud; exHash requires Tair memory edition'},
{'component': 'MySQL', 'source_version': '5.7', 'target_version': '8.0', 'risk_level': 'Medium', 'notes': 'Recommend traffic replay tool for compatibility validation'},
],
'risks': [
('GaussDB to PolarDB SQL incompatibility', 'High', 'High', 'Conduct SQL compatibility testing and refactoring in advance'),
('Redis 4.0 upgrade + exHash compatibility', 'High', 'High', 'Must use Tair memory edition; disk edition does not support extended data structures'),
('Cutover during peak hours affects user experience', 'Medium', 'High', 'Choose off-peak window, prepare rollback plan'),
('DNS switch propagation delay in some regions', 'Low', 'Medium', 'Lower TTL 48 hours in advance'),
],
'pending_items': [
'Confirm specific GaussDB version and features',
'Confirm the list of Redis extended commands in use',
'Provide a complete application dependency diagram',
'Confirm the specific cutover time window for databases',
],
'next_steps': [
'Export complete Huawei Cloud resource inventory',
'Set up Alibaba Cloud test environment for POC',
'Complete GaussDB -> PolarDB compatibility testing',
'Validate Tair memory edition compatibility with exHash commands',
'Develop detailed cutover plan',
],
}
output_path = generate_report(survey_data, output_dir='./output/', customer_name='XX Tech')
results = quality_check(output_path)
.docx report and passed the quality check.{customer_name}_migration_survey_report.docx.The report is a Chinese .docx document containing a cover page, table of contents, 8 sections, a resource detail table, a product mapping table, a version risk table, a risk table, etc. High-risk rows are automatically highlighted in orange. The cover page contains the customer name, project name, source cloud platform, preparing organization, date, document version, and confidentiality level. The footer contains the document title and an automatic page number (Word PAGE field code). The TOC is a field code; the user updates the field in Word to display it.
../.scripts/extract.py to read the input file; never parse .docx/.xlsx/.csv/.txt with your own ad-hoc code.scripts/generate_report.py to produce the .docx; never generate the document with write_file or a custom python-docx script.scripts/extract.py first; if the file is absent, reconstruct it from the survey information the user provided via scripts/prepare_sample_input.py <file_path> <details_json>, then re-run scripts/extract.py on it and continue with scripts/generate_report.py + quality check. Never hand-write file creation/parsing code or guess details that were never provided (leave them as "to be confirmed"); never reconstruct or read a file at a path that fails traversal validation.openpyxl==3.1.2 and python-docx==1.1.0 should be pre-installed and version-pinned at build time; running pip install at runtime is forbidden.python scripts/extract.py --check.qn('w:eastAsia').references/cloud-mapping.md.references/version-risks.md.quality_check() must be run to validate after the report is generated.sanitize_path() (the null-byte check is performed first), and customer_name is cleaned by sanitize_filename() (compatible with Windows illegal characters).validate_output_dir() refuses to write to critical system directories (/etc /usr /System, etc.), and checks both the realpath and the original path (to handle macOS symlinks).validate_input_path() detects path traversal, validates file existence, applies an extension whitelist, and enforces the file size limit.quality_check() has built-in regex detection (AccessKey/AWS Key/password fields/public IP/JWT token, etc.), with RFC1918 private IPs auto-whitelisted.FileReadTimeoutError, which does not shadow the built-in Python TimeoutError).