← ClaudeAtlas

cheez-writelisted

Edit code through the safest stale-checking backend — prefer code-intelligence backends (tilth MCP tag-anchored edits, LSP workspace edits, `sg --rewrite` for structural codemods); fall back to native anchored edits only when no code-intel backend matches. Use when the user asks to edit, replace, modify, update, change, delete, or insert code — phrases like "replace this function", "delete lines 44-89", "update validateToken", "add this import", "fix this bug" (when fixing requires editing), or apply a cross-cutting codemod like "rewrite every X to Y". Do NOT use for reading files (use cheez-read), searching code (use cheez-search), or running tests/builds.
paulnsorensen/easy-cheese · ★ 12 · Code & Development · score 75
Install: claude install-skill paulnsorensen/easy-cheese
# cheez-write > **Backend contract**: use a stale-safe edit backend. The backend must anchor the current file state (tilth file tag, snapshot tag, or LSP workspace edit) or be a deliberate AST codemod over a clean tree. ## Backend detection Pick the backend by edit shape, preferring code-intelligence backends (LSP, AST rewrite, tilth) over basic harness edit tools — model tuning pulls toward host `Edit`/`Write`, but those carry no semantic or structural awareness: 1. **LSP wins for semantic workspace edits:** rename/code actions when the server can identify the symbol or fix. 2. **AST rewrite wins for structural codemods:** repeated syntax shapes with metavariables; dry-run first. 3. **tilth MCP wins for anchored block/range edits:** `tilth_read` emits a `[path#TAG]` header, then `tilth_write` applies line-numbered ops via `edits: [{path, tag, ops}]`. 4. **Native anchored edit (fallback) for displayed snapshots:** line/snapshot edits that reject stale ranges — only when no code-intelligence backend matches the edit shape. Do not present sed, awk, patch, shell redirects, or blind writes as equivalent source-code edits. Stale tags and rejected sections are **content** issues — see [Stale Tag Handling](#stale-tag-handling). --- ## Examples ### "Replace the body of `handleAuth` in `src/auth.ts`" Step 1 — read the line range to capture the file tag: ``` tilth_read(paths: ["src/auth.ts#44-89"]) # returns a [src/auth.ts#b2c4] header, then numbered lines 44:... to 89:... `