iterate Skill
iterate --bridge 模式交互指南(Rust 原生,比 Python 更快)。
⚠️ 重要:使用 --bridge 模式
推荐使用 iterate --bridge 替代 Python 脚本。
bash
# ✅ 推荐:使用 --bridge 模式(Rust 原生,更快) clear && printf '%s\n' '## 标题' '' '内容' > ~/.cunzhi/5312/output.md && /Applications/iterate.app/Contents/MacOS/iterate --bridge --port 5312 --workspace "/Users/apple/cunzhi"
优势:
- •Rust 原生,启动更快
- •无需 Python 依赖
- •更少的进程开销
正常调用流程
- •写入任务摘要到
~/.cunzhi/{PORT}/output.md - •调用
iterate --bridge --port {PORT} --workspace "/项目路径" - •等待返回
KeepGoing=true/false - •读取
~/.cunzhi/{PORT}/input.md获取用户指令
故障自动恢复
端口不可用 (Port not available)
当脚本返回 Error: Port {PORT} is not available 时:
- •
自动启动服务器(非阻塞):
bashiterate --serve --port {PORT} - •
等待 2-3 秒后重新调用脚本
- •
如果仍然失败,提示用户手动检查
服务器已运行但无响应
- •检查进程:
lsof -i :{PORT} - •如有僵尸进程,提示用户 kill
- •重新启动服务器
VS Code 插件集成
如果 VS Code 插件未自动启动服务器:
- •插件应在激活时自动运行
iterate --serve --port {PORT} - •当前需要手动启动,后续可优化插件逻辑
端口约定
| 环境 | 端口 |
|---|---|
| Windsurf | 5315 |
| VS Code | 5314 |
| Cursor | 5316 |