技能 os-scripting
🖥️

os-scripting

安全

排查操作系统和Shell脚本问题

此工作流套件帮助开发人员和系统管理员调试shell脚本、创建生产级bash代码,并在Linux、macOS和Windows上自动化系统管理任务。

支持: Claude Codex Code(CC)
🥉 73 青铜
1

下载技能 ZIP

2

在 Claude 中上传

前往 设置 → 功能 → 技能 → 上传技能

3

开启并开始使用

测试它

正在使用“os-scripting”。 Help me debug a bash script that exits with error code 1

预期结果:

I'll help you debug this systematically. First, let me check the script for common issues using ShellCheck, then we'll enable debug mode and trace the execution...

正在使用“os-scripting”。 Create a monitoring script for disk space

预期结果:

I'll create a production-ready monitoring script with proper error handling, logging, and notifications. This will check disk space and alert when usage exceeds thresholds...

正在使用“os-scripting”。 My server has high CPU usage, help troubleshoot

预期结果:

Let's diagnose this systematically. We'll check running processes, identify resource-heavy tasks, and analyze system logs to find the cause...

安全审计

安全
v1 • 2/24/2026

This is a documentation/workflow bundle skill (SKILL.md) that provides educational guidance on OS and shell scripting. All 93 static findings are false positives. The detected 'external_commands', 'network', and 'filesystem' patterns are example commands in documentation, not executable code. The skill's own metadata correctly identifies it as 'risk: safe'.

1
已扫描文件
430
分析行数
0
发现项
1
审计总数
未发现安全问题
审计者: claude

质量评分

38
架构
100
可维护性
85
内容
50
社区
100
安全
83
规范符合性

你能构建什么

调试失败的bash脚本

使用系统化调试技术追踪并修复shell脚本错误,配合适当的日志记录和错误处理。

创建生产级自动化脚本

构建具有适当错误处理、输入验证和使用Bats框架测试的健壮shell脚本。

排查系统性能问题

使用标准系统命令诊断高CPU、内存问题、磁盘空间问题和网络连接问题。

试试这些提示

基础系统诊断
Use @os-scripting to help me check system performance and identify any issues
Shell脚本审查
Use @os-scripting to analyze my shell script for issues and run ShellCheck on it
调试脚本错误
Use @os-scripting to systematically debug this shell script that is failing with error: [describe error]
创建自动化脚本
Use @os-scripting to help me create a production-ready backup script with error handling and tests

最佳实践

  • 始终在脚本开头使用 'set -euo pipefail' 以实现严格错误处理
  • 引用所有变量以防止单词拆分和通配符问题
  • 添加带时间戳的全面日志记录以便故障排查
  • 为所有关键脚本功能编写Bats测试

避免

  • 使用可能包含空格或特殊字符的未加引号变量
  • 使用 '|| true' 忽略命令退出码而没有明确处理
  • 在使用用户输入之前不进行验证
  • 编写没有任何错误处理或日志记录的脚本

常见问题

此工作流套件调用哪些技能?
此套件协调调用 bash-linux、bash-pro、shellcheck-configuration、systematic-debugging、bats-testing-patterns 和 devops-troubleshooter 等技能。
此技能能否在我的系统上执行命令?
否,这是一个文档和工作流指南。它提供指导和建议,但不会直接执行shell命令。
我是否需要安装其他技能才能使用此功能?
是,此工作流套件设计用于与其他技能配合使用,如 bash-linux、shellcheck-configuration 和 bats-testing-patterns。
支持哪些平台?
此工作流涵盖 Linux、macOS 和 Windows(通过 WSL 或 PowerShell 等效命令)。
如何开始学习shell脚本编写?
从第1阶段(环境评估)开始了解您的系统,然后转到第4阶段(脚本开发)创建您的第一个脚本。
我可以将此用于生产自动化吗?
是,该套件包含质量门槛和最佳实践,用于创建具有适当测试和错误处理的生产级脚本。

开发者详情

文件结构

📄 SKILL.md