From f68e915b04d41704850ff3d02f0e4c14f9c80c51 Mon Sep 17 00:00:00 2001 From: ooodc <549496103@qq.com> Date: Sat, 23 May 2026 21:12:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E6=8A=80=E8=83=BD?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=B7=A5=E5=85=B7=E6=96=87=E6=A1=A3=EF=BC=8C?= =?UTF-8?q?=E6=98=8E=E7=A1=AE=E6=8A=80=E8=83=BD=E5=88=9B=E5=BB=BA=E5=92=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9A=84=E6=AD=A3=E7=A1=AE=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E5=8F=8A=E5=AD=98=E5=82=A8=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gateway/default_agent_prompt.md | 16 +++++++++++++++- src/tools/skill_manage.rs | 11 +++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/gateway/default_agent_prompt.md b/src/gateway/default_agent_prompt.md index 25ff6a7..d995b66 100644 --- a/src/gateway/default_agent_prompt.md +++ b/src/gateway/default_agent_prompt.md @@ -71,7 +71,21 @@ - 如果任务涉及文件、命令、配置或下一步操作,优先给出最关键的那部分。 ## PICO配置 -- Skill安装在[basedir]/skills + +### 技能系统 + +- **技能存储路径**: + - 项目级: `{project-root}/.picobot/skills/{skill-name}/SKILL.md` + - 用户级: `~/.picobot/skills/{skill-name}/SKILL.md` + +- **创建/修改技能**: + - 必须使用 `skill_manage` 工具的 `create` 或 `update` action + - 不要使用 `write` 工具直接写入技能文件 + - `skill_manage` 会自动创建正确的目录结构 + +- **使用技能**: + - Skill 不是工具名,不能直接调用 + - 必须先调用 `skill_activate` 工具激活技能,再按指令执行 ## 补充要求 diff --git a/src/tools/skill_manage.rs b/src/tools/skill_manage.rs index 9e8e038..28a57b6 100644 --- a/src/tools/skill_manage.rs +++ b/src/tools/skill_manage.rs @@ -24,15 +24,18 @@ impl Tool for SkillManageTool { fn description(&self) -> &str { "Manage PicoBot skills. Actions: list, get, create, update, delete, disable, reload.\n\n\ + IMPORTANT: To create or modify skills, ALWAYS use this tool (skill_manage), NOT the write tool.\n\n\ Skill Structure:\n\ - Folder name: kebab-case (lowercase with hyphens, e.g., 'my-cool-skill')\n\ - Required: SKILL.md with YAML frontmatter + Markdown body\n\ - Optional folders: scripts/, references/, assets/\n\ - - Storage: .picobot/skills/{name}/SKILL.md or ~/.picobot/skills/{name}/SKILL.md\n\n\ + - Storage paths (created automatically by this tool):\n\ + - Project scope: {current-dir}/.picobot/skills/{name}/SKILL.md\n\ + - User scope: ~/.picobot/skills/{name}/SKILL.md\n\n\ Installing from Zip:\n\ - - Extract skill folders to skills/ directory\n\ + - Extract skill folders to .picobot/skills/ directory (NOT skills/)\n\ - If zip contains multiple skills, extract each subfolder separately\n\ - - Final structure: skills/{skill-name}/SKILL.md" + - Final structure: .picobot/skills/{skill-name}/SKILL.md" } fn parameters_schema(&self) -> serde_json::Value { @@ -51,7 +54,7 @@ impl Tool for SkillManageTool { }, "name": { "type": "string", - "description": "Skill folder name in kebab-case (e.g., 'my-cool-skill', 'code-review'). Must match the folder name under .picobot/skills/ or ~/.picobot/skills/" + "description": "Skill folder name in kebab-case (e.g., 'my-cool-skill', 'code-review'). The skill_manage tool automatically creates files at .picobot/skills/{name}/SKILL.md (project scope) or ~/.picobot/skills/{name}/SKILL.md (user scope)." }, "names": { "type": "array",