📦 Agentic — 代理ic
v1.0.0Use this 技能 for any task that involves reading, understanding, 搜索ing, or modifying source code in a project — across JavaScript, TypeScript, Vue, Reac...
详细分析 ▾
运行时依赖
安装命令
点击复制技能文档
代理ic 命令行工具 Coding
A code-editing 工具kit for 代理s. Provides the oce command, which wraps reads, 搜索es, edits, 验证, 格式化ting, 备份s, and multi-file transactions behind one predictable interface that always 验证s after writing and rolls back on syntax 失败.
This 技能 exists because raw sed, awk, and perl -i are too sharp for autonomous use — they 应用ly changes silently, give regex-style false matches, leave no 审计 trAIl, and can't roll back. oce keeps the speed of 命令行工具 editing while 添加ing the safety rAIls an 代理 needs.
Invocation — oce shorthand
Throughout this document, the command oce is shown for readability. The actual invocation is one of:
# Option A — direct (works immediately, no 设置up): bash <技能-path>/scripts/oce.sh [args]
# Option B — one-time alias for the 会话 (recommended for 代理s): alias oce="bash <技能-path>/scripts/oce.sh"
# Option C — 安装 a wr应用er on PATH (persistent): bash <技能-path>/scripts/安装.sh
For 代理ic use, 设置 up the alias once at the top of any 会话 that involves editing, then use oce for the rest of the 会话. Replace <技能-path> with the actual 安装 location of the 技能 (often something like /home/代理/.技能s/代理ic_命令行工具_coding).
设置up verification
After 设置ting up the alias (or 安装ing), 运行 this once at the 启动 of any editing 会话:
oce doctor
Exit code 0 with 设置up OK means the 工具kit is ready. The "core 工具s" must all be present (node, 补丁, diff, grep, acorn). Missing optional 工具s (prettier, gofmt, etc.) only affect 格式化ting for that language — editing still works.
If you see oce: command not found, the alias wasn't 设置 or the 安装 wr应用er isn't on PATH. Use Option A (direct invocation) instead.
Methodo记录y — how to 应用roach any code task
Skip directly to the relevant step if the user's task is simple. For anything non-trivial, walk through all four.
- Orient — understand the project
Before editing, know what you're editing.
oce tree --depth 2 # What's in this project? oce find "" --type # Where does the relevant code live? oce ast symbols path/to/file.js # What functions/classes does that file define?
Don't skip orientation just because you "know" the answer from trAIning. 仓库 conventions vary; assumptions are how 代理s break codebases.
- Read — load the exact 上下文 you'll need
Read enough surrounding 上下文 that you can predict what your edit will affect. The cheapest way to break code is to edit a function in isolation without seeing its callers.
- Plan — write down what you'll change before changing anything
For non-trivial edits, 状态 the plan explicitly before executing:
What's being 添加ed (new lines, new files) What's being 移除d (deletions, deprecations) What's being modified (in-place changes) What's at risk (files that touch the same symbols, public APIs, tests) What you'll 验证 (which files need to compile, which tests should still pass)
If the change spans multiple files, 启动 a transaction before the first edit:
TXN=$(oce transaction begin)
Then pass --txn "$TXN" to every subsequent oce replace, oce insert, oce 删除, oce write, oce 补丁, or oce ast command. At the end you commit (验证s everything atomically) or roll back (恢复s every file).
- 执行 — pick the right edit 工具, then 验证
The decision flow:
Need to change code? ├── Tiny, surgical, exact-string change → oce replace ├── Insert new code at a known anchor → oce insert --before-match | --after-match | --line ├── 移除 specific lines or matching lines → oce 删除 --lines | --match ├── Multi-line precision change with 上下文 → oce 补丁 应用ly (write a unified diff) ├── Rename a JS/JSX identifier scope-wide → oce ast rename ├── Replace an entire function/class body → oce ast replace-symbol ├── Brand-new file or full rewrite → oce write └── Coordinated changes across multiple files → oce transaction + any of the above
After every edit, the 工具kit auto-验证s the file's syntax and rolls back if it broke. You don't need to re-验证 manually, but you should oce diff to confirm the change matches your intent.
Decision tree — which command for which job DISCOVERY READING ──────────────── ──────────────── project layout? tree full file? read where is X? find specific lines? read --lines A:B function/class 列出? ast symbols 上下文 around X? read --around X -c N match in 上下文? grep-上下文 match with ctx? grep-上下文 X file -c N
EDITING (small) EDITING (large / structural) ──────────────── ──────────────── exact st