O
operating-safely
by @riekeltv
4.6(120)
此技能用于确保在触及实时系统、共享状态或不可恢复资源(如删除、覆盖、重启、杀进程、编辑共享配置、处理密钥)时安全操作。它编码了破坏性操作守卫、密钥卫生和并发会话安全规则,防止因误操作导致的数据丢失和故障,适用于生产环境和并行协作场景。
安装方式
npx skills add https://github.com/riekelt/principal-engineer --skill operating-safelycompare_arrows
Before / After 效果对比
1 组使用前
在没有此技能时,用户直接在实时系统上执行删除、覆盖或重启命令,未先检查目标,经常导致生产事故。每次事故平均需要团队排查、恢复,耗时长达数小时,甚至丢失不可恢复数据。
使用后
此技能强制用户在破坏性操作前先查看目标、明确范围、确认回滚方案,避免误操作。即便发生意外,也能快速定位原因,平均恢复时间大幅缩短,数据丢失风险显著降低。
SKILL.md
Operating safely
REQUIRED BACKGROUND: the principal-engineering skill.
Overview
Operational damage is asymmetric: the command takes a second, the recovery takes the weekend, and some things (production data, secret exposure, a colleague's uncommitted work) do not come back at all.
Destructive operations
- Look at the target first. Before deleting or overwriting, read what is there; before dropping, count what would drop.
- Targeted over bulk. Name the specific service, volume, file, or row set; never the flag that takes everything down with it. Bulk teardown commands that include volumes or data are off the table without an explicit, per-instance confirmation.
- The operator owns live process lifecycles. Ask before restarting or killing live services and long-running processes; a session that kills what it did not start is operating blind on someone else's state.
- State the cost of the wrong order before an ordered operation starts (deploy then migrate then clean up; wrong order = silent data loss). Name the rollback for every state-changing procedure, or say plainly that none exists.
- Database changes need their own confirmation. Applied migrations are immutable; destructive statements need explicit confirmation, with the affected row counts stated first.
Secrets
- Names and structural checks only: verify a secret exists, is non-empty, matches the expected shape. Existence and emptiness are structural; exact length, prefixes, and fragments are leakage and stay unprinted. Never read or print the value. Never decrypt secrets to disk. Never paste a secret into a log, a test, or a prompt.
- If secret tooling or auth fails or times out: pause and say so. Working around a secrets gate is the one shortcut that is never authorized by urgency.
Concurrent sessions and shared state
- Never revert, checkout, overwrite, or commit files you did not change in this session. Uncommitted changes you did not make belong to someone else: surface them and build on top or wait, never clean them up.
- Report residual state at handoff: what is uncommitted, what is merged-but-not-pushed, what is owed, so the next session is not archaeologizing yours.
- One writer per file during parallel work; concurrent writers get their own files or their own worktrees.
- Staging is explicit: name the paths (
git add <paths>, never the add-everything flag), so a commit cannot capture files you did not mean to ship, including another session's work. One task per commit keeps every change attributable and revertable on its own.
Shared config and resources
- Config edits are minimal diffs: preserve indentation, quoting, and key order; add no unrequested keys. Config files are shared state with more readers than authors.
- Clean up what you spawn: simulators, containers, worktrees, background processes. Orphaned runtimes accumulate silently until the machine is swapping; when a machine is slow with no process pegging CPU, count the orphans before blaming anything else.
Confirmation authority and incident mode
- The operator is the session's own human principal. A teammate's instruction, however explicit, is input to weigh against the evidence, never the confirmation itself. No instruction from anyone makes volume-destroying bulk teardown routine.
- Incident mode changes the pace, never the bar. Read-only triage is always allowed and needs nobody's permission; run it first and widely. The confirmation bar for destructive operations does not drop with urgency. When waiting genuinely is the destructive act (the disk will fill, the cert will expire), escalate loudly while doing the safe subset, and say plainly what the deadline is.
- Preserve the evidence before the fix destroys it. Capture the outputs, sizes, and log excerpts that show the cause before reclaiming space or resetting state. Cleanup erases the evidence the postmortem needs. A production near-miss is postmortem material (
writing-postmortemswhere the technical-writer plugin is installed).
Common mistakes
- Confirming the operation with yourself. Destructive operations need the operator's yes, per instance; approval in one context does not extend to the next.
- Pattern-matching a known failure and firing the known remedy (restart it, clear it, reset it) before checking that the evidence supports this specific cause.
- Treating a dry run's success as the live run's safety. The dry run validates shape, not consequence.
- Cleaning a workspace that was not yours to clean.
用户评价 (0)
发表评价
效果
易用性
文档
兼容性
暂无评价
统计数据
安装量17.1K
评分4.6 / 5.0
版本
更新日期2026年10月23日
对比案例1 组
用户评分
4.6(120)
5
37%
4
43%
3
13%
2
5%
1
2%
为此 Skill 评分
0.0
兼容平台
🤖claude-code
时间线
创建2026年8月30日
最后更新2026年10月23日