Skip to main content

idempotent-script-design

Use this skill when writing scripts, cron jobs, data pipelines, or any automated process that may be run multiple times. Design every operation to be safely re-runnable without side effects.

소스 정보

저장소
aiming-lab/MetaClaw
최근 소스 활동
2026년 3월 10일 18:04
감지된 SKILL.md 언어
영어
스타
3,464
포크
453

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
idempotent-script-design
description
Use this skill when writing scripts, cron jobs, data pipelines, or any automated process that may be run multiple times. Design every operation to be safely re-runnable without side effects.
category
automation
# Idempotent Script Design An idempotent operation produces the same result whether run once or ten times. **Techniques:** - **Check before create:** `CREATE TABLE IF NOT EXISTS`, `mkdir -p`, check file existence before writing. - **Upsert instead of insert:** Use `INSERT ... ON CONFLICT DO UPDATE` in SQL. - **Atomic writes:** Write to a temp file, then rename — prevents corrupt partial output. - **Track progress:** Write a completion marker or checkpoint so reruns skip done work. **Testing idempotency:** Run your script twice on the same input and verify the output is identical. **Anti-patterns:** - Appending to a file without checking if the data is already there. - Inserting rows without checking for duplicates.
GitHub에서 보기