JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.
Python
fix(evolution): add evolution slash commands docs
z2tngbfb1331e0530
diff --git a/docs/en/SlashCommands.md b/docs/en/SlashCommands.mdindex e3af82d911..a68b5844fd 100644--- a/docs/en/SlashCommands.md+++ b/docs/en/SlashCommands.md@@ -27,6 +27,10 @@ Executed locally in the terminal UI, not through Gateway control pipeline.| `/status` | Show jiuwenswarm status overview, usage, config (see below) || `/statusline` | Configure the TUI footer status bar with a custom command (see below) || `/permissions` | Manage tool permissions (`allow`/`ask`/`deny`) |+| `/evolve` | Trigger skill self-evolution for one skill (see below) |+| `/evolve_list` | Show one skill's evolution records (see below) |+| `/evolve_simplify` | Simplify and consolidate one skill's evolution records (see below) |+| `/evolve_rebuild` | Rebuild `SKILL.md` from archives and evolution records (see below) |> Note: `/mode` controlled switching logic is primarily on Gateway side, see "`/mode` and `/switch`" below.@@ -196,6 +200,39 @@ Manages directories AI can access for file read, edit, and execute operations.- Changes are written to `config.yaml` under `mcp.servers`;- After write, Agent config reload is triggered, and runtime MCP server bindings are synced accordingly.+### `/evolve*` (Skill Self-Evolution)++These commands are registered and parsed by the TUI, then forwarded as slash text through the normal chat channel. The actual evolution logic runs on the Agent / Team backend:++- Agent mode: handled by `SkillEvolutionRail`; only `agent.plan` is supported.+- Team mode: handled by `TeamSkillEvolutionRail` for team skill evolution.+- Code mode and `agent.fast` do not support these commands.++#### Subcommands++| Command | Description |+|---|---|+| `/evolve <skill_name> [user_query]` | Trigger evolution for one skill. `agent.plan` scans the current conversation for tool failures and user corrections; Team mode requires `user_query`. |+| `/evolve_list <skill_name> [--sort score]` | Show one skill's evolution records with count, average score, usage/feedback stats, section, and content preview. |+| `/evolve_simplify <skill_name> [user_intent]` | Generate an approval-gated cleanup plan to merge duplicates, split long records, or remove low-value records. Trailing text is passed to the backend as intent. |+| `/evolve_rebuild <skill_name> [user_intent]` | Generate a rebuild follow-up prompt and continue as a normal Agent / Team task to rebuild `SKILL.md`. |++#### Approval Flow++- `/evolve` and `/evolve_simplify` do not silently write changes; the backend pushes a confirmation question and the TUI waits for approval.+- Accepting persists/solidifies the generated records; rejecting discards this generation.+- Accepted Team skill evolution syncs the team skill directory.+- While evolution or approval is pending, supplemental user input is queued and sent after evolution completes.++#### Examples++```bash+/evolve pptx improve export error handling+/evolve_list pptx --sort score+/evolve_simplify pptx merge duplicate export-failure records+/evolve_rebuild pptx strengthen Troubleshooting and Examples+```+### `/branch` (Branch Session)- Usage: `/branch [name]`.@@ -614,4 +651,4 @@ Use the following template to write commands. `input=$(cat)` reads JSON into a v| `/btw` | Ask question || `/memory` | Memory management || `/export` | Export related files |-| `/permissions` | Permission management |\ No newline at end of file+| `/permissions` | Permission management |diff --git "a/docs/zh/Slash\345\221\275\344\273\244\350\241\250.md" "b/docs/zh/Slash\345\221\275\344\273\244\350\241\250.md"index 035ecbf282..6a1c82d423 100644--- "a/docs/zh/Slash\345\221\275\344\273\244\350\241\250.md"+++ "b/docs/zh/Slash\345\221\275\344\273\244\350\241\250.md"@@ -27,6 +27,10 @@| `/status` | 查看 jiuwenswarm 运行状态概览、用量统计、配置编辑(见下文) || `/statusline` | 配置 TUI 底部状态栏的自定义命令(见下文) || `/permissions` | 管理工具权限(`allow`/`ask`/`deny`) |+| `/evolve` | Skill 自演进入口:触发 Skill 演进(见下文) |+| `/evolve_list` | 查看某个 Skill 的演进经验库(见下文) |+| `/evolve_simplify` | 整理、合并某个 Skill 的演进经验(见下文) |+| `/evolve_rebuild` | 基于归档与演进记录重建 `SKILL.md`(见下文) |> 说明:`/mode` 的受控切换逻辑以 Gateway 侧行为为主,详见下文「`/mode` 与 `/switch`」。@@ -218,6 +222,39 @@- `delete` 走 TeamSkills Hub 原生删除接口 `DELETE /api/v1/plugins/{skill_id}/versions/{version}`;- `--token` 与 `--system-token` 互斥,且必须二选一。+### `/evolve*`(Skill 自演进)++这组命令由 TUI 本地注册并解析,随后通过普通聊天通道把 slash 文本转发给后端。实际演进逻辑在 Agent / Team 侧完成:++- Agent 模式:由 `SkillEvolutionRail` 处理,仅 `agent.plan` 可用。+- Team 模式:由 `TeamSkillEvolutionRail` 处理,用于团队技能演进。+- Code 模式与 `agent.fast` 不支持这组命令。++#### 子命令++| 命令 | 说明 |+|---|---|+| `/evolve <skill_name> [user_query]` | 为指定 Skill 触发演进。`agent.plan` 会扫描当前会话中的工具失败、用户纠错等信号;Team 模式必须提供 `user_query`。 |+| `/evolve_list <skill_name> [--sort score]` | 按分数查看某个 Skill 的演进经验,展示记录数、平均分、使用/反馈统计、section 与内容预览。 |+| `/evolve_simplify <skill_name> [user_intent]` | 生成经验库整理方案,用于合并重复经验、拆分过长经验或清理低价值经验;尾随文本会作为整理意图传入后端。 |+| `/evolve_rebuild <skill_name> [user_intent]` | 生成重建 `SKILL.md` 的 follow-up prompt,并继续作为一次普通 Agent / Team 任务执行。 |++#### 审批流程++- `/evolve` 和 `/evolve_simplify` 不会直接落盘覆盖内容;后端会推送确认问题,TUI 进入等待确认状态。+- 接收后,后端接受本次演进记录并写入/固化;拒绝后丢弃本次生成内容。+- Team 技能演进接收后会同步团队技能目录。+- 演进或审批未完成时,用户补充的新输入会先排队,等待演进完成后再继续发送。++#### 示例++```bash+/evolve pptx 修复导出失败时的错误处理+/evolve_list pptx --sort score+/evolve_simplify pptx 合并重复的导出失败经验+/evolve_rebuild pptx 强化 Troubleshooting 和 Examples+```+### `/branch`(分支会话)- 用法:`/branch [name]`。@@ -625,5 +662,3 @@| `/btw` | 提问 || `/export` | 导出相关文件 || `/permissions` | 权限管理 |--diff --git "a/docs/zh/TUI\344\275\277\347\224\250\346\214\207\345\215\227.md" "b/docs/zh/TUI\344\275\277\347\224\250\346\214\207\345\215\227.md"index d5f5ad6c75..1f9431fd99 100644--- "a/docs/zh/TUI\344\275\277\347\224\250\346\214\207\345\215\227.md"+++ "b/docs/zh/TUI\344\275\277\347\224\250\346\214\207\345\215\227.md"@@ -66,10 +66,10 @@| `/config` | `/settings`, `/setting` | 查看/设置后端配置 | `/config`、`/config get`、`/config set key value` | 全部 || `/context` | - | 查看上下文窗口占用与 Token 用量明细 | `/context` | 全部 || `/diff` | - | 查看本会话按轮次的文件改动 | `/diff` | 全部 |-| `/evolve` | - | 触发技能演进或列出待处理(转发为聊天内容) | `/evolve`、`/evolve list` | 全部 |-| `/evolve_list` | - | 列出某技能的演进条目 | `/evolve_list myskill --sort score` | 全部 |-| `/evolve_rebuild` | - | 从归档重建 SKILL.md | `/evolve_rebuild myskill` | 全部 |-| `/evolve_simplify` | - | 简化演进经验 | `/evolve_simplify myskill --dry-run` | 全部 |+| `/evolve` | - | 触发技能演进 | `/evolve myskill 修正错误处理` | `agent.plan` / `team`(见下) |+| `/evolve_list` | - | 列出某技能的演进条目 | `/evolve_list myskill --sort score` | `agent.plan` / `team` |+| `/evolve_rebuild` | - | 从归档与演进记录重建 SKILL.md | `/evolve_rebuild myskill 强化错误处理` | `agent.plan` / `team` |+| `/evolve_simplify` | - | 整理、合并某技能的演进经验 | `/evolve_simplify myskill 合并重复经验` | `agent.plan` / `team` || `/init` | - | 在 **Code 模式** 下初始化 `JIUWENCLAW.md` / `JIUWENCLAW.local.md` | `/init` | **仅 `code.*`** || `/mcp` | - | 管理 MCP 服务 | `/mcp list`、`/mcp add ...` | 全部 || `/mode` | - | 切换或查看模式 | `/mode`、`/mode code` | 全部 |@@ -163,6 +163,30 @@- **`/skills`**:默认等价 `list`;子命令含 `install`、`uninstall`、`marketplace`、`use` 等;部分长操作有 120s 超时(见 `skills.ts`)。- **`/teamskills`**:无子命令时打印用法提示;支持 `init`、`validate`、`pack`、`info`、`search`、`list`、`install`、`uninstall`、`config`、`publish`、`delete`(见 `teamskills.ts` 与 Slash命令表)。+#### `/evolve*`(Skill 自演进)++这组命令在 TUI 本地注册(`evolve.ts`),但业务逻辑不在前端执行:TUI 只做必要参数校验,然后通过 `sendMessage(...)` 把原始 slash 文本发给后端。后端在 Agent / Team 流程中拦截并调用 SkillEvolutionRail / TeamSkillEvolutionRail。++| 命令 | 用途 | 行为要点 |+|------|------|----------|+| `/evolve <skill_name> [user_query]` | 为单个 Skill 生成演进记录 | `agent.plan` 下会先扫描当前会话中的工具失败和用户纠错信号;若没有信号且未给 `user_query`,返回“未发现明确演进信号”。Team 模式必须提供 `<user_query>`。 |+| `/evolve_list <skill_name> [--sort score]` | 查看某 Skill 的经验库 | 展示记录数、平均分、使用/反馈统计、目标 section 与内容预览;当前实现按 score 获取记录。 |+| `/evolve_simplify <skill_name> [user_intent]` | 智能整理经验库 | 生成可审批的整理方案,用于合并、拆分或清理演进经验。尾随文本会作为整理意图传给后端,不是独立 CLI flag。 |+| `/evolve_rebuild <skill_name> [user_intent]` | 重建 SKILL.md | 由后端生成 follow-up prompt,并继续作为普通 Agent / Team 任务执行,用归档历史与演进记录重建 Skill 文档。 |++适用条件:++- `agent.plan`:用于单 Agent Skill 自演进;其它 Agent / Code 子模式不处理这组命令。+- `team`:使用团队技能演进 rail;`/evolve <skill_name> <user_query>`、`/evolve_list`、`/evolve_simplify`、`/evolve_rebuild` 可用。++审批与状态:++- `/evolve` 和 `/evolve_simplify` 生成变更后不会静默写入,会推送 `chat.ask_user_question`,TUI 进入确认态,用户确认后才由后端接受或丢弃记录。+- Team 技能演进确认后会同步团队技能;拒绝则丢弃本次生成内容。+- 后端推送 `chat.evolution_status` 时,TUI 会把演进状态标记为 running / idle;演进或审批未完成时补充输入会先排队,等待演进完成后再发送。++更多机制说明见 [Skill 自演进](Skill自演进.md)。+#### `/plan`- 在 `team` 模式下不可用。