minimal-agent 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -113,12 +113,33 @@ TUI 内部支持:
113
113
 
114
114
  | 输入 | 效果 |
115
115
  |---|---|
116
- | `/new` | 清空历史,重建 system prompt(带最新 skills + 项目指令) |
116
+ | `/new` | 清空历史,重建 system prompt(带最新 skills + 项目指令);同时清掉当前工作目录下所有 `.minimal-agent*/` 状态目录 |
117
117
  | `/compact` | 手动压缩当前对话 |
118
118
  | `/config` | 重新配置 LLM provider(LLM 驱动 skill,单独输入才触发) |
119
+ | `/ralph-loop "<目标>" [--max-iterations N] [--verify ...]` | 复制任务循环(PLAN→BUILD→VERIFY→HEAL→DONE 五阶段 FSM);按当前 cwd 隔离,不同工作目录可并行 |
119
120
  | `Alt+Enter` | 输入框换行(教学/多行 prompt 友好) |
120
121
  | `ESC` / `Ctrl+C` | 中断当前任务 |
121
122
 
123
+ ### `/ralph-loop` 速查
124
+
125
+ 最小用法:
126
+
127
+ ```bash
128
+ /ralph-loop "在当前目录创建 hello.txt 内容为 hi" --max-iterations 5 --verify "file_exists:hello.txt"
129
+ ```
130
+
131
+ 参数:
132
+ - `--max-iterations N` — 用户上限,默认 50,硬天花板 200
133
+ - `--verify <type>:<args>` — 完成判据,支持四种 type:
134
+ - `shell:<cmd>` —— 命令退出码 0 即通过(跨平台 spawn)
135
+ - `file_exists:<path>` —— 文件存在即通过(相对路径以当前 cwd 为锚)
136
+ - `file_contains:<file>:<regex>` —— 文件内容匹配正则即通过
137
+ - `test_count:<N>` —— 跑 `bun test` 并解析 "X pass",X≥N 即通过
138
+
139
+ agent 通过输出 `<promise>DONE</promise>` 哨兵声明完成,验证通过才真正退出;声明完成但验证不过会回 BUILD 阶段继续干,连续 3 次失败强转 HEAL 阶段。若 agent 判断方案不可行,可输出 `<PROMISE>NEED_REPLAN</PROMISE>` 强制回 PLAN 重新规划。
140
+
141
+ FSM 状态文件落在 `<cwd>/.minimal-agent-ralph-wiggum/`(`goal.md` / `phase.md` / `progress.md` / `learnings.md` / `decisions.md` / `completion.md`),循环结束或 `/new` 时自动清理。Windows / macOS / Linux 都能跑。
142
+
122
143
  ---
123
144
 
124
145
  ## 内置工具