mcpbeat Sign in

Ops Safety Agent Skill

>- 运维安全规范。当用户执行系统级命令(sysctl、iptables、systemctl、Docker 配置、数据库 DDL) 或进行服务器运维操作时触发。 包含命令风险说明模板、回滚方案要求、问题排查原则、Docker/Cloudflare/数据库场景规则等。

703 tokens
context cost
SKILL.md, read when the skill is used
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
1 027
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/doccker/cc-use-exp --skill ops-safety

The instruction itself

7 sections, as written by the author

运维安全规则

> 防止因不完整的操作导致系统故障。


1. 系统级命令规则

在给出任何系统级命令(sysctl、firewalld、iptables、systemctl 等)之前,必须先说明:

| 项目 | 说明 |

|------|------|

| 影响范围 | 这个命令会影响什么(网络、Docker、服务等) |

| 风险等级 | 高/中/低 |

| 回滚方案 | 完整的回滚步骤,包括所有依赖服务的重启 |

| 需要重启的服务 | 明确列出 |


2. 回滚方案要求

回滚方案必须包含以下步骤,缺一不可:

| 步骤 | 说明 | 示例 |

|------|------|------|

| 1. 恢复配置 | 删除或还原配置文件 | rm -f /etc/sysctl.d/99-xxx.conf |

| 2. 重载配置 | 重新加载系统配置 | sysctl --system |

| 3. 重启服务 | 重启所有受影响的服务 | systemctl restart docker |

| 4. 恢复应用 | 重启依赖的应用 | docker-compose up -d |

| 5. 验证恢复 | 确认服务正常 | curl -I http://127.0.0.1:80 |


3. 问题排查原则

不扩散问题

如果 A 配置导致问题:

  • ✅ 先彻底恢复 A
  • ❌ 不要去改 B、C、D

最小改动原则

  • 只修改必要的配置
  • 一次只改一个变量
  • 改完验证后再进行下一步

不动正常配置

  • 用户明确说某配置正常,不要建议修改
  • 不要"顺手"优化其他配置

4. 特定场景规则

Docker 相关

修改以下配置后,必须提示重启 Docker:

  • 内核网络参数(sysctl)
  • iptables / firewalld 规则
  • Docker daemon 配置

数据库操作

执行以下操作前必须提示备份:

  • 表结构修改(ALTER TABLE)
  • 批量数据更新(UPDATE/DELETE 无 WHERE 或影响大量数据)
  • 数据库迁移

5. 禁止行为

| 禁止 | 说明 |

|------|------|

| ❌ 问题未解决时改其他配置 | 不要扩散问题 |

| ❌ 不完整的回滚方案 | 必须包含服务重启步骤 |

| ❌ 无风险说明的系统命令 | 必须先说明再执行 |

| ❌ 未经确认执行高风险命令 | 必须等用户确认 |

| ❌ 同时修改多个配置 | 一次一个,验证后再下一个 |


6. 风险等级定义

| 等级 | 定义 | 示例 |

|------|------|------|

| 高 | 可能导致服务中断、数据丢失 | 内核参数、防火墙、数据库DDL |

| 中 | 可能影响部分功能 | 应用配置、环境变量 |

| 低 | 影响范围小,易回滚 | 日志级别、非核心配置 |

How to use it

Copy the folder

Take doccker/cc-use-exp-.cursor-ops-safety from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

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.