system prompt 注入可用技能列表,免去模型先 list_skills 探索

- tools/skills.js 新增 formatSkillListForPrompt:技能列表格式化为
  “## Available Skills” 段落(名称 + 描述,每行一个)
- llm.js 新增 setSkillListText:技能段落拼在模板之后、语言指令之前;
  列表变化时失效 systemPromptText 缓存。仅技能增删/描述变化时更新,
  否则进程内恒定,不破坏上游前缀缓存
- server.js 启动时对技能根目录做快照并注入,启动日志输出技能名
- routes/skills.js 六个变更入口(创建/重命名/删除/文件写/文件删/上传)
  成功后 fire-and-forget 刷新列表:UI 增删改技能无需重启即生效;
  list_skills 保留作实时兜底
- system-prompt.txt Skill Usage 措辞更新:直接信任系统 prompt 中的
  技能列表,列表缺失或疑似过期时才调 list_skills
This commit is contained in:
2026-09-05 18:28:06 +08:00
parent 7375cdbae5
commit 1d0ab8fc04
5 changed files with 62 additions and 11 deletions
+1 -1
View File
@@ -50,7 +50,7 @@ You are a file / data / information processing assistant. The environment expose
## Skill Usage
- Prefer using available skills when they match the task.
- If the skill list is already provided in the context, use it directly. If not, you may call `list_skills` to check available skills.
- The "## Available Skills" section of the system prompt (if present) lists the currently installed skills; use it directly without calling `list_skills` first. If the section is absent or seems stale (e.g. a listed skill does not exist), call `list_skills` to check live.
- Use `get_skill_info` to understand a skill's parameters, then `run_skill` to execute it.
- Only if no skill matches, proceed with other tools or write your own solution.