一键导入
file-ops
Read, write, search, and edit files in the workspace safely — atomic writes, exact-match edits, and recursive content search.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Read, write, search, and edit files in the workspace safely — atomic writes, exact-match edits, and recursive content search.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Read, filter, select, aggregate, and join CSV / tabular data without spinning up a full data stack.
jq-style select, filter, and reshape over JSON and YAML — extract paths, map arrays, and filter records without writing throwaway code.
Write a dataset (array of records) to CSV, JSON, XLSX, or PDF through one interface — format chosen by the output extension.
Everyday git — clone, branch, stage, diff, commit, and push, with a safe, predictable workflow.
Make HTTP/REST requests with auth, custom headers, query/body, pagination, retries with backoff, and structured error handling.
Connect to a Model Context Protocol (MCP) server, perform the handshake, discover its tools, and invoke them over JSON-RPC.
| name | file-ops |
| description | Read, write, search, and edit files in the workspace safely — atomic writes, exact-match edits, and recursive content search. |
| version | 0.1.0 |
Work with files in the workspace without corrupting them. Reads and searches are low-risk; writes and edits are where things go wrong (clobbering a file, ambiguous replacements, partial writes). This skill keeps those safe.
The helper at scripts/file_tool.py (stdlib only) covers the two error-prone
operations: an exact-string edit with a uniqueness guard, and a recursive
search. Plain reads/writes you can do with the shell or your built-in tools.
write does this for you.Prefer a targeted replacement of an exact, unique string over rewriting the whole file — it's safer and produces a clean diff.
# Replace an exact string; fails if the old string isn't found exactly once
python scripts/file_tool.py edit path/to/file.py \
--old 'DEBUG = True' --new 'DEBUG = False'
# Replace every occurrence on purpose
python scripts/file_tool.py edit path/to/file.py \
--old 'old_name' --new 'new_name' --all
The edit refuses to run if --old appears zero times (nothing to do) or more
than once without --all (ambiguous) — that guard prevents the most common
edit mistakes.
# Recursively find files whose contents match a regex; prints file:line:text
python scripts/file_tool.py search 'TODO|FIXME' src/
# Restrict by filename glob
python scripts/file_tool.py search 'import requests' . --glob '*.py'