file-ops

Read, write, and edit files on disk with confirmation before destructive changes.

1.6k|168|Updated Dec 16, 2024
One-click install
npx skills add https://github.com/amd/gaia --skill file-ops-amd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: file-ops
Source: https://github.com/amd/gaia/tree/main/hub/skills/file-ops
Command: npx skills add https://github.com/amd/gaia --skill file-ops-amd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Accidental file overwrites and stale-content edits can destroy work that cannot be recovered. This Skill enforces a disciplined read-before-write workflow so file changes touch only what was intended, with confirmation before anything destructive. ## Core Features & Use Cases - Safe file discovery: Locate files by name with find_files or by content with search_file_content, then verify the exact path with get_file_info before acting. - Surgical edits: Prefer edit_file for targeted string replacement over write_file, which replaces an entire file, and re-read the file when an edit fails instead of guessing. - Destructive-action guardrails: Confirm with the user before overwriting unrelated content, and respect sandbox limits on system directories, credential files, and files over 10 MB. - Use Case: A user asks to update a config value in "the project settings file." The Skill locates the exact file, reads its current content, applies a precise edit, and reports only what changed. ## Quick Start Ask the agent to find the config file in your project and update the timeout value to 30 seconds, confirming before it writes anything.

Frequently Asked Questions about file-ops

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

FAQPage Schema
How do I safely edit a file without overwriting unrelated content?

Read the file first, then use edit_file to replace one exact string with another so only the targeted content changes. Reserve write_file for new files or full replacements, since it overwrites everything.

How to find a file when I only know part of its content?

Use search_file_content with a string you know must be inside the file to locate candidates, then confirm the exact path with get_file_info before reading or editing it.

Why does edit_file fail with content not found?

The failure means your copy of the file is stale or the whitespace does not match byte-for-byte. Re-read the file to get its current exact content instead of retrying with a guessed variation.

Can file operations write to system directories or credential files?

No. write_file and edit_file refuse system directories, credential-bearing dotfiles such as environment files and SSH key directories, and files over 10 MB. These sandbox limits cannot be bypassed.

What are the limitations of read_file for documents?

read_file handles text formats like Python, Markdown, and config files but refuses binary formats such as PDF, DOCX, and XLSX. Those require document indexing and querying tools instead.