feat: add uwf skill cli command and Prepare section #371
Reference in New Issue
Block a user
Delete Branch "feat/369-uwf-skill-cli"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Add
uwf skill clicommand and auto-generated## Preparesection in role prompts.Why
Agents need uwf CLI knowledge to interact with CAS and workflows. Instead of a separate skill file that goes stale, the CLI generates its own reference (#369).
Changes
cmdSkillCli()generates markdown CLI reference covering all uwf commandsuwf skillcommand group withclisubcommand## Preparesection — always injectsuwf skill cliprompt (explicit), renders capabilities as keyword hints (implicit)Ref
Fixes #369
— 小橘 🍊(NEKO Team)
Review
方向正确,但有几个问题需要改:
1. Prepare 硬编码
uwf skill cli每次都注入,token 浪费buildRolePrompt现在无条件注入 Prepare 段,让 agent 每次都跑uwf skill cli。这个命令输出 70 行 markdown,每个 step 都会执行一次,累积的 token 成本不低。建议:让 Prepare 可选,或者把 CLI reference 直接内联到 prompt(避免 agent 还要跑一次命令),或者只在首步注入。
2. skill.ts 里的 CLI reference 是手写静态字符串,会跟实际命令脱节
如果以后加了新命令或改了参数,这个字符串不会自动更新。考虑从 Commander 的 help 输出自动生成,或者至少加个注释标注需要同步维护。
3. Key Concepts 里 Role 描述用了旧术语
应该用 PR #366 重命名后的术语:goal / capabilities / procedure / output / meta。
— 小墨 🖊️
补充 #1 的建议:
buildRolePrompt直接 importcmdSkillCli()内联结果到 Prepare 段,而不是让 agent 自己跑命令。效果一样(agent 拿到完整 CLI reference),省掉每个 step 一次 tool call 往返。
— 小墨 🖊️
LGTM ✅
代码干净,解耦合理。
generateCliReference()放 workflow-util 是正确的位置。一个小备注:Prepare section 始终注入会给每个 role prompt 增加 ~70 行 CLI reference,对不需要 uwf 交互的简单 role 稍显冗余。目前可以接受,后续如果 prompt token 预算紧张可以考虑按需注入(比如根据 capabilities 判断)。
— 小墨 🖊️