--- name: filesystem-operation description: 本地文件系统读写、搜索和目录操作。支持读取、写入、修改、搜索文件和目录遍历。 tools: - read_file - write_file - patch_file - search_files - list_directory --- # Filesystem Operation ## Overview 本地文件系统读写、搜索和目录操作。支持读取、写入、修改、搜索文件和目录遍历。 ## When to Use - Use when the task requires Filesystem Operation guidance. ## Required Tools - `read_file` - `write_file` - `patch_file` - `search_files` - `list_directory` ## Workflow - Identify whether the user's request matches the skill's trigger conditions. - Read the relevant source guidance below and apply only the steps that fit the current task. - Use the required tools deliberately and keep tool output tied to the user's goal. ### Source Guidance ### Filesystem Operation — 文件系统操作 本地文件系统工具集,用于读写和搜索项目文件。 #### 工具说明 ##### read_file 读取本地文件内容。 - 使用 `skill_view` 查看文件预览 - 大文件会分页返回,可通过 offset/limit 控制 ##### write_file 写入新文件或覆盖已有文件。 - 创建新文件时自动创建父目录 - 写入前确认不会覆盖重要配置 ##### patch_file 精确修改文件中的指定内容。 - 通过搜索-替换方式修改 - 适用于局部更新,避免整文件重写 ##### search_files 在项目中搜索文件名或内容。 - 支持 glob 模式匹配 - 支持按内容搜索 - 支持限制搜索目录深度 ##### list_directory 列出目录内容。 - 可递归列出子目录 - 支持过滤文件类型 #### 使用原则 1. 优先使用 `read_file` 查看文件内容,再决定修改方案 2. 小范围修改用 `patch_file`,大范围用 `write_file` 3. 搜索文件时先确认路径是否存在 4. 修改前确认文件编码(默认 UTF-8) 5. 敏感文件(.env、密钥等)不写入版本控制 ## Validation - Verify the requested outcome with the most direct available check. - Report any skipped step, unavailable dependency, or remaining uncertainty explicitly. ## Boundaries - Do not broaden the task beyond the user's request. - Do not use tools that are not listed or clearly available in the current runtime. ## Anti-Patterns - Do not summarize the skill instead of applying it. - Do not claim completion without validation evidence.