Skip to content
Back to skills

Edit File

ASecurity

Edit an existing file by replacing text

  • 12 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 13, 2026
ai-agentsgo

Security analysis

A100/100

Scanned November 13, 2026

npx -y skills add theonlyamos/cognitrix --skill edit-file --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Edit File?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Edit File
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/theonlyamos-edit-file/badge)](https://www.skillsdirectory.com/skills/theonlyamos-edit-file)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: edit-file
description: Edit an existing file by replacing text
context: same
args:
  - name: file_path
    description: Path to the file to edit
    required: true
  - name: old_string
    description: The text to find and replace
    required: true
  - name: new_string
    description: The replacement text
    required: true
  - name: replace_all
    description: If true, replace all occurrences. Defaults to false.
    required: false
tags: [file, edit, modify]
category: system
version: "1.0.0"
author: cognitrix
allowed-tools: [Edit]
safety:
  risk-level: medium
---

# Edit File

Edit an existing file by replacing text using the Edit tool.

## Usage

### Replace first occurrence
```
<filepath> old_string="old text" new_string="new text"
```

### Replace all occurrences
```
<filepath> old_string="old text" new_string="new text" replace_all=true
```

### Create file if it doesn't exist
```
<filepath> old_string="" new_string="new content" create_if_missing=true
```

## Notes

- Supports both absolute and relative paths
- Use `~` for home directory paths
- old_string cannot be empty
- The first occurrence is replaced by default
- Set replace_all=true to replace all occurrences

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.