multi-edit-file

A gateway-enabled tool for verified text-file operations: precise replacements, multi-file edits, file creation, deletion, and moves. Before use, the complete builtin://multi_edit_file/SKILL.md must be read to obtain the skillToken (this initial read does not require a token); do not use regex or partial reads to obtain the token. Calls without the correct skillToken will fail and must be retried.

Last repository push
GitHub Stars
159
Forks
48
Issues / PRs
2

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "multi-edit-file" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-507db0fed2a4b7d8b690bbbfe2d0abab3d0ad87869666e9335517f5c0e5546c9. Verify the upstream source and version against https://github.com/aiguicai/MCP-Gateway before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

A gateway-enabled tool for verified text-file operations: precise replacements, multi-file edits, file creation, deletion, and moves. Before use, the complete builtin://multi_edit_file/SKILL.md must be read to obtain the skillToken (this initial read does not require a token); do not use regex or partial reads to obtain the token. Calls without the correct skillToken will fail and must be retried.

0 Downloads

Introduction source: third_party · aiguicai · 0.0.1 Reference

SkillPi interpretation

Inputs and outputs
Legacy single-file edit: Multi-file exact edits: Structured file operations:
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: multi_edit_file
description: >-
  Apply validated text file operations through the gateway: exact replacements,
  multi-file edits, file creation, deletion, and moves. First read the complete
  builtin://multi_edit_file/SKILL.md to get skillToken; this SKILL.md read does
  not require skillToken. Do not use regex or partial reads to fetch only the
  token. Calls without the correct skillToken will fail and must be retried.
metadata:
  bundled: true
  tool: multi_edit_file
  category: editing

Multi Edit File

Use this bundled skill for manual text-file changes. The gateway resolves all affected paths, validates the full request, applies exact replacements in memory, and only then commits the file operations. If validation fails, no file is written.

Prefer multi_edit_file over shell redirection or ad hoc scripts for normal source/config/docs edits because the gateway can audit affected paths, enforce allowed-directory policy, and return a compact delta.

Input Modes

Legacy single-file edit:

{
  "path": "src/example.rs",
  "edits": [
    {
      "old_string": "old text",
      "new_string": "new text",
      "replace_all": false,
      "startLine": 42
    }
  ],
  "cwd": "D:/path/to/workspace",
  "skillToken": "..."
}

Multi-file exact edits:

{
  "files": [
    {
      "path": "src/a.rs",
      "edits": [
        {
          "old_string": "old",
          "new_string": "new"
        }
      ]
    },
    {
      "path": "src/b.rs",
      "edits": [
        {
          "old_string": "enabled: false",
          "new_string": "enabled: true"
        }
      ]
    }
  ],
  "cwd": "D:/path/to/workspace",
  "skillToken": "..."
}

Structured file operations:

{
  "operations": [
    {
      "type": "edit",
      "path": "src/a.rs",
      "edits": [
        {
          "old_string": "old",
          "new_string": "new"
        }
      ]
    },
    {
      "type": "create",
      "path": "src/new.rs",
      "content": "pub fn new_file() {}\n"
    },
    {
      "type": "delete",
      "path": "src/old.rs"
    },
    {
      "type": "move",
      "from": "src/name_old.rs",
      "to": "src/name_new.rs"
    }
  ],
  "cwd": "D:/path/to/workspace",
  "skillToken": "..."
}

Fields

  • path plus top-level edits keeps compatibility with the original single-file mode.
  • files is for multiple existing files, each with its own path and edits.
  • operations supports edit, create, delete, and move.
  • cwd is required when more than one allowed directory is configured.
  • skillToken is required for normal calls. The documentation read for this SKILL.md is the only call that does not require it.

Edit fields:

  • old_string must be exact current file text after normalizing CRLF to LF.
  • new_string is the replacement text.
  • replace_all replaces every occurrence of old_string in the current in-memory state.
  • startLine is optional and 1-based. Use it when the same old_string appears more than once and you want the closest match to that line.

Create and move fields:

  • content is required for create.
  • overwrite defaults to false. When false, create or move fails if the target already exists.
  • from and to are required for move.

Rules

  1. Read relevant current content with read_file before editing unless the exact text is already in context. Use terminal reads only if read_file is disabled, unavailable, or unsuitable.
  2. Use exact old_string text copied from the current file, including indentation. Do not include the line-number prefix or tab from read_file output.
  3. Keep old_string as small as practical while still unique. If it is not unique, either set replace_all or provide startLine.
  4. Do not set old_string equal to new_string.
  5. Do not use an empty old_string; use create for new files, or include surrounding existing text for insertions.
  6. Do not touch the same path more than once in one call. Put all replacements for one file into a single edit operation.
  7. Order edits inside one file so a later old_string does not target text produced by an earlier new_string.
  8. For TS, TSX, JS, and JSX template strings, write ${...} exactly. Do not escape the dollar sign as \${...} unless the target source code truly needs a literal ${...} string.

Result And Events

