in-place-file-mutation
Installation
SKILL.md
In-Place Code Mutation (Zero-Tempfile Architecture)
Overview
A common anti-pattern in naive AI coding workflows is creating temporary sidecar duplicate files (auth_new.ts, server_temp.py, index.backup.js) with the intention of later swapping them with the original file.
Creating temporary sidecar files causes severe workflow hazards:
- Multi-Turn Cleanup Churn: Requires 3 to 4 turns (Write new file $\rightarrow$ Delete old file $\rightarrow$ Rename new file $\rightarrow$ Remove backup), wasting roundtrip tokens.
- Broken Module Resolution: Compilers and bundlers (
tsc,vite,pytest) pick up the duplicate files, triggering duplicate identifier and conflicting route errors. - Orphaned Garbage on Disk: If a task fails or aborts mid-stream, orphaned
_tempfiles remain permanently committed to the repository.
The In-Place Code Mutation Protocol enforces direct, atomic file mutations in-place using replace_file_content or memory-buffered atomic filesystem writes.