系统提示只列名字、描述、目录,正文靠 read_file 自取
渐进披露只有两层:系统提示里逐条列出技能的名字、描述和目录,并要求模型动手前先用 read_file 读对应的 SKILL.md;正文不进提示词。没有专用的加载工具,复用的是通用文件读取能力。SkillManager 注册时要求 SKILL.md 的 YAML 头里必须有 description,缺了直接抛 KeyError;另有 RemoteSkillUtil 支持从 GitHub 目录树拉取技能。列表没有长度预算,技能多了就原样增长。
- 适合
- 技能数量不多、已有通用读文件工具的 Agent。
- 代价
- 列表没有长度预算,技能一多就原样挤占上下文。
此后的变化
- 2026-W39 →
对外部 CLI 成员(Claude Code、Codex、dsh),技能不再走系统提示列目录加 read_file 自取,而是整包复制进目标 CLI 的项目扫描目录,由目标 CLI 自己加载;冲突策略有 skip、replace、append 三种。
SKILL_PROMPT_CONTENT = '''
To help you better complete tasks, the following skill knowledge is equipped:
{{skills}}
You can use the read_file tool to read the corresponding SKILL.md file to obtain the relevant skill.
'''
# ...(17-98 行:SkillUtil 的注册与查询方法)
system_prompt = (
"You are an agent equipped with various skills to solve problems.\n"
"Before attempting any task, read the relevant skill document (SKILL.md) "
"using read_file and follow its workflow.\n"
)
skills = self._skill_manager.get_all()
skills_info = []
for index, skill in enumerate(skills):
skills_info.append(
f"{index}.Skill name: {skill.name}; "
f"Skill description: {skill.description}; "
f"Skill directory: {skill.directory}"
)
skill_text = skill_prompt.format({"skills": "\n".join(skills_info)}).content
return system_prompt + "\n" + skill_text