On success, the result includes added, modified, deleted, moved, a compact delta with byte counts and affected path metadata, and a warnings array when the gateway detects likely syntax hazards such as unbalanced delimiters or accidental \${...} in TS/JS files. Warnings do not block the write; inspect and verify them before continuing.

The admin event stream records an editPreview event before policy confirmation and a finished event after completion.

Version history

  1. v0.1.9 GitHub ↗
    Original release notes

    ## Commits since v0.1.8 - feat: expand codegraph and officecli builtin tools with new commands, docs, and output improvements ([`9cfc330`](https://github.com/aiguicai/MCP-Gateway/commit/9cfc3307bf2acd6ab5ff223a804f66ec93dfe73c)) **Full Changelog:** https://github.com/aiguicai/MCP-Gateway/compare/v0.1.8...v0.1.9

  2. v0.1.8 GitHub ↗
    Original release notes

    ## Commits since v0.1.7 - feat: require self-read for builtin skill tokens ([`c289d10`](https://github.com/aiguicai/MCP-Gateway/commit/c289d1034b91fba6eb5b21514441b5701eefb7de)) - feat(codegraph): add built-in CodeGraph skill and UI support ([`11233c3`](https://github.com/aiguicai/MCP-Gateway/commit/11233c3d338d9f0e41cd7c7f86a0667429a3d73a)) **Full Changelog:** https://github.com/aiguicai/MCP-Gateway/compare/v0.1.7...v0.1.8

  3. v0.1.7 GitHub ↗
    Original release notes

    ## Commits since v0.1.6 - chore: bump version to 0.1.7 and update README screenshots ([`c3bc742`](https://github.com/aiguicai/MCP-Gateway/commit/c3bc742add394e165440f3942452749cf539cbef)) - refactor: deduplicate backend auth, routing, SSE, and heartbeat helpers ([`bf94241`](https://github.com/aiguicai/MCP-Gateway/commit/bf94241ee70d84fdbf1e27b4ba75aafbbe8c29a1)) **Full Changelog:** https://github.com/aiguicai/MCP-Gateway/compare/v0.1.6...v0.1.7

  4. v0.1.6 GitHub ↗
    Original release notes

    ## Commits since v0.1.5 - fix: resolve clippy warnings in AI adapter code ([`fa658a6`](https://github.com/aiguicai/MCP-Gateway/commit/fa658a65f9977b1a725c669f6dcf9515d7fd393b)) - style: apply cargo fmt to all Rust source files ([`8d1a95b`](https://github.com/aiguicai/MCP-Gateway/commit/8d1a95b90ce544683012e55df1974a6b6f3994b0)) - feat: add AI adapter for BYOK-style external AI tool integration ([`63c4cc4`](https://github.com/aiguicai/MCP-Gateway/commit/63c4cc4b0729d5a82234530faca68e7b3a05ee0b)) - feat: add system tray with minimize-to-tray and quit support ([`396fc9f`](https://github.com/aiguicai/MCP-Gateway/commit/396fc9f2700d2e0d725b8c0760f65ce595fcde7c)) **Full Changelog:** https://github.com/aiguicai/MCP-Gateway/compare/v0.1.5...v0.1.6

  5. v0.1.5 GitHub ↗
    Original release notes

    ## Commits since v0.1.4 - fix(skills): prevent false path-guard triggers from rg glob patterns and relative path resolution ([`719638e`](https://github.com/aiguicai/MCP-Gateway/commit/719638e15e3171797cba5570a23ed03b71e8f06b)) - feat: plans viewer modal and planningId in structured content ([`8092f83`](https://github.com/aiguicai/MCP-Gateway/commit/8092f83be24e99b5ce7c46c92948d462f894079d)) - fix: optimize the text output for timeout returns ([`94b9a4e`](https://github.com/aiguicai/MCP-Gateway/commit/94b9a4e882cc8e687a1aa057fd1af224b50681d0)) - feat: add skill groups with per-group endpoints and copy feedback fix ([`57d921e`](https://github.com/aiguicai/MCP-Gateway/commit/57d921e98fe8e75d7dca5f825011ef5046ea8fdf)) **Full Changelog:** https://github.com/aiguicai/MCP-Gateway/compare/v0.1.4...v0.1.5

Only the five most recent versions are shown. View full version history at the source ↗

Current listing version

0.0.1

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value95/100

Highlights

  • 高价值/高频刚需。直接解决用户明确的核心任务痛点,显著提升日常高频场景的效率,如自动化任务、信息聚合、内容生成等。
Trigger Precision90/100

Highlights

  • 触发词精准完整,覆盖多种变体,边界清晰。
Structure and Standards95/100

Highlights

  • Phase/步骤清晰,有出口条件,含端到端示例,frontmatter完整,单文件≤500行。
Execution Reliability90/100

Highlights

  • 工具来源明确,参数正确,覆盖主要异常,不可逆操作有确认机制。
Evidence Verifiability (mean of the first four)93/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.