robust-edit

Replace a specified line range in a text file with new content.

23|Updated Apr 5, 2026
One-click install
npx skills add https://github.com/reedmayhew18/ClawedBack --skill robust-edit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: robust-edit
Source: https://github.com/reedmayhew18/ClawedBack/tree/main/.claude/skills/robust-edit
Command: npx skills add https://github.com/reedmayhew18/ClawedBack --skill robust-edit

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Edits line-based blocks by replacing a specified range of lines in a file, eliminating fragility from exact-string matching and whitespace sensitivity.

Core Features & Use Cases

  • Line-range editing: replace, insert, or delete a contiguous block by line numbers.
  • Flexible use cases: refactoring code blocks, updating multi-line templates, and batch edits where surrounding content is variable.
  • Safe operation: preserves encoding and line endings and provides a read mode to preview changes before applying.

Quick Start

Run the robust_edit script with a target file and a line range, then provide the new content to replace that range.

Frequently Asked Questions about robust-edit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I replace a specific range of lines in a text file?

To replace a range of lines in a text file, use a Python script that targets edits by line numbers instead of exact-string matching, allowing you to specify the start and end lines and provide the new content to overwrite that block.

Why does my multi-line refactor fail when using exact-string matching?

Multi-line refactors often fail with exact-string matching due to whitespace sensitivity or variable surrounding content, but editing by line range eliminates this fragility by targeting the block numerically.

How can I update multi-line templates without worrying about whitespace sensitivity?

You can update multi-line templates by specifying the target line range numerically, bypassing whitespace sensitivity entirely and replacing the contiguous block with your new content.

Can I preview changes to a Python script before applying a line-range edit?

Yes, you can preview changes before applying a line-range edit by using the script's built-in read mode, which allows you to verify the targeted lines and content before the replacement is committed.

Does line-range editing preserve UTF-8 encoding and original line endings?

Yes, line-range editing preserves UTF-8 encoding and original line endings, ensuring that replacing or inserting text blocks does not alter the file's formatting or character encoding.

What is the best way to delete a contiguous block of lines in a text file?

The best way to delete a contiguous block of lines is to specify the target line range for removal, which safely updates the text file without relying on matching the exact content string.