Skip to content
cccskills
FreePublished on GitHub

ops-safety

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

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md2.7 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

运维安全规则

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


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
中可能影响部分功能应用配置、环境变量
低影响范围小,易回滚日志级别、非核心配置

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

当设计或修改 REST API 响应结构、处理 API 返回值时触发。防止 API 设计缺陷导致的字段错位、类型歧义等问题。

The English summary is being prepared. Showing the original description.

doccker/cc-use-exp1.1KUpdated Aug 26, 2026

当设计或修改 REST API 响应结构、处理 API 返回值,或生成 Excel/CSV/PDF/对账文件等下游产物时触发。防止 API 设计缺陷导致的字段错位、类型歧义,以及生成产物时关键字段缺失但静默成功的问题。

The English summary is being prepared. Showing the original description.

doccker/cc-use-exp1.1KUpdated Aug 26, 2026

网关/代理/WAF/CDN 中间件的安全关键词匹配实现规范,防止纯子串匹配误判正常响应内容中的技术术语(如 Cloudflare、502、error)

The English summary is being prepared. Showing the original description.

doccker/cc-use-exp1.1KUpdated Aug 26, 2026

当 API/任务可能执行超过 10 秒(批量数据处理、远程 API 批量调用、全表扫描、跨租户聚合)时触发。防止同步接口被网关 30s 超时切断、用户重复点击触发并发、状态缓存内存泄漏等问题。提供异步任务状态机标准模板。

The English summary is being prepared. Showing the original description.

doccker/cc-use-exp1.1KUpdated Aug 26, 2026

Bash 脚本与系统命令规范。禁止行尾注释,强制使用 tee/heredoc 写入,提升命令执行的可维护性。

The English summary is being prepared. Showing the original description.

doccker/cc-use-exp1.1KUpdated Aug 26, 2026

当用户操作 .sh、Dockerfile、Makefile、.yml、.yaml 文件,或在 Markdown 中编写 bash 代码块时触发。提供 Bash 编写规范。

The English summary is being prepared. Showing the original description.

doccker/cc-use-exp1.1KUpdated Aug 26, 2026

See all skills by doccker

Report a problem with this skill