principle-make-operations-idempotent
하는 일
충돌 후에도 안전하게 재시도할 수 있는 작업을 만드는 규칙을 에이전트에 제공합니다. 명령, 작업, 처리 루프를 작성하는 엔지니어를 위한 스킬입니다.
사용하는 경우
- ✓실패 후 다시 실행될 수 있는 명령이나 작업을 설계할 때.
- ✓재시작, 재시도, 충돌로 부분적인 상태가 남을 수 있는 경우.
- ✓중단된 곳에서 안전하게 이어서 처리하는 루프가 필요할 때.
스킬 링크
https://github.com/cursor/plugins/blob/main/harness/pstack/claude-code/skills/principle-make-operations-idempotent/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“데이터 가져오기 작업이 충돌 후 다시 실행되어도 레코드가 중복되지 않도록 만들어 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 각 단계를 현재 상태에서 도출하고, 빠진 차이만 적용합니다. 락이나 임시 파일 같은 남은 표시가 오래된 것인지 알아볼 수 있게 하고, 작업을 두 번 실행하거나 각 지점에서 충돌하면 어떻게 되는지 확인합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Make Operations Idempotent
Design operations so they converge to the correct state regardless of how many times they run or where the previous run stopped. Every state-mutating operation should answer: "What happens if this runs twice? What happens if the previous run crashed halfway?"
Why: Commands, lifecycle operations, and processing loops run where crashes, restarts, and retries are normal. If partial state changes the next run's outcome, every restart becomes a debugging session.
The idea: derive each step from the state that exists, not from what the previous run meant to do. Read the current state, compare it to the goal, and apply only the difference. A step written this way is safe to repeat, because a repeat finds nothing left to do.
Anything a run leaves behind, such as a lock, a temporary file, a half-written record, or a claimed job, must be recognizable as stale by the next run. Judge staleness by evidence that stays true wherever the previous run could have stopped, not only in the common case. A marker that the next run cannot judge turns every crash into manual cleanup. For example, write to a temporary path and rename it into place, or compare artifacts by content instead of by creation order.
The test:
- What happens if this runs twice in a row?
- What happens if the previous run crashed at every possible point?
- Does re-execution converge to the same end state?
If any answer is "it depends on what state was left behind," the operation needs a reconciliation step.
자주 묻는 질문
핵심 시험은 무엇인가요?
작업을 연달아 두 번 실행하면 어떻게 되는지, 그리고 마지막 실행이 가능한 모든 지점에서 충돌했다면 어떻게 되는지 묻는 것입니다.
남은 락은 어떻게 처리하나요?
이전 실행이 어디에서 멈췄을 수 있든 계속 참인 증거로, 오래된 락이라고 판단해야 합니다.
임시 파일에 쓰는 방식이 도움이 되나요?
네. 임시 경로에 쓴 뒤 제자리로 이름을 바꾸는 방식은 반만 써진 결과를 피하는 방법 중 하나입니다.
상세 정보
작성자의 원본 설명
Apply when designing commands, lifecycle steps, or processing loops that run amid crashes, restarts, and retries. Converge to the same end state regardless of partial prior runs.
repo: cursor/plugins
인기도
- GitHub 스타
- 15k
- 순위
- #10979
- 라이선스
- —
- 업데이트
- 2026. 10. 31.
댓글
- …
이 저장소의 다른 스킬
advisor
15k사용자가 켜 두면, 큰 결정 전이나 오류에 막혔을 때처럼 핵심 시점에 에이전트가 더 강력한 두 번째 모델에게 자문을 구하도록 합니다.
check-agent-compatibility
15kAI 코딩 에이전트가 저장소를 시작하고, 검증하고, 문서화할 수 있는지 전체 점검해, 하나의 호환성 점수와 주요 문제를 돌려줍니다.
cli-for-agents
15kAI 에이전트가 프롬프트 없이 실행할 수 있도록 명령줄 도구를 설계하거나 검토하며, 명확한 도움말과 예시를 담도록 에이전트를 가르칩니다.
continual-learning
15k과거 채팅을 검토하는 일을 전담 메모리 업데이터에게 맡겨서 AGENTS.md 메모를 최신 상태로 유지합니다.
비슷한 스킬
api-connector-builder
280k에이전트가 기존 패턴을 따라 새로운 API 연결을 만들도록 합니다. 새로운 방식을 도입하지 않고 연동을 하나 더 추가할 때 씁니다.
api-design
280k에이전트가 모범 사례에 따라 REST API를 설계하도록 돕습니다. API가 통신하는 방식, 오류를 보여 주는 방식, 데이터를 정리하는 방식을 정하는 데 유용합니다.
backend-patterns
280k에이전트가 서버 쪽 아키텍처 패턴과 데이터베이스 최적화를 다루도록 돕습니다. 서버에서 실행되는 코드를 만들거나 검토할 때 유용합니다.