Safe Code Editing Skill
Use this skill when making code changes that need verification.
Shadow Workspace Pattern
The Smart Edit plugin uses a "shadow workspace" approach:
- •Copy: Create a temporary copy of the file
- •Edit: Apply changes to the shadow copy
- •Validate: Run linters/type checkers on the shadow
- •Apply: Only apply changes if validation passes
When to Use
- •Making structural code changes
- •Refactoring existing code
- •Editing files with type annotations
- •Changes that need syntax validation
Workflow
- •Identify the file and changes needed
- •Use
smart-edittool with:- •
file_path: Target file - •
changes: Description of changes
- •
- •Tool validates before applying
- •Review the diff and confirm
Benefits
- •Safety: Changes validated before applying
- •Rollback: Original preserved until confirmed
- •Validation: Catch errors before they happen