qianwenai-operate
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese千问 AI 运维
Qwen AI Operations
对由 部署在阿里云国内站的应用做故障诊断与确认式恢复。诊断只读、无需确认;任何
改变云资源或应用运行状态的动作都必须经过明确确认。
qianwenai-deployPerforms fault diagnosis and confirmation-based recovery for applications deployed by on the Aliyun China site. Diagnostics are read-only and require no confirmation; any action that changes cloud resources or the application runtime state requires explicit confirmation.
qianwenai-deploy交互流程
Interaction Flow
text
识别应用和资源
→ 最小诊断(只读)
→ 给出原因、证据、建议动作
→ 展示影响并请求确认
→ 执行一个恢复动作
→ 验证应用、ECS、RDS
→ 返回结果和审计信息
→ 提议经 qianwenai-observe 重新评分(恢复前 → 恢复后)text
Identify the application and resources
→ Minimal diagnostics (read-only)
→ Present the cause, evidence, and recommended action
→ Explain the impact and request confirmation
→ Execute one recovery action
→ Verify the application, ECS, and RDS
→ Return the results and audit information
→ Propose re-scoring via qianwenai-observe (before recovery → after recovery)交互形态
Interaction Format
- 只读信息(诊断、原因、证据、验证结果):纯文本,每条判断后附一行证据(指标、状态、RequestId)。
- 改状态动作(启停 ECS、重启应用、重载 Nginx 等任何写调用):先用 AskUserQuestion,提问答清 做什么 · 影响(停机/不可逆) · 怎么验证,确认前不执行;一次只提议一个恢复动作。
- 主动纪律:恢复后如结果正常则安静收尾;仅在仍有风险或未恢复时主动给下一步,让用户选。
- Read-only information (diagnostics, causes, evidence, verification results): plain text, with one line of evidence after each finding (metrics, status, RequestId).
- State-changing actions (starting or stopping ECS, restarting the application, reloading Nginx, or any other write call): first use AskUserQuestion and clearly state what will be done · the impact (downtime/irreversibility) · how it will be verified. Do not execute before confirmation; propose only one recovery action at a time.
- Proactive discipline: after recovery, if the result is normal, wrap up quietly; only proactively present a next step when risks remain or recovery has not succeeded, allowing the user to choose.
范围
Scope
| 范围内 | 范围外 |
|---|---|
由 | 无 |
| 单 ECS,或 ECS + RDS MySQL 8.0 | 其他拓扑 / 自建服务器 |
| 诊断 + 确认式恢复(启动 ECS、重启应用、重载 Nginx) | 数据破坏性操作、扩缩容、配置重构 |
| 定位到应用层报错(哪一层坏了、报了什么错) | 源码审查、找 bug/漏洞、判断哪行代码写错、改代码 |
| 阿里云国内站 | 国际站 → 用 |
| In Scope | Out of Scope |
|---|---|
Applications deployed by | Applications without a |
| A single ECS, or ECS + RDS MySQL 8.0 | Other topologies / self-managed servers |
| Diagnostics + confirmation-based recovery (starting ECS, restarting the application, reloading Nginx) | Destructive data operations, scaling, configuration restructuring |
| Locating application-layer errors (which layer is broken and what error occurred) | Source-code review, finding bugs/vulnerabilities, determining which line of code is incorrect, modifying code |
| Aliyun China site | International site → use |
代码问题不在能力范围内
Code Issues Are Outside This Skill's Scope
本 skill 处理基础设施与运行时故障,不做源码审查、缺陷定位或代码修改。诊断可定位到「应用层报错、报了
什么错」,帮用户缩小范围,但不判断具体哪行代码有问题,也不改代码。
涉及代码时,明确告知用户:修改代码属于本 skill 能力之外,需由用户自行决定并执行,相应后果由用户
自行承担。不要在恢复动作里夹带任何代码改动。
This skill handles infrastructure and runtime failures; it does not perform source-code review, defect localization, or code modification. Diagnostics can identify application-layer errors and what was reported, helping narrow down the problem, but the skill does not determine which line of code is incorrect or modify code.
When code is involved, explicitly inform the user that code modification is outside this skill's scope. The user must decide whether and how to make the changes and bears the corresponding consequences. Do not include any code changes in a recovery action.
前置条件
Prerequisites
Aliyun CLI:(需 3.x)。所有命令用驼峰原生形态直连 OpenAPI, 不依赖插件。凭证仅用aliyun version查看状态。绝不读取、回显、打印或索要 AK/SK/Token。 无有效配置集 → 停止并请用户在本会话之外配置凭证。见aliyun configure list。references/cli_installation_guide.md
Aliyun CLI:(3.x required). All commands use the native camelCase form to call OpenAPI directly and do not depend on plugins. Usealiyun versiononly to view credential status. Never read, echo, print, or request AK/SK/Token. If there is no valid configuration set → stop and ask the user to configure credentials outside this session. Seealiyun configure list.references/cli_installation_guide.md
怎么做
How to Proceed
- 识别应用 — 从 识别应用。见 workflow。
.qianwenai-deploy - 诊断(只读,无需确认)— 找出坏在哪一层、可能的原因、证据,以及该怎么处理。见 diagnose。
- 一次只恢复一件事,且先确认。 选中与诊断匹配的动作,向用户展示影响并取得同意,再执行且仅执行
那一件事:
- 启动已停止的服务器 → recover-ecs
- 重启卡死的服务器 → recover-reboot
- 重启应用服务 → recover-app
- 通过后重载 Nginx → recover-nginx
nginx -t - EIP 解绑后重新绑定 → recover-eip
- 放行安全组 80 / 443 入方向 → recover-securitygroup
- 数据库相关问题 → recover-rds
- 根分区将满 / 清理后仍不足需扩容 → recover-disk
- 验证应用是否恢复,再记录做了什么。见 workflow。
- Identify the application — identify the application from . See workflow.
.qianwenai-deploy - Diagnose (read-only, no confirmation required) — determine which layer is broken, the likely cause, the evidence, and how to proceed. See diagnose.
- Recover one thing at a time, and confirm first. Select the action that matches the diagnosis, show the user its impact, obtain consent, and then execute only that action:
- Start a stopped server → recover-ecs
- Reboot a hung server → recover-reboot
- Restart the application service → recover-app
- Reload Nginx after passes → recover-nginx
nginx -t - Rebind an EIP after it has been unbound → recover-eip
- Allow inbound traffic on security group ports 80 / 443 → recover-securitygroup
- Database-related issues → recover-rds
- The root partition is nearly full / remains insufficient after cleanup and needs expansion → recover-disk
- Verify whether the application has recovered, then record what was done. See workflow.
保证恢复安全的几条规则
Rules for Safe Recovery
- 诊断只读;恢复只用一小组已知安全的命令。
- 任何会改变状态的动作都先与用户确认,取消则不改变任何东西。
- 一次一个动作,验证后再决定下一步——绝不把多个恢复步骤合在一起。
- 恢复动作可安全重复。
- 遇到超时、权限错误或状态意外变化时,在下一次改动前停下。
- 审计记录和对话里绝不出现密码、Token 或完整连接串。
任何改动前,确认信息要告诉用户:操作哪个资源、执行什么动作、是否会短暂中断应用、是否改变版本、是否
产生新费用,以及你将如何验证(失败了怎么办)。
- Diagnostics are read-only; recovery uses only a small set of known-safe commands.
- Confirm with the user before any state-changing action. If canceled, nothing is changed.
- Perform one action at a time, verify it, and then decide on the next step—never combine multiple recovery steps.
- Recovery actions can be safely repeated.
- If a timeout, permission error, or unexpected state change occurs, stop before the next modification.
- Passwords, Tokens, and complete connection strings must never appear in audit records or conversations.
Before any change, the confirmation information must tell the user: which resource will be affected, what action will be performed, whether the application will be briefly interrupted, whether the version will change, whether new charges will be incurred, and how the result will be verified (including what happens if verification fails).
所需权限
Required Permissions
见 。只读:、、
、、、
RDS describe/performance/慢日志。写(恢复):、、
、、、
(仅白名单恢复命令)。
references/ram_policies.mdecs:DescribeInstancesecs:DescribeInvocationsecs:DescribeSecurityGroupAttributeecs:DescribeDisksvpc:DescribeEipAddressesecs:StartInstanceecs:RebootInstanceecs:AuthorizeSecurityGroupecs:ResizeDiskvpc:AssociateEipAddressecs:RunCommandSee . Read-only: , , , , , and RDS describe/performance/slow-log operations. Write operations (recovery): , , , , , and (whitelisted recovery commands only).
references/ram_policies.mdecs:DescribeInstancesecs:DescribeInvocationsecs:DescribeSecurityGroupAttributeecs:DescribeDisksvpc:DescribeEipAddressesecs:StartInstanceecs:RebootInstanceecs:AuthorizeSecurityGroupecs:ResizeDiskvpc:AssociateEipAddressecs:RunCommand更多细节
More Details
分步指南已在上面「怎么做」中链接。另有两份配置参考:
- CLI 配置 — 安装与凭证检查。
- CLI 踩坑速查 — 参数形态、时间格式、响应解析易错点。
- RAM 权限 — 本 skill 所需的权限。
The step-by-step guide has already been linked above under How to Proceed. Additional references include:
- CLI Configuration — installation and credential checks.
- CLI Troubleshooting Quick Reference — common pitfalls involving parameter forms, time formats, and response parsing.
- RAM Permissions — permissions required by this skill.