Use this skill whenever the user reports a problem with a Windows system, Windows Server, or Windows ECS instance, or asks to check, diagnose, inspect, or troubleshoot anything Windows-related. Covers network issues (ping, DNS, DHCP, firewall, SMB), RDP/remote desktop (connection failures, authentication, black screen, lag), storage/disk, system activation, Windows Update, performance slowdowns, user accounts/permissions, drivers, app crashes, security/certificate/TLS, scheduled tasks, or vague requests like 'check the system' or 'something is wrong.' Load this skill even if the user does not explicitly mention Windows but the context implies a Windows environment.
npx skills add https://github.com/aliyun/alibabacloud-ecs-troubleshoot-skills --skill alibabacloud-ecs-windows-online-troubleshooting
当用户报告 Windows 实例的故障现象,或要求对 Windows 实例进行问题排查、状态检查时,加载本技能。覆盖范围包括:
诊断能力清单和问题路由表存放在 references/REFERENCE.md 中,在路径规划阶段加载。
执行过程中向用户呈现进度、排查路径、当前步骤等信息时,禁止暴露 Skill 内部标记,必须用自然语言描述该步骤所对应的诊断功能。需隐藏的内部标记包括但不限于:
references/REFERENCE.md、references/rdp-service.md、references/networking-tcpip.md 等Step 1、Step 2 等机械编号,以及 Direct/Contributing/Unrelated、Critical/Warning/Info、MUST 等词汇的原始字样示例:
内部标记仅用于工具调用、日志与模型内部推理,不进入对话面向用户的文本。
references/REFERENCE.md,获取诊断能力清单和问题路由表按排查序列逐个加载 reference 执行诊断。
单个 reference 执行规则:
references/{file}.md)序列控制逻辑:
[用户问题] 远程桌面连不上
│
├── [Direct] TermService 服务已停止
│ └── [Contributing] 依赖服务 RpcSs 异常
│
└── [Direct] 防火墙阻止 3389 端口
└── [Contributing] 公共网络配置文件生效
#requires -RunAsAdministrator
# 修复:{根因名称}
# 风险:{风险说明}
# 验证:执行后运行 {验证命令} 确认修复结果
# --- 修复操作 ---
{修复命令}
# --- 验证 ---
{验证命令}
> 诊断结论
>
> 用户问题:{原始问题描述}
>
> 共发现 {N} 个问题,按修复优先级排列:
>
> ---
>
> 🔴 问题 1(Direct | Critical):{root_cause}
>
> 证据:{采集到的异常数据}
>
> 分析:{为什么这个问题直接导致了用户看到的现象}
>
> 因果链:{用户问题} ← {直接原因} ← {间接原因(如有)}
>
> 修复方案:
> `powershell
> {修复脚本}
> `
>
> 验证:
> `powershell
> {验证命令}
> `
> 预期结果:{正常状态}
>
> ---
>
> 🟡 问题 2(Contributing | Warning):{root_cause}
> ...
Get-WmiObject 在部分系统上被弃用,优先使用 Get-CimInstanceSelect-Object 仅输出关键字段,避免冗长的完整对象输出。示例:Get-Service TermService | Select-Object Name, Status, StartTypeGet-Service TermService(输出包含大量无关字段)Get-Process | Sort-Object CPU -Descending | Select-Object -First 5 Id, Name, CPUGet-Process | Sort-Object CPU -Descending | Select-Object -First 5(输出 20+ 字段)Select-Object 返回的对象进入延迟格式化队列,后续 Write-Host 输出可能先于表格到达控制台,导致输出顺序错乱。采集脚本编写时必须在 Select-Object 后追加 | Format-Table 或 | Format-List 强制同步渲染,从源头保证输出顺序正确| cmd 命令 | PowerShell 替代 |
|-----------|-------------------|
| net user | Get-LocalUser / Get-CimInstance Win32_UserAccount |
| net localgroup | Get-LocalGroupMember / Get-CimInstance Win32_GroupUser |
| netstat | Get-NetTCPConnection / Get-NetUDPEndpoint |
| ipconfig | Get-NetIPConfiguration / Get-NetIPAddress |
| tasklist | Get-Process / Get-CimInstance Win32_Process |
| sc query | Get-Service / Get-CimInstance Win32_Service |
| net accounts | 无直接替代,直传原始输出 |
| netsh | 无直接替代,直传原始输出 |
| fsutil | 无直接替代,直传原始输出 |
| bcdedit | 无直接替代,直传原始输出 |
slmgr、winver 等命令默认会弹出图形化对话框,在无人值守或非交互式执行环境(如云助手、远程脚本)中会导致挂起。必须使用 cscript //Nologo 前缀调用对应的 .vbs 脚本,将输出重定向到控制台:例如 cscript //Nologo C:\windows\system32\slmgr.vbs /dli 替代 slmgr /dli输入侧 — CMD/EXE 命令输出捕获:以下命令使用系统默认代码页(简体中文系统为 GBK/936),与 PowerShell 的 UTF8 编码不一致,直接执行会导致中文乱码。执行这些命令时,MUST 通过 ProcessStartInfo 显式指定 StandardOutputEncoding = [System.Text.Encoding]::GetEncoding(936) 来正确捕获输出:
w32tm — Windows 时间服务命令cscript — 脚本宿主(如 slmgr.vbs)netsh — 网络配置命令ipconfig — IP 配置命令net accounts — 账户策略命令pnputil — 设备驱动工具bcdedit — 启动配置命令fsutil — 文件系统工具icacls — 权限管理命令wusa — Windows 更新独立安装程序ProcessStartInfo 包装模板:
$psi = New-Object System.Diagnostics.ProcessStartInfo "<executable>", "<arguments>"
$psi.RedirectStandardOutput = $true; $psi.UseShellExecute = $false
$psi.StandardOutputEncoding = [System.Text.Encoding]::GetEncoding(936)
$p = [System.Diagnostics.Process]::Start($psi)
$p.StandardOutput.ReadToEnd(); $p.WaitForExit()
reference 文件中可直接写原始命令(如 w32tm /query /source),agent 在实际执行时根据本规则自动应用 ProcessStartInfo 包装
输入侧:以上规则用于正确捕获 cmd 命令的中文输出,避免乱码
switch、foreach、function 等)和自动变量(如 $_、$input、$args、$error、$host、$pwd、$foreach、$switch、$null、$true、$false 等)。误用内置标识符会导致脚本行为异常或变量值被覆盖,排查困难Get-ItemProperty 默认返回包含 PSPath、PSParentPath、PSChildName、PSDrive、PSProvider 等 PowerShell 元数据字段,干扰诊断输出。MUST 通过以下方式之一过滤这些字段:| Select-Object <目标属性> 明确选取需要的属性(推荐,适用于已知属性名的场景):Get-ItemProperty ... -Name ProxyEnable, ProxyServer | Select-Object ProxyEnable, ProxyServer| Select-Object -Property * -ExcludeProperty PSPath,PSParentPath,PSChildName,PSDrive,PSProvider(适用于需要全部注册表值但排除元数据的场景)[PSCustomObject] 提取目标属性(适用于需要进一步处理的场景)禁止直接输出 Get-ItemProperty 的完整结果
CommandNotFoundException、'xxx' is not recognized as an internal or external command)→ 直接跳过该检查项,不要重试>nul、2>nul、1>nul),这会触发 RedirectionFailed 错误$null 替代 nul,如 2>$null、>$nullschtasks /query /fo LIST /v 2>nul | Select-String "TermService"schtasks /query /fo LIST /v 2>$null | Select-String "TermService"Get-ScheduledTask)替代 cmd 命令{...} 视为脚本块(ScriptBlock),传给原生命令(如 bcdedit、reg、schtasks 等)时会被错误展开为 -encodedCommand 参数,导致命令报错bcdedit /enum {default} 报错 Invalid command line switch: /encodedCommand / 参数错误{default} / {bootmgr} / {current} / {globalsettings} / GUID 形式 {xxxxxxxx-xxxx-...} 等)MUST 用 双引号 或 单引号 包裹后再传给原生命令bcdedit /enum {default} 2>&1bcdedit /enum "{default}" 2>&1bcdedit /set {default} bootstatuspolicy IgnoreAllFailuresbcdedit /set "{default}" bootstatuspolicy IgnoreAllFailuresreg、wmic、schtasks、takeown 等所有原生 cmd/exe 工具调用Expert in secure backend coding practices specializing in input validation, authentication, and API security. Use PROACTIVELY for backend security implementations or security code reviews.
This skill should be used when the user asks to "perform cloud penetration testing", "assess Azure or AWS or GCP security", "enumerate cloud resources", "exploit cloud misconfigurations", "test O365 security", "extract secrets from cloud environments", or "audit cloud infrastructure". It provides comprehensive techniques for security assessment across major cloud platforms.
You are a dependency security expert specializing in vulnerability scanning, license compliance, and supply chain security. Analyze project dependencies for known vulnerabilities, licensing issues, outdated packages, and provide actionable remediation strategies.
Comprehensive Flow Nexus platform management - authentication, sandboxes, app deployment, payments, and challenges
This skill should be used when the user asks to "escalate privileges on Linux", "find privesc vectors on Linux systems", "exploit sudo misconfigurations", "abuse SUID binaries", "exploit cron jobs for root access", "enumerate Linux systems for privilege escalation", or "gain root access from low-privilege shell". It provides comprehensive techniques for identifying and exploiting privilege escalation paths on Linux systems.
Expert malware analyst specializing in defensive malware research, threat intelligence, and incident response. Masters sandbox analysis, behavioral analysis, and malware family identification. Handles static/dynamic analysis, unpacking, and IOC extraction. Use PROACTIVELY for malware triage, threat hunting, incident response, or security research.
This skill should be used when the user asks to "use Metasploit for penetration testing", "exploit vulnerabilities with msfconsole", "create payloads with msfvenom", "perform post-exploitation", "use auxiliary modules for scanning", or "develop custom exploits". It provides comprehensive guidance for leveraging the Metasploit Framework in security assessments.
Expert in secure mobile coding practices specializing in input validation, WebView security, and mobile-specific security patterns. Use PROACTIVELY for mobile security implementations or mobile security code reviews.
Take aliyun/alibabacloud-ecs-windows-online-troubleshooting from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.