ychampion/cskill-agents/create-only-idempotent-artifact-write

Claude Code and agent skill by ychampion/cskill-agents

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Persist deterministic artifacts with a create-only write and treat existing files as replay success instead of an error.

Install

npx vskill@latest install ychampion/cskill-agents/create-only-idempotent-artifact-write

SKILL.md

SKILL: Create-Only Idempotent Artifact Write

Domain: tool-orchestration Trigger: Apply when a deterministic artifact is keyed by a stable invocation ID and may be replayed across retries, compaction, or resume passes. Source Pattern: Distilled from reviewed tool-loop and result-shaping patterns.

Core Method

When an artifact path is derived from a stable identity, write it once with an atomic create-only operation instead of checking for existence first. If the write hits "already exists," treat that as proof the earlier successful write already materialized the deterministic content and continue with the normal readback or preview path. This removes the stat-then-write race, avoids useless rewrites during replay, and keeps repeated passes behaviorally identical.

Key Rules

  • Derive the artifact path from a stable key such as tool_use_id so repeated calls target the same location.
  • Use a create-only write primitive like flag: 'wx' to collapse "create if absent" into one filesystem operation.
  • Treat EEXIST as idempotent success when the content is deterministic for that key; only unexpected filesystem errors should fail the operation.
  • Continue into the downstream preview or response-building path even when the file already existed, so replayed calls return the same contract as fresh ones.
  • Avoid preflight existence checks because they reintroduce races and duplicate I/O under concurrency.

Example Application

If a large tool result is persisted under tool-results/<tool_use_id>.json, write it once with a create-only flag. When transcript replay or micro-compaction revisits that same tool result, the write sees EEXIST, skips the rewrite, and still returns the same preview payload and saved path to the caller.

Anti-Patterns (What NOT to do)

  • Do not stat() and then writeFile() for idempotency; another writer can win between those calls.
  • Do not overwrite existing artifacts on every replay when the file path is already the canonical output for that key.
  • Do not treat "file already exists" as a hard error in deterministic replay flows; it is often the success path.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
36
Repository forks
7
7-day trend score
18

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/ychampion/cskill-agents/create-only-idempotent-artifact-write/badge)](https://verified-skill.com/skills/ychampion/cskill-agents/create-only-idempotent-artifact-write)

Something wrong with this skill or its page? Tell us.