agent/skills/tools/edit/SKILL.md
Replace exact text in a file. Use when modifying existing files with precise text replacement, making targeted edits, or deleting code.
npx skillsauth add knoopx/pi editInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Replace exact text in a file. This is the default tool for changing any existing file — prefer it over Write for anything except creating a new file from scratch.
REQUIRED: path (absolute), edits (array of {oldText, newText}) OPTIONAL: none
RULES:
oldText must match EXACTLY (whitespace, indentation, line endings all matter)oldText must be unique in the file — include 2-3 lines of surrounding context if needededits is matched against the original file, not after earlier edits apply — do not overlap or nestnewText to ""edits[] entriesEXAMPLE (single change):
{"name": "Edit", "input": {"path": "/absolute/path/file.py", "edits": [{"oldText": "def hello():\n return 1", "newText": "def hello():\n return 2"}]}}
EXAMPLE (two changes in one call):
{"name": "Edit", "input": {"path": "/absolute/path/file.py", "edits": [{"oldText": "MAX = 10", "newText": "MAX = 20"}, {"oldText": "TIMEOUT = 5", "newText": "TIMEOUT = 30"}]}}
RECOVERY WHEN Edit FAILS:
oldText is unique, then retry EditoldText, retry. Write is almost always the wrong recovery here for an existing file.oldText matches precisely (whitespace, indentation, line endings)edits[] entries for disjoint changes in one calltools
Inform the user what is happening — skip passive lookups
development
Renders markdown to self-contained HTML with a custom dark stylesheet and opens in browser. Use when previewing markdown documents, generating styled HTML from README or report files.
testing
Programmatic hunk selection for Jujutsu — split, commit, or squash specific hunks without interactive prompts. Use when making partial commits or selective squashes.
content-media
Manage version control with Jujutsu (jj) — no staging area, immediate changes, smart rebasing. Use when navigating history, squashing, or pushing to Git remotes.