| name | file_writer |
| description | Create, modify, and delete files with safe edit operations and confirmation for large changes |
| version | 1.0.0 |
| author | Hive Team |
| icon | ✍️ |
| category | filesystem |
| permissions | ["filesystem_read","filesystem_write"] |
| dependencies | [] |
| tools | ["project_read","project_write","project_edit","project_exists"] |
| triggers | ["creá un archivo","create a file","escribí en","write to","editá este archivo","edit this file","modificá","modify","eliminá el archivo","delete file","guardá esto","save this","actualizá el archivo","update file"] |
| preferred_agents | [] |
| steps | [{"step":1,"action":"project_exists","instruction":"Check if file exists to determine if creating or editing","output":"exists_boolean"},{"step":2,"action":"project_read (if editing)","instruction":"Read existing file to understand current structure before modifying","output":"current_content"},{"step":3,"action":"decision_write_or_edit","instruction":"Choose project_write for new files or complete rewrite, project_edit for targeted changes","output":"operation_type"},{"step":4,"action":"canvas_confirm (if large changes)","instruction":"Confirm with user before overwriting files with >50 lines of changes","output":"user_approval"},{"step":5,"action":"project_write or project_edit","instruction":"Execute the write operation with appropriate method","output":"result"}] |
| rules | ["Always read file before editing to understand structure","Use project_edit for small, targeted changes (find/replace)","Use project_write for new files or complete rewrites","Confirm with canvas_confirm before changes >50 lines","Verify file path is within workspace unless explicitly requested otherwise","For delete operations, confirm explicitly with user"] |
| output_format | {"structure":"markdown","sections":["operation","file_path","lines_changed","summary"],"max_length":"Brief summary of changes"} |
| examples | [{"user_input":"creá un archivo README.md con la descripción del proyecto","expected_behavior":"project_exists (false) → project_write({ path: 'README.md', content: '...' })"},{"user_input":"editá el package.json para agregar la dependencia lodash","expected_behavior":"project_read → project_edit with old_string/new_string for dependencies → confirm"},{"user_input":"eliminá el archivo temporal.log","expected_behavior":"project_exists → canvas_confirm('¿Eliminar archivo?') → if approved, delete operation"}] |