# File

> 文件读写操作，支持创建、读取、写入、删除文件

- **Type:** Skill
- **Install:** `agentstack add skill-baizeagent-baize-file`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [BaiZeAgent](https://agentstack.voostack.com/s/baizeagent)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [BaiZeAgent](https://github.com/BaiZeAgent)
- **Source:** https://github.com/BaiZeAgent/Baize/tree/main/skills/file

## Install

```sh
agentstack add skill-baizeagent-baize-file
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 文件操作技能

## 功能说明

提供文件系统操作能力，包括：

| 操作 | 说明 | 风险等级 |
|-----|------|---------|
| read | 读取文件内容 | 低 |
| write | 写入文件（覆盖已有内容） | 中 |
| create | 创建新文件（如存在则覆盖） | 中 |
| delete | 删除文件 | 高 |
| exists | 检查文件是否存在 | 低 |

## 使用示例

### 创建文件
```json
{
  "action": "create",
  "path": "G:/test.txt",
  "content": "Hello World"
}
```

### 读取文件
```json
{
  "action": "read",
  "path": "G:/test.txt"
}
```

### 写入文件
```json
{
  "action": "write",
  "path": "G:/test.txt",
  "content": "新的内容"
}
```

### 删除文件
```json
{
  "action": "delete",
  "path": "G:/test.txt"
}
```

### 检查文件是否存在
```json
{
  "action": "exists",
  "path": "G:/test.txt"
}
```

## 注意事项

1. **路径格式**：支持绝对路径（如 `G:/test.txt`）和相对路径
2. **自动创建目录**：write和create操作会自动创建不存在的父目录
3. **删除警告**：delete操作不可恢复，请谨慎使用
4. **编码支持**：默认使用UTF-8编码

## 错误处理

| 错误 | 原因 | 解决方案 |
|-----|------|---------|
| 文件不存在 | read/delete时文件不存在 | 先使用exists检查 |
| 权限不足 | 没有读写权限 | 检查文件权限 |
| 路径无效 | 路径格式错误 | 使用正确的路径格式 |

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [BaiZeAgent](https://github.com/BaiZeAgent)
- **Source:** [BaiZeAgent/Baize](https://github.com/BaiZeAgent/Baize)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-baizeagent-baize-file
- Seller: https://agentstack.voostack.com/s/baizeagent
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
