Skip to content
Agentmart
Submit a tool
This entry duplicates write-file, which is the one we list in search.

write-file

Write or create files with given content.

Skill by tzaeb

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/tzaeb-write-file-a4731e

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Write or create files with given content. Use when the user asks to create, write, edit, or modify files.

Use cases: writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions: not checked yet.

What's inside

Skill name
write-file
Description
Write or create files with given content. Use when the user asks to create, write, edit, or modify files.
License
MIT
Instructions
40 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Write File

## Instructions

Write content to a file, creating parent directories as needed.

```python
import os

path = "path/to/file.txt"
content = "file content here"

os.makedirs(os.path.dirname(path) or ".", exist_ok=True)
with open(path, "w", encoding="utf-8") as f:
    f.write(content)
print(f"Written {len(content)} bytes to {path}")
```

For editing existing files, read first, modify, then write back:

```python
with open("path/to/file.txt", encoding="utf-8") as f:
    lines = f.readlines()

# Modify specific lines (0-indexed)
lines[5] = "replacement line\n"

with open("path/to/file.txt", "w", encoding="utf-8") as f:
    f.writelines(lines)
print("File updated")
```

## Guidelines

- Always create parent directories with `os.makedirs`
- Confirm the write by printing the path and bytes written
- When editing, read the file first to understand its structure
- Use UTF-8 encoding explicitly

From tzaeb/skills_example, MIT.

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Mar 5, 2026 (7 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

Same skill elsewhere

Copies of this SKILL.md published by others; search shows only one of them.

More from tzaeb

Cite this page

write-file skill. Agent Mart. https://agentmart.dev/skills/tzaeb-write-file-a4731e (last updated 2026-10-24)