‹ 首页

idempotent-redundancy

@parcadei · 收录于 1 周前 · 上游提交 5 个月前

Idempotent Redundancy

适合你,如果需要在分布式系统中保证操作只执行一次

/ 下载安装
idempotent-redundancy.skill双击,或拖进 Claude 桌面版 / Cowork,即完成安装↓ .skill↓ .zip
用别的 agent?下载 .zip 解压,把文件夹放进它的技能目录
Claude Code~/.claude/skills/(项目级 .claude/skills/)
Codex CLI~/.codex/skills/
Cursor自动读取上面两处目录
其他工具见其文档的「skills」目录;两个下载是同一份文件,只是名字不同
/ 通过 npx 安装 校验哈希
npx oh-my-skill add parcadei/continuous-claude-v3/idempotent-redundancy
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- parcadei/continuous-claude-v3/idempotent-redundancy
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify parcadei/continuous-claude-v3/idempotent-redundancy
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
3859GitHub stars
~152上下文体积 · 单文件
镜像托管

怎么用

商店整理自技能原文 · 版本 d07ff4b · 表述以原文为准
它做什么

当 Claude 需要添加冗余路径(如备用方案、双重保险)时,它会确保这些操作是幂等的——即重复执行不会产生副作用或数据损坏。

什么时候触发

在编写或修改涉及回退、修复、数据同步等可能重复执行的代码时触发。

装好后可以这样说
Claude 会使用原子写入/重命名操作。
Claude 会添加存在性检查,避免重复写入。
技能原文 SKILL.md作者撰写 · MIT · d07ff4b

Idempotent Redundancy

When adding redundant paths (fallbacks, belt-and-suspenders), make them idempotent.

Pattern

Redundancy without idempotency causes loops, churn, or data corruption.

DO
  • Use _is_merge: true for Braintrust updates
  • Check if value exists before writing (fallback only if missing)
  • Use atomic write/rename for file operations
  • Make reconciliation steps safe to run repeatedly
DON'T
  • Write unconditionally in fallback paths
  • Allow multiple writers to overwrite each other
  • Fire "repair" actions that can trigger more repairs
Source Sessions
  • a541f08a: "Redundancy is good only if idempotent"
  • 1c21e6c8: "Belt-and-suspenders, but make it idempotent"
  • 6a9f2d7a: "Idempotent repair hooks"
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。