os-scripting
排查操作系统和Shell脚本问题
此工作流套件帮助开发人员和系统管理员调试shell脚本、创建生产级bash代码,并在Linux、macOS和Windows上自动化系统管理任务。
下载技能 ZIP
在 Claude 中上传
前往 设置 → 功能 → 技能 → 上传技能
开启并开始使用
测试它
正在使用“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...
安全审计
安全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'.
质量评分
你能构建什么
调试失败的bash脚本
使用系统化调试技术追踪并修复shell脚本错误,配合适当的日志记录和错误处理。
创建生产级自动化脚本
构建具有适当错误处理、输入验证和使用Bats框架测试的健壮shell脚本。
排查系统性能问题
使用标准系统命令诊断高CPU、内存问题、磁盘空间问题和网络连接问题。
试试这些提示
Use @os-scripting to help me check system performance and identify any issues
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' 忽略命令退出码而没有明确处理
- 在使用用户输入之前不进行验证
- 编写没有任何错误处理或日志记录的脚本