with one click
fs
文件系统操作。⚠️读取前先调用info获取文件信息:图片用read_file(mode='data_url'),大文件用from/lines分块。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
文件系统操作。⚠️读取前先调用info获取文件信息:图片用read_file(mode='data_url'),大文件用from/lines分块。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
| name | fs |
| description | 文件系统操作。⚠️读取前先调用info获取文件信息:图片用read_file(mode='data_url'),大文件用from/lines分块。 |
| argument-hint | [info|read|write|grep|action] [path] |
| user-invocable | true |
完整的文件系统操作,用于读取、写入、搜索和管理文件。
路径可以是相对路径或绝对路径;最终访问范围由 skill-runner 沙箱白名单控制,越界路径会被拒绝。
| 工具 | 说明 | 关键参数 |
|---|---|---|
info | 获取文件/目录信息 | path, include_content_preview, hash |
read_file | 读取文件 | path, mode, from, lines |
list_files | 列出目录内容 | path, recursive |
grep | 搜索文本 | pattern, path, use_regex |
write_file | 写入文件 | path, content, mode |
replace_in_file | 替换文本 | path, old, new |
edit_lines | 编辑行 | path, operation, line, content |
action | 文件操作 | operation, source, destination, path |
获取文件或目录的详细元数据。建议在其他操作前先调用。
参数:
path (string, required): 文件或目录路径include_content_preview (boolean, optional): 包含内容预览(默认: false)hash (string, optional): 计算文件哈希 - "md5", "sha256", "sha1"返回:
exists, type, size, sizeHumancreated, modified, accessedisReadOnly, pathInfo, mimeType, isTextFiledirectoryInfo (目录), contentPreview (文件)读取文件内容,支持多种模式。
参数:
path (string, required): 文件路径mode (string, optional): 读取模式 - "lines" (默认), "bytes", 或 "data_url"from (number, optional): 起始行(lines 模式,默认: 1)lines (number, optional): 行数(lines 模式,默认: 100)offset (number, optional): 起始字节(bytes 模式,默认: 0)bytes (number, optional): 字节数(bytes 模式,默认: 50000)读取模式:
| 模式 | 说明 | 用途 |
|---|---|---|
lines | 按行读取(默认) | 读取文本文件 |
bytes | 按字节读取 | 读取二进制文件片段 |
data_url | 转换为 Data URL | 多模态 LLM 调用 |
data_url 模式(用于多模态):
让多模态专家能够"看到"图片文件内容。
⚠️ 重要:此功能仅对多模态模型有效!如果专家使用的是纯文本模型,图片数据将被忽略。
何时使用:
使用方法:
read_file(path="tasks/screenshot.png", mode="data_url")完整示例:
# 用户:请帮我分析这张截图
# 专家调用工具:
read_file(path="tasks/screenshot.png", mode="data_url")
# 工具返回:
{
success: true,
data: {
dataUrl: "data:image/png;base64,iVBORw0KGgo...",
mimeType: "image/png"
}
}
# 系统自动处理:
# ToolManager.formatToolResultsForLLM() 检测到 dataUrl
# 自动添加 Markdown 图片语法到工具结果中
# LLMClient.processMultimodalMessages() 转换为多模态格式
# 多模态模型接收到图片并可以"看到"内容
# 专家回复:
根据截图内容,我可以看到这是一个...
工作原理(自动处理):
read_file(mode="data_url") 返回 base64 编码的 Data URLToolManager.formatToolResultsForLLM() 检测到工具结果中的 dataUrlLLMClient.processMultimodalMessages() 检测到 Markdown 图片语法{ type: "image_url", image_url: { url: "data:..." } }✅ 新特性:系统现在会自动处理图片 Data URL,专家无需手动添加 Markdown 语法!
支持的文件类型:
限制:
列出目录内容。
参数:
path (string, required): 目录路径recursive (boolean, optional): 递归列出(默认: false)跨文件搜索文本。
参数:
pattern (string, required): 搜索模式path (string, optional): 文件或目录路径(默认: 当前)file_pattern (string, optional): 文件模式过滤(默认: "*")use_regex (boolean, optional): 使用正则模式(默认: false)ignore_case (boolean, optional): 忽略大小写(默认: true)搜索模式:
| 模式 | 说明 | 示例 |
|---|---|---|
| 字面量(默认) | 简单字符串匹配 | pattern: "TODO" |
| 正则 | 完整正则支持 | pattern: "TODO\\d+" |
写入内容到文件。
参数:
path (string, required): 文件路径content (string, required): 写入内容mode (string, optional): 写入模式 - "write" (默认) 或 "append"替换文件中的文本。
参数:
path (string, required): 文件路径old (string, required): 要替换的文本new (string, required): 替换后的文本编辑文件行。
参数:
path (string, required): 文件路径operation (string, optional): 操作类型 - "insert" (默认) 或 "delete"line (number, required): 行号(从1开始)end_line (number, optional): 结束行(delete 操作)content (string, required for insert): 插入内容统一的文件系统操作。
参数:
operation (string, optional): 操作类型 - "copy" (默认), "move", "delete", "create_dir"source (string, required for copy/move): 源路径destination (string, required for copy/move): 目标路径path (string, required for delete/create_dir): 路径| 操作 | 说明 | 必需参数 |
|---|---|---|
copy | 复制文件 | source, destination |
move | 移动文件 | source, destination |
delete | 删除文件或目录 | path |
create_dir | 创建目录 | path |
info 检查文件是否存在、类型、大小include_content_preview 快速了解文件结构size,使用 from/lines 分块读取replace_in_file,行操作使用 edit_linesPowerPoint 演示文稿处理。用于读取现有 PPTX 基本信息、文本、表格、图表基础数据与备注,创建新演示文稿,并提取媒体文件。支持在新建演示文稿时添加文本、图片、表格、图表、形状、媒体与演讲者备注。当用户提到 .pptx 文件或需要操作 PowerPoint 时触发。
Excel 文件处理。用于读取、写入、编辑 .xlsx/.xls/.csv 文件,支持工作表管理、格式化、公式计算、数据查询和格式转换。当用户需要操作电子表格文件时触发。
发票专用解析技能。支持中国增值税发票、普通发票、电子发票的结构化提取。基于 pdfjs-dist 实现坐标提取,可提取发票号码、日期、买卖双方信息、商品明细、金额等字段。
PDF 文件处理。用于读取、提取文本/表格/图片、合并、拆分、旋转、水印、加密/解密、表单填写、页面渲染。当用户提到 .pdf 文件或需要操作 PDF 时触发。
PDF 文件处理(Python 版)。使用 PyMuPDF 实现,内存效率高,适合处理大文件。用于读取、提取文本/表格/图片、合并、拆分、旋转、水印、加密/解密、页面渲染。当用户提到 .pdf 文件或需要操作 PDF 时触发。
Word 文档处理。用于读取、写入、编辑、模板填充 .docx 文件。支持页眉页脚、超链接、目录、图片操作。使用 Patcher API 保留原文档样式。当用户需要操作 Word 文档时触发